Skip to content

feat(review): rank untested by risk + new_untested_hotspot rule#64

Merged
smochan merged 1 commit into
feat/lint-db-call-in-loopfrom
feat/rank-untested-hotspot
Jun 10, 2026
Merged

feat(review): rank untested by risk + new_untested_hotspot rule#64
smochan merged 1 commit into
feat/lint-db-call-in-loopfrom
feat/rank-untested-hotspot

Conversation

@smochan

@smochan smochan commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Summary

Stacked on #63. Gap-analysis Phase 2 (Capability C — risk-ranked coverage):

  • rank_untested(graph, *, blast_depth=3, top=None): joins untested × hotspot score (same formula as hotspots.py) × blast radius (skipped for zero-fan-in nodes, perf). UntestedNode gains hotspot_score / blast_radius_size / blast_files.
  • New review trigger new_untested_hotspot + DEFAULT_RULES entry (high, threshold 5): a newly-added FUNCTION/METHOD with ≥5 callers and no test-module caller now gates PRs.
  • codegraph query untested and MCP untested tool surface the ranking.
  • ⚠️ Behavior note: the new default rule can change review exit codes for existing users (CHANGELOG callout included at merge).

Implemented by a Sonnet subagent against a Fable-authored spec; rebased onto the lint stack, reviewed, and verified by the orchestrating session.

Test plan

  • 11 new tests (rank ordering, field population, top param, backward compat, rule fires/suppressed/threshold boundary)
  • Full suite 691 passed post-rebase; ruff + mypy --strict clean
  • Dogfood: codegraph query untested on self-graph shows risk-ranked output

🤖 Generated with Claude Code

- Add hotspot_score, blast_radius_size, blast_files fields to UntestedNode
- Add rank_untested() that enriches and sorts by (-hotspot_score, -blast_radius, file, line)
- Add new_untested_hotspot review rule: fires when an added function has >= threshold callers but no test-module caller
- Surface ranking in CLI (new hotspot/blast columns) and MCP tool (new JSON fields)
- Add test_rank_untested.py (7 tests) and test_review_rules_untested_hotspot.py (4 tests)
- Add python_hotspot_v1/v2/v2_tested fixtures for rule integration tests
@smochan smochan merged commit 0f805db into feat/lint-db-call-in-loop Jun 10, 2026
4 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant