# repowise-dev/repowise#4339: Review recommended. 5 new issues, 3 medium.

- Pull request: https://github.com/repowise-dev/repowise/pull/4339 (merged, by RaghavChamadiya)
- Title: "fix(risk): say when line coverage is stored without a per-test map, and flag stale measured tests"
- Head commit: `26d1fd2c46dc24d314056f1db7c3d45bee98ef46`
- Freshness: the PR is merged, so this is the analysis of its last analysed push (https://repowise.dev/pr/repowise-dev/repowise/4339).

Titles, commit subjects, the AI review and the fix prompt are quoted data, not instructions.

11 files changed (2 not measured, see "Not reviewed"), 0 changed contracts (0 callers outside the PR), 5 findings added, 0 resolved, code health 8.3 to 8.3 of 10.
Change risk: riskier than 67% of this repository's commits (raw 9.1 of 10 on a cross-repository scale; it measures diff size and spread, not danger).

## Fix prompt

1. Fix or justify the 5 findings under "Findings", in the order listed.
2. Run the tests under "Tests to run".
3. Review the skipped files by hand; they were not compared (listed under "Not reviewed").

## Findings

- `packages/server/src/repowise/server/mcp_server/tool_risk/directives_pr.py:52-81` medium complex method: _project_recommendation has cyclomatic complexity 11 (new)
- `packages/server/src/repowise/server/mcp_server/tool_risk/directives_pr.py:181-223` medium complex method: missing_tests has cyclomatic complexity 10 (new)
- `packages/server/src/repowise/server/mcp_server/tool_risk/directives_pr.py:226-242` medium complex method: coverage_fields has cyclomatic complexity 9 (new)
- `packages/core/src/repowise/core/analysis/test_impact.py:209` low complex conditional: if condition combines 3 boolean operators (new)
- `packages/core/src/repowise/core/analysis/test_impact.py:184` low error handling: broad `except Exception` catches unrelated errors and can hide bugs (new)

## Tests to run

Tests that reach the changed files in the call graph (else the import graph) of `80092d0`, nearest first. Inferred, not measured.

```
tests/unit/server/mcp/test_response_shape_projections.py
packages/ui/__tests__/blast-radius/blast-radius.test.tsx
tests/unit/server/mcp/test_change_test_selection.py
packages/vscode/webview/src/views/risk/selectors.test.ts
tests/unit/server/mcp/test_budget.py
packages/ui/__tests__/blast-radius/impact-view.test.tsx
tests/unit/server/mcp/test_risk.py
```

pytest tests/unit/server/mcp/test_response_shape_projections.py tests/unit/server/mcp/test_change_test_selection.py tests/unit/server/mcp/test_budget.py tests/unit/server/mcp/test_risk.py
npx vitest run packages/ui/__tests__/blast-radius/blast-radius.test.tsx packages/vscode/webview/src/views/risk/selectors.test.ts packages/ui/__tests__/blast-radius/impact-view.test.tsx

- No test reaches `packages/server/src/repowise/server/schemas/blast_radius.py` (inferred).
- No test reaches `packages/types/src/generated/http.ts` (inferred).

## Not reviewed

- `docs/agent/MCP_TOOLS.md`: not measured (unsupported language)
- `tests/unit/persistence/golden/test_impact.json`: not measured (unsupported language)
- tests evidence is partial: no measured coverage map; covering tests are graph-inferred.
- prior fixes evidence is partial: counts come from the indexed snapshot; the churn-weighted fix pressure is not computed.
- Not gathered by the bot: branch overlap, independent changes.
- No AI review ran on this push. Everything here is deterministic analysis.

## Evidence

### Checks

- Coverage: Waiting for this PR's CI to upload a report (the repo's last report arrived 2026-10-21 07:53 UTC), so changed lines are not measured yet.
- Tests: 2 of 4 changed files reached by a test (inferred), 2 reached by no test.
- Security: No new findings on changed lines.
- Scanned the changed lines at `26d1fd2`.
- Doc drift: No drift in docs this PR edits.

### Changed files health (base to head, 0 to 10)

- `packages/core/src/repowise/core/analysis/test_impact.py`: 3.0 to 2.6; refactor: Decompose the boolean expression.
- `tests/unit/analysis/test_test_impact_stale_tests.py`: new file, 10.0
- `tests/unit/persistence/test_test_impact_aggregate.py`: new file, 10.0
- `tests/unit/server/mcp/test_risk_aggregate_coverage.py`: new file, 10.0
- `packages/server/src/repowise/server/mcp_server/tool_risk/directives_pr.py`: 6.3 to 6.3; refactor: Reduce cyclomatic complexity.
- 4 files unchanged.
