Parse the ## Status heading form and never drop a present ADR - #1
Merged
Conversation
The extraction inlined adrstatus's classifyStatus but reproduced only one of the two status forms parseADR handled. loadADRStatusByNumber matched the `**Status:**` bold line and silently ignored the `## Status` heading form (status value on the next non-empty line). An ADR using the heading form got no entry, and the backward gate reads a missing entry as a missing ADR, so its TestADR_* pins failed. Atrium's ADR-0043 is the lone heading-form ADR and surfaced this as three false backward-gate failures on adoption. Restore the heading-form branch so both forms classify exactly as the original adrstatus did. Also default a present-but-statusless ADR to "unknown" instead of omitting it: the original parseADR set "unknown", and an omitted entry reads as a missing ADR (a false violation) too. The inlined loadADRStatusByNumber had no test, which is how the dropped branch slipped through. Add one covering both status forms, a retired heading-form ADR, and the statusless default. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XfX5F1DpdEsAhw9A8E4wJU
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The extraction inlined
adrstatus'sclassifyStatusbut reproduced only one of the two status forms the originalparseADRhandled.loadADRStatusByNumbermatched the**Status:**bold line and silently ignored the## Statusheading form (where the status value sits on the next non-empty line).Consequences in the backward gate:
## Statusheading form got no entry in the status map. The backward gate reads a missing entry as a missing ADR, so everyTestADR_NNNN_*pinning that ADR failed.parseADRdefaulted it to "unknown" (not a violation); the inlined version omitted it entirely → false "missing ADR" violation.This surfaced during adoption in the original consuming repo: its lone heading-form ADR produced three false backward-gate failures (
TestADR_0043_*) that the old in-repo tool did not.Fix
## Statusheading branch so both status forms classify exactly as the originaladrstatusdid.Why it slipped through
The inlined
loadADRStatusByNumbershipped with no test — the extraction ported all original tests verbatim, but the original tool drove this path viaexec.Command("go run <tool>"), so there was nothing to port. This PR addsTestLoadADRStatusByNumber_HandlesBothStatusFormscovering: the**Status:**form, the## Statusheading form, a retired heading-form ADR (→superseded), and the statusless default (→unknown).Verification
Built the patched binary and ran it against the original consuming repo's tree:
--strict,--json,--reverse,--matrixoutput byte-identical to the old in-repo tool on the same tree.0on a clean checkout ("every landed plan passes its forward checks; every TestADR_* pins a live ADR").docs/acceptance/traceability.md.go build,go vet,go test ./..., andgofmtall clean.