Repository navigation
fix(affected): unify affected-tests and dead-code queries between CLI and MCP - #575
Merged
Merged
Conversation
… and MCP Add src/index/queries.rs as the single implementation. Fixes the CLI stem bug (extension used as stem), adds LIKE ESCAPE, batches queries, and makes MCP dead-code honor analysis.entry_point_patterns from project config. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: ajianaz <ajianaz@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
New
src/index/queries.rsis the single implementation of "affected tests for changed files" and "dead code with config-derived options". CLI (cora affected,cora dead-code) and MCP (cora.find_affected_tests,cora.dead_code) now only parse input and format output.Why
Closes #568. The CLI derived the stem via
rsplit('.')(returns the extension), so naming-convention matching never worked; it also lacked LIKE escaping, ran N queries, and used a different pattern list than MCP. MCP dead-code ignoredentry_point_patterns.How
file_stemviaPath::file_stem,escape_like+ESCAPE '\', batched/chunked queries (500 binds), deduplicated sorted union.{stem}_test,test_{stem},{stem}.test,{stem}.spec,tests/{stem},__tests__/{stem}overrs go py ts tsx js jsx.call_graphquery (no per-symbol 100-row cap).MAX_AFFECTED_FILES(200) enforced viavalidate_changed_filesat the MCP boundary only; the CLI (git diff input) is chunked instead.entry_point_patternsfrom project.cora.yamlonly (existingload_project_config: no env/global/keys).Testing
cargo test --features tree-sitterpassescargo fmt --all -- --checkpassescargo clippy --all-targets --features tree-sitter -- -D warningspassescargo build --release --features tree-sitterpassesNew in-memory SQLite tests: stem extraction,
_/%literal matching, cap, both strategies,--filtermarkers, project scoping, chunking (1200 files), entry_point_patterns honored.Related Issues
Closes #568
Checklist
develop🤖 Generated with Claude Code