Repository navigation
Add a raw co-change count and label the decayed score - #60
Merged
Merged
Conversation
A7: cochange_counts walks the same in-process history window and, for the asked path, counts the kept non-merge commits every other tracked path shares, with no decay and no lift floor. Bulk commits stay skipped and reported, rows sort by count then path, and the read writes nothing. The rename walk is shared with the decayed scan through one helper, so both modes agree on current paths. Schema, stored data and the extractor version are unchanged.
cochange FILE --count, and MCP mode count, list every tracked file with the kept commits it shared with FILE: no decay, no lift floor, merges left out, bulk commits skipped and counted, over the stored scan's window, computed at query time and never stored. FILE may be any tracked file. The decayed reply gains scope (indexed .rs, decay 90d, 3 commits, bulk 30) after its old keys, and each partner gains together_decayed, with together kept as its alias; under a budget both go first. show keeps the old partner shape. A file that is not indexed is not_found with a message that says so and points to --count and git log. The README examples are pinned by a test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The decayed op hands its argument checks and its partner listing to two named helpers. A unit test pins the limit range, which the command line and MCP refuse before the op is reached, and the count test pins that a limit equal to the partner count lists them all untruncated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feat/w14-skill took one test-only commit after this branch began: the whole-reply budget test asks four budgets instead of 361. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The command line and MCP refuse a bad limit, min_lift or max_tokens before the op is reached, so only a unit test can see the op's own check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feat/w14-skill took one more test-only commit: a fixed sample of every 25th budget, judged on the printed line alone, and a monotone verdict. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
phantom.nu cochange now runs cochange --count by default (or with --count), and reshapes each partner to its path and its count of shared non-merge commits, with no decay and no lift floor. --rust runs the decayed, lift-filtered mode over indexed Rust files and labels its weight as a weight, not a count. Both modes copy the CLI scope and scan through with a note that says which one answered. Giving both modes, or --min-lift without --rust, is a usage error. SKILL.md says when to use each. skill_nu covers both modes on a git history, with the no-write snapshot of the tree and the index. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A8: cochange_counts reads the HEAD tree and, when the asked path is an entry of no tree there, answers GitError::NotTracked with the path and HEAD instead of an empty partner list. The count op maps that to not_found so the reply says the file is not tracked at HEAD and points at git log. Tracked files count exactly as before. Tests cover a file deleted at HEAD and a path that never existed.
…git log cochange --count, and MCP mode count, now answer not_found, exit 3, for a file no tree at HEAD holds, deleted or never added, never an empty list. The message says the file is not tracked at HEAD and points to git log -- FILE, naming FILE as given when it is a relative path and as FILE when it is absolute. The git crate's signal is mapped in its own function, so the count reader keeps its branches. Tests cover a deleted file and never-tracked paths over the command line and MCP, through a new delete in the test history script. Every tracked reply is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The count walk no longer drops older commits that touch a path added again on another branch: an Add or a Delete leaves the name counting as itself, while renames still carry forward. The decayed scan keeps its own walk untouched, so its output and every W13 figure stay byte-identical. Tests pin a side branch hidden by history simplification and a path added twice across a merge.
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.
Adds a raw co-change count beside the existing decayed score, and labels each one honestly.
What changes
The count. In the git crate,
cochange_countscounts, for one file, the kept non-merge commits it shares with every other tracked file. The count:The rename walk is now shared with the decayed score, so the two modes agree on current paths. The score's behaviour is unchanged.
The surfaces. The CLI adds
cochange --count, and MCP addsmode: "count". The decayed reply addsscope(files,weighting,min_commits,bulk_skip) and a per-partnertogether_decayed, keepingtogetheras an alias; under a budget, both are dropped first. A file that is not indexed now gets anot_foundthat says so and points to--countandgit log.The skill.
cochange --countand--rust.SKILL.mdsays when to use each mode, in the same words as the new scope labels.Checks
fmt, clippy (
-D warnings),cargo deny checkand nextest all pass. Store schema 3 and extractor version 12 are unchanged, there is no stored-data change, no new package or crate, and no.githubchange.🤖 Generated with Claude Code