3.6 KiB
ADR 0025: Inspect Failed Configuration Loads
Status
Accepted.
Date
2026-12-05
Context
Applications need to explain rejected configuration using the evidence produced by the same load. Diagnostics identify failures, while values, history, and source information help operators understand how those failures arose. A load can fail after producing a coherent configuration candidate, even though it cannot return a successful execution result.
ADR 0003 and ADR 0005 establish retained history and safe explanation. ADR 0008 describes synchronous loading and cleanup. Inspection should preserve those boundaries while making available evidence independent of validation outcome.
Decision
Keep returning a nil result and the existing error on load failure. A LoadError
may expose a frozen reporting snapshot through InspectSubtree, using the same
Inspection interface available from a successful result. Inspection does not
change the error outcome, resume processing, rerun callbacks, or reload inputs.
Select the latest coherent, admissible candidate already produced by the load: the main tier, composed sources, inherited sources, decoded values, overridden values, resolved values, or validated values. Identify the represented checkpoint on the view. Earlier acquisition, parsing, schema, and composition failures can have no view; retained-history limits can prevent a candidate from being retained or require an earlier available candidate. Raw-source checkpoints do not invent typed defaults or partially completed work. A failure in final validation reports the candidate supplied to the validator, including when that callback mutates it.
Reuse existing classification, history, source evidence, passive resource contexts, rendering, and redaction. Classification must finish before a view is exposed. Only contexts actually established are available; the error's source catalog remains consistent with its view. Loading handles are released before return as before.
Extend ADR 0010 and ADR 0024 to allow comparison of available inspection views regardless of load outcome or checkpoint. Matching scopes, structural equality, atomic sequences, ancestor changes, and paired redaction retain their existing semantics. Comparison does not compare diagnostic status. The existing same-type result comparison remains unchanged.
Alternatives considered
- Restrict inspection to successful loads. This withholds useful evidence precisely when operators need to diagnose rejected configuration.
- Reload with validation disabled. A second invocation can observe different inputs and repeat callbacks, and does not faithfully describe the failed load.
- Expose partial mutable processing state. Incomplete work and callback edits can misrepresent the candidate and its origins. Coherent frozen checkpoints preserve the existing reporting boundary.
- Introduce a reduced failure reporting API. This duplicates presentation and disclosure rules that the existing inspection interface already supplies.
Consequences
Applications can use one reporting interface for available evidence from both successful and failed loads while continuing to handle errors normally. An earlier checkpoint describes only the work completed through that point; it is not proof of validation or of later successful processing. Existing source and history limits continue to apply, and unavailable snapshots do not erase the original diagnostics.