Skip to content

fix(cli): filter test callers in impact command#4

Merged
sdsrss merged 1 commit intomainfrom
fix/cli-impact-test-filtering
Mar 17, 2026
Merged

fix(cli): filter test callers in impact command#4
sdsrss merged 1 commit intomainfrom
fix/cli-impact-test-filtering

Conversation

@sdsrss
Copy link
Owner

@sdsrss sdsrss commented Mar 17, 2026

Summary

  • CLI cmd_impact was counting test functions as production callers, inflating risk levels (e.g. handle_message showed Risk: HIGH with 33 callers when all were tests, now correctly shows Risk: LOW with 0 prod callers)
  • Moved is_test_symbol from server.rs to domain.rs as a shared utility so both MCP and CLI use the same test-filtering logic
  • CLI impact output now shows (N tests affected) separately, matching MCP tool_impact_analysis behavior

Test plan

  • cargo test --release — all tests pass
  • cargo test --no-default-features — all tests pass
  • Verified cargo run --release -- impact handle_message shows Risk: LOW, 0 prod callers, 33 tests affected
  • Verified cargo run --release -- impact ensure_indexed shows Risk: MEDIUM, 9 direct callers, 9 tests affected
  • Verified JSON output (--json) includes tests_affected field

🤖 Generated with Claude Code

CLI `cmd_impact` was counting test functions as production callers,
inflating risk levels (e.g. `handle_message` showed HIGH with 33 callers
when all were tests). Move `is_test_symbol` to `domain.rs` as shared
utility and apply the same test/production separation logic used by the
MCP `tool_impact_analysis`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sdsrss sdsrss merged commit 7392504 into main Mar 17, 2026
1 check passed
@sdsrss sdsrss deleted the fix/cli-impact-test-filtering branch March 17, 2026 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant