Repository navigation
Drop the code-graph integration from /repo-init - #368
Conversation
Nothing in src ever read the index back: gate1 resolves code refs against the live file tree, and gate evidence is identical with the index present or absent. What the integration cost was an optionalDependency pin, a three-step binary discovery path, a published schema enum, and a supply-chain surface — /repo-init could spawn a pinned third-party binary inside the user's repository. Measured on the benchmark it also cost 11-26s on the first-write critical path and failed in 29 of 32 real inits. Removed: ensureGraph/cbmProject and the graph status line, cbmBin()/graphEnabled(), the mode argument (tool schema, wire snapshot, InitArgs), the optionalDependency and its lockfile entry, the OPENCODE_CBM_BIN/OPENCODE_MEMORY_GRAPH docs, the Code graph section and its troubleshooting rows, and the graph assertions in the init and characterization suites. The init stamp no longer carries graph= and mode=; stamp matching keys on head, so existing stamps keep working. Fixed on the way out: the GATE-1 resolver header claimed it cross-checked refs against the graph when OPENCODE_CBM_BIN was set. It never did — the comment is now what the code does. The gate names graph_current/graph_drift stay: they are GATE-1's own ref-freshness read of the live tree, unrelated to the removed indexer. Test: memory_init now asserts the opposite of the old opt-in proof — no Bun.spawn call at all for any argument set. Merge gate green: 1104 unit + 30 e2e, tsc clean, lint identical to main's baseline.
Adversarial self-review (author-side, not independent)Checked the removal against current Verified clean:
Findings:
Verdict: approve after (1). (2) is a doc line, (3) is optional. Branch is 23 commits behind |
# Conflicts: # src/init/run.ts # test/init.test.ts
|
Merged into Before landing, per the self-review: dropped the dead Then merged |
|
🎉 This PR is included in version 0.22.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What this does
/repo-initused to be able to build a code-graph index with an external tool calledcodebase-memory-mcp. This removes that integration.It was worth removing because nothing ever read the index back. The plugin resolves code references (a memory that names a file or a constant) by looking at the live files on disk, and the write-gate audit trail comes out byte-identical whether the index exists or not. So the feature cost:
optionalDependenciespin on a third-party package, and the install that comes with it;mode), two environment variables, a README section, and a troubleshooting row.Indexing stays an operator-side concern: anyone who wants the graph can run that tool as its own MCP server. The plugin no longer has an opinion or a subprocess.
What changes for a user
/repo-initis local-only: parse manifests, write the command memories, write the stamp. No subprocess, ever. There is now a test asserting exactly that.Graph: …line, andmemory_initno longer takes amodeargument.graph=/mode=. Stamps are matched on git head, so existing stamps keep working; the next init rewrites the line in the new shape.OPENCODE_MEMORY_GRAPHandOPENCODE_CBM_BINdo nothing.One stale comment went with it: the write-gate resolver's header claimed it cross-checked references against the graph when
OPENCODE_CBM_BINwas set. It never did — the comment now describes the code.Note on names: the gate's own audit lines
graph_currentandgraph_driftstay. They are the gate re-reading the live file tree to see whether a remembered file path still exists — the word "graph" there predates this integration and has nothing to do with it.Tests
bun run gategreen: 1104 unit tests + 30 terminal/BDD tests against a real host, 0 fail.bunx tsc --noEmitclean;bun run lintidentical to main's baseline.Breaking in the strict sense (one tool argument and two env vars disappear), with no behavior lost — the decision is recorded on the ticket.
Closes #231.