os-adr: path-based inward-dependency lint for the role directories #935

Closed
opened 2026-10-04 17:14:37 +00:00 by jared · 2 comments
Owner

Problem

The crc-refactor run moved plugins/os-adr/lib/adr/ into six collapsed role directories (model, query, presenter, parser, command, adapter; Proposed ADR-0271).
Nothing checks the inward rule, so a later change can add an outward reference silently.
The role architecture requires inward-dependency enforcement to prevent structural violations.

Approach

Add an inward-dependency check for plugins/os-adr that prevents outward references from role directories, seeding from today's baseline and running from the os-adr suite or gate.

Required work:

  1. Add an inward-dependency check for plugins/os-adr; reuse plugins/os-sdlc/bin/lint-inward-dependencies if it can take a target, else add a small bin script — check: present inward in plugins/os-adr/bin/*
  2. Seed its baseline with today's outward references.
  3. Run it from the os-adr suite or gate.

Acceptance criteria

  1. Given today's code, when the lint runs, then it passes with the baseline in place.
  2. Given a deliberate outward reference from model to query, when the lint runs, then it fails.
  3. Given the os-adr suite, when run, then the inward-dependency lint runs as part of it.

Owner sketch

class Adr::Lint::InwardDependencies
  def initialize(baseline_path)
    @baseline = File.read(baseline_path)
  end

  def check(target_dir)
    # Check that files in role dirs do not reference files outside their role
    # Allow references defined in baseline
  end
end

Origin

  • Trigger: crc-refactor run on plugins/os-adr, worktree crc-os-adr-2026-10-04
  • Improvised this session: none
  • Chain: role-based refactor (Proposed ADR-0271) requires inward-dependency enforcement ← crc-refactor process (os-sdlc skill crc-refactor, references/parameters.md "When a value does not exist")
  • Root candidate: none (this is the root)
  • Where: plugins/os-adr/lib/adr/ (six role directories: model, query, presenter, parser, command, adapter)
  • Session: a20defa9-036a-415a-9dde-2ed833c727cb
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os--claude-worktrees-crc-refactor-docs/a20defa9-036a-415a-9dde-2ed833c727cb.jsonl

VERDICT: CREATE. The change is a recorded decision, not a speculative one. Nothing enforces the Proposed ADR-0271 inward rule for os-adr. The ticket points at the root, a missing check.

Note

Work this ticket after branch crc-os-adr-2026-10-04 merges.

## Problem The crc-refactor run moved plugins/os-adr/lib/adr/ into six collapsed role directories (model, query, presenter, parser, command, adapter; Proposed ADR-0271). Nothing checks the inward rule, so a later change can add an outward reference silently. The role architecture requires inward-dependency enforcement to prevent structural violations. ## Approach Add an inward-dependency check for plugins/os-adr that prevents outward references from role directories, seeding from today's baseline and running from the os-adr suite or gate. Required work: 1. Add an inward-dependency check for plugins/os-adr; reuse plugins/os-sdlc/bin/lint-inward-dependencies if it can take a target, else add a small bin script — check: present `inward` in `plugins/os-adr/bin/*` 2. Seed its baseline with today's outward references. 3. Run it from the os-adr suite or gate. ## Acceptance criteria 1. Given today's code, when the lint runs, then it passes with the baseline in place. 2. Given a deliberate outward reference from model to query, when the lint runs, then it fails. 3. Given the os-adr suite, when run, then the inward-dependency lint runs as part of it. ## Owner sketch ```ruby class Adr::Lint::InwardDependencies def initialize(baseline_path) @baseline = File.read(baseline_path) end def check(target_dir) # Check that files in role dirs do not reference files outside their role # Allow references defined in baseline end end ``` ## Origin - Trigger: crc-refactor run on plugins/os-adr, worktree crc-os-adr-2026-10-04 - Improvised this session: none - Chain: role-based refactor (Proposed ADR-0271) requires inward-dependency enforcement ← crc-refactor process (os-sdlc skill crc-refactor, references/parameters.md "When a value does not exist") - Root candidate: none (this is the root) - Where: plugins/os-adr/lib/adr/ (six role directories: model, query, presenter, parser, command, adapter) - Session: a20defa9-036a-415a-9dde-2ed833c727cb - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os--claude-worktrees-crc-refactor-docs/a20defa9-036a-415a-9dde-2ed833c727cb.jsonl VERDICT: CREATE. The change is a recorded decision, not a speculative one. Nothing enforces the Proposed ADR-0271 inward rule for os-adr. The ticket points at the root, a missing check. ## Note Work this ticket after branch crc-os-adr-2026-10-04 merges.
Author
Owner

ADR-0272 decision 3 now requires the inward-dependency lint to read each file's role from the class name suffix or the crc ledger job_category column, not from the first path segment. The os-sdlc move to the A15 layout waits on this redesign.

ADR-0272 decision 3 now requires the inward-dependency lint to read each file's role from the class name suffix or the crc ledger job_category column, not from the first path segment. The os-sdlc move to the A15 layout waits on this redesign.
Author
Owner

Resolution

Done: Closed as stale: os-adr no longer has role directories, so a path-based inward-dependency lint for them has nothing to check.

Evidence: Commit 9e416b0f (A15) flattened plugins/os-adr/lib/adr/; find plugins/os-adr/lib shows no model/query/presenter/parser/command/adapter dirs; plugins/os-adr/bin has no inward script. The os-sdlc lint's role-from-name need is carried by #835.

Follow-ups: none; os-sdlc lint role-from-name requirement moved to #835

## Resolution **Done:** Closed as stale: os-adr no longer has role directories, so a path-based inward-dependency lint for them has nothing to check. **Evidence:** Commit 9e416b0f (A15) flattened plugins/os-adr/lib/adr/; find plugins/os-adr/lib shows no model/query/presenter/parser/command/adapter dirs; plugins/os-adr/bin has no inward script. The os-sdlc lint's role-from-name need is carried by #835. **Follow-ups:** none; os-sdlc lint role-from-name requirement moved to #835
jared closed this issue 2026-10-16 16:22:26 +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#935
No description provided.