Skip to content

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

Closed

Description

@Shashankss1205

Reported by a user indexing a 46-file C# project with scip-dotnet:

I got a project with 46 files, only some of them are C# ofc but cgc index . seems to "never seem to have completed" … it said repository '.' has only 32 of 46 files indexed. Continuing. then it completes indexing and… if I run it again and again and again it always says only 32 of the 46 have been indexed

Cause

Two different rules count files, and one can never be satisfied.

The "46" comes from cli_helpers.py:350 → graph_builder.estimate_processing_time() → discover_files_to_index(), which returns supported extensions plus a generic set (discovery.py:14-22):

_GENERIC_EXTENSIONS = {".toml", ".sh", ".yaml", ".yml", ".json", ".ini",
                       ".cfg", ".md", ".txt", ".bat", ".ps1"}
_GENERIC_FILENAMES  = {"Dockerfile", "Makefile", ".gitignore",
                       ".dockerignore", ".env"}

The "32" is MATCH (r:Repository {path:$path})-[:CONTAINS*]->(f:File) RETURN count(DISTINCT f).

The gap is at scip_pipeline.py:198-200, 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 does not have this hole — pipeline.py:189 falls back to add_minimal_file_node for exactly these files, and parse_file distinguishes them deliberately so it can: generic types return "unsupported": False (graph_builder.py:1048) while genuinely unparseable ones return True (:1053).

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

Reproduction

$ # 32 .cs files + 14 typical non-code files
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.

Impact

Cosmetic in terms of graph content — the C# code is fully indexed, and the missing entries would only ever be inert placeholder nodes. But:

  • cgc index . reports a partial index on every run and re-indexes each time; the state cannot be cleared (--force re-indexes but the warning returns).
  • It is indistinguishable from a real partial index, so a genuine failure would be invisible.
  • Only the SCIP path is affected, so behaviour differs by language for the same repository.

Fix

Give scip_pipeline the same add_minimal_file_node fallback the Tree-sitter pipeline has, so both agree on what a file is.


Environment
Version 0.5.4
Backend LadybugDB (also applies to other backends)
Indexer scip-dotnet

Activity

  1. added
    bugSomething isn't working
    severity: mediumIncorrect results, misleading output, or a broken contract
    area: indexerParsing, discovery, resolution, persistence
    on Aug 2, 2026
  2. github-actions commented on Aug 2, 2026

    @github-actions
    Contributor

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

  3. moved this from Backlog tasks to In progress in CGC Progress Boardon Aug 2, 2026
  4. moved this from In progress to Done in CGC Progress Boardon Aug 2, 2026
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

    area: indexerParsing, discovery, resolution, persistencebugSomething isn't workingseverity: mediumIncorrect results, misleading output, or a broken contract

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions