You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exclude test files from risk_map to fix coverage_gap noise
Test files always score coverage_gap=1.0 because edges go FROM test
units, never TO test-file code units. Including them masks real coverage
differences between source files. Default exclude_tests=True aligns
risk_map with test_gaps behavior. Pass --no-exclude-tests to include.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CLAUDE.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,6 +56,7 @@ chisel/
56
56
-**Inline coupling partners**: `risk_map` includes `"coupling_partners"` (top 3 by co-commit count) in each file entry alongside the breakdown. Data is already fetched in the batch query — no extra DB calls.
57
57
-**Triage tool**: Composite `triage` runs `risk_map` (top-N) + `test_gaps` (filtered to top-N files) + `stale_tests` in a single read lock. Returns a dict, not a list, so `limit` is not injected. Summary includes `test_edge_count`, `test_result_count`, and `coupling_threshold` for data quality visibility.
58
58
-**Risk-map `_meta` envelope**: `tool_risk_map()` returns `{"files": [...], "_meta": {...}}` instead of a bare list. `_meta` contains: `total_files`, `coupling_threshold`, `total_test_edges`, `total_test_results`, `effective_components` (list of components that vary across files), `uniform_components` (dict of components with identical values + diagnostic reason). This tells LLM agents which risk components are providing real signal vs noise. `_build_risk_meta()` and `_diagnose_uniform()` in `engine.py`. `dispatch_tool()` in `mcp_server.py` applies `limit` to `result["files"]` for dict-wrapped responses. CLI `_limit()` handles both formats.
59
+
-**Risk-map test-file exclusion**: `risk_map` and `triage` exclude test files by default (`exclude_tests=True`). Test files always score `coverage_gap=1.0` because edges go FROM test units, never TO test-file code units — including them adds noise and masks real coverage differences between source files. `storage.get_test_file_paths()` fetches distinct test file paths from `test_units`. CLI flag: `--no-exclude-tests`. Aligns with `test_gaps` which already excludes test files by default.
0 commit comments