Map renamed constants in crc-inward-delta offense subjects #1174

Open
opened 2026-10-19 21:12:13 +00:00 by jared · 0 comments
Owner

Problem

crc-inward-delta maps an offense of a moved file to the file's new path. It does not map the constant name in the offense subject. When a move renames a constant, an InwardDependency offense in an unmoved caller file keeps its path but changes its subject. The delta then reports the same offense once as new and once as gone, and exits 1. The gate fails although the move added no offense.

Observed

Run 3 of the os-sdlc CRC pass, ticket #1172, moved OsSdlc::Handoff::Content to OsSdlc::HandoffContent (commit f5fcc5d1). The ledger rows carry new_path, new_constant, and commit. The delta reported:

"before": 242, "after": 242,
"new":  [... "plugins/os-sdlc/lib/os_sdlc/handoff.rb Sdlc/Structural/InwardDependency HandoffContent (layer parser) is referenced from layer model" x3, ".../implementation/mutation_check.rb ... HandoffContent ..." x1],
"gone": [... "plugins/os-sdlc/lib/os_sdlc/handoff.rb Sdlc/Structural/InwardDependency Handoff::Content (layer parser) is referenced from layer model" x3, ".../implementation/mutation_check.rb ... Handoff::Content ..." x1]

plugins/os-sdlc/lib/os_sdlc/crc/inward_delta/moves.rb builds its map from path to new_path only. Offense#moved_to replaces only the path.

Reproduce

  1. Apply a ledger move row that changes the constant (constant differs from new_constant) where an unmoved file in another layer references the constant.
  2. Save the inward lint output before and after the move.
  3. Run plugins/os-sdlc/bin/crc-inward-delta --target os-sdlc docs/crc/os-sdlc <before> <after>. It exits 1 and lists the renamed subject under new and the old subject under gone.

Origin

  • Trigger: inward delta during the #1172 gate, os-sdlc CRC run 3
  • Improvised this session: compared the new and gone lists by hand and confirmed that they differ only in the constant name
  • Chain: false new offenses ← Offense#moved_to rewrites only the path ← Moves maps path to new_path and ignores constant to new_constant
  • Root candidate: none found; searched inward-delta, inward_delta, moved_to, new_constant, renamed, rename, InwardDependency
  • Where: plugins/os-sdlc/lib/os_sdlc/crc/inward_delta/moves.rb, plugins/os-sdlc/lib/os_sdlc/crc/inward_delta/offense.rb
  • Session: 2e167079-f404-4139-9cfa-6c0c937ce9f0
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os--claude-worktrees-crc-os-sdlc-run-3/2e167079-f404-4139-9cfa-6c0c937ce9f0.jsonl

VERDICT: CREATE

## Problem `crc-inward-delta` maps an offense of a moved file to the file's new path. It does not map the constant name in the offense subject. When a move renames a constant, an `InwardDependency` offense in an unmoved caller file keeps its path but changes its subject. The delta then reports the same offense once as new and once as gone, and exits 1. The gate fails although the move added no offense. ## Observed Run 3 of the os-sdlc CRC pass, ticket #1172, moved `OsSdlc::Handoff::Content` to `OsSdlc::HandoffContent` (commit f5fcc5d1). The ledger rows carry `new_path`, `new_constant`, and `commit`. The delta reported: ``` "before": 242, "after": 242, "new": [... "plugins/os-sdlc/lib/os_sdlc/handoff.rb Sdlc/Structural/InwardDependency HandoffContent (layer parser) is referenced from layer model" x3, ".../implementation/mutation_check.rb ... HandoffContent ..." x1], "gone": [... "plugins/os-sdlc/lib/os_sdlc/handoff.rb Sdlc/Structural/InwardDependency Handoff::Content (layer parser) is referenced from layer model" x3, ".../implementation/mutation_check.rb ... Handoff::Content ..." x1] ``` `plugins/os-sdlc/lib/os_sdlc/crc/inward_delta/moves.rb` builds its map from `path` to `new_path` only. `Offense#moved_to` replaces only the path. ## Reproduce 1. Apply a ledger move row that changes the constant (`constant` differs from `new_constant`) where an unmoved file in another layer references the constant. 2. Save the inward lint output before and after the move. 3. Run `plugins/os-sdlc/bin/crc-inward-delta --target os-sdlc docs/crc/os-sdlc <before> <after>`. It exits 1 and lists the renamed subject under `new` and the old subject under `gone`. ## Origin - Trigger: inward delta during the #1172 gate, os-sdlc CRC run 3 - Improvised this session: compared the `new` and `gone` lists by hand and confirmed that they differ only in the constant name - Chain: false new offenses ← `Offense#moved_to` rewrites only the path ← `Moves` maps `path` to `new_path` and ignores `constant` to `new_constant` - Root candidate: none found; searched inward-delta, inward_delta, moved_to, new_constant, renamed, rename, InwardDependency - Where: plugins/os-sdlc/lib/os_sdlc/crc/inward_delta/moves.rb, plugins/os-sdlc/lib/os_sdlc/crc/inward_delta/offense.rb - Session: 2e167079-f404-4139-9cfa-6c0c937ce9f0 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os--claude-worktrees-crc-os-sdlc-run-3/2e167079-f404-4139-9cfa-6c0c937ce9f0.jsonl VERDICT: CREATE
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#1174
No description provided.