Skip to content

Projects with a ::missed shadow row vanish from list_projects and the graph UI #1044

Closed

Description

@metehanulusoy

Summary

Any project whose db carries a <name>::missed shadow row (created by the miss-graph feature for projects with at least one parse/index failure — i.e. most real-world repos) disappears from list_projects and the graph UI, even though the index is complete and directly-addressed tools (search_graph, index_status, get_graph_schema) keep working.

Observed on a real repo: a 704-file ASP.NET codebase indexed fine (70,410 nodes / 308,106 edges, index_status → ready), but list_projects returned {"projects":[]} and the UI showed "No indexed projects".

Environment

Root cause

Two features conflict:

  1. The miss-graph pass inserts a second row into the per-db projects table — <project>::missed — because nodes.project has an FK to projects(name). The comment there still claims this row is "Invisible to list_projects, which scans the cache directory for .db files, not this table" (src/store/store.c#L1983-L1986) — that claim is stale since query_graph / search_graph return "project not found" inconsistently; DBs valid on disk but CLI looks up wrong inode #704.
  2. Since query_graph / search_graph return "project not found" inconsistently; DBs valid on disk but CLI looks up wrong inode #704, list_projects (via build_project_json_entry) and resolve_store_fallback_scan key on the db's INTERNAL project name via db_internal_project_name, which requires the projects table to contain exactly one row: n == 1 at src/mcp/mcp.c#L1338.

Once the shadow row lands, n == 2 → db_internal_project_name returns false → the db is treated as "ghost / unreadable" and skipped from the listing, and the fallback-scan resolve path fails as well.

Reproduction

# index any repo that produces >= 1 parse failure (or add the row manually):
sqlite3 ~/.cache/codebase-memory-mcp/<project>.db \
  "INSERT INTO projects(name, indexed_at, root_path) VALUES ('<project>::missed','2026-01-01T00:00:00Z','');"
codebase-memory-mcp cli list_projects
# → {"projects":[], "hint":"No projects indexed. ..."}  — while the db has 70k nodes

Deleting the ::missed row makes the project reappear immediately.

Expected behavior

Internal shadow projects (*::missed) are ignored when deriving the db's internal name; the primary project stays listed and resolvable.

Proposed fix

In db_internal_project_name, filter out rows whose name contains :: and require exactly one primary row, instead of n == 1 over all rows. I have a patch with a reproduce-first regression test (modeled on the #704 test fixture) and will open a PR referencing this issue shortly.

Activity

  1. added
    bugSomething isn't working
    priority/highNeeds near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.
    on Jul 14, 2026
  2. added this to the 0.9.1-rc milestone on Jul 14, 2026
  3. DeusData commented on Jul 14, 2026

    @DeusData
    Owner

    Thanks for the precise shadow-row diagnosis. This is a high-priority 0.9.1-rc visibility bug because valid indexed projects disappear from both list_projects and the graph UI. PR #1046 is the current fix candidate; review will verify exact base-project selection, multiple shadow rows, and no regression for directly addressed tools.

  4. DeusData commented on Jul 15, 2026

    @DeusData
    Owner

    Fixed on main by PR #1046 (merged in 807a4a3, author @metehanulusoy), shipping in v0.9.1.

    Root cause confirmed: since #704, the project-name resolution and list_projects enumeration didn't distinguish the miss-graph pass's <name>::missed shadow row from a real project, so any db carrying that shadow (i.e. most repos with at least one parse failure) was skipped as a ghost and vanished from list_projects and the UI — while directly-addressed tools kept working, which is exactly why it looked like "nothing is indexed" over a fully-present index.

    The fix filters ::-bearing shadow names from enumeration and base-project selection. Verified: the regression test is genuinely RED without the production change (the project is absent from list_projects) and GREEN with it; the shadow name itself is never advertised. Closing — thanks for the precise root-cause writeup.

  5. added a commit that references this issue on Jul 15, 2026
    3b1ea58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingparsing/qualityGraph extraction bugs, false positives, missing edgespriority/highNeeds near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.ux/behaviorDisplay bugs, docs, adoption UX

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions