Add cop Sdlc/Structural/ConceptCallsItsCaller with lesson #1751

Closed
opened 2026-11-13 20:06:54 +00:00 by jared · 2 comments
Owner

Problem

The one message of Sdlc/Structural/ConceptCycle does 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 cop Sdlc/Structural/ConceptCycle and the class OsSdlc::Lint::ConceptCycleCheck. main does not have them.

The research source is docs/research/lint-lessons/2026-11-13-concept-cycle-kinds/ on main (commits 5465548a7, 9bb6a9845, 58ee53c). It holds simulation/kinds.rb, simulation/facts-os-sdlc.yml, simulation/package/ (lessons, message forms, render.rb), and simulation/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/ConceptCallsItsCaller and 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 under plugins/os-sdlc/lint-lessons/.
Write fixtures for both message forms.

Constraints:

  • Register cops in plugins/os-sdlc/.rubocop.yml only (ADR-0298).
  • Each cop file name under lib/os_sdlc/cops/structural/ agrees with its constant (ADR-0090).
  • Use no Exclude list and no allowlist.
  • Write no repository name in lesson or message-form text.
  • Put pass/fail logic in tested Ruby, not in prompt text.

Observed

In round 1 (round-1/grades/known-D.yml and known-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 "direction correct" form lists the users of the wrong constant. It must list the users of the entry constant.
  • The lesson says that the message gives report counts. This form prints none.
  • The message says "a change at the fault site alone does not remove this report". It does not name the second loop that makes this true.
  • The message says that the entry "holds something that belongs to" the owner. It does not name the thing.
  • The ban on "a forwarding method" conflicts with "let the entry call the owner".

The new lesson and message forms must remove these five defects.

Reproduce

n/a: feature ticket.

Origin

  • Trigger: round 1 of the concept-cycle kinds research (docs/research/lint-lessons/2026-11-13-concept-cycle-kinds/ on main)
  • Improvised this session: none
  • Chain: the agent may make a local fix only ← the one message does not name this kind ← no cop for this kind exists (DESIGN: ticket 1 of this set and simulation/package/sdlc-structural-concept-calls-its-caller.yml)
  • Root candidate: none found; searched ConceptCallsItsCaller, ConceptCycle, concept loop, loop reference, direction correct, lint-lessons, structural cop
  • Where: plugins/os-sdlc/lib/os_sdlc/cops/structural/ and plugins/os-sdlc/lint-lessons/ (branch ticket-1742)
  • Session: fdf2ac7d-9590-47d4-97e8-ebff9711ce46
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os-plugins-os-sdlc/fdf2ac7d-9590-47d4-97e8-ebff9711ce46.jsonl
  • VERDICT: CREATE - handoff step 5 states this work; round 1 observed five defects; no open ticket adds a cop for this kind.
## Problem The one message of `Sdlc/Structural/ConceptCycle` does 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 cop `Sdlc/Structural/ConceptCycle` and the class `OsSdlc::Lint::ConceptCycleCheck`. `main` does not have them. The research source is `docs/research/lint-lessons/2026-11-13-concept-cycle-kinds/` on `main` (commits `5465548a7`, `9bb6a9845`, `58ee53c`). It holds `simulation/kinds.rb`, `simulation/facts-os-sdlc.yml`, `simulation/package/` (lessons, message forms, `render.rb`), and `simulation/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/ConceptCallsItsCaller` and 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 under `plugins/os-sdlc/lint-lessons/`. Write fixtures for both message forms. Constraints: - Register cops in `plugins/os-sdlc/.rubocop.yml` only (ADR-0298). - Each cop file name under `lib/os_sdlc/cops/structural/` agrees with its constant (ADR-0090). - Use no `Exclude` list and no allowlist. - Write no repository name in lesson or message-form text. - Put pass/fail logic in tested Ruby, not in prompt text. ## Observed In round 1 (`round-1/grades/known-D.yml` and `known-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 "direction correct" form lists the users of the wrong constant. It must list the users of the entry constant. - The lesson says that the message gives report counts. This form prints none. - The message says "a change at the fault site alone does not remove this report". It does not name the second loop that makes this true. - The message says that the entry "holds something that belongs to" the owner. It does not name the thing. - The ban on "a forwarding method" conflicts with "let the entry call the owner". The new lesson and message forms must remove these five defects. ## Reproduce n/a: feature ticket. ## Origin - Trigger: round 1 of the concept-cycle kinds research (`docs/research/lint-lessons/2026-11-13-concept-cycle-kinds/` on `main`) - Improvised this session: none - Chain: the agent may make a local fix only ← the one message does not name this kind ← no cop for this kind exists (DESIGN: ticket 1 of this set and `simulation/package/sdlc-structural-concept-calls-its-caller.yml`) - Root candidate: none found; searched ConceptCallsItsCaller, ConceptCycle, concept loop, loop reference, direction correct, lint-lessons, structural cop - Where: plugins/os-sdlc/lib/os_sdlc/cops/structural/ and plugins/os-sdlc/lint-lessons/ (branch `ticket-1742`) - Session: fdf2ac7d-9590-47d4-97e8-ebff9711ce46 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os-plugins-os-sdlc/fdf2ac7d-9590-47d4-97e8-ebff9711ce46.jsonl - VERDICT: CREATE - handoff step 5 states this work; round 1 observed five defects; no open ticket adds a cop for this kind.
Author
Owner

Blocked by #1748: this ticket uses the classification that it builds.

Blocked by #1748: this ticket uses the classification that it builds.
Author
Owner

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 1910c129c dce7f6c61 4eeafd40f 4f63d2cd7 (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.

## 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 1910c129c dce7f6c61 4eeafd40f 4f63d2cd7 (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. <!-- os-backlog kind: resolution -->
jared closed this issue 2026-11-13 21:37:54 +00:00
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#1751
No description provided.