From 8758c350e93a95874c590b24daf88a18792a2d2c Mon Sep 17 00:00:00 2001 From: Eric Rakestraw Date: Sat, 21 Nov 2026 17:27:06 +0000 Subject: [PATCH] Record defaulted input metadata integration gap --- docs/roadmap/remediation.md | 81 ++++++++++++++++++++++++++++++++++++- 1 file changed, 80 insertions(+), 1 deletion(-) diff --git a/docs/roadmap/remediation.md b/docs/roadmap/remediation.md index 824dca6..809e6b7 100644 --- a/docs/roadmap/remediation.md +++ b/docs/roadmap/remediation.md @@ -60,7 +60,61 @@ Verification: compare the revised text with the feature roadmap's application-specific-fields contract and existing focused-inspection sensitivity coverage. No change to execution or redaction implementation is needed. -## Review Results And Validation +### 3. Preserve Effective Input Metadata Supplied By Application Defaults + +Status: open. Priority: P2. Implementation stages: 5–6 and 13. + +Locations: `internal/configuration/load.go:208–216`, +`internal/configuration/prompts.go:174–180`, and +`internal/configuration/resources.go:81–87`. + +The new application-owned loading path preserves ConfigKit `Defaults` and +application resolution callbacks, but the existing input-inspection machinery +still equates `FieldInfo.Explicit == false` with an absent effective value. +`finalFieldState` consequently discards metadata for values supplied by Go +defaults or recorded derived defaults. These are valid final values, not missing +configuration. + +Reproduced through the public API with a completed ConfigKit load whose +`Definition.Defaults` returns a prompt input equivalent to: + +```go +promptkit.PromptInputSettings{ + Name: "doc", Required: true, + ContentType: new("text/plain"), Description: new("default description"), +} +``` + +With a valid prompt and default profile, `NewFromConfig` succeeds. The final +typed input retains those values; native metadata describes their defaulted, +nonnull presence (`Explicit: false`, `Null: false`, default layer), but: + +- `InspectPrompt` returns `Required: nil` instead of the effective true value. +- `InspectRequirements` correctly classifies `doc` as required but returns nil + content type and description, contrary to its effective-metadata contract. +- `ValidateRequest` without `doc` fails with `ErrPromptRender` and a missing + required-input error, confirming that execution uses the true value that + resource inspection fails to report. + +A second public-API reproduction using an application `Resolve` callback and +`RecordDerivedDefault` for an omitted `required` and `content_type` has the same +result. Source-loaded inputs ordinarily have explicit metadata, which is why +the migrated source fixtures and current handoff tests do not expose this gap. + +Required change: capture effective input metadata from the final typed values +and native final metadata without treating source explicitness as a universal +presence test. Preserve the existing ordinary omission/null and explicit +false/empty-string behavior. Keep source provenance in native inspection; +do not inspect raw sources, replay history, reject application defaults, or +rerun resolution to repair the report. + +Verification: add public integration regressions for both Go defaults and +recorded application-derived defaults. Compare `InspectPrompt`, +`InspectRequirements`, and preparation/preflight for the same captured input, +and retain existing source-presence cases. Include a collection case if the fix +introduces separate root/collection handling; the current capture logic is shared. + +## Initial Review Results And Validation - Stage 1: ConfigKit v1.4.0, unchanged Go minimum, and commit-pinned attribution match the selected module and its notices. @@ -81,3 +135,28 @@ Fresh checks passed with Go 1.27.4, `GOTOOLCHAIN=local`, and `GOWORK=off`: differences, and the implementation diff passes `git diff --check`. This review changes only this findings document; it does not implement fixes. + +## Integration-Focused Follow-Up + +The second review revisited stages 1–17 at their interaction boundaries: the +ConfigKit upgrade and native metadata semantics; repair-input conversion and +prepared budgets; shared settings and application callbacks; capture, inspection, +mounting, and constructor wiring; migrated tests and examples; and their contracts +with the existing runtime. Finding 3 records the newly reproduced integration +gap. Findings 1 and 2 remain unchanged. + +Additional disposable external-package checks, outside the repository, passed +under the race detector for both `NewEngine` and `NewFromConfig`. They combined +configured default repair with continuation, appended messages, direct session +selection, namespace views, frozen prepared execution, structured output, +numeric-presence settings, usage/observer accounting, capacity release, and +single-pass smoke diagnostics. Both default-metadata reproductions failed their +expected inspection assertions, including under the race detector; those failures +are the evidence for finding 3, not failures in the existing test suite. + +Fresh targeted race-enabled tests passed for the public handoff and runtime +contracts, configuration and use-case packages, maintained examples, capacity, +generation, observation, rendering, and validation. No other integration defect +was found. The prior full-suite and vet results remain applicable to unchanged +implementation code. No repository implementation or test files were changed by +this review.