From 34bf78de835d8852579713f860396077808b6a50 Mon Sep 17 00:00:00 2001 From: Eric Rakestraw Date: Sat, 5 Dec 2026 15:53:18 +0000 Subject: [PATCH] Record inspection of failed configuration loads --- ...0025-inspect-failed-configuration-loads.md | 74 +++++++++++++++++++ docs/roadmap/implementation.md | 4 +- 2 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 docs/adr/0025-inspect-failed-configuration-loads.md diff --git a/docs/adr/0025-inspect-failed-configuration-loads.md b/docs/adr/0025-inspect-failed-configuration-loads.md new file mode 100644 index 0000000..1097de5 --- /dev/null +++ b/docs/adr/0025-inspect-failed-configuration-loads.md @@ -0,0 +1,74 @@ +# 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](0003-preserve-presence-and-resolution-history.md) and +[ADR 0005](0005-explicit-overrides-and-safe-explanation.md) establish retained +history and safe explanation. [ADR 0008](0008-complete-on-return-loading.md) +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](0010-effective-configuration-diff.md) and +[ADR 0024](0024-compare-inspection-views-across-application-types.md) 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. diff --git a/docs/roadmap/implementation.md b/docs/roadmap/implementation.md index ab545bf..b1fdae6 100644 --- a/docs/roadmap/implementation.md +++ b/docs/roadmap/implementation.md @@ -1,6 +1,6 @@ # Implementation plan: inspect failed configuration loads -Status: ready for implementation; no stages implemented by this document. +Status: implementation in progress. Baseline: `5e0f406`, with runtime behavior at `4a7ae66`. ## Scope and execution @@ -98,6 +98,8 @@ or cause another load. No new numeric budgets or benchmark thresholds are added. ## Stage 1 — Record the inspection-on-failure decision +**Complete.** + Write ADR 0025 (use the next unused number if another ADR has landed) recording inspection independent of validation outcome, the error accessor, reuse of the existing Inspection interface, and identified existing checkpoints. Record the