Repository navigation
Description
Part of #3640.
Context
Following related evidence for several documents currently requires one brain_graph root per request. A multi-root traversal might share work and deduplicate returned nodes/edges, but it could also produce a larger, less useful neighbourhood. Evaluate it against parallel existing calls before committing to a new interface.
Read (walkLinks, packages/core/src/lib/link-walk.ts:39-124), (brainGraphTool, packages/ui-backend-pi/src/brain-tools.ts:259-294), core MCP graph registration inside (registerReadTools, packages/core/src/mcp-server.ts:212-414) and the parent. walkLinks already deduplicates edges within one walk and reads edges/nodes inside one transaction; this is not missing node metadata or a graph-engine replacement.
Scope
- Compare independent parallel walks with one bounded multi-root traversal over overlapping and disjoint Odysseus project graphs.
- Specify candidate root/direction/depth limits, global node/edge/serialized-output/work bounds, root-to-result provenance and truncation/continuation behavior.
- Assess whether shared traversal improves useful evidence per returned byte and call, preserving each root's reachability semantics and a coherent index snapshot.
Out of scope
Shipping a production API, graph visualization/layout changes, new storage/seams, changed single-root behavior and inferred relationships that are not in the link graph. A smaller tool count alone is not success.
Acceptance criteria
- Reproducible offline fixtures cover shared neighbours, disconnected roots, cycles, unresolved links, duplicate/missing roots, both directions, depth bounds and concurrent index updates. Use the pinned date.
- The proposal states how roots map to returned paths/edges and prevents one large neighbourhood from silently erasing another root's coverage.
- Returned edges retain necessary endpoint metadata; deduplication preserves associations and unresolved links, and partial results are distinguishable from a complete union.
- Equivalent comparisons report traversal work, elapsed time, serialized bytes, duplicate content and task evidence coverage; real-model usability and token/cost claims require their own evidence rather than inference from local runtime results.
- A written go/no-go/inconclusive decision explains whether the complexity is justified and, if positive, supplies a scoped implementation brief and contract impact. A documented no is an acceptable completion.
Verification
Exercise the actual local traversal and existing graph/MCP/Pi paths keylessly, reusing the transaction consistency test seam without relaxing it. Keep harness-only tests in experiments/ and run through bun run test. Record source/fixture/runtime identities and exact commands. Do not require external services or a private corpus.
Contract impact
None for a written spike/private prototype. A later additive root-array or new tool/result schema requires its own supported-contract update, CONTRACT: commit and changeset. No release milestone is assigned.
Triage 2026-11-08 at main 1619741f291f525d17cde4970a5ada40644117c1: Verified the cited shared operations and concrete Pi adapters. The independent brief is complete; p2 reflects wanted unscheduled work. External model evidence is optional and does not block the specified keyless work.
Activity
schlessera commentedon Nov 8, 2026
Claimed as part of the #3640 epic run (claim token
c3640-ec699b9a-3646).spike/3646-multi-root-graph, PR targeting the epic integration branchepic/3640-bounded-retrieval; the epic lands onmainas one batch.origin/main1619741): every code citation in this body still points at its named anchor.docs(decisions): record a no-go for multi-root link traversal (#3670)
schlessera commentedon Nov 8, 2026
Spike result (2026-11-08): no-go — keep parallel single-root
brain_graphcalls.Delivered in #3670, merged into
epic/3640-bounded-retrievalas 0ce2256. The record isdocs/decisions/multi-root-graph.md, and the harness isexperiments/multi-root-graph.test.ts.The harness ran five scenarios on an Odysseus project fixture of 172 notes dated
2026-07-12. Each scenario went through the real CLI index, the core MCP server over stdio and the Pi tool.Two genuine advantages turned up: one consistent index snapshot across roots, and telling a missing root from an isolated one. Neither justifies a new contract. Tokens, cost and model usability were not measured: no paid or real-model trial was authorized.
Reopen only with real-model or provider-usage evidence; a lower call count is not enough. The record lists the rules any future proposal must start from: per-edge
roots[], global bounds on edges, nodes, characters and work, edges taken from each root in turn, an explicit partial flag, and one snapshot.All seven mutation checks failed their named tests when applied and passed again after restoring; the receipts are in #3670. This issue stays open until the epic lands on
main. Follow-ups for the single-root tool are filed separately.schlessera commentedon Nov 8, 2026
Follow-ups for the single-root tool, filed from this spike: #3677 (bound the MCP result), #3678 (depth cap differs: 5 over MCP, 4 over Pi), #3679 (a missing root looks like an isolated one).
Merge pull request #3721 from schlessera/epic/3640-bounded-retrieval