Skip to content

fix(archsummary): skip the Architecture Decisions log in the drift check - #2126

Open
pai-scaffolde wants to merge 1 commit into
danielmiessler:mainfrom
pai-scaffolde:fix/v-archsummary-skip-decisions-log
Open

pai-scaffolde wants to merge 1 commit into
danielmiessler:mainfrom
pai-scaffolde:fix/v-archsummary-skip-decisions-log

Conversation

@pai-scaffolde

Copy link
Copy Markdown

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 check fails on the shipped tree, with nothing wrong in it:

STALE: LifeosSystemArchitecture.md references older Algorithm version(s) 8.8.0 — current is v8.20.2
exit 1

The only hit is inside AD-4 in the master doc's ## Architecture Decisions log:

**Superseded again (2026-07-24, Algorithm v8.8.0):** doctrine now names ROLES, never models.

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 Decisions section is an append-only history log, and says so in its own entries:

- **Replaced:** … (AD-4 is left intact per the append-only convention; …)
- **Superseded:** 2026-07-11 — … Entry kept per the append-only convention.

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 Decisions before the scan and check only the living sections above it. Six lines, in cmdCheck() 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_DIR holding upstream main's own master doc plus ALGORITHM/LATEST at 8.20.2, with one extra fixture AD row saying Superseded at Algorithm v8.9.0:

$ HOME=$SB/home LIFEOS_DIR=$SB/home/.claude/LIFEOS bun upstream-main.ts check
STALE: LifeosSystemArchitecture.md references older Algorithm version(s) 8.8.0, 8.9.0 — current is v8.20.2
exit=1

$ HOME=$SB/home LIFEOS_DIR=$SB/home/.claude/LIFEOS bun branch.ts check
FRESH: Summary is up to date
exit=0

8.8.0 there 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:

$ HOME=$SB/home LIFEOS_DIR=$SB/home/.claude/LIFEOS bun branch.ts check
STALE: LifeosSystemArchitecture.md references older Algorithm version(s) 8.7.0 — current is v8.20.2
exit=1

Only 8.7.0 is reported, so the guard still has teeth and the log is what got skipped. Transpiles: bun build --target=bun --no-bundle LIFEOS/TOOLS/ArchitectureSummaryGenerator.ts exits 0. On the live install the check now passes and the AD log was left as recorded.

Repro on a clean tree: point LIFEOS_DIR at a copy of the shipped LIFEOS/, write the current Algorithm version to ALGORITHM/LATEST, and touch DOCUMENTATION/ARCHITECTURE_SUMMARY.md so it is newer than the doc and CLAUDE.md. Before the patch check exits 1 naming the versions cited inside ## Architecture Decisions; after it, exit 0.

🤖 Generated with Claude Code

`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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant