feat(status): separate files seen from files parsed - #1658
Open
ferrine wants to merge 1 commit into
Open
Conversation
`Files by Language` is a GROUP BY over the `files` table, whose `language` column comes from the file extension. It therefore counts a file the parser never understood exactly like one it parsed perfectly, which makes a broken language remarkably cheap to ship: remove a grammar and `init` still exits 0, `status` still lists the language with its full file count, and a symbol lookup still "runs" (its not-found message even contains the symbol name, so grepping for that passes too). Every obvious check stays green while the language contributes nothing. Add `parsedFilesByLanguage` — files with at least one node that is not their own `file` node, which every indexed file gets regardless — and surface it: - `status` prints the parsed count beside the file count whenever they differ, and names any language that parsed nothing at all; - `--strict` exits non-zero on that condition, for packaging and CI. It is opt-in: failing by default would break existing callers; - the MCP status tool reports the same split, so a connected agent is not told a language is available when none of it was extracted. The zero-parsed check is restricted to grammar-backed languages via the new `hasGrammar`. Config formats (yaml, twig, xml) are tracked at file level deliberately and must never raise it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Bsi9EH64kMisnik4E1gf7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Branch:
ferrine:feat/status-parsed-vs-seen→mainSize: 7 files, +232/−5 · Tests:
__tests__/status-parsed-vs-seen.test.ts(6 new)Why
codegraph statuscounts files by extension, so a language whose parser ismissing or failing reports its full file count and looks completely healthy.
Indexing succeeds, the language is listed, symbol lookups still run — and
nothing from those files is in the graph.
This is the silent-zero failure mode: "no symbols" and "nothing to extract" are
indistinguishable from the outside, so a broken grammar can sit unnoticed
indefinitely. It is also invisible to any smoke test that only checks that
indexing exited 0.
What changed
statusreports, per language, how many files actually produced symbolsalongside how many were seen.
plain terms rather than leaving the reader to compare two numbers.
--strictflag exits non-zero in that case, so packaging and CI can gateon it.
receive.
Restricted to grammar-backed languages, so config formats that legitimately
parse to nothing (yaml, properties) do not warn.
Notes for review
Purely additive: existing output gains a column, the new exit behaviour is
behind an opt-in flag.