Add cop Sdlc/Structural/ConceptCallsItsCaller with lesson #1751
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#1751
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 one message of
Sdlc/Structural/ConceptCycledoes not tell an agent the correct fix for a concept that references back into a concept that uses it.A separate cop with its own message forms and lesson gives the correct fix.
Ticket 1 supplies the facts. This ticket is blocked by ticket 1.
The base branch is
ticket-1742. It is not merged. Its worktree is/home/jared/dev/cc-os/.claude/worktrees/ticket-1742. It holds the copSdlc/Structural/ConceptCycleand the classOsSdlc::Lint::ConceptCycleCheck.maindoes not have them.The research source is
docs/research/lint-lessons/2026-11-13-concept-cycle-kinds/onmain(commits5465548a7,9bb6a9845,58ee53c). It holdssimulation/kinds.rb,simulation/facts-os-sdlc.yml,simulation/package/(lessons, message forms,render.rb), andsimulation/round-1/grades/*.yml.A "loop reference" is a reference from one concept to another concept when the two concepts are in a dependency loop. A "concept" is a top-level namespace of the library with its directory. The cop reports 93 loop references in 58 files of os-sdlc.
Work: add the cop
Sdlc/Structural/ConceptCallsItsCallerand its lesson. The cop reports a concept that references back into a concept that uses it, at one fault line.The cop has two message forms: one for the fault line, and one for a line on the correct side ("direction correct").
The source text is
simulation/package/sdlc-structural-concept-calls-its-caller.yml.Put the cop file under
plugins/os-sdlc/lib/os_sdlc/cops/structural/. Put the lesson underplugins/os-sdlc/lint-lessons/.Write fixtures for both message forms.
Constraints:
plugins/os-sdlc/.rubocop.ymlonly (ADR-0298).lib/os_sdlc/cops/structural/agrees with its constant (ADR-0090).Excludelist and no allowlist.Observed
In round 1 (
round-1/grades/known-D.ymlandknown-E.yml), 6 of 6 runs made the cause-level fix.No run made the small local fix alone.
All runs named these defects, and each one was verified against the payload:
The new lesson and message forms must remove these five defects.
Reproduce
n/a: feature ticket.
Origin
docs/research/lint-lessons/2026-11-13-concept-cycle-kinds/onmain)simulation/package/sdlc-structural-concept-calls-its-caller.yml)ticket-1742)Blocked by #1748: this ticket uses the classification that it builds.
Resolution
Done: Cop Sdlc/Structural/ConceptCallsItsCaller reports a one-edge-back fault with a fault form at the fault line and a direction-correct form at each line of the entry constant that names the fault concept. The rule for the direction-correct lines is the Fact direction_correct_for in Kinds::Report. The forms list the users of the entry constant, print the counts, name the second loop with the lines of each edge, and give the effect of the cause fix from a simulation. The lesson is lint-lessons/sdlc-structural-concept-calls-its-caller.yml. The checksum tests of #1749 and the singular counts are corrected.
Evidence: Branch ticket-1742, commits
1910c129cdce7f6c614eeafd40f4f63d2cd7(34 files, +1105/-76). Suite: 5519 runs, 0 failures, 0 errors. Rubocop on the 32 changed Ruby files: no offenses. On os-sdlc lib with .rubocop-sweep.yml: ConceptCycle 62 in 36 files, ClassInWrongConcept 1 (2 references), StartingCodeInSharedConcept 19 (18 references), ConceptCallsItsCaller 11 in 4 files (2 fault lines, 9 direction-correct lines); 62 + 2 + 18 + 11 = 93. The build agent reported that on os-backlog lib the three kind cops report 0 and ConceptCycle reports 10. The fault form at project/config_command.rb:29 states that the line fix removes 1 of 93 and the cause fix leaves 64.Follow-ups: none filed. No agent run has tested the new message texts; step 7 of the handoff is that test. A three-concept loop with the same cause (lint/autocorrection.rb:9) stays with ConceptCycle; #1752 owns that message.