Skip to content

Decide the codebase-memory graph: wire it into the resolver or delete the integration #231

Closed

Description

@abogartz

Finding

/repo-init spawns the external codebase-memory-mcp binary and writes an index; nothing in src/ ever reads the graph back. Every consumer of the result is cosmetic or bookkeeping (src/init.ts:252,274,292,309,327). The permanent cost: an optionalDependency pin (package.json:42-44), a three-step binary discovery function (src/config.ts:97-107), a published schema enum pinned by test/boundaries.test.ts:66-71, README sections, and a supply-chain surface (/repo-init can spawn a pinned third-party binary in the user's repository). Only the absence path is tested (test/init.test.ts points at a nonexistent binary).

Two comments describe behaviour that does not exist: src/resolver.ts:1-4 and src/config.ts:91-93 claim the resolver cross-checks against the graph; src/resolver.ts contains no spawn and no graph call. GATE-1 never consults the graph.

Decision needed

Either give the graph a job it already claims (have the resolver use it when the binary is present, and test that path), or remove the integration - drop the optionalDependency, cbmBin(), the mode argument, the README section and the troubleshooting row - and let indexing stay an operator-side MCP concern. Deleting also removes the supply-chain surface. If the integration stays, fix the two stale comments first: a stale comment about a gate's inputs is worse than no comment.

Source

Architecture review 2026-11-01, finding Y1 (Medium). This decision gates the bench-payload ticket: the answer changes what evidence is worth keeping.

Activity

  1. added
    question
    severity:medium
    agent:ready
    on Nov 1, 2026
  2. ocsi-triager commented on Nov 3, 2026

    @ocsi-triager

    osi-spec-hash: f845d993e142efbc 2026-11-03T22:41:21Z - acceptance criteria frozen at this text. A later edit to the body changes this hash, and the reviewer will withhold approval until a maintainer replies spec ok.

  3. removed
    agent:ready
    on Nov 4, 2026
  4. abogartz commented on Nov 5, 2026

    @abogartz
    OwnerAuthor

    Maintainer ruling 2026-11-04: wire it — and the archaeology says nothing was lost, it was never built

    Verified on 06e4e28 plus full history:

    • cbmBin() has exactly two commits touching it ever: the initial feature commit 47dff9c and the folder restructure c5a6b51. No removal exists.
    • Its only consumer is src/init/detect.ts:170 — the one-shot index spawn at /repo-init.
    • src/gate/resolver.ts claims a graph cross-check in its header comment; the file contains no import, no spawn, no graph reference. The comment has been aspirational since day one.
    • No watcher exists in src/init or src/gate — the only watcher commits in history are the TUI badge's filesystem watcher, unrelated to the graph.

    Ruling: the intended design stands — the resolver reads through the graph when the binary is present, and a watcher keeps the index fresh. That is a feature, not a one-line fix, so this ticket is queued to the architect (agent:analysis) to verify against the code, weigh the watcher's process-lifetime questions, and decompose into buildable tickets. The lying comments in src/gate/resolver.ts and src/core/config/paths.ts get fixed either way — first child ticket regardless of verdict.

  5. added
    agent:analysis
    on Nov 5, 2026
  6. added
    architect:working
    and removed
    agent:analysis
    on Nov 5, 2026
  7. ocsi-architect commented on Nov 5, 2026

    @ocsi-architect

    Architect verdict 2026-11-05: BLOCKED — two contract choices precede decomposition.

    Verified against 06e4e28dd30bff61d593883aede03c1033a10b80 (current main).

    Judgement questions:

    • PROBLEM: real — the graph integration pays permanent cost (optionalDependency pin package.json:42-44, discovery path src/core/config/paths.ts:71-80, published schema enum, a spawnable third-party binary) and has zero readers: cbmBin()'s only consumer is the one-shot index spawn at src/init/detect.ts:170, and two comments (src/gate/resolver.ts:1-4, src/core/config/paths.ts:64-66) describe a resolver cross-check that does not exist.
    • COST: the owner ruling of 2026-11-04 says the feature is wanted, so cost is judged against the plan, not against the dead weight alone. The honest build is 4–6 tickets including new runtime machinery (below).
    • COMPLEXITY: the nearest existing mechanism is the resolver's in-process tree scan (findLiveCall, src/gate/resolver.ts:394-437) — deterministic, tested, zero-dependency, already resolves definitions and signatures. The graph wiring duplicates that job and adds two moving parts the system does not have today: a query client and a freshness service.
    • DOWNSIDE OF AS-IS: the dead weight and the lying comments keep going; nothing user-facing breaks. Urgency is the owner's stated desire for the feature, not a live defect.

    Criterion 5 (DECIDED) fails. The ruling sets the direction and explicitly asks me to weigh the watcher's process-lifetime questions. Measurement says the ticket splits differently depending on two choices only a human can make:

    Q1 — how does the resolver consume the graph? Measured on 0.11.0: every one-shot CLI call costs 2.75–2.86 s wall (~2.4 s CPU; three timings: index_status 2.86 s, search_graph 2.75 s, detect_changes 2.80 s — the binary reloads its graph DB on every spawn). GATE-1 runs synchronously on every memory write (src/gate/gate.ts:454).

    • (a) Sync CLI spawn per query: adds ≥2.8 s to every write, per call form. Measurably harmful on the hot path; I will not file acceptance criteria around a known multi-second regression.
    • (b) Persistent codebase-memory-mcp stdio subprocess owned by the plugin: low query latency after startup, but it becomes the plugin's first long-lived child process — today every spawn is one-shot (src/init/detect.ts:44, src/init/run.ts:61, src/identity/repokey.ts:55). Needs an MCP client, health/restart handling, and a per-session lifecycle. ~4–5 tickets and changes the runtime shape of the plugin.
    • (c) Out-of-band: graph checks run as a background/evidence job (session start or post-write) and the resolver reads precomputed results. Write path unchanged; drift correction is delayed rather than at-write. ~3 tickets.

    Each answer produces a disjoint set of tickets and files, so I cannot decompose around it.

    Q2 — where does the freshness watcher live? Binary 0.11.0 has no watch/daemon mode (--help lists only stdio server, one-shot cli, install/uninstall/update/config). The plugin has no long-lived host process: a watcher inside the plugin dies with each OpenCode session and duplicates across concurrent sessions; a detached daemon is unsupervised and orphanable. Third option: drop the watcher and do a use-time freshness check via index_status/detect_changes — but that is another 2.8 s spawn per check, which folds back into Q1.

    To requeue: answer the question(s) here, remove architect:blocked, re-add agent:analysis.

    Independent of both answers, child #1 under any resolution is the comment fix the ruling already ordered: src/gate/resolver.ts:1-4 and src/core/config/paths.ts:64-66 claim a graph cross-check that has never existed (the resolver contains no spawn and no graph call). If you want it built before the contract question settles, adopt it as its own ticket.

  8. added
    architect:blocked
    and removed
    architect:working
    on Nov 5, 2026
  9. abogartz commented on Nov 8, 2026

    @abogartz
    OwnerAuthor

    Decision (maintainer, 2026-11-08): DELETE the codebase-memory graph integration. Nothing reads the index on any path (the rationale behind #323 making it opt-in), and the opt-in default-OFF state has held with no consumer appearing. Removal is implementation work tracked on this ticket: drop the indexing calls, the MCP wiring, and their tests; keep the memory core untouched.

  10. removed
    architect:blocked
    on Nov 8, 2026
  11. abogartz-opencode-self-improvement commented on Nov 9, 2026

    @abogartz-opencode-self-improvement

    🎉 This issue has been resolved in version 0.22.2 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionreleasedseverity:medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions