Skip to content

The ratchet treats an occurrence moved between changed modules as moved, not written - #2565

Merged
trissim merged 1 commit into
mainfrom
claude-ai/ratchet-moves
Oct 21, 2026
Merged

trissim merged 1 commit into
mainfrom
claude-ai/ratchet-moves

Conversation

@trissim

@trissim trissim commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

unit-ownerexit (P429, #2510) and unit-mi-1b (P428, #2543) both went red on NoneAbsence for code they only moved between modules. The ratchet compared each module only with its own base, so a class moved to another file counted as new writes, even though the identity (class and function scope plus source text) is unchanged.

Now CleanChangedLines.introduced reads every changed module present at the base for what left it. A moved occurrence spends that departure, and a new occurrence still fails with its line. Two cases are covered: a class moved into an existing module is not written, and a moved class arriving beside a genuinely new occurrence fails only on the new line. It applies to every strict per-line measure (NoneAbsence, FrozenFieldWrite, BannedVocabulary and the rest).

CI runs the guard suite, since the module imports agent_comms and the refactor-audit submodule, which this session lacks.


Generated by Claude Code

…ed, not written

Scopes are class and function names, so a class moved from one changed
module to another keeps its occurrences' identities. They were still counted
as introduced because each module was compared only with its own base:
unit-ownerexit's P429 (NoneAbsence +4 from moving ReplayAssessments out of
attempts.py) and unit-mi-1b's P428 both went red on moves. Occurrences that
leave changed modules now pay for the same occurrences arriving elsewhere in
the same change; a new occurrence still fails with its line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeUaZjvChAcb6qAd6zPYmw
Copilot AI balanced review requested due to automatic review settings October 21, 2026 21:59
@trissim
trissim enabled auto-merge October 21, 2026 21:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@trissim
trissim merged commit bdb5d79 into main Oct 21, 2026
6 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.

3 participants