Repository navigation
Description
Reproduce (public repo, 3 commands, no API key)
git clone --depth 1 https://github.com/leanprover-community/batteries.git
cd batteries
graphify update .Result on batteries @ 3b4ce082, graphify 0.9.58:
[graphify watch] Rebuilt: 18 nodes, 13 edges, 7 communities
Code graph updated.
Exit code 0. The 18 nodes come from 4 shell scripts and 2 README files. All
260 .lean files are absent, and the run says nothing about them.
GRAPH_REPORT.md then states:
## Corpus Check
- 11 files · ~7,795 words
- Verdict: corpus is large enough that graph structure adds value.
For a repository whose actual content is 260 Lean files, that verdict is
describing four shell scripts.
The data is already there
This is the part that makes it cheap to fix. detect() already computes and
returns the list:
>>> from graphify.detect import detect
>>> r = detect(Path("batteries"))
>>> sorted(r.keys())
['files', 'graphifyignore_patterns', 'ignored', 'needs_graph',
'pruned_noise_dirs', 'scan_root', 'skipped_sensitive', 'total_files',
'total_words', 'unclassified', 'walk_errors']
>>> r["total_files"]
22
>>> len(r["unclassified"])
268
>>> collections.Counter(Path(x).suffix for x in r["unclassified"]).most_common(3)
[('.lean', 260), ('.toml', 3), ('', 4)]unclassified holds 268 entries, 260 of them .lean. Nothing downstream reads
it: it does not reach GRAPH_REPORT.md, and graph.json has no field for it.
So this is not a missing computation. It is a missing three lines of display.
Suggested fix (not Lean-specific)
Surfacing unclassified would make the gap visible for every unsupported
language at once:
- scan summary line —
unclassified: 268 files (top: .lean 260, .toml 3) GRAPH_REPORT.mdCorpus Check — same line, next to the file/word countsgraph.json—"unclassified_files": {"count": 268, "by_extension": {".lean": 260, ...}}
No change to graph topology, no new dependency, and it turns a silent drop into
a number the user can act on. A Verdict: line that knows 268 files were
skipped can also stop asserting the corpus is well covered.
Why .lean is unclassified (for reference)
Verified in source on v8 @ 23f2ffa, not inferred from behaviour:
graphify/detect.py→CODE_EXTENSIONSholds 100+ suffixes;.leanis not
among them.graphify/detect.py→DOC_EXTENSIONSis
{.md .mdx .qmd .skill .txt .rst .html .yaml .yml};.leanis not there either.pyproject.tomldeclares 31tree-sitter-*grammars. There is no
tree-sitter-leanto add —pypi.org/pypi/tree-sitter-lean/jsonand
pypi.org/pypi/tree-sitter-lean4/jsonboth return HTTP 404.
Not classifying .lean is correct behaviour for an unsupported language. The
reporting is the bug.
Separate question: should graphify parse Lean 4?
Raising it here rather than as a PR, because it does not fit the extractor
pattern in ARCHITECTURE.md and the architecture call is yours. Step 4 of
"Adding a new language extractor" is "Add the tree-sitter package to
pyproject.toml dependencies"; for Lean there is no such package, so any Lean
support would be the project's first non-tree-sitter code extractor — a
precedent rather than a patch.
I wrote a standalone Lean 4 extractor as prior art. It emits graphify's
documented extraction schema and build_from_json() consumes it unchanged. It
is deliberately two-layered so the trustworthy half is separable:
| layer | method | confidence |
|---|---|---|
| module / import / declaration | literal match on source after comments and string literals are blanked (nested /- -/, --, "…") |
exact |
declaration → declaration uses |
identifier match against the declared-symbol table, resolved through the enclosing namespace and open, local binders excluded |
INFERRED, or AMBIGUOUS when more than one declaration matches |
On a 445-file Lean corpus it produced 4,068 nodes and 19,804 edges in about two
seconds. One number that may be worth knowing if you take this on: excluding
locally bound names (∀/fun/intro/obtain, and header binder groups) from
resolution removed 4,589 false uses edges — 19% of the edge set — and
moved the hub list from single binder letters to the corpus's real concepts.
Before that fix the top "god nodes" were j, I, A, S.
Happy to open a PR for the reporting fix above if you want it; the extractor I
would only submit if a regex-layer extractor is a direction you want at all.
Environment
- graphify 0.9.58, installed via
uv tool install 'graphifyy[leiden,svg,pdf,office,watch]' - Python 3.10.12, Linux aarch64
- repo
v8@23f2ffa; reproduction repobatteries@3b4ce082
Activity
ahpxna commentedon Sep 12, 2026
Correction to my own issue text, before anyone acts on it.
I wrote "Nothing downstream reads it". That is wrong.
cli.pydoes readdetection["unclassified"]and prints a[graphify extract] N file(s) not classified ...line — added in #1692. I missed it because I reproduced withgraphify update, which does not go through that path.The accurate statement is narrower:
extractpath surfaces unclassified files (Dockerfile/Gemfile/Makefile/Rakefile/LICENSEand other extensionless, non-shebang project files currently produce no visible trace in graphify's output — not classified, not counted anywhere #1692, working as intended);graphify update,graphify watchand the git hookdoes not —
watch.pynever reads the key, and thedetectiondict itsynthesizes for
report.generatedrops it;GRAPH_REPORT.mdtherefore cannot mention them on that path, andgraph.jsonhas no field for them at all.
Everything else in the issue stands, including the
batteriesreproduction —that run used
graphify update, so it is a reproduction of the rebuild-path gapspecifically. Apologies for the overstatement.
PR opened against
v8for the rebuild path and the report line.Surface unclassified files in GRAPH_REPORT.md
Report unclassified files from graphify update too