crc os-adr wave 4: Record concept into role directories; loader collapses six role directories #926

Closed
opened 2026-10-04 16:36:58 +00:00 by jared · 2 comments
Owner

Problem

Move lib files into role directories by their job (verb), and update the loader to collapse them. Implement R1 and its dependent rulings for the Record concept: Record, Record::ParseError, Template, Finder, and CLI::New.

Reproduce

n/a: structure-only refactor, no behavior change

Approach

Required work:

  1. plugins/os-adr/lib/adr/record.rb: move to plugins/os-adr/lib/adr/model/record.rb, constant Adr::Record, test plugins/os-adr/tests/model/record_test.rb
  2. plugins/os-adr/lib/adr/record/parse_error.rb: move to plugins/os-adr/lib/adr/model/record/parse_error.rb, constant Adr::Record::ParseError
  3. plugins/os-adr/lib/adr/template.rb: move to plugins/os-adr/lib/adr/presenter/record/template.rb, constant Adr::Record::Template
  4. plugins/os-adr/lib/adr/finder.rb: move to plugins/os-adr/lib/adr/query/record/matches.rb, constant Adr::Record::Matches, test plugins/os-adr/tests/query/record/matches_test.rb
  5. plugins/os-adr/lib/adr/cli/new.rb: move to plugins/os-adr/lib/adr/command/record/creation.rb, constant Adr::Record::Creation
  6. plugins/os-adr/lib/adr.rb: update the loader to collapse the six role directories model/, query/, presenter/, parser/, command/, adapter/ (R1, Proposed ADR-0271)

Governed by rulings: R1, R2, R4, R6, R8, R11, R13
Rejected: none (all rows apply)

Acceptance criteria

  • All five lib files moved to their role directories with constants updated
  • Loader plugins/os-adr/lib/adr.rb collapses the six role directories model/, query/, presenter/, parser/, command/, adapter/
  • tests/model/record_test.rb and tests/query/record/matches_test.rb mirror the lib paths
  • ruby plugins/os-adr/tests/all.rb passes with 0 failures
  • ruby -e 'require "./plugins/os-adr/lib/adr"; Adr.loader.eager_load' runs silently
  • All existing callers updated to use new constant names (cli/new.rb, detector.rb, repository.rb, bin/adr-new)

Owner sketch

Familiar with Ruby, Zeitwerk, and os-adr architecture. Work in sequence: move Record, move dependencies (Template, Finder, ParseError), move CLI::New, update loader, verify tests and lint.

Non-goals

No behavior change; no new tests; no deletion of code that has callers.

Origin

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
Where: crc-refactor run on plugins/os-adr, worktree crc-os-adr-2026-10-04, ledger docs/crc/os-adr/ledger.tsv

## Problem Move lib files into role directories by their job (verb), and update the loader to collapse them. Implement R1 and its dependent rulings for the Record concept: Record, Record::ParseError, Template, Finder, and CLI::New. ## Reproduce n/a: structure-only refactor, no behavior change ## Approach Required work: 1. plugins/os-adr/lib/adr/record.rb: move to plugins/os-adr/lib/adr/model/record.rb, constant Adr::Record, test plugins/os-adr/tests/model/record_test.rb 2. plugins/os-adr/lib/adr/record/parse_error.rb: move to plugins/os-adr/lib/adr/model/record/parse_error.rb, constant Adr::Record::ParseError 3. plugins/os-adr/lib/adr/template.rb: move to plugins/os-adr/lib/adr/presenter/record/template.rb, constant Adr::Record::Template 4. plugins/os-adr/lib/adr/finder.rb: move to plugins/os-adr/lib/adr/query/record/matches.rb, constant Adr::Record::Matches, test plugins/os-adr/tests/query/record/matches_test.rb 5. plugins/os-adr/lib/adr/cli/new.rb: move to plugins/os-adr/lib/adr/command/record/creation.rb, constant Adr::Record::Creation 6. plugins/os-adr/lib/adr.rb: update the loader to collapse the six role directories model/, query/, presenter/, parser/, command/, adapter/ (R1, Proposed ADR-0271) Governed by rulings: R1, R2, R4, R6, R8, R11, R13 Rejected: none (all rows apply) ## Acceptance criteria - All five lib files moved to their role directories with constants updated - Loader plugins/os-adr/lib/adr.rb collapses the six role directories model/, query/, presenter/, parser/, command/, adapter/ - tests/model/record_test.rb and tests/query/record/matches_test.rb mirror the lib paths - ruby plugins/os-adr/tests/all.rb passes with 0 failures - ruby -e 'require "./plugins/os-adr/lib/adr"; Adr.loader.eager_load' runs silently - All existing callers updated to use new constant names (cli/new.rb, detector.rb, repository.rb, bin/adr-new) ## Owner sketch Familiar with Ruby, Zeitwerk, and os-adr architecture. Work in sequence: move Record, move dependencies (Template, Finder, ParseError), move CLI::New, update loader, verify tests and lint. ## Non-goals No behavior change; no new tests; no deletion of code that has callers. ## Origin 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 Where: crc-refactor run on plugins/os-adr, worktree crc-os-adr-2026-10-04, ledger docs/crc/os-adr/ledger.tsv
Author
Owner

cf078f47; rows applied 5/5; rows deviated 0; rows blocked 0

cf078f47; rows applied 5/5; rows deviated 0; rows blocked 0
Author
Owner

Resolution

Done: Record concept moved into role directories (Record, Record::ParseError, Record::Template, Record::Matches, Record::Creation); loader collapses six role directories

Evidence: cf078f47 on branch crc-os-adr-2026-10-04 (not merged; user review pending); suite: 51 runs, 168 assertions, 0 failures, 0 errors, 0 skips; eager load silent; inward lint: none (os-adr has none)

Follow-ups: none for this ticket; run-level follow-ups filed as #934 and #935; dropped items listed in docs/crc/os-adr/HANDOFF.md Review

## Resolution **Done:** Record concept moved into role directories (Record, Record::ParseError, Record::Template, Record::Matches, Record::Creation); loader collapses six role directories **Evidence:** cf078f47 on branch crc-os-adr-2026-10-04 (not merged; user review pending); suite: 51 runs, 168 assertions, 0 failures, 0 errors, 0 skips; eager load silent; inward lint: none (os-adr has none) **Follow-ups:** none for this ticket; run-level follow-ups filed as #934 and #935; dropped items listed in docs/crc/os-adr/HANDOFF.md Review
jared closed this issue 2026-10-04 17:15:00 +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#926
No description provided.