Adopt ConfigKit native override conflict behavior

This commit is contained in:
2026-11-20 03:47:30 +00:00
parent 26ac62fbb7
commit d903a1aa4e
2 changed files with 37 additions and 16 deletions

View File

@@ -173,10 +173,14 @@ loader rather than retaining the old flag parser as a compatibility layer.
Preserve useful application source and server controls through appropriate selectors.
Enable temporary configuration overrides where the loader supports them,
passing native override records into loading. The reviewed PromptKit scope
does not support these overrides; do not emulate them locally. Configuration
comparison must support independent selections for both sides in both scopes,
including corresponding application selectors where needed.
passing native override records into loading. Named selectors and `--set` may
be combined for nonconflicting paths. ConfigKit owns rejection and diagnostics
for duplicate or ancestor/descendant-overlapping override records; `--set` does
not supersede named selectors. Do not filter or merge conflicts locally.
The reviewed PromptKit scope does not support these overrides; do not emulate
them locally. Configuration comparison must support independent selections for
both sides in both scopes, including corresponding application selectors where
needed.
Keep the established collection-discovery model: ConfigKit imports discover
`collection.yml` and `collection.yaml` entry points; each independently

View File

@@ -75,7 +75,7 @@ their old counterparts without a compatibility parser.
| Repeated `--promptkit-source PATH` | Replace the complete `promptkit_sources` list during ConfigKit loading with the selected files/directories in occurrence order, as a native override. Retain the useful existing file/directory classification, without comma splitting. |
| `--schema-dir` | Presence-aware override of application `schema_dir`. |
| `--addr`, `--artifact-root`, `--max-request-bytes`, `--max-artifact-bytes`, `--max-response-bytes` | Presence-aware application `server` overrides; available on `serve` and application-scope configuration inspection. |
| `config ... --set POINTER=JSON` | Ordered native override records for `app`; append after named application-selector overrides so native assignments are authoritative when both address the same value. Enable the feature only on `app`. |
| `config ... --set POINTER=JSON` | Native override records for `app`, passed alongside explicitly supplied named-selector overrides with ConfigKit's native conflict handling. Enable the feature only on `app`. |
| `config diff --against-*` | Independent right-side selections and corresponding application-selector overrides, initialized independently rather than inherited from the left. |
| `--run-timeout DURATION` on `run` | `time.ParseDuration`, then unchanged into `RunRequest.OperationTimeout`. Positive values add the native operation budget; zero and negative values add none under PromptKit v0.23.3. No second application timer or positivity restriction. |
| Native `--llm-timeout-seconds` / `--timeout-seconds` | Integer per-attempt timeout through the ckprompt execution binding; no old duration conversion. |
@@ -90,9 +90,13 @@ selectors, not generation request controls. The configured `transient_retries`
value remains an engine default; the native execution flag overrides a request.
ConfigKit remains responsible for loading and all precedence, resolution, and
inspection semantics. The override ordering above selects library inputs; it
does not authorize post-load merging. Keep cwd-relative application path values,
the existing discovery locations, and source-relative PromptKit resources.
inspection semantics. Named selectors and native `--set` records may be combined
for nonconflicting paths. Duplicate and ancestor/descendant-overlapping records
are rejected by ConfigKit; neither record order nor `--set` grants precedence.
Preserve native diagnostics without local conflict filtering, deduplication, or
merging. This also applies independently to each comparison side, including
`--against-set`. Keep cwd-relative application path values, the existing discovery
locations, and source-relative PromptKit resources.
### Outcomes And Delivery
@@ -202,6 +206,15 @@ paths against the selected commits. Final composed behavior is checked in Stage
## Stage 2: Adapt Authoritative Application Loading And Shared Selectors
**Status: In progress; override decision resolved.** Adopt ConfigKit v1.2.1's
native conflict behavior; no upstream change or dependency upgrade is required.
The real-library `TestApplicationSelectorsPreservePresenceOrderAndEvidence`
reproduces `override.duplicate` for a named `schema_dir` override and a native
assignment to the same path. Revise its precedence expectation to assert native
conflict rejection and complete the stage's remaining checks. Configuration
package and metadata/selection-error tests were previously reported passing;
the obsolete precedence test has not yet been updated.
**Primary files:** `internal/config/{load,document,settings}.go`, their tests,
and CLI application-loading/source-selector helpers.
@@ -214,10 +227,12 @@ and CLI application-loading/source-selector helpers.
ConfigKit's synchronous work can be forcibly interrupted.
2. Replace `flag.FlagSet.Visit` and parser-owned override collection with typed
CommandKit bindings retaining `Supplied.Set`. Convert only supplied
application selectors into correctly labeled ConfigKit overrides, then append
native `Selection.Overrides` as specified above. Keep source-list order and
replacement. Use ordinary OS classification for explicitly supplied source
paths; do not load framework definitions during application inspection.
application selectors into correctly labeled ConfigKit overrides and pass
them together with native `Selection.Overrides`. Let ConfigKit validate all
records and report conflicts without selecting a winner locally. Keep
source-list order and replacement. Use ordinary OS classification for
explicitly supplied source paths; do not load framework definitions during
application inspection.
Preserve the existing nonnegative `int64` domain for HTTP byte limits,
including zero as unlimited; do not narrow it to a platform `int` or add a cap.
3. Keep schema, defaults, normalization, and domain validation inside the
@@ -245,10 +260,12 @@ and CLI application-loading/source-selector helpers.
acceptable and must not alter effective configuration.
**Evidence:** real ConfigKit-backed tests cover omitted versus explicit-empty
config/overlay selection, a supplied zero or empty app override, native `--set`
precedence, ordered source replacement, normalized values and their evidence,
and removal of `render_format`. Reuse existing import/search/source tests;
do not reproduce ConfigKit's exhaustive composition matrix.
config/overlay selection, a supplied zero or empty app override, individual named
and native overrides, nonconflicting combinations, and native duplicate and
ancestor/descendant conflict rejection with diagnostic evidence. Also cover
ordered source replacement, normalized values and their evidence, and removal
of `render_format`. Reuse existing import/search/source tests; do not reproduce
ConfigKit's exhaustive composition matrix.
## Stage 3: Install Native Configuration Scopes And Independent Comparison