Repository navigation
Description
GRAPH_REPORT.md can show a different "thin community" count in its ## Knowledge Gaps section than in its ## Summary and ## Communities headers for the very same run, whenever the run doesn't use the default community-size threshold. A separate figure in the same report — the "isolated node(s)" count — also won't match a straightforward recount of degree-<=1 nodes straight from the accompanying graph.json. Either way, a reader auditing the report's own headline numbers, or diffing them against the graph data, sees stats that don't add up, which undermines trust in the rest of the report.
Repro
graphify update . --min-community-size=5(anything other than the default3) on a corpus with at least one community whose "real" node count falls between the two thresholds.- Compare
## Summary's(<shown> shown, <thin> thin omitted)and## Communities (<total> total, <thin> thin omitted)figures against## Knowledge Gaps's"<K> thin communities (<min_community_size> nodes) omitted"line —Kis computed against a different threshold than the number the label itself prints. - Separately, for the "isolated node(s)" figure: recount nodes with
degree <= 1directly fromgraph.jsonand compare to the reported count — they won't agree, because the report's isolated-node list additionally excludes file-hub nodes, concept nodes, and rationale nodes, which isn't stated anywhere in the report output.
Evidence (HEAD 43d54acbfa9e731f7a592bb582c1f4b9d48ed73e)
report.py:144-148—thin_count_summary(feeds the## Summaryand## Communitiesheader counts) is gated by the caller-suppliedmin_community_sizeparameter.report.py:287-290—thin_communities(feeds## Knowledge Gaps) is gated by a hardcoded literal3, notmin_community_size— while the label text right next to it,report.py:301, still prints"(<{min_community_size} nodes) omitted".cli.py:1858andcli.py:2173confirmmin_community_sizeis a CLI-configurable flag (--min-community-size, default3) that is threaded intogenerate(), so the two thresholds are reachably different, not just a theoretical edge case.report.py:280-286— the isolated-node list filters out file nodes and concept nodes (analyze.py:63_is_file_node,analyze.py:165_is_concept_node) plus any node withfile_type == "rationale". Per_is_file_node's own docstring, this exclusion is deliberate for "knowledge gap reporting" — but the report text doesn't say so, so a plaindegree <= 1recount fromgraph.jsonwill disagree with it.
Related prior art: #2129 (closed, NOT_PLANNED, self-withdrawn by its own reporter, no fix landed) reported a related divergence in this same community-counting code — its item 1 found the render loop and thin_count_summary use different guards for zero-real-node communities, causing the shown count to overstate what's actually rendered. Worth checking together with the hardcoded-threshold issue here, since both live in the same handful of lines.
Suggested fix
Compute the Knowledge Gaps thin-community count with the same min_community_size-gated predicate used for the Summary/Communities counts (share one helper), rather than a separate hardcoded 3. For the isolated-node count, either state the file/concept/rationale exclusion inline in the report text, or additionally print the raw degree <= 1 count so it's auditable against graph.json without reading the source.
Found while maintaining a downstream consumer of the generated report.
Activity
fix(report): make the report's headline numbers agree with themselves (…
chore: bump to 0.9.53
safishamsi commentedon Aug 30, 2026
Fixed in v0.9.53: https://github.com/Graphify-Labs/graphify/releases/tag/v0.9.53. Closing as resolved.