fix: stop committing volatile graph stats (AGENTS/CLAUDE/arch-doc churn)#3
Merged
Merged
Conversation
Committed agent docs churned on every teammate's machine because they embed live graph stats that regenerate per re-index: - docs/ARCHITECTURE.gitnexus.md — kit-generated arch doc (generate-arch-doc) - the <!-- gitnexus:start -->..<!-- gitnexus:end --> block the GitNexus `analyze` tool injects into AGENTS.md/CLAUDE.md (symbol/relationship/per-area counts) Each teammate's graph differs slightly, so these showed as perpetually "modified" after any refresh — noise for everyone who pulls. Fix: - gitignore docs/ARCHITECTURE.gitnexus.md (kept local, still regenerated) - new .gnkit/lib/stabilize-agent-docs.mjs strips the volatile gitnexus:start block from AGENTS.md/CLAUDE.md, preserving the user's content and the kit's stable gitnexus-agent-kit contract block - run it in sync-teaching (install + autonomous agent-refresh) and in the pre-commit hook (after full-pdg re-injects the block) so commits stay clean Verified on a real 626-line CLAUDE.md: block + stats removed, user content and kit block intact. 56/56 tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Problem
Teammates who pull see committed agent docs perpetually "modified" — even with no real change. Root cause: three committed files embed live graph stats that regenerate on every re-index, and each machine's graph differs slightly:
docs/ARCHITECTURE.gitnexus.md— kit-generated (generate-arch-doc, runs on refresh)<!-- gitnexus:start -->…<!-- gitnexus:end -->block the GitNexusanalyzetool injects intoAGENTS.md/CLAUDE.md(symbol / relationship / per-area counts)Example diff a teammate hit after a routine refresh:
Fix
docs/ARCHITECTURE.gitnexus.md(still regenerated locally, just not committed)..gnkit/lib/stabilize-agent-docs.mjsstrips the volatilegitnexus:startblock while preserving the user's own content and the kit's stablegitnexus-agent-kitcontract block (can't gitignore these files — they hold real user instructions).analyzere-injects the block: sync-teaching (install + autonomousagent-refresh) and the pre-commit hook (afterfull-pdg), so both the working tree and commits stay clean.Verified
CLAUDE.md(325 lines of user rules) → block + stats gone, user content and kit block intact.🤖 Generated with Claude Code