Files
codebase-memory-mcp/src
Martin Vogel 329cfc3c36 fix(cross-repo): stop a "::missed" shadow row making a project unresolvable
Indexing writes an internal "<name>::missed" miss-graph row into the SAME db as
the primary project whenever a file parses partially. cr_store_has_exact_project
required `count == 1` over ALL rows returned by cbm_store_list_projects, which
does not filter those rows - so any project that had ever recorded a parse miss
failed validation, as SOURCE and as TARGET, and the whole feature reported:

    project is not indexed

for a project that plainly was. There is no user-level workaround: a partial
parse is not something the operator controls, and re-indexing reproduces the
shadow row.

This is the same defect mcp.c fixed for list_projects in #1044 ("requiring
n == 1 over ALL rows made every project with a miss graph vanish"); the
cross-repo site never learned it. The fix ports that primary-row filter.

The single-primary requirement itself is deliberately kept: it is what proves
the db belongs to the project we were asked about rather than being a shared or
mislabelled store. Only "::" shadow rows stop counting toward it.

Reported by vitaliy-shatskiy in #1609, whose diagnosis named the exact function
and the exact reason.

Reproduce-first, and revert-checked both ways:
  - the new test fails on origin/main with `ASSERT(!(result.failed))`
    (tests/test_cross_repo.c), for the behaviour under test rather than a setup
    error;
  - it passes with the fix;
  - reverting ONLY src/pipeline/pass_cross_repo.c and keeping the test brings
    the identical RED back, so the test binds to the production change.

The existing pair without shadow rows is the control: those tests already prove
that path returns edges, so this cannot pass vacuously on a fixture that never
matched.

cross_repo 8 passed; pipeline 249 passed; store_edges 25 and store_nodes 67
passed - no collateral change.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-08-15 08:44:20 +02:00
..