v0.3.0
V2b slice 2: tools that change agent behavior per-task instead of just informing it.
Added
assess_risk_diff(project, file_paths[])MCP tool andcodesage risk-diffCLI command. Aggregate risk for a set of files (the file list of a patch). Returns per-file decomposition plus rollups:max_score,mean_score,max_risk_file, and lists of files in each risk category (hotspot, fix-heavy, test-gap, wide blast radius). Output includes paste-readysummary_notesfor PR descriptions. Use BEFORE submitting a patch to decide whether to add tests, split the change, or flag concerns.recommend_tests(project, file_paths[])MCP tool andcodesage tests-forCLI command. Returns the tests an agent should run after editing a set of files. Two layers:primary(sibling tests resolved by language convention —FooTest.php,foo.test.ts,test_foo.py,foo_test.go, plus Rust integration tests undercrates/<name>/tests/*.rs) andcoupled(tests that historically change with the input files via git co-change history). Coupled entries are deduped against primary so each test appears once. Empty result means no test files in the index for these paths.- Both new CLI commands accept positional file args or read newline-separated paths from stdin, so they compose with
git diff --name-only | codesage risk-diffand similar pipelines. discover::TEST_LIKE_EXCLUDE_PATTERNS: subset of the default exclude list covering test and bench files. Exposed sogit_historycan split test files from hard-excluded files.
Changed
codesage git-indexnow keeps test and bench files ingit_filessorecommend_testsandassess_risktest-gap detection can find them. Test files remain dropped from co-change pair generation, so coupling rankings stay focused on production code. Re-runcodesage git-index --fullafter upgrading to populate test files.