Repository navigation
feat(cli): add Git churn, change coupling, and CODEOWNERS attribution - #202
Merged
Merged
Conversation
Extend crates/git with native gix first-parent tree-diff churn analysis over configurable --since (days or UTC date) and --commits windows, with clean shallow-clone and non-Git diagnostics. Surface churn-prioritized Erosion and Duplication Findings independently per Metric (preserving ADR 0003 with no blended score) via codeint churn (text, TOON, JSON, Markdown) and the read-only churn tool in codeint mcp. Closes #182
…filtering Parse standard CODEOWNERS files (.github/CODEOWNERS, CODEOWNERS, docs/CODEOWNERS) with last-match-wins semantics, attach matched owners to report Findings when present while remaining silent when absent, and support --owner filtering in codeint check and codeint diff. Closes #184
# Conflicts: # crates/cli/src/check.rs # crates/report/src/lib.rs
Extend crates/git with native gix co-change pair accumulation over the same history window as churn, excluding bulk commits above --max-commit-files (default 50) and filtering to measured Source-set paths before forming pairs. Annotate each coupled pair with co_change_count, coupling_ratio, and has_direct_import against resolved runtime imports, defaulting to Production with --include-tests and preserving ADR 0003 with no blended score. Expose co-change coupling via codeint coupling (text, TOON, JSON, Markdown) and the read-only coupling tool in codeint mcp. Closes #183
…upling # Conflicts: # crates/report/src/lib.rs
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.
Summary
Adds native
gixfile commit churn (codeint churn), co-change coupling with bulk-commit noise filtering (codeint coupling), matching read-onlychurnandcouplingMCP tools, and standardCODEOWNERSowner attribution plus--ownerfiltering acrosscodeint checkandcodeint diff—strictly preserving ADR 0003 with no blended score.Closes #171
Closes #182
Closes #183
Closes #184
Tier
Tier 3 from the tier check:
crates/cli/tests/mcp.rsupdates thetools/listassertion from 6 tools to 8 tools to include the two newchurnandcouplingMCP tools.Task
Spec #171 and sub-issues #182, #183, #184:
gixfile commit churn (--since/--commits), churn-prioritized Erosion and Duplication Findings with no blended score, shallow/non-Git handling, CLI and MCP (Nativegixfile commit churn and churn-prioritized Findings (CLI & MCP) #182)--max-commit-files), Production default / Test opt-in,has_direct_importflag, CLI and MCP (Co-change coupling analysis with bulk-commit filtering (CLI & MCP) #183)CODEOWNERSparsing (.github/CODEOWNERS,CODEOWNERS,docs/CODEOWNERS, last-match-wins), owner attribution in reports,--ownerfiltering, silent when absent (CODEOWNERSparsing, owner attribution in reports, and--ownerfiltering #184)Fail-first test
crates/cli/tests/churn.rs(churn_ranks_eroded_and_duplicated_files_independently_by_commit_count_with_no_score),crates/cli/tests/coupling.rs(coupling_detects_co_changed_pairs_flags_direct_imports_and_omits_blended_scores), andcrates/cli/tests/codeowners.rs(check_owner_flag_filters_findings)error: unrecognized subcommand 'churn',error: unrecognized subcommand 'coupling',error: unexpected argument '--owner' found)Checks
cargo test --workspace --lockedcargo clippy --workspace --all-targets -- -D warningscargo fmt --checkcodeint diff fce5585lefthookpre-commit and commit-msgcargo run --package xtask -- merged-result)Safety proof
CODEOWNERSfile experience zero behavior or output change incheckanddiff, shallow clones never fabricate file touches at the shallow boundary, and all Git history reads run natively viagixunder#![forbid(unsafe_code)]with zero externalgitsubprocess calls.crates/cli/tests/codeowners.rs(check_is_silent_when_no_codeowners_file_exists), shallow-clone--depth 1/--depth 2regression tests incrates/cli/tests/churn.rsandcrates/cli/tests/coupling.rs, andCodeowners::loadreturningOk(None)with#[serde(default, skip_serializing_if = "Vec::is_empty")]on finding owners.interrogate: Round 1 found 7 verified edge cases (shallow-clone boundary tree diffing,CODEOWNERSescaped glob metacharacters, leading UTF-8 BOM, strict MCP arg type validation, unborn-repo remedy wording, Markdown truncation notice, exact unrounded--min-ratiocomparison). All 7 were fixed with regression tests in3a7d069; clean rerun in progress on3a7d069.Runtime evidence
End-to-end CLI and MCP integration tests executed the compiled
codeintbinary on revision3a7d069against synthetic multi-commit temporary Git repositories,--depth 1and--depth 2shallow clones, unborn/non-Git directories, andCODEOWNERSfixtures (churn,coupling,codeowners,mcp,referencetest suites all passed, andcodeint diff fce5585exited 0 with zero regressions).Gaps