Report unclassified files from graphify update too

graphify extract has printed this since #1692, but the update and
watch rebuild path never did, so a corpus with no extractor for its
language, Lean 4 in the reported case, rebuilt successfully with
those files completely absent and nothing said about it. Prints the
same wording from the extract command, and threads the count into
the local detection summary the rebuild path already builds for
GRAPH_REPORT.md, which previously dropped it. Fixes #3511.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017qfdzgbA5KedGEjD1AayNh
(cherry picked from commit 120405673f)
This commit is contained in:
ayushcodes10 authored and safishamsi committed 2026-09-12 17:36:10 +01:00
1 parent c9da36d87c
commit cd8552242c
2 files changed
+34

No files matched your search

+15
View File
@@ -1428,6 +1428,20 @@ def _rebuild_code(
)
code_files = [Path(f) for f in detected['files']['code']]
# #3511: `graphify extract` has surfaced files it saw but could not
# classify since #1692; this update/watch rebuild path never did,
# so a corpus in a language with no extractor (no supported
# extension or shebang) rebuilt "successfully" with those files
# silently absent from the graph. Same wording as the extract path.
_unclassified = detected.get("unclassified", []) if isinstance(detected, dict) else []
if _unclassified:
_names = ", ".join(sorted({Path(p).name for p in _unclassified})[:6])
_more = f" (+{len(_unclassified) - 6} more)" if len(_unclassified) > 6 else ""
print(
f"[graphify watch] {len(_unclassified)} file(s) not classified "
f"(no supported extension or shebang), skipped: {_names}{_more}"
)
# #2495: hand reconcile the same ignore decisions the detect() call
# above made, so a newly-ignored file that still exists on disk is
# purged from the graph instead of preserved forever by the fail-closed
@@ -1876,6 +1890,7 @@ def _rebuild_code(
"files": {"code": [str(f) for f in code_files], "document": [], "paper": [], "image": []},
"total_files": len(code_files),
"total_words": detected.get("total_words", 0),
"unclassified": detected.get("unclassified", []),
}
# Inherit the existing graph's directed flag (#2342) so `graphify