report: count an all-file-node community as thin, not invisible (#3548) - #3549
ayushcodes10 wants to merge 2 commits into
Conversation
Number 3148 fixed shown to be computed directly instead of total minus thin, since the old formula counted a community with zero real nodes as shown even though the render loop skips it. That fix left thin itself under a zero real guard from before it, so a zero real community was excluded from both figures at once and went uncounted anywhere the report prints about itself, and shown plus thin no longer summed to the total community count. Both counting sites drop that guard so a community the render loop skips for having too few real nodes, zero included, is now always reflected in the thin figure next to it. Fixes Graphify-Labs#3548. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017qfdzgbA5KedGEjD1AayNh
Three existing tests pinned the old, undercounting behavior directly, including one whose own docstring asserted the exact shape this fix corrects. Updates all three to the now correct figures and adds a dedicated test asserting the two invariants the issue itself suggested, shown equals what actually renders and shown plus thin equals the total, at both thresholds already exercised in this file. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017qfdzgbA5KedGEjD1AayNh
There was a problem hiding this comment.
Graphify reviewed this change.
Worth a look — the grounded gate found no coupling regressions or blocking issues, but 1 advisory finding(s) below merit a look before merge.
Formal verification. No changes could be formally verified in this run.
Graphify review — findings
Counts a zero-real-node (all-file) community as "thin" in generate, dropping the earlier 0 < guard from both thin_count_summary and thin_communities so a community the render loop skips is no longer omitted from every tally. This restores the shown + thin == len(communities) invariant, at the cost that any all-file community now shows as thin at every positive min_community_size. Tests assert the invariant and matching render count at thresholds 3 and 5.
Worth a look
- Thin/shown counts use a different file-node predicate than the render filter —
graphify/report.py:175· Escalate · medium- agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 353 functions depend on the 21 functions this change touches.
Health — this change adds coupling hotspots:
- new:
_rebuild_code()— 116 callers, 51 callees - new:
dispatch_command()— 2 callers, 124 callees - new:
generate()— 34 callers, 7 callees - new:
run_pipeline()— 8 callers, 13 callees - new:
watch()— 5 callers, 7 callees - new:
load_learning_for_report()— 4 callers, 3 callees - new:
test_report_shows_avg_confidence_for_inferred()— 0 callers, 7 callees - new:
test_poisoned_manifest_is_healed()— 0 callers, 6 callees - …and 1 more — each is listed as a finding
Verification — 353 functions in the blast radius were not formally verified this run (proofs are advisory here).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 178 function(s) in the blast radius were not formally verified this run
Test selection
Test selection
6 of 275 test file(s) selected (2%) via static blast radius.
tests/test_confidence.py— impacttests/test_hypergraph.py— impacttests/test_pipeline.py— impacttests/test_report.py— impacttests/test_report_gap_thresholds.py— impact, changed-testtests/test_semantic_similarity.py— impact
Selection is safe under the controlled-regression assumption; always-run tests + a periodic full run are the backstops. Advisory — it never changes the check verdict.
Formal verification
Could not verify: Could not verify generate.
The verifier did not have enough to check generate, so it is saying so rather than guessing. No false assurance is the whole point.
Guarantee: No guarantee either way, this is an honest abstention, not a pass.
Note: Reason: not verifiable: all 200 sampled inputs raised on both versions — the function never executed, so 'no divergence' would be vacuous (mostly ValueError — names the real obstacle, not a sampling gap)
· 9 more finding(s) on lines outside this diff (see the check run).
Summary
Fixes #3548. The issue's own reported repro (
shown_countoverstating the number of rendered### Communitysections by counting all-file-node communities as shown) turned out to already be fixed on currentv8by #3148/#2129 —shown_countis now computed directly from the render condition rather thantotal - thin. But that earlier fix left a residual gap this issue's own invariant check still catches: thethincount kept a0 <guard excluding all-file-node (zero-real-node) communities, so those communities — which the render loop skips for exactly the same reason as a genuinely thin one — went uncounted anywhere in the report.shown + thinno longer summed to the total community count, and the "N thin communities omitted" figure undercounted what was actually omitted.Reproduced directly: a 3-community graph (one large, one genuinely thin, one all-file-node) reported
"(1 shown, 1 thin omitted)"for 3 total communities —1 + 1 = 2 ≠ 3. Both counting sites (thin_count_summaryin the Summary section,thin_communitiesin the Knowledge Gaps section) drop the0 <guard, exactly matching the issue's own suggested patch, applied against the current (already-partially-fixed) code shape rather than the olderlen(communities) - thin_count_summaryform the issue was written against.Test plan
tests/test_report_gap_thresholds.pypinned the old, undercounting figures — one explicitly, in its own docstring, asserting the exact shape this PR corrects. Updated all three to the now-correct counts, verified by hand against a directgenerate()call before updating the assertions.shown == rendered,shown + thin == total) at both thresholds already exercised in this file.python3 -m pytest -q— 5487 passed, only the pre-existing unrelated failures (test_ollama_retry_cap.pymissingopenaiin this env, one flaky timing assertion intest_ts_import_type_arguments.py).python3 -m tools.skillgen --check— OK.Note: the issue's separate "second, smaller issue" (the Knowledge Gaps section's hardcoded
< 3threshold disagreeing withmin_community_size) was also already fixed on currentv8by #3148 — confirmed the code already readsmin_community_sizethere, not a hardcoded3.🤖 Generated with Claude Code
https://claude.ai/code/session_017qfdzgbA5KedGEjD1AayNh