Repository navigation
An engine write is not product movement - #52
Merged
Merged
Conversation
Tier 1 of the context survey is "what the product is for, in the team's own words", and it lists CLAUDE.md and AGENTS.md. In an onboarded repo those are frequently this engine's own output — 8 of the 31 agent files across this machine's registered repos carry the marker. So onboarding a repo, and every later re-render, moved a "product doc" and marked that repo's whole context/ stale with no product fact changed. On 2026-09-22 `d427cbb`, "chore: onboard the app into second-brain-workflow as shared", did that to all three of babypath-app's context files. Dropping those filenames from the tier would be the wrong fix. A hand-written AGENTS.md is a genuine product doc — often the clearest statement a repo has of how its team works — and render.py already refuses to overwrite one. Name alone cannot tell the two apart; provenance can, and it is the question render.py asks before writing. Two shapes, because the engine writes two ways. A whole file it owns carries the marker and leaves the survey. An `@AGENTS.md` import prepended to a CLAUDE.md the repo owns carries none, because that file really is hand-written — so the file stays a source and the *commit* is skipped, and the check walks back to the last commit that changed something a person wrote. A commit that cannot be read is never treated as ours: a real product change must not be able to hide behind a failed `git show`. Same shape as the v0.55.0 rule-budget defect, and the third instance of it: a correct computation over the wrong input set.
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.
Found by using v0.59.0's own audit: re-sourcing eleven stale
context/filessurfaced that one of the four projects was not stale at all. The commit that
aged it was the commit that onboarded the repo into this engine.
Tier 1 of the context survey is "what the product is for, in the team's own
words" and lists
CLAUDE.mdandAGENTS.md. In an onboarded repo those arefrequently our own output — 8 of the 31 agent files across this machine's
registered repos carry the marker. So a render moves a "product doc", and
check-context-freshness.pyreports drift nobody caused. It recurs on everyre-render, across every onboarded repo.
Same shape as the v0.55.0
rule-budgetdefect, and the third instance of it: acorrect computation over the wrong input set.
Why not just drop those filenames from tier 1
Because a hand-written
AGENTS.mdis a genuine product doc — often theclearest statement a repo has of how its team works — and
render.pydeliberately refuses to overwrite one. 23 of those 31 files are hand-written.
Dropping the names would throw away real evidence to silence a false positive.
Name alone cannot separate the two. Provenance can, and it is the same question
render.pyalready asks before it writes.Two shapes, because the engine writes two ways
A whole file it owns carries the marker → dropped from the survey. It is not
evidence about the product in any tier.
An
@AGENTS.mdimport prepended to aCLAUDE.mdthe repo owns carries nomarker, correctly, because that file really is hand-written. This was the
babypath case, and it is the one my first diagnosis missed — the marker alone
would not have fixed it. So the file stays a source and the commit is
skipped: a commit whose only changes to tier sources are engine-written lines is
not product movement, and the check walks back to the last one that is.
A commit that cannot be read is never treated as ours. A real product change
must not be able to hide behind a failed
git show.lib/provenance.pyOne definition, because there are now two consumers asking for opposite reasons:
render.pyasks what may I overwrite, the survey asks what counts asevidence.
render.pyandlib/registry.pytakeMARKERfrom it instead ofcarrying copies.
lib/registry.shkeeps its own because it is shell, andtest-repo-registry.shstill guards that one against drift — that test is whatcaught the move, which is the argument for it existing.
Testing
make lintclean, 41 suites pass,test-render.sh149 assertions green acrossthe refactor.
Five new assertions in
test-context-freshness.sh, all confirmed failingagainst the pre-fix code, covering both shapes and the case that must keep
working:
The third of those matters most: a real product commit that lands behind an
engine write is still found and still reports STALE. The fix must not swallow
movement, only ignore our own.
One pre-existing failure, in a git worktree only:
doctor.shreads.gitas afile there. Passes in a normal checkout and in CI; already tracked.
🤖 Generated with Claude Code