Repository navigation
Description
Context
Found by the #3646 spike. The core MCP brain_graph clamps depth to MAX_GRAPH_DEPTH = 5 (MAX_GRAPH_DEPTH, packages/core/src/mcp-server.ts:67), but the Pi tool goes through (readLinkWalk, packages/core/src/queries/index.ts:74), which clamps to 4 (packages/core/src/queries/index.ts:87). The same request returns a different neighbourhood on the two surfaces.
Scope
Give both surfaces one shared depth bound, defined once, and document it in each tool description.
Out of scope
Output caps (filed separately), multi-root traversal.
Acceptance criteria
- MCP and Pi apply the same maximum depth from one constant; a depth-5 request on a chain fixture returns identical edges on both.
- Tool descriptions state the bound; the Pi tool-roster fixture and MCP schema snapshot are updated if descriptions change.
- A test fails when either surface's clamp diverges.
- The shared bound is 5 (below 1 → 1, above 5 → 5; Pi default stays 1), and the Pi cap is updated from 4 to 5 in
docs/integration-contract/package-api.mdanddocs/content-index-queries.mdin the sameCONTRACT:commit, with a changeset (additive minor).
Verification
Odysseus chain fixture, pinned 2026-07-12; real MCP and Pi tests; provider-history guard if the Pi description changes.
Contract impact
Both limits are currently documented: MCP depth 5 in docs/integration-contract/mcp.md, and Pi default 1/cap 4 in the content-index query section of docs/integration-contract/package-api.md and docs/content-index-queries.md. Changing one is a supported behavior change. Carry contract, update all owning components/specifications and applicable fixtures in the same CONTRACT-prefixed change, and record the selected additive/breaking and minor-release assessment. A narrowing branch needs a maintainer ruling.
Refs #3646
Contract decision needed (resolved below)
Choose one common bound and its compatibility treatment: raise the shared query/Pi limit to 5, or lower MCP's documented limit to 4 with an explicit breaking ruling. Retaining the documented difference is an alternative only if the maintainer amends this alignment request; do not silently call the existing difference undocumented. Recommendation: prefer 5 to avoid narrowing existing MCP depth-5 calls, while explicitly reviewing the query/Pi resource and returned-neighbourhood increase. This is a recommendation, not a ruling.
Completion evidence: recorded common bound, treatment of below-minimum/above-maximum requests, affected query/Pi/MCP contracts and release classification. Fold that result into acceptance criteria before removing needs: decision. Read and preserve the shared-operation direction in docs/decisions/index-query-api.md and provider-history.md; extract one concrete constant rather than importing the MCP server into the library. This advances #3640's consistent retrieval behavior.
Triage 2026-11-08 at main 1619741f291f525d17cde4970a5ada40644117c1: Verified both source clamps and both authoritative documented bounds; retained a precise common-bound/compatibility decision instead of choosing a new limit. Priority p2 reflects wanted unscheduled work; assignments and milestones are preserved.
Triage 2026-11-08 at main 8752570331ffebdbb9233196412781f6cd71f3d9: Verified the moved active source anchors and refreshed navigation. Historical measurements and source-bound failure receipts keep their identities; existing scope, rulings, needs, priority, assignment and release attribution are preserved. This source review supplies no new runtime qualification or epic completion.
Maintainer decision — 2026-11-08
raise the shared bound to 5.
- One constant (
MAX_GRAPH_DEPTH = 5) is defined once in the core query layer, next toreadLinkWalk. Both the MCPbrain_graphand the Pi tool use it, and the MCP server keeps no separate copy. The library does not import the MCP server. - Depth below 1 clamps to 1 and above 5 clamps to 5 on both surfaces. Pi's default stays 1.
- Classification: additive. No previously accepted call gets narrower; Pi/query depth-5 requests now return the depth-5 neighbourhood instead of the depth-4 one, which is a deliberate widening. It ships in a minor with a
CONTRACT:commit that updatesdocs/integration-contract/package-api.mdanddocs/content-index-queries.md(Pi cap 4 → 5) in the same commit, plus a changeset.docs/integration-contract/mcp.mdkeeps depth 5.
2026-11-08: folded the ruling into the acceptance criteria; removed needs: decision, added agent-ready.
Activity
schlessera commentedon Nov 8, 2026
Decision (maintainer, 2026-11-08): raise the shared bound to 5.
MAX_GRAPH_DEPTH = 5) is defined once in the core query layer, next toreadLinkWalk. Both the MCPbrain_graphand the Pi tool use it, and the MCP server keeps no separate copy. The library does not import the MCP server.CONTRACT:commit that updatesdocs/integration-contract/package-api.mdanddocs/content-index-queries.md(Pi cap 4 → 5) in the same commit, plus a changeset.docs/integration-contract/mcp.mdkeeps depth 5.schlessera commentedon Nov 9, 2026
2026-11-09: detached from epic #3640 by maintainer decision (ruling). This issue is now standalone. Its scope, labels and readiness are unchanged.