Lens proposal: lift cross-concept nested cop helpers to top level under Cops::Sdlc::Structural #1523
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#1523
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
Three helper objects are nested inside one cop but have callers in other cop concepts. Lens A2 says an object with callers in more than one concept is a top-level object. The nesting hides the shared role, and each new cop that needs a helper reaches into another cop's namespace.
Structural::EdgeScopeandStructural::EffectReachalready show the correct top-level form.Observed
The A2 lens challenge on #1511 (run 221) returned "code defect found". The contract-auditor had marked the break JUSTIFIED because the ticket asked for reuse of nested helpers; the challenge found that the ticket named
SameFileDefsandEFFECT_CONSTANTSonly, neverCandidate, and that the other nested reuses are earlier A2 breaks, not a pattern to follow.Reproduce
n/a: structure finding, the suite is the proof
Approach
Structure-only moves under
RuboCop::Cop::Sdlc::Structural, one concept per commit, no behavior change, on the fast path.Required work:
QueryMethodReachesWrite::SameFileDefstostructural/same_file_defs.rband update its callers (QueryMethodReachesWrite, PrecedenceInEdge, DomainEffectInEdge::Facts). — check: presentclass SameFileDefsinplugins/os-sdlc/lib/os_sdlc/cops/structural/same_file_defs.rbEffectInModel::EffectCalltostructural/effect_call.rband update its callers (EffectInModel, EdgeScope, EffectReach::Walk). — check: presentclass EffectCallinplugins/os-sdlc/lib/os_sdlc/cops/structural/effect_call.rbPrecedenceInEdge::Candidate.unwrapand.slot_ofinto a top-level value (name to be ruled) and update the callers (PrecedenceInEdge Candidate, Presence, Guard; DomainEffectInEdge::Condition).Candidateitself stays nested. — check: absentPrecedenceInEdge::Candidateinplugins/os-sdlc/lib/os_sdlc/cops/structural/domain_effect_in_edge/**/*.rbOrchestrator work: rule the name of the unwrap value before item 3.
Acceptance criteria
cops/structural/, when it needsSameFileDefs,EffectCall, or the unwrap, then it references a top-levelStructural::constant, not another cop's nested constant.Owner sketch
Origin
/os-sdlc:implement 1511, run 221, contract-auditor LENS line on A2; challenged per references/lens-challenge-checklist.mdef991fc4)VERDICT: CREATE — the A2 challenge on #1511 found a real code defect; no open ticket covers lifting the nested Structural cop helpers.
Ruling (Jared, 2026-11-03): item 3 name is
Structural::Operand. Follow-up question under investigation before item 3: does DomainOperandInEdge (#1510) model the same operand concept, so that Operand should own more than unwrap/slot_of? Work starting on main via fast-batch.This is a design-only refactor with no observed failure, and its parent #1523 is itself an AI-created follow-up, so the depth-1 rule applies. If the Operand work in #1523 wants a third method for the test-call unwrap in Presence#subject_of and Condition#check_of, add it there. Note it on #1523 instead of filing a new ticket.
Resolution
Done: All three ticket items shipped via fast-batch-23, plus three related fixes: SameFileDefs, EffectCall, and Operand (unwrap, slot_of; name ruled by Jared) are top-level under Structural. DefKey is top-level and CallKeys nests under SameFileDefs (same A2 defect, exposed by item 1). The duplicate leaves became Structural::ConditionLeaves.of. ForwardingClass::Operand was renamed to Argument so the bare name Operand stays unambiguous. No behavior change.
Evidence: main
d538dd47(merge),cfc7ed26(pushed). Commitsa3003a8f682f5e051218d3ed91db7ec0d027d88b8311730169d884c4. Full suite after merging main: 3305 runs, 7016 assertions, 0 failures, 0 errors. Sdlc/Structural/InwardDependency sweep 93 -> 93. AC2 grep: no Candidate.unwrap/slot_of, QueryMethodReachesWrite::SameFileDefs/DefKey/CallKeys, EffectInModel::EffectCall, or ForwardingClass::Operand left in plugins/*.rb. Records: docs/crc/os-sdlc/fast-batch-23/.Follow-ups: none. Presence#subject_of / Condition#check_of merge: ticket-skeptic DROP (depth-1, reason on this ticket). design/generated/ staleness: dropped, the periodic regeneration commit owns it. ConstantChain#operands method name and a nested-constant shadowing cop: dropped, speculative.