Skip to content

fix(indexer): record non-code files on the SCIP path so cgc index stops reporting a partial index - #1566

Merged
Shashankss1205 merged 1 commit into
mainfrom
fix/scip-minimal-file-nodes
Aug 2, 2026
Merged

Shashankss1205 merged 1 commit into
mainfrom
fix/scip-minimal-file-nodes

Conversation

@Shashankss1205

Copy link
Copy Markdown
Collaborator

Fixes #1565 — reported by a user indexing a 46-file C# project with scip-dotnet, where cgc index . said "Repository '.' has only 32 of 46 files indexed. Continuing." on every run and never converged.

Full suite: 1080 passed, 7 skipped, no failures.

Cause

Two rules counted files, and one could never be satisfied.

The expected count comes from estimate_processing_time → discover_files_to_index, which returns supported extensions plus a generic set (discovery.py:14-22): .md .txt .json .yaml .yml .toml .ini .cfg .sh .bat .ps1, plus Dockerfile, Makefile, .gitignore, .dockerignore, .env.

The actual count is File nodes in the graph.

The gap was scip_pipeline.py, in the supplementary Tree-sitter pass:

ts_parser = get_parser(repo_file.suffix)
if not ts_parser:
    continue          # no File node, no record, nothing

The Tree-sitter pipeline has no such hole — pipeline.py:189 falls back to add_minimal_file_node, and parse_file separates the two cases deliberately so it can: generic types return "unsupported": False (graph_builder.py:1048) while genuinely unparseable ones return True (:1053).

So the two pipelines disagreed about what counts as a file, and the SCIP path was short by exactly the number of non-code files in the repo.

Reproduction

files on disk:                      46
discover_files_to_index (expected): 46
  with a .cs parser:                32
  with NO parser:                   14   (.gitignore, Dockerfile, LICENSE.txt,
                                          README.md, appsettings.json, build.sh, …)
SCIP path writes File nodes for:    32

The 32/46 split is the natural one for a project of that shape, not a coincidence.

Fix

Give the SCIP path the same fallback. Non-code files now get a minimal File node, count toward job progress, and are surfaced in the summary log:

[SCIP+TS] Recorded 14 non-code file(s) as minimal File nodes

Test

tests/unit/tools/test_scip_pipeline_minimal_nodes.py pins the two pipelines to the same contract: for a 32-source + 14-non-code repo, File nodes written must equal files discovered.

Reverting the fix fails it with the reported symptom:

AssertionError: graph would hold 32 File nodes but discovery expects 46
                — `cgc index` will warn on every run

Notes for review

🤖 Generated with Claude Code

`cgc index .` reported "Repository '.' has only 32 of 46 files indexed.
Continuing." on every run of a C# project, and no amount of re-indexing
cleared it.

Two rules were counting files and one could never be satisfied.
`estimate_processing_time` -> `discover_files_to_index` returns supported
extensions plus a generic set (.md, .json, .yaml, .toml, .sh, Dockerfile,
.gitignore, ...), while the check compares that against File nodes in the
graph. The SCIP pipeline's supplementary pass skipped any file it had no
parser for:

    ts_parser = get_parser(repo_file.suffix)
    if not ts_parser:
        continue          # no File node, no record, nothing

so the graph was short by exactly the number of non-code files.

The Tree-sitter pipeline has no such hole: pipeline.py:189 falls back to
add_minimal_file_node, and parse_file separates the two cases on purpose —
generic types return "unsupported": False (graph_builder.py:1048) while
genuinely unparseable ones return True (:1053). The SCIP path simply never
grew the fallback, so the two pipelines disagreed about what a file is.

Give the SCIP path the same fallback. Non-code files now get a minimal
File node, count toward job progress, and are reported in the summary log.

Regression test asserts the two pipelines agree: for a 32-source +
14-non-code repo, File nodes written == files discovered. Reverting the
fix fails it with "graph would hold 32 File nodes but discovery expects
46", reproducing the report exactly.

Co-Authored-By: Claude Fable 5 <[email protected]>
@vercel

vercel Bot commented Aug 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
code-graph-context-pack Ready Ready Preview Aug 2, 2026 6:51pm

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Hi! 👋 Join our CodeGraphContext Discord channel to collaborate: https://discord.gg/dR4QY32uYQ

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

🔍 PR Code Graph Analysis

fix(indexer): record non-code files on the SCIP path so cgc index stops reporting a partial index (#1566)

📊 Interactive Visualization

View the blast radius graph: PR Reviewer Dashboard

📦 Artifacts

The graph JSON has been uploaded as a build artifact: pr-code-graph-1566


Generated by CodeGraphContext using FalkorDB Lite

@Shashankss1205
Shashankss1205 merged commit 433593e into main Aug 2, 2026
19 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog tasks to Done in CGC Progress Board Aug 2, 2026
@Shashankss1205
Shashankss1205 deleted the fix/scip-minimal-file-nodes branch August 2, 2026 19:00
Shashankss1205 added a commit that referenced this pull request Aug 2, 2026
Bug-fix release. Since 0.5.4 on PyPI:

- fix(indexer): record non-code files on the SCIP path so `cgc index`
  stops reporting a partial index forever (#1565, #1566)
- fix(parsers): capture PHP imports rather than trait uses (#1522, #1563)
- fix(parsers): recover Python annotated parameters — 40.3% of parameters
  were being dropped — and Go grouped imports (#1520, #1521, #1561)
- fix(graph): always sanitize bundle filenames (#1517, #1541)
- fix(cli/mcp): read import aliases from the IMPORTS relationship (#1515, #1540)
- fix(cli/mcp): fall back to JSON when GCF encoding fails (#1518, #1539)

Co-authored-by: Claude Fable 5 <[email protected]>

This branch was successfully deployed

1 active deployment
Preview — 3f9b22da Deployed Aug 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bug(indexer): SCIP path never records non-code files, so cgc index reports "only N of M files indexed" forever

1 participant