Skip to content

Add a raw co-change count and label the decayed score - #60

Merged
VirtualMachinist merged 10 commits into
mainfrom
feat/w14-cochange
Nov 15, 2026
Merged

VirtualMachinist merged 10 commits into
mainfrom
feat/w14-cochange

Conversation

@VirtualMachinist

Copy link
Copy Markdown
Member

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_counts counts, for one file, the kept non-merge commits it shares with every other tracked file. The count:

    • is computed at query time;
    • covers every tracked file, Rust or not;
    • has no decay and no lift floor;
    • keeps the bulk skip and reports it;
    • is sorted by count, then path;
    • writes nothing.

    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 adds mode: "count". The decayed reply adds scope (files, weighting, min_commits, bulk_skip) and a per-partner together_decayed, keeping together as an alias; under a budget, both are dropped first. A file that is not indexed now gets a not_found that says so and points to --count and git log.

  • The skill. cochange --count and --rust. SKILL.md says when to use each mode, in the same words as the new scope labels.

Checks

fmt, clippy (-D warnings), cargo deny check and 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 .github change.

🤖 Generated with Claude Code

VirtualMachinist and others added 10 commits November 15, 2026 00:36
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.
@VirtualMachinist
VirtualMachinist merged commit d951cef into main Nov 15, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant