Files
codebase-memory-mcp/tests
Martin Vogelandlorenzozanee 784b13f2ee fix(mcp): scope possible_callees to the page and to dispatching calls
Follow-up to the include_overrides proposal (the previous commit), with
the September review applied:

- possible_callees is computed for the outbound rows the page requests,
  so pages stay exactly-once and the list is bounded by limit;
- implementations are found with one per-node OVERRIDE query
  (cbm_store_find_edges_by_target_type) and followed transitively with a
  visited set, so C.m is listed for a call to A.m when C : B : A; the walk
  stops at 5000 nodes per response and says so (possible_callees_truncated);
- under max_output_tokens the section yields before any other field or
  graph row and the response reports possible_callees_omitted;
- the tree format renders it as a tree table;
- the list lives in CBM_DYN_ARRAYs and a failed lookup marks it
  incomplete instead of failing the trace, so src/mcp/mcp.c keeps its raw
  allocator baseline;
- the tool description keeps "Rows keep qn/hop with explicit totals,
  relations, and continuations.".

Two rules beyond the review. Only callables are contracts or
implementations: OVERRIDE edges now also link tfvars values and kustomize
overlays. And a contract lists implementations only when a traced call
reaches it through an instance receiver: a super()/base call is bound to
the parent and a call on a constructed object or a type runs the declared
method itself (Django: 1,075 super() calls reach overridden methods).

include_overrides joins the cursor identity only when set: without it a
cursor is the token main mints, so the default output stays
byte-identical to main and cursors already handed out stay valid.

Main's topology/deploy/run modes stay in the schema. Eight tests replace
the single combined assert: the shape and the unchanged default, a
two-level hierarchy, include_tests and non-callable filtering, the tree
table, paging, the budget, static calls, and the cursor identity.

Co-authored-by: lorenzozanee <wyz0707@proton.me>
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-14 00:14:27 +01:00
..