docs: recommend Git LFS for team-shared graph artifact - #1697
Conversation
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
9abcf4f to
5dc36a9
Compare
5dc36a9 to
22f90fe
Compare
|
Landed as #1992 — thank you, and sorry it took two weeks to reach you while you were keeping the branch rebased. The problem you found is real and the README should have warned about it. The artifact regenerates on every index, including the watcher's Fast tier, and nothing in that section connected "rewritten on every index" to "commit it to your repo". You hit the consequence on a real monorepo, measured it, rewrote ~6 GB back out with Two things changed on the way in. The second one matters, because it would have bitten anyone who followed the instruction as written. The The version that works keeps both files: the LFS line at the repo root, the auto-created one untouched. Attributes resolve per attribute from the nearest To be clear about where the fault lies: the old README wording said only "a The costs got named. Putting LFS in the README commits every reader to it, and it is a metered store rather than a free one — GitHub bills LFS storage and bandwidth, LFS objects cannot be pruned without contacting support, and a teammate who clones without Thanks again. This is the kind of thing that only surfaces after someone runs into it for real, and the docs are better for it. |
|
Reopening, and apologies for the churn — that close was wrong of me. You rebased this only a few hours ago, so you are plainly still on it, and a PR that is one edit away from landing should stay yours rather than be reimplemented around you. I have closed #1992. This is the one that should merge. The comment above is the whole review; nothing new. Concretely, three changes and it is ready: 1. Put the LFS line at the repo root, and keep the auto-created file. Don't tell readers to replace the 2. Name the costs. GitHub meters LFS storage and bandwidth, its objects can't be pruned without contacting support, and a teammate without 3. Lead with the cheaper fix. The root cause in your story is committing every regeneration, including the watcher's Fast tier. LFS is the right answer for teams that genuinely need the file to move on every commit; for everyone else, choosing a cadence is cheaper and has no quota attached. If it saves you time, take this wording verbatim — it's yours, no attribution needed. It replaces the existing No merge pain bullet (which also gains the filename, since that omission is what made "replace it" the natural reading): - **No merge pain**: a `.codebase-memory/.gitattributes` line with `merge=ours` is auto-created on first export, so concurrent edits don't produce conflicts on the binary artifact
- **Commit it deliberately**: the artifact is rewritten on every index, including the watcher's Fast tier, and git stores each rewrite as a full new blob. Committing every refresh is what turns a 20 MB file into gigabytes of history — one team reached ~6 GB across ~350 commits of this single path. Pick a cadence (a release, a milestone, a nightly job) rather than committing every save.
- **Git LFS, if it must move on every commit**: track it from the **repo-root** `.gitattributes` and leave the auto-created `.codebase-memory/.gitattributes` in place — the nearer file goes on supplying `merge=ours`, and only `filter` comes from the root:
```gitattributes
.codebase-memory/graph.db.zst filter=lfs diff=lfs merge=lfs -text
```
Track only the `.zst`; `artifact.json` is small and carries the schema version. The attribute applies to future commits only, so a repo that already has the blobs in history needs `git-filter-repo` to rewrite them first. Two costs to weigh before adopting it: GitHub meters LFS storage and bandwidth, and its objects cannot be pruned without contacting support; and every teammate needs `git lfs install` — without it their checkout leaves a pointer file where the artifact should be, the integrity-checked import refuses it, and they fall back to a full reindex.Push whenever suits you and I'll take it from there. Thanks for your patience with the round trip. |
Signed-off-by: Angus Gastle <angusgastle@gmail.com>
22f90fe to
4b844b7
Compare
Address maintainer review on PR DeusData#1697: - LFS pattern goes in the repo-root .gitattributes; the auto-created .codebase-memory/.gitattributes (bare graph.db.zst, merge=ours) is kept as-is, since a slash-containing pattern inside it would anchor to .codebase-memory/ and match nothing - Lead with commit cadence as the cheaper fix; LFS is for teams that need the artifact to move on every commit - Name the LFS costs: metered storage/bandwidth, no pruning without support, and teammates without `git lfs install` fall back to a full reindex Co-Authored-By: Claude Code <noreply@anthropic.com>
|
That is exactly it — thank you for turning it around so quickly, and for writing a commit message that explains why the pattern moves to the repo root rather than just that it does. The next person to touch this will be glad it is there. One thing left, and it is small: To save you second-guessing it: the The Nothing else outstanding. |
Address maintainer review on PR DeusData#1697: - LFS pattern goes in the repo-root .gitattributes; the auto-created .codebase-memory/.gitattributes (bare graph.db.zst, merge=ours) is kept as-is, since a slash-containing pattern inside it would anchor to .codebase-memory/ and match nothing - Lead with commit cadence as the cheaper fix; LFS is for teams that need the artifact to move on every commit - Name the LFS costs: metered storage/bandwidth, no pruning without support, and teammates without `git lfs install` fall back to a full reindex Co-Authored-By: Claude Code <noreply@anthropic.com> Signed-off-by: Angus Gastle <angusgastle@gmail.com>
4b844b7 to
957b27f
Compare
|
Thank you for the thorough review — and for reopening this after the #1992 close. The anchoring catch in particular ( All three points from the review are now pushed as
Also added per your last note: a Sign-off: good catch — CI: understood on Thanks again for the patience on both ends of this round trip. |
|
Housekeeping note, so the close-and-reopen above does not look alarming: it was a CI plumbing fix, not a decision about this PR. Your three checks — The workflow uses Nothing is being asked of you and nothing about the change has changed. Once |
|
Merged as 2f9828d -- thank you, Angus, and welcome as a contributor! This one took a longer road than a seven-line README change deserved, and the delay was on our side. What made it worth the round trips is that the guidance now describes what the code actually does: the auto-created The 6 GB / ~350-commit data point from your own team is what makes the section land -- abstract warnings about binary bloat are easy to skim past; a number is not. |
Summary
Adds guidance to the Team-Shared Graph Artifact section recommending Git LFS for the
.codebase-memory/graph.db.zstartifact in team-shared repos.The problem we hit
The existing guidance told teams to commit
graph.db.zstas a regular file withmerge=ours. That works for merge conflicts but ignores the bigger issue: the artifact is a ~20MB binary that regenerates on every re-index, and committing it plainly stores a full new blob each time.We discovered this on a real monorepo (internal HR/finance app, ~2047 files). Within a normal week of indexing:
graph.db.zstblob was committed hundreds of times across history.mainalone carried 352 commits with the raw ~20MB blob (~6 GB).We reclaimed the space with a
git-filter-repohistory rewrite that converted the artifact to a Git LFS pointer across all history. After the rewrite, a fresh clone dropped from ~6 GB to ~534 MB — roughly a 10× reduction — andmain's.gitwent from 5.9 GB to under 1 GB.The fix
The artifact still regenerates, but with LFS the binary is stored out-of-band rather than as a new blob per commit. The
.gitattributestracking line:The
merge=oursconflict-avoidance the original guidance emphasized is preserved by LFS's ownmerge=lfshandler.What this PR changes
git-filter-repofirst (themerge=ours→ LFS switch on its own only affects future commits).Notes
merge=oursline on first export. A follow-up could auto-emit the LFS line (or detect an existing LFS setup), but that's a code change left for a separate PR.🤖 Generated with Claude Code