crc-records reads an applied split row as stale when a part keeps the old last constant segment #1072
Labels
No labels
P0
P1
P2
P3
bug
category/code-change
category/cross-repo
category/eval-run
category/investigation
category/no-test-target
category/owner-ruling
category/prose-artifact
category/recurring-chore
category/structure
category/umbrella
crc-refactor
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
rule-proposal
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#1072
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
PathLookup#defined_in(plugins/os-sdlc/lib/os_sdlc/crc_records/path_lookup.rb) falls back to the last constant segment. In the os-sdlc run, the applied split rowcommand/residual_dispatch_report.rb(OsSdlc::ResidualDispatchReport, split in #1064,720f911c) reads as stale. The newlint/residual_dispatch_report.rbdefinesOsSdlc::Lint::ResidualDispatchReport, so the fallback matches it. No ledger cell shape clears the row without recording the split as a deletion. A false stale row in the records step teaches the run to ignore stale rows.Second symptom (CRC run 2 close-out, 2026-10-18): the same fallback makes
crc-recordsexit 1 on 10 falseambiguousentries. Each is an unchangedkeeprow undercops/(for examplecops/inward_dependency/ledger.rb, constantRuboCop::Cop::Sdlc::Structural::InwardDependency::Ledger). The Zeitwerk path for aRuboCop::constant does not exist, sodefined_inglobs for the last segment and finds two or more files.RowCheck#resolve(lib/os_sdlc/crc/records/row_check.rb:60-63) uses the recorded path only when the lookup is:missing. The close-out rule "crc-records exits 0" cannot be met. The 10 rows are listed in docs/crc/os-sdlc/records-report.json.Reproduce
The output lists the command/residual_dispatch_report.rb row as stale.
Approach
Scope of this pass: the second symptom only. An unchanged keep row (verdict
keep, emptynew_path) whose recorded path exists is current;RowCheckresolves it at the recorded path before any constant lookup, so it is neverambiguous.Part 1 shipped in implementation 76 (
RowCheck#unchanged_keep_in_place?, AC 1-3 below, green). Part 2: the same last-segment fallback makes an applied move row undercops/ambiguous.cops/constants (RuboCop::Cop::Sdlc::...) have no Zeitwerk path, soPathLookup#resolve_exactalways misses them. After #1153 the ledger rowcops/inward_dependency/ledger.rbrecords the applied move tocops/layer_ledger/ledger.rb(RuboCop::Cop::Sdlc::Structural::LayerLedger::Ledger, commit260d07de); that file exists and definesLedger, yet the row reads ambiguous between it,crc/ledger.rbandlint/gated_run/ledger.rb.Required work:
RowCheck#resolve, resolve an unchanged keep row whose recorded path exists at that path, before the constant lookup — check: presentkeepinplugins/os-sdlc/lib/os_sdlc/crc/records/row_check.rbAcceptance criteria
cops/keep row is reported ambiguous.new_pathexists and defines the last segment ofnew_constant, and that last segment is defined in two other files, when crc-records runs, then the row is current, not ambiguous.Owner sketch
Non-goals
The stale applied split row (first symptom) and the last-segment fallback in
PathLookup#defined_instay open on this ticket.Origin
720f911c)VERDICT: CREATE — real defect in crc-records seen in the Phase 7 run; no existing mechanism covers it; parent #835 is user-filed.
Occurrence: crc-records reports unchanged cops/ keep rows as ambiguous
Seen: plugins/os-sdlc/lib/os_sdlc/crc/records/path_lookup.rb (last-segment fallback); 10 keep rows under lib/os_sdlc/cops/ (feature_envy/site.rb, instance_variable_assumption/class_site.rb, inward_dependency/ledger.rb, lifecycle_ivar_behind_attr_reader/body_statements.rb, mutable_collection_leak_via_attr_reader/body_statements.rb, primitive_obsessed_ivar/class_site.rb, require_in_method/call.rb, unreachable_branch_after_guard/{branch,statements}.rb, unused_private_method/visibility_call.rb) listed under ambiguous with a target in another concept
Run: CRC refactor run 2, docs/crc/os-sdlc, session ca7a7686-22a8-4463-86d5-c542e7d9f215; records-report.json committed in the run dir
Adds: the cops/ case (RuboCop::Cop::Sdlc constants outside OsSdlc, file at the row path exists unchanged) makes crc-records exit 1 at close-out; a row whose path exists needs no lookup, and a cops constant maps to cops//.rb by path
Work started on branch ticket-1072 through /os-sdlc:implement, scoped to the ambiguous unchanged keep rows (see body Approach and Non-goals).
Occurrence (2026-10-19, ambiguous keep rows), not a close.
Done: an unchanged keep row whose recorded path exists is current, never ambiguous (implementation 76); any non-pending row resolves at its recorded path when that file exists and defines the constant's last segment (implementation 77). The ledger records the #1153 moves of InwardDependency::Ledger and ::LayerMap (
e723d1b0).Evidence: merged to main
6fe46aae.crc-records --target os-sdlc docs/crc/os-sdlcexits 0: 756 current, 0 stale, 0 ambiguous (was exit 1 with 9 ambiguous and 1 stale). Suite 2201 runs, 0 failures. The close-out exit 0 rule can now be met.Follow-ups: the first symptom (stale applied split row through the last-segment fallback in PathLookup#defined_in) stays open on this ticket, per Non-goals.