Key the RuboCop cache on the CRC ledger that the layer cops read #1173
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#1173
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
The ledger-reading cops (
Sdlc/Structural/UnlayeredConstant,Sdlc/Structural/InwardDependency) readdocs/crc/os-sdlc/ledger.tsvthrough theLedgerPathsetting. The RuboCop result cache keys on the inspected file and the config, not on the ledger file. After a ledger edit,lint-sweepreplays a cached offense that the new ledger no longer supports. The inward delta then reports a false new offense, and a gate can fail on stale data.Observed
Run 3 of the os-sdlc CRC pass, ticket #1169, created
plugins/os-sdlc/lib/os_sdlc/fact_names.rb. The first lint-sweep reportedUnlayeredConstantforOsSdlc::FactNames. I appended the FactNames row to the ledger. The next lint-sweep reported the same offense. With a fresh cache directory, the offense went away:Reproduce
plugins/os-sdlc/lib/os_sdlc/with no ledger row, and runplugins/os-sdlc/bin/lint-sweep. It reportsUnlayeredConstant.plugins/os-sdlc/bin/lint-sweepagain. It still reports the offense.RUBOCOP_CACHE_ROOTset to an empty directory. The offense is gone.Origin
RUBOCOP_CACHE_ROOTset to a fresh scratch directoryUnlayeredConstantoffense ← RuboCop result cache replays the earlier result ← the cache key does not include the ledger file that the cop reads (UPSTREAM-TOOL: RuboCop caches by file content and config; the cop reads an outside file inplugins/os-sdlc/lib/os_sdlc/cops/layer_ledger/ledger.rb)VERDICT: CREATE
Occurrence: Sdlc cops that read other files give stale results from the RuboCop cache
Seen: plugins/os-sdlc/lib/os_sdlc/cops/structural/adapter_built_outside_entry.rb (also Sdlc/Structural/OwnEntryPointSpawnedInTest)
Run: bc5ad309-36b7-4fe5-a67f-1d90187242eb
Adds: On 2026-11-09 in worktree ticket-1647-adapters, rubocop --only Sdlc/Structural/AdapterBuiltOutsideEntry lib/os_sdlc/evidence/resolution.rb reported a stale offense at line 28; with --cache false the file had none. Two more cops read other files. Fix: external_dependency_checksum (RuboCop 1.90.0). Acceptance: a cached clean result turns to an offense when the referenced constant file changes, and the reverse clears it. No --cache false in the gate.
Occurrence: four Sdlc/Structural/DomainEffectInEdge offenses in plugins/os-sdlc/test/system_model_catalog_test.rb (lines 33, 45, 49, 61) show only with the cache off
Seen: bundle exec rubocop --cache false test/system_model_catalog_test.rb, from plugins/os-sdlc, on main
e16fd58bdand on380176169(same 4 offenses at both)Run: Session 720a7477-bb8e-4373-8d74-6bbdb56f0200 (#1665 close-out)
Adds: the file last changed in the tests/ to test/ rename (
4ff1a393d), so the offenses are older than today's work, and the cached gate did not report them. Each flagged line is assert_empty or assert_equal on patterns.select { ... } in a test method. Not fixed here: the fix is either a query on the catalog object or a cop change, and a cop change would alter files under mutation work.