Skip to content

Best-effort indexing-coverage signal: mark files/regions that were not fully indexed #963

Description

@DeusData

Best-effort indexing-coverage signal

Framing (read first): this is a best-effort attempt to mark code that was not fully indexed into the graph. A flag means "we know this file/region is incomplete — prefer grep here." The absence of a flag is NOT a guarantee of completeness — it means no gap was detected, not that none exists. We never present this as a completeness proof.

Why

Today the graph can silently drop constructs and nothing surfaces it. Concrete case: cbm_path_within_root (an #ifdef-split-brace function) was entirely absent from the graph while its callers stayed linked (#960, #961). An agent searching the graph has no way to know it might be reading an incomplete picture and should fall back to grep.

What we can detect (best-effort, in decreasing confidence)

Class Example Signal
Purposely ignored gitignore / excluded dirs / .cbmignore / vendored already in the index response excluded — surface as not_indexed_by_design (a design note, kept separate from gaps)
File-level skip unreadable / oversized / parse-timeout / worker crash already in skipped[] (#785)
Parse-partial #ifdef-split brace, truncated file, unparseable syntax NEW — ts_node_has_error(root) + ERROR/MISSING line ranges. Verified: tree-sitter reports has_error=TRUE for exactly this case.
Extractor gap tree-sitter parsed a function_definition, extractor didn't emit a node NEW — per-file reconciliation of tree-sitter recognized-construct count vs. emitted node count (analog of the existing dump_verify). Per-language, only where calibrated to zero false positives.
Clean-but-wrong misparse valid tree, mis-categorized def, count matches Undetectable — the honest residual; part of why this is best-effort.

Deliverables

  • Signal A (first increment): capture has_error + ERROR line-ranges per file → mark the File node (a present-when-incomplete marker, so absence never implies "complete") → surface in the index_repository response as parse_partial[]. Reproduce-first test with the #ifdef fixture (RED before, GREEN after). This alone would have caught cbm_path_within_root.
  • Signal B (follow-up): parse-vs-extract count reconciliation, per calibrated language.
  • Agent surfacing: the File-node marker so search/trace/snippet results carry "this file is partial" inline; and an index_coverage view (extend index_status) with grep-fallback guidance.
  • Docs: state the best-effort guarantee explicitly wherever the signal is exposed.

Non-goals / honesty guards

  • No claim of exhaustive completeness. Absence of a flag ≠ complete.
  • Signal B must not false-positive — uncalibrated languages get Signal A only.
  • not_indexed_by_design (ignored files) stays a separate, clearly-labelled list — never mixed into "gaps."

Relates to #961 (the extractor limitation this makes visible).

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