Record inspection integration audit findings

This commit is contained in:
2026-12-05 16:48:28 +00:00
parent 36a54ec788
commit a675d3ab50

View File

@@ -4,6 +4,8 @@ Reviewed commit `729724debab789ffb0e91147a134283bb2e236fa` against the
[implementation plan](implementation.md), the
[feature roadmap](failed-load-inspection.md), and
[ADR 0025](../adr/0025-inspect-failed-configuration-loads.md).
The follow-up integration audit reviewed `36a54ec788e9c912f335652ecfe244a30e90e8a3`,
whose production code is unchanged, and adds Findings 2 and 3 below.
## Finding 1 — Preserve the actual layered main checkpoint and its collection policy
@@ -93,6 +95,94 @@ not become a completed checkpoint merely by retrying without that rule. No new
consumer registration requirement, callback retry, source reread, or history
limit is needed.
## Finding 2 — Record consumption of descendants inside an inheritance selector
**Status:** Open. **Priority:** P2. **Affected stages:** 3 and 8, integrating
the shared inheritance-history producer with failed-load inspection.
### Relevant code
- [observeSourcePrefix](../../internal/engine/override_context.go) reuses
`observeInheritanceEvidence` for source-stage failure snapshots.
- [observeInheritanceControl](../../internal/engine/history_inheritance.go)
records consumption only at the control's root path, then removes its complete
subtree from the scratch document.
- [selectHistory](../../internal/engine/history_select.go) selects exact and
descendant observations for a query. Its producer contract requires facts for
every affected path; it does not infer consumption of an unobserved descendant
from an ancestor control observation.
- [Explain](../../internal/engine/explain.go) and
[appendInheritanceExplanation](../../internal/engine/inheritance_explain.go)
consequently omit the consumption event for that descendant.
### Circumstances and observed behavior
Consider a typed configuration with `Count int` and
`Items []map[string]any`, loaded from:
```yaml
config:
sequences: [{destination: [items], key: id}]
count: invalid
items:
- {id: parent, width: 5}
- {id: child, extends: {id: parent}, width: 20}
```
Inheritance completes and decoding rejects `count`, so the error exposes an
`inherited` inspection. `/items/1/extends/id` remains a valid historical query.
Its explanation correctly reports `Effective.Present == false`, but its history
contains only the source contribution with `After.Present == true` and YAML
`parent`. Its metadata history likewise contains no inheritance consumption.
Querying `/items/1/extends` does include the removal event.
Expected behavior is that the nested query also includes the containing
control's consumption, with the control path as its reported operation path,
and an absent after-value. This follows the existing descendant-history and
consumed-control behavior in the
[configuration contract](../config.md#layered-metadata); it requires no new
inheritance or configuration semantics.
The same omission was reproduced with `count: 0` both on successful loading and
on semantic validation rejection. This is an existing shared-history defect,
not a newly introduced composition regression. Reusing that producer makes the
new failure views inherit it, and outcome-parity tests alone cannot detect it.
Effective configuration values are correct; the missing operation makes their
history incomplete and inconsistent between parent and descendant queries.
### Remediation and verification
Have the inheritance producer register consumption for the concrete descendant
shapes present in a mapping-valued control before removing it, reusing the
existing operation payload, attribution and reported control path. Keep query
selection and ordinary scalar-control behavior consistent; do not substitute a
synthetic decoding event for the inheritance operation.
Add focused coverage through the shared inspection interface for a consumed
selector field. Verify effective absence, the inheritance event and its
before/after presence in explanation, metadata history, and retained historical
paths. Exercise the source-stage failure case and a successful counterpart so
both use the same corrected evidence.
## Finding 3 — Clarify the diagnostic-only statement about load errors
**Status:** Open. **Priority:** P3. **Affected stage:** 10.
[docs/config.md](../config.md#classification-and-output-details), around line
925, still states that metadata records, diagnostics and load errors contain
no configuration values. The earlier results-and-failures section and the new
[LoadError.InspectSubtree](../../inspection_view.go) explicitly permit error
inspection to expose non-secret configuration values and historical snapshots.
The unconditional statement leaves the owning contract inconsistent about the
boundary between diagnostic reporting and explicit configuration inspection.
Qualify the existing statement to cover diagnostic records and ordinary
`LoadError.Error()` reporting. State that explicitly requested inspection
snapshots can expose non-secret values under the existing redaction rules,
regardless of load outcome. Preserve the implemented error accessor and
inspection behavior; this calls for documentation clarification, not another
restriction on inspecting rejected configuration.
## Review coverage and validation
The review followed all ten implementation stages in order:
@@ -101,17 +191,28 @@ The review followed all ten implementation stages in order:
| --- | --- |
| 1 | Accepted decision separates failure status from inspection and extends existing view comparison. |
| 2 | Shared finalization classifies snapshots and attaches conservative source catalogs, passive contexts and known references. |
| 3 | Source prefixes reuse source/inheritance evidence without inventing typed defaults. Finding 1 affects which main prefix is selected. |
| 3 | Source prefixes reuse source/inheritance evidence without inventing typed defaults. Findings 1 and 2 affect main selection and inherited control history. |
| 4 | CLI and resolver failures retain their frozen entry candidates without failed partial edits. |
| 5 | Late failures retain resolved evidence, including pre-validator values and known secret references. |
| 6 | Ownership and budget fallback are implemented; Finding 1 affects preservation of the actual layered main checkpoint. |
| 7 | Root-owned API and stage conversions reuse the existing inspection view, including nil/zero and absent scopes. |
| 8 | Evidence, redaction, comparison and detachment tests protect success/failure parity; the policy-dependent fallback above is missing. |
| 8 | Evidence, redaction, comparison and detachment tests protect many parity cases. Integration probes expose the shared-history omission in Finding 2; the policy-dependent fallback in Finding 1 is also missing. |
| 9 | Maintained consumer example reports failed loads from one invocation and preserves the error. |
| 10 | Public/configuration/architecture/internal documentation describes checkpoint inspection and retains existing lifecycle boundaries. |
| 10 | Public/configuration/architecture/internal documentation describes checkpoint inspection and retains existing lifecycle boundaries. Finding 3 identifies an unrevised diagnostic-boundary statement. |
`./scripts/check.sh` and `go test -race ./...` passed using Go 1.27.4 with
dependency downloads disabled. Disposable public-API probes outside the
repository confirmed both manifestations above. No production code or permanent
tests were changed during this review. No additional actionable defects or
inadvertently strengthened contracts were identified.
dependency downloads disabled, including during the follow-up integration
audit. An uncached focused run also passed for failure inspection, history,
source versions, destinations, resource contexts, resolution and the consumer
reporting example.
Disposable public-API probes outside the repository confirmed Finding 1 and
the missing selector-consumption history in Finding 2. Additional probes checked
source-stage replay for strict imports, lower-tier upsert, mapping and identified
sequence inheritance, mounted mapping inputs, and imported sequence-item inputs.
Those cases agreed on effective and historical values apart from Finding 2.
The stage-by-stage follow-up also traced error-source sanitization, frozen
resolver-entry metadata, late secret/validation failures, scoped comparison,
passive contexts, nil/zero facade behavior and the one-invocation example.
No production code or permanent tests were changed during either review. No
further actionable integration gaps were identified.