Skip to content

ArchitectureSummaryGenerator --check can never pass: drift guard matches every semver, not just Algorithm versions #1501

Description

@HyggeHacker

Bug

The version-drift guard in cmdCheck matches every vX.Y.Z in LifeosSystemArchitecture.md and reports them all as "older Algorithm version(s)". That doc legitimately cites hook versions, the Memory version, Bunker's spine version, and historical Algorithm notes — so --check exits 1 on a correct, freshly generated tree, permanently.

LifeOS/install/LIFEOS/TOOLS/ArchitectureSummaryGenerator.ts:287

const cited = [...archContent.matchAll(/v(\d+\.\d+\.\d+)/g)].map(m => m[1]);

Repro

Against a pristine checkout of main (03a969d, v7.1.1):

git archive main LifeOS/install/LIFEOS | tar -x -C /tmp/repro
L=/tmp/repro/LifeOS/install/LIFEOS
# make the summary newest, so the mtime guard doesn't short-circuit first (see note below)
touch "$L/DOCUMENTATION/ARCHITECTURE_SUMMARY.md"
LIFEOS_DIR="$L" bun "$L/TOOLS/ArchitectureSummaryGenerator.ts" check

Output:

STALE: LifeosSystemArchitecture.md references older Algorithm version(s) 8.2.0, 6.29.0, 8.0.0, 6.11.0, 6.10.0, 6.9.0, 6.8.0, 6.7.0, 1.3.0, 0.1.0, 6.18.0 — current is v8.4.0
exit 1

Not one of those eleven is Algorithm drift:

  • 8.2.0 — the Memory version (**Version:** LifeOS 7.1.1 | Algorithm v8.4.0 | Memory v8.2.0)
  • 1.3.0 — the AgentInvocation hook ("model injector was removed in v1.3.0")
  • 0.1.0 — the Bunker spine
  • the 6.x — historical notes about when things changed

The only Algorithm-qualified mention in the doc is Algorithm v8.4.0, which is correct and current.

Impact

The freshness gate reports STALE regardless of actual drift, so it can't pass. A check that always fails is one people learn to ignore — and real drift would look identical to the noise.

Fix

Count only Algorithm-qualified mentions (Algorithm v8.4.0, ALGORITHM/v8.4.0.md). This is the same scoping IntegrityCheck.checkVersionAnchors already applies for the equivalent job, so the two gates agree on what an Algorithm reference looks like:

-  const cited = [...archContent.matchAll(/v(\d+\.\d+\.\d+)/g)].map(m => m[1]);
+  const cited = [...archContent.matchAll(/(?:Algorithm\s+v|(?:Algorithm|ALGORITHM)\/v)(\d+\.\d+\.\d+)/g)].map(m => m[1]);

Verified on the same pristine checkout with the patch applied — both directions, because a fix that kills false positives by never firing isn't a fix:

  • correct tree → FRESH: Summary is up to date (exit 0) — previously STALE with 11 bogus versions
  • master doc citing Algorithm v8.3.0 while ALGORITHM/LATEST is 8.4.0STALE: ... older Algorithm version(s) 8.3.0 — current is v8.4.0 (exit 1)

Secondary note (deliberately not in the patch)

cmdCheck reads CLAUDE.md from $HOME/.claude even when LIFEOS_DIR points elsewhere, so its mtime guard consults a different root than the rest of the command and can short-circuit before the drift check runs. That's why the repro above touches the summary first. Happy to split that into its own issue if it's worth fixing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions