Add opt-in configuration overrides

This commit is contained in:
2026-11-07 04:39:34 +00:00
parent 85ae55bf42
commit aeb70e5873
22 changed files with 238 additions and 35 deletions

View File

@@ -306,6 +306,17 @@ runtime context or acquire configuration. It reports the intersection between
declared scope capabilities and installed handlers, so an operation is listed
only when the corresponding command is available.
Scopes can opt in to transient overrides. For an opted-in scope, acquisition
commands accept repeatable `--set POINTER=JSON`; comparison also accepts
`--against-set POINTER=JSON` for the right side. Each assignment is passed to
the loader in order, with `--set` or `--against-set` as its source label.
The pointer and value are split at the first `=`, so pointer keys containing
`=` cannot be addressed by these flags; JSON strings can contain `=`. Values
use JSON types, including null, false, zero, and empty containers. ConfigKit
owns override path validation and conflict handling. A selected scope must opt
in before receiving overrides; for `--scope all`, every selected scope must
support them.
Applications can add `ckprompt.ConfigScope(loadEngine)` to the ConfigKit suite
to expose PromptKit engine configuration through these handlers. The scope
declares validate, show, sources, explain, and native diff. It does not install

View File

@@ -255,6 +255,10 @@ owns operator syntax and report details. `Scope.Features` declares optional mode
`View.Metadata` and `View.Findings` carry native path metadata and diagnostic
records when available. `Findings.Messages` contains presentations associated
with those records, while `Acquired.Diagnostics` carries independent messages.
Set `Scope.Features.Overrides` only when the loader passes
`Selection.Overrides` to ConfigKit as part of its normal load. The integration
parses CLI records but cannot add them to an already-loaded result. The
[CLI reference](../cli.md#configuration-scopes) describes the operator syntax.
## PromptKit configuration, definitions, and requirements

View File

@@ -1,6 +1,6 @@
# Shared reporting and PromptKit v0.20.0 implementation plan
Status: implementation in progress; Stages 1–15 complete.
Status: implementation in progress; Stages 1–16 complete.
## Scope, authority, and execution
@@ -571,6 +571,11 @@ model. Explicit-empty custom collections remain application-defined.
## Stage 16: Opt-in transient override acquisition
**Complete.** Opted-in loaders receive ordered, independently copied native
override records with safe flag labels. The root, ckconfig, and ckprompt
workspace suites passed with Go 1.27.0, including scope preflight, comparison
separation, native provenance, and load-error propagation.
Add `Selection.Overrides []configkit.Override`. Preserve ordered records; nil
means no CLI records. A loader opting in via `scope.Features.Overrides = true`
reads those records during its ordinary load and supplies them to ConfigKit.