fix(archsummary): skip the Architecture Decisions log in the drift check - #2126
Open
pai-scaffolde wants to merge 1 commit into
Open
pai-scaffolde wants to merge 1 commit into
pai-scaffolde wants to merge 1 commit into
Conversation
`ArchitectureSummaryGenerator.ts check` failed on the shipped tree because the master doc's AD-4 entry records that a rule was superseded at Algorithm v8.8.0. The drift scan read the whole doc, so that dated row counted as a stale citation. The `## Architecture Decisions` section is append-only history by the doc's own rule — its entries say they are kept "per the append-only convention" — so the only way to satisfy the check was to edit history. Slice the doc at `## Architecture Decisions` in cmdCheck and scan only the living sections above it. `generate()` is untouched, and drift in the living sections still fails the check. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Reproduced on a fresh LifeOS 7.40.4 install (macOS, Claude Code in the Claude desktop app); the fix was applied to that install and run there before filing.
Observed
bun LIFEOS/TOOLS/ArchitectureSummaryGenerator.ts checkfails on the shipped tree, with nothing wrong in it:The only hit is inside AD-4 in the master doc's
## Architecture Decisionslog:That is a dated record of when a rule was superseded. The only way to make the check pass is to edit it, which the log forbids.
Root cause
cmdCheck()scans the whole master doc for Algorithm-qualified versions. The doc's## Architecture Decisionssection is an append-only history log, and says so in its own entries:The same rule is stated for versioned history generally in § Versioning: "Historical changelog entries stay as recorded — no back-filling." So every superseded-at-vX.Y.Z row in that log is permanent, and the drift scan reads each one as drift. The check has been failing on every install since AD-4 was written, and it gets worse with each decision recorded, because a fresh superseding note is stale the moment the Algorithm moves on.
The narrower version of this was already fixed once: bare-semver matching was scoped to Algorithm-qualified mentions for public issue #1501. That kept the hook/Memory/Bunker versions out but not the AD log, where the mentions genuinely are Algorithm-qualified.
Fix
Slice the doc at
\n## Architecture Decisionsbefore the scan and check only the living sections above it. Six lines, incmdCheck()alone;generate()still reads the whole file, so the summary is unchanged. If the section is absent the whole doc is scanned, as before.Drift in the living sections — the sections a reader treats as current — is still caught. Only the history log is exempt, which is the correct boundary: history is not drift.
How tested
Probe against a sandbox
HOME/LIFEOS_DIRholding upstreammain's own master doc plusALGORITHM/LATESTat8.20.2, with one extra fixture AD row sayingSuperseded at Algorithm v8.9.0:8.8.0there is upstream's own AD-4 row, not a fixture. Negative control — same sandbox, one stale mention added to a living section above the log:Only
8.7.0is reported, so the guard still has teeth and the log is what got skipped. Transpiles:bun build --target=bun --no-bundle LIFEOS/TOOLS/ArchitectureSummaryGenerator.tsexits 0. On the live install the check now passes and the AD log was left as recorded.Repro on a clean tree: point
LIFEOS_DIRat a copy of the shippedLIFEOS/, write the current Algorithm version toALGORITHM/LATEST, and touchDOCUMENTATION/ARCHITECTURE_SUMMARY.mdso it is newer than the doc andCLAUDE.md. Before the patchcheckexits 1 naming the versions cited inside## Architecture Decisions; after it, exit 0.🤖 Generated with Claude Code