Record preflight integration audit findings

This commit is contained in:
2026-11-28 15:52:56 +00:00
parent ab445439cc
commit 3df1a53b5a

View File

@@ -5,6 +5,9 @@
Reviewed implementation commit `c08e5ab` against all eleven stages of
[Implementation Plan](implementation.md) and the accepted
[Preflight Feature Roadmap](preflight.md).
A follow-up integration audit at `ab44543` reviewed those stages against the
existing run, configuration, source, reference, cache, capture, and reporting
paths. Findings 1 and 2 remain open; Finding 3 records the additional result.
The intended architecture is in place. Run and explicit preflight share local
selection and construction; prepared adapters own source parsing; domain owners
@@ -14,8 +17,9 @@ capture, and native readiness reporting. Offline pipeline validation remains
offline. Preflight neither executes the substantive pipeline nor initializes
an accepted-result cache store.
Two follow-ups are warranted: consistent error propagation at the smoke observer
boundary, and narrow documentation corrections. No unintended strengthening of
Three follow-ups are warranted: consistent error propagation at the smoke observer
boundary, narrow documentation corrections, and consistent handling of marked
sensitive runtime parameters in invocation capture. No unintended strengthening of
permissions policy, provider capability requirements, retry budgets, or readiness
guarantees was found. Keep the accepted scope unchanged while remediating.
@@ -99,6 +103,69 @@ Review the resulting heading hierarchy and capture-owner wording against the
implemented command. Check affected links and `git diff --check`; no prose
snapshot tests or additional upstream-library documentation are needed.
## Finding 3: Apply Existing Sensitive-Parameter Handling To Invocation Context
**Priority:** P2 — integration with the established capture contract.
Related plan stages: 1, 4, and 7.
**Affected owners:** Early context writing in
[the preflight command](../../internal/cli/pipeline_preflight.go), line 108,
and [the run command](../../internal/cli/pipeline_run.go), line 67, plus the shared
[capture helpers](../../internal/cli/run_capture.go).
Preflight copies the run path's direct serialization of
`input.Overrides.Execution` into `context.json`. This includes raw
`--llm-extra-params` values. That bypasses both ConfigKit's secret-aware effective
configuration writer and the selected-target masking used for native evidence.
A temporary offline regression test selected a profile with an `extra_params.token`
field marked sensitive by the existing definition, then supplied a different
synthetic value for that same field through `--llm-extra-params`. The provider
fixture confirmed that the intended runtime override was used. Capture contained:
| Capture surface | Result |
| --- | --- |
| Effective application configuration | Sensitive field redacted. |
| Native preflight smoke report | Sensitive runtime value redacted. |
| Preflight invocation context | Sensitive runtime value present verbatim. |
| Ordinary run invocation context | Same sensitive runtime value present verbatim. |
The assertion that the marked value is absent from retained context failed for
both commands. Thus this is a pre-existing run pattern propagated into the new
feature, rather than a defect in native smoke-report redaction. It affects
explicitly enabled debug capture, not the public readiness report.
The existing [architecture policy](../policy/architecture.md#state-output-and-safety)
already requires preserving marked-secret handling and native credential
omissions. This finding requests consistency with that contract, not a new
threat model or a claim that debug bundles sanitize arbitrary application data.
### Required Change
- Reuse a small common context-capture helper for run and preflight, so the two
invocation owners do not independently serialize raw runtime parameter maps.
- Keep early capture available before pipeline/target selection. Omit raw
`ExtraParams` values from that early record and retain supplied-state metadata
when useful. Detailed effective parameters can remain in the existing native
evidence, where selected-profile/backend marks are already applied.
- Preserve the existing native evidence path's redaction of marked parameters
and retention of ordinary non-sensitive settings. Do not mutate the values
passed to PromptKit or add provider calls/configuration loads to capture them.
- Use established sensitivity metadata; do not add heuristic scanning of source,
references, prompts, responses, arbitrary strings, or provider parameter names.
No new configuration restrictions, permission rules, or logging subsystem is
needed.
### Verification
Add a shared capture-boundary regression for both commands using synthetic
marked runtime parameters. Assert that the provider receives the intended
value while the retained context does not contain it; verify marked native
settings remain redacted and ordinary settings are still retained. Exercise an
early preparation failure as well as successful execution, since early capture
must not depend on later native evidence becoming available. Prefer content and
immutability assertions over full snapshots of the private capture layout.
## Stage-By-Stage Review Evidence
| Plan stage | Review result |
@@ -109,11 +176,39 @@ snapshot tests or additional upstream-library documentation are needed.
| 4 — Native smoke orchestration | Access checks and structured generation are deduplicated, native overrides/retries are forwarded, and actual facts determine verdicts. Unsupported/inapplicable capabilities add no failed check or warning. Finding 1 concerns observer error propagation. |
| 5 — Destination probes | Standard-library temporary probes are cleaned up; output failure and cache warnings have different dispositions. Auto/refresh leave accepted entries unchanged; bypass/deterministic work avoids cache access. No permission convergence was added. |
| 6 — Command and report | Both native command spellings work. Text/JSON/YAML and unsuccessful assessments use CommandKit reporting; quiet/verbose and presentation failures retain native behavior. Assessment disposition needs the narrow adjustment described in Finding 1. |
| 7 — Capture and causes | Requested capture starts before selection/engine work, updates `latest`, and finalizes before reporting. Existing tests retain cancellation and sticky capture causes, including a positive assessment with failed capture. Finding 1 removes the lower helper's reliance on that sticky mechanism. |
| 7 — Capture and causes | Requested capture starts before selection/engine work, updates `latest`, and finalizes before reporting. Existing tests retain cancellation and sticky capture causes, including a positive assessment with failed capture. Finding 1 removes the lower helper's reliance on that sticky mechanism. Finding 3 addresses raw invocation context bypassing the existing sensitive-parameter treatment. |
| 8 — Assembled verification | Existing real-kit/local-provider tests pass. An additional temporary offline test exercised the unabridged maintained D&D pipeline, its ordinary transcript/reference inputs, generated handoffs, and selected target discovery; it passed with one shared-profile model call and no substantive execution. |
| 9 — Public documentation | Command/report and subprocess workflows are documented, including fixture scope and process-status handling. Finding 2 corrects the Operations hierarchy. |
| 10 — Internals and architecture | Native ownership, shared parsing, online versus offline boundaries, and smoke usage separation are documented. Finding 2 corrects the stale run-only capture sentence. No unrelated architecture restriction was introduced. |
| 11 — Final verification | Tests, vet, build, both help routes, and offline validation succeed. The two findings above should be addressed before treating documentation and error-boundary cleanup as complete. |
| 11 — Final verification | Tests, vet, build, both help routes, and offline validation succeed. The three findings above should be addressed before treating the reviewed work as complete. |
## Follow-Up Integration Audit Evidence
- Stages 1–2: Compared extracted loading/selection/preparation and parsing against
the original run path. Existing source-relative path, selector specificity,
unbinding, generated-reference, session/profile override, construction-order,
and source-index regression tests pass without cached test results.
- Stages 3–4: Checked initial/correction/validator target selection against actual
request builders and native override handling. Existing native smoke facts,
deduplication, endpoint-only profile, and typed-cause tests pass. No additional
target-resolution or provider-ownership conflict was found.
- Stage 5: An additional real-cache round trip ran a pipeline, performed both
auto and refresh preflight, and ran the pipeline again with auto reuse. Both
preflights left accepted cache bytes unchanged, each performed a smoke call,
and the subsequent run reused the original acceptance without new producer
calls. Output and cache file-placement helpers introduce no conflicting root
or permission treatment in these paths.
- Stages 6–7: Compared native outcome/delivery evidence and capture ownership
with ordinary run. Findings 1 and 3 identify the remaining error-propagation
and parameter-capture inconsistencies; no duplicate execution, publication,
or ordinary usage accounting was introduced.
- Stage 8: Ran the additional round-trip and marked-parameter reproduction tests
through a temporary Go overlay using real application configuration/registries
and a fake model client. Only the new sensitive-context assertion failed.
- Stages 9–11: Checked the new consumer/report guidance against the existing
subprocess protocol, configuration ownership, debug policy, and offline command
boundary. Finding 2 remains the narrow documentation correction; no additional
contract conflict was identified. The normal full test suite and vet pass.
## Checks Run During Review
@@ -126,6 +221,13 @@ snapshot tests or additional upstream-library documentation are needed.
`pipeline validate dnd-session --config examples/dnd-complete/config.yml`.
- Temporary Go-overlay tests exercised the full D&D preflight and the terminal
observer-error case without modifying application or permanent test files.
- The follow-up audit reran uncached tests for CLI, preflight, configuration,
pipeline, file I/O, debug allocation, and accepted-result cache packages, plus
`go test ./...` and `go vet ./...`.
- Additional temporary integration tests passed the run/preflight/cache round
trip and reproduced Finding 3 with a failing marked-context assertion in both
command paths. They used synthetic placeholders, not actual credentials.
No live provider calls, real credentials, extraction artifacts, or accepted cache
entries were needed for this review.
No live provider calls or real credentials were used. Artifacts and accepted cache
entries exercised by the round-trip tests were synthetic temporary fixtures;
no production state, application code, or permanent test files were modified.