Skip to content

refactor(cortex): remove the codebase indexer - #6774

Merged
hurttlocker merged 1 commit into
mainfrom
del/codebase-indexer
Nov 25, 2026
Merged

hurttlocker merged 1 commit into
mainfrom
del/codebase-indexer

Conversation

@hurttlocker

Copy link
Copy Markdown
Collaborator

Removes the codebase indexer. The owner decided this on 2026-11-24: coding agents search files on demand and don't need a prebuilt index.

Removed

  • The startup pass. ensureCodebaseMemoryBootIndex / indexAllRepos, started from src/lib/panel/status-boot.ts. On every server start it indexed each registered repository through the codebase-memory-mcp binary, waiting up to 5 minutes for the binary, and republished its state every 5 s while it ran.
  • src/lib/codebase-memory: the indexer, binary resolver, MCP client, symbol client, state store and live-state publisher.
  • The /api/cortex/codebase-memory route and its native registration.
  • The native Settings Indexing page (settings_indexing.rs, with its tests and navigation).
  • The graph retriever in Brain answers (retrievers/graph.ts), with the symbol citation kind it produced. The SQL, full-text, facts and corrections sources stay.
  • The up-to-3 symbol lines in the worker prompt's <context> block.
  • The codebase-memory server from the Tool-Spine registry. Setup and the MCP config writers no longer add it for Claude Desktop, Claude Code, Gemini or OpenCode, and Connect no longer waits for or warns about its download. Readiness is now just "the bundled operator server exists".

TS: −2,383 lines net. Rust: −561 lines net.

  • Startup. About 1,576 lines of the deleted code were loaded at server startup: the indexer, its helpers and the symbol client, through status-boot and the prompt builder.
  • Resting work removed. The startup index of every repository (one codebase-memory-mcp child per repository) and its 5 s state publisher.

Kept

  • The context block moves to src/lib/cortex/context-block.ts. Directives, outcomes, corrections, review outcomes, project scope and the pending spec stay.
  • Users' agent config files. An existing codebase-memory entry is left as it is. Disconnect now removes only the o8 entry, so o8 never edits that server's entry again.
  • The classic desktop shell's binary download and the launcher's O8_CODEBASE_MEMORY_BIN pass-through. The classic shell is out of scope, and other agents own the launcher. Nothing in the server reads the variable any more.
  • The Settings "Refresh docs" route (/api/cortex/reingest). It belongs to the notes index (item 15), and Settings no longer calls it.
  • The phone app. No /api/mobile route or mobile code imported anything removed.

Tests

  • Rewritten:
    • o8d-cortex-owner-real-path and o8d-cortex-owner-transport-real-path now cover only the diagnostics owner.
    • mcp-setup-readiness now covers the bundled-server gate.
    • The Tool-Spine smoke scripts now assert that codebase-memory is never written, even with the binary on disk.
  • Quarantined under Real-path suites drifted on main because they only run when their own files change #6761: project-codebase-dispatch-real-path. It fails on unchanged main (the non-main repository worker never launches), and this PR edits it for the moved import.
  • Left untouched so the queue doesn't select them: review-outcome-reuse, delegate-dispatch-merge and ws-work-soak still carry a vi.mock of a deleted codebase-memory module. Vitest treats a mock of a missing path as a no-op. All three fail on unchanged main (Real-path suites drifted on main because they only run when their own files change #6761). Skipping cases in review-outcome-reuse cascades, because later cases depend on the first case's state.

Verification

Based on 2cf9aa89c.

  • npm run typecheck:fast, tsc -p cli/tsconfig.json and ESLint on the changed files pass.
  • The native check passes: cargo check --tests for native/o8-next, with no new warnings in the settings files.
  • The nine enumerating real-path suites plus the touched cortex, worker-environment and brain suites, against an o8d built from this branch, all pass except project-codebase-dispatch, which fails identically on main and is now quarantined.
  • Unit tests pass for src/lib/{mcp,cortex}, the status route, the session-rules prompt test and mcp-setup-readiness: 247 of 247.
  • npm run verify:ci: Lint, Type Check, Test Classification, Hermetic Unit Tests, Server Bundle Size, Security Audit and Governance Smoke pass.
    • Integration (changed files) failed locally in three ways:
      • the 15 GiB disk gate on api-front-door
      • delegate-dispatch-merge and ws-work-soak, which fail identically on main and are now left untouched
      • review-outcome-reuse, also left untouched; its two failures match main

🤖 Generated with Claude Code

Agents search files on demand, so the prebuilt codebase index goes. This
removes the startup pass that indexed every registered repository through
the codebase-memory binary and republished its state every 5 s while it
ran, src/lib/codebase-memory, the /api/cortex/codebase-memory route, the
native Settings indexing page, the graph retriever in Brain answers (the
SQL, full-text, facts and corrections sources stay), and the up-to-3
symbol lines in the worker prompt's context block. Directives, outcomes,
corrections, review outcomes, project scope and the pending spec stay in
that block, which moves to src/lib/cortex/context-block.ts.

Setup and the MCP config writers no longer add a codebase-memory server
for Claude Desktop, Claude Code, Gemini or OpenCode, and Connect no
longer waits on or warns about its download. An entry already in a
user's config file is left as it is, including on disconnect.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hurttlocker hurttlocker added shell-work tests-removed-ok Human-reviewed: test deletions/assertion loss are intentional labels Nov 25, 2026
@github-actions github-actions Bot added the size/XL Pull request with XL diff size label Nov 25, 2026
@github-actions

Copy link
Copy Markdown

📝 o8.run docs may need updating

This PR changes source that the public docs describe. Review whether these pages are still accurate (and bump their stamp in o8-site if so):

  • The Brain the-brain — tracks src/lib/cortex/qa/citations.ts, src/lib/cortex/qa/retrieve.ts, src/lib/cortex/qa/retrievers/graph.ts, src/lib/cortex/qa/types.ts

Flagged by docs-drift against https://o8.run/api/docs/manifest. Docs only — nothing is auto-edited.

@github-actions

Copy link
Copy Markdown

🔍 PR Review Bot

Metric Value
Files changed 68
Additions +118
Deletions -3084
New files 0

⚠️ Large files (>300 lines changed)

  • native/o8-next/src/settings_indexing.rs — +0/-303
  • src/lib/codebase-memory/client.ts — +0/-508
  • src/lib/codebase-memory/indexer.ts — +0/-522
  • src/lib/codebase-memory/mcp-client.ts — +0/-301

Note: This PR touches 68 files. Consider splitting into smaller PRs.


Automated review — CI workflow

@hurttlocker
hurttlocker added this pull request to the merge queue Nov 25, 2026
Merged via the queue into main with commit 69e4f91 Nov 25, 2026
43 of 45 checks passed
@hurttlocker
hurttlocker deleted the del/codebase-indexer branch November 25, 2026 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shell-work size/XL Pull request with XL diff size tests-removed-ok Human-reviewed: test deletions/assertion loss are intentional

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant