Split AdrFixtures into AdrFixture (value) and AdrScenario (disk) #1467

Closed
opened 2026-10-28 16:56:49 +00:00 by jared · 1 comment
Owner

Problem

plugins/os-adr/tests/support/adr_fixtures.rb mixes two jobs.
sample_adr(id:, title:, status:, extra_frontmatter:) is pure.
with_project(adrs) calls Dir.mktmpdir, mkdir_p, and File.write (lines 7-11), against rule 2 of the record-fixtures convention.
The module also uses the plural name Fixtures.

Approach

Create AdrFixture with build(**overrides) (the renamed sample_adr).
Keep sample_adr as an alias only if it has more than 10 callers (58 uses today).
Create AdrScenario.with_project.
Update the callers (grep -rl AdrFixtures plugins/os-adr/tests lists 17 files).
plugins/os-adr/.sdlc does not exist, so os-adr is not set up for os-sdlc. Route by hand.

Required work:

  1. Create AdrFixture — check: present module AdrFixture in plugins/os-adr/tests/support/adr_fixture.rb
  2. Remove the old name — check: absent AdrFixtures in plugins/os-adr/tests/**

Acceptance criteria

  1. Given the split modules, when the os-adr suite runs, then it is green.

Owner sketch

module AdrFixture
  def self.build(**overrides)
end
module AdrScenario
  def self.with_project(adrs = {})
end

Route: by hand (no .sdlc in os-adr).

Origin

  • Trigger: tests/support inventory survey 2026-10-28 after fast-batch-21 (#1019)
  • Improvised this session: none
  • Chain: misnamed or hand-built test records ← convention adopted 2026-10-28 but only TicketFixture converted ← DESIGN (#1019 memo comment)
  • Root candidate: none found; searched AdrFixtures, adr_fixture, AdrScenario, with_project, sample_adr
  • Where: plugins/os-adr/tests/support/adr_fixtures.rb
  • Session: 2dd497e0-555e-4518-9cdd-c68461c32463
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/2dd497e0-555e-4518-9cdd-c68461c32463.jsonl

VERDICT: CREATE

Parent: #1019

## Problem `plugins/os-adr/tests/support/adr_fixtures.rb` mixes two jobs. `sample_adr(id:, title:, status:, extra_frontmatter:)` is pure. `with_project(adrs)` calls Dir.mktmpdir, mkdir_p, and File.write (lines 7-11), against rule 2 of the record-fixtures convention. The module also uses the plural name `Fixtures`. ## Approach Create `AdrFixture` with `build(**overrides)` (the renamed `sample_adr`). Keep `sample_adr` as an alias only if it has more than 10 callers (58 uses today). Create `AdrScenario.with_project`. Update the callers (`grep -rl AdrFixtures plugins/os-adr/tests` lists 17 files). `plugins/os-adr/.sdlc` does not exist, so os-adr is not set up for os-sdlc. Route by hand. Required work: 1. Create AdrFixture — check: present `module AdrFixture` in `plugins/os-adr/tests/support/adr_fixture.rb` 2. Remove the old name — check: absent `AdrFixtures` in `plugins/os-adr/tests/**` ## Acceptance criteria 1. Given the split modules, when the os-adr suite runs, then it is green. ## Owner sketch ```ruby module AdrFixture def self.build(**overrides) end module AdrScenario def self.with_project(adrs = {}) end ``` Route: by hand (no `.sdlc` in os-adr). ## Origin - Trigger: tests/support inventory survey 2026-10-28 after fast-batch-21 (#1019) - Improvised this session: none - Chain: misnamed or hand-built test records ← convention adopted 2026-10-28 but only TicketFixture converted ← DESIGN (#1019 memo comment) - Root candidate: none found; searched AdrFixtures, adr_fixture, AdrScenario, with_project, sample_adr - Where: plugins/os-adr/tests/support/adr_fixtures.rb - Session: 2dd497e0-555e-4518-9cdd-c68461c32463 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/2dd497e0-555e-4518-9cdd-c68461c32463.jsonl VERDICT: CREATE Parent: #1019
Author
Owner

Resolution

Done: AdrFixtures split: AdrFixture.build (old sample_adr, pure) and AdrScenario.with_project (disk). All callers call them explicitly; no alias.

Evidence: fast-batch-22 merged to main 5f32ca8f; commit b761641a. os-adr suite 144 runs, 370 assertions, 0 failures before and after. No AdrFixtures left in plugins/os-adr/tests.

Follow-ups: none

## Resolution **Done:** AdrFixtures split: AdrFixture.build (old sample_adr, pure) and AdrScenario.with_project (disk). All callers call them explicitly; no alias. **Evidence:** fast-batch-22 merged to main 5f32ca8f; commit b761641a. os-adr suite 144 runs, 370 assertions, 0 failures before and after. No AdrFixtures left in plugins/os-adr/tests. **Follow-ups:** none
jared closed this issue 2026-10-28 19:00:10 +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#1467
No description provided.