concept_root_test enforces ADR-0223 ownership rule: missing roots and mis-scoped constants, not roots outside model/ #747

Closed
opened 2026-09-26 15:23:23 +00:00 by jared · 1 comment
Owner

Problem

plugins/os-sdlc/tests/concept_root_test.rb (commit fc0289fa, closed #745) enforces ADR-0222 item 3, which ADR-0223 amends. The test currently records a KNOWN_ROOTLESS baseline of 33 entries. 32 of the 33 are roots outside model/, which ADR-0223 says are not defects. 1 entry (Git) is a genuinely missing root.

Approach

Required work:

  1. Keep the missing-root check. Baseline: Git -> missing.
  2. Replace the outside-model/ check with two ownership checks: a nested object referenced from more than one concept, and a top-level object referenced from exactly one concept. Compute each from OsSdlc.loader.all_expected_cpaths plus Prism constant references, the way plugins/os-sdlc/tests/inward_dependency_test.rb (commit fd59331c) already does.
  3. Record a separate baseline for each of the two new checks.
  4. Rename KNOWN_ROOTLESS to match the new checks (it no longer means "root outside model/").

Rejected: leave the outside-model/ check as-is and only add exceptions — rejected, ADR-0223 says the check itself enforces the wrong rule.

Acceptance criteria

  1. Given the concept root test runs, when a concept namespace has nested objects but no root file, then it is reported as a defect (missing-root check unchanged; Git is the recorded baseline entry).
  2. Given the concept root test runs, when a nested object is referenced from more than one concept, then it is reported as a defect.
  3. Given the concept root test runs, when a top-level object is referenced from exactly one concept, then it is reported as a defect.
  4. Given the concept root test runs, when a concept's root lives outside model/ but has no ownership violation, then it is not reported as a defect.

Owner sketch

class OsSdlc::ConceptRootTest
  def classify_concepts
  end
end

Origin

  • Trigger: user decision on 2026-09-26 recorded as ADR-0223, amending ADR-0222 item 3
  • Improvised this session: none
  • Chain: concept_root_test.rb enforces the wrong rule ← ADR-0222 item 3 over-generalized the Gate finding ← DESIGN (ADR-0223)
  • Root candidate: this ticket
  • Where: plugins/os-sdlc/tests/concept_root_test.rb
  • Session: d0c72a0b-34c7-4dae-bf3b-7400ef21ad4a
  • Transcript: /tmp/claude-1000/-home-jared-dev-cc-os--claude-worktrees-crc-pass-os-sdlc/d0c72a0b-34c7-4dae-bf3b-7400ef21ad4a
## Problem plugins/os-sdlc/tests/concept_root_test.rb (commit fc0289fa, closed #745) enforces ADR-0222 item 3, which ADR-0223 amends. The test currently records a KNOWN_ROOTLESS baseline of 33 entries. 32 of the 33 are roots outside model/, which ADR-0223 says are not defects. 1 entry (Git) is a genuinely missing root. ## Approach Required work: 1. Keep the missing-root check. Baseline: Git -> missing. 2. Replace the outside-model/ check with two ownership checks: a nested object referenced from more than one concept, and a top-level object referenced from exactly one concept. Compute each from OsSdlc.loader.all_expected_cpaths plus Prism constant references, the way plugins/os-sdlc/tests/inward_dependency_test.rb (commit fd59331c) already does. 3. Record a separate baseline for each of the two new checks. 4. Rename KNOWN_ROOTLESS to match the new checks (it no longer means "root outside model/"). Rejected: leave the outside-model/ check as-is and only add exceptions — rejected, ADR-0223 says the check itself enforces the wrong rule. ## Acceptance criteria 1. Given the concept root test runs, when a concept namespace has nested objects but no root file, then it is reported as a defect (missing-root check unchanged; Git is the recorded baseline entry). 2. Given the concept root test runs, when a nested object is referenced from more than one concept, then it is reported as a defect. 3. Given the concept root test runs, when a top-level object is referenced from exactly one concept, then it is reported as a defect. 4. Given the concept root test runs, when a concept's root lives outside model/ but has no ownership violation, then it is not reported as a defect. ## Owner sketch ```ruby class OsSdlc::ConceptRootTest def classify_concepts end end ``` ## Origin - Trigger: user decision on 2026-09-26 recorded as ADR-0223, amending ADR-0222 item 3 - Improvised this session: none - Chain: concept_root_test.rb enforces the wrong rule ← ADR-0222 item 3 over-generalized the Gate finding ← DESIGN (ADR-0223) - Root candidate: this ticket - Where: plugins/os-sdlc/tests/concept_root_test.rb - Session: d0c72a0b-34c7-4dae-bf3b-7400ef21ad4a - Transcript: /tmp/claude-1000/-home-jared-dev-cc-os--claude-worktrees-crc-pass-os-sdlc/d0c72a0b-34c7-4dae-bf3b-7400ef21ad4a
Author
Owner

Resolution

Done: Withdrawn. The test enforced constant placement, a structure property, not behavior. Deleted concept_root_test.rb instead of re-speccing it.

Evidence: commit d76058a5; ADR-0223's ownership rule moves to a living principles document in a following session

Follow-ups: none

## Resolution **Done:** Withdrawn. The test enforced constant placement, a structure property, not behavior. Deleted concept_root_test.rb instead of re-speccing it. **Evidence:** commit d76058a5; ADR-0223's ownership rule moves to a living principles document in a following session **Follow-ups:** none
jared closed this issue 2026-09-26 17:31:14 +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#747
No description provided.