Rename the nine I/O-doing *_fixture.rb support files to scenarios #1463

Closed
opened 2026-10-28 16:56:46 +00:00 by jared · 2 comments
Owner

Problem

Nine support files carry the name *Fixture but write disk, git, or DB.
The convention in plugins/os-sdlc/skills/lens-testing/references/record-fixtures.md rule 2 says a Fixture returns a value and does no I/O.
A Scenario owns the disk.
The files and their I/O:

  1. changed_project_fixture.rb — File.write at 29, 33, 58; git through Open3 at 62-63.
  2. crc_ledger_fixture.rb — lines 9-13.
  3. entry_map_fixture.rb — lines 5-6.
  4. evidence_fixture.rb — lines 25-32.
  5. gate_commands_project_fixture.rb — lines 20-38.
  6. git_repo_fixture.rb — lines 13-30.
  7. lesson_fixture.rb — write at 22-24; FIELDS and yaml are pure.
  8. dispatch_fixture.rb — DB creates at 5-8.
  9. open_implementation_fixture.rb — Initiation.open_project and Open.call at 5-6; 26 references.

Approach

Rename each file to <Name>Scenario in *_scenario.rb, and update the callers (use grep -rlw per constant).
Split LessonFixture: keep LessonFixture with FIELDS and yaml (pure), and move write to LessonScenario.
Three helper files are also scenarios: cli_next_instruction_helpers.rb (git init, disk, DB at 13-41, 163, 181), seeded_git_repo_helpers.rb (14-23), evidence_bin_helpers.rb (46-51).
Rename them to *_scenario.rb, or keep them as helpers with a ruling.

Required work:

  1. Rename the nine files and update their callers — check: absent class ChangedProjectFixture in plugins/os-sdlc/tests/**
  2. Split LessonFixture and create LessonScenario — check: present LessonScenario in plugins/os-sdlc/tests/support/lesson_scenario.rb
  3. Rename the three helper files that are scenarios, or rule to keep them as helpers — orchestrator decides at batch time

Acceptance criteria

  1. Given the renamed files, when the os-sdlc suite runs, then it is green.
  2. Given plugins/os-sdlc/tests/support/*_fixture.rb, when grep -l 'File\|FileUtils\|Open3\|\.create' runs on them, then it lists nothing.

Owner sketch

ChangedProjectScenario
CrcLedgerScenario
EntryMapScenario
EvidenceScenario
GateCommandsProjectScenario
GitRepoScenario
LessonScenario
DispatchScenario
OpenImplementationScenario
LessonFixture # FIELDS, yaml

Non-goals

Record fixtures for lib records (see the other conversion tickets).

Route: fast-batch.

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 fixture, Scenario, ChangedProjectFixture, GateCommandsProjectFixture, tests/support, record-fixtures, rename
  • Where: plugins/os-sdlc/tests/support/changed_project_fixture.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 Nine support files carry the name `*Fixture` but write disk, git, or DB. The convention in `plugins/os-sdlc/skills/lens-testing/references/record-fixtures.md` rule 2 says a Fixture returns a value and does no I/O. A Scenario owns the disk. The files and their I/O: 1. `changed_project_fixture.rb` — File.write at 29, 33, 58; git through Open3 at 62-63. 2. `crc_ledger_fixture.rb` — lines 9-13. 3. `entry_map_fixture.rb` — lines 5-6. 4. `evidence_fixture.rb` — lines 25-32. 5. `gate_commands_project_fixture.rb` — lines 20-38. 6. `git_repo_fixture.rb` — lines 13-30. 7. `lesson_fixture.rb` — write at 22-24; FIELDS and `yaml` are pure. 8. `dispatch_fixture.rb` — DB creates at 5-8. 9. `open_implementation_fixture.rb` — Initiation.open_project and Open.call at 5-6; 26 references. ## Approach Rename each file to `<Name>Scenario` in `*_scenario.rb`, and update the callers (use `grep -rlw` per constant). Split LessonFixture: keep `LessonFixture` with FIELDS and `yaml` (pure), and move `write` to `LessonScenario`. Three helper files are also scenarios: `cli_next_instruction_helpers.rb` (git init, disk, DB at 13-41, 163, 181), `seeded_git_repo_helpers.rb` (14-23), `evidence_bin_helpers.rb` (46-51). Rename them to `*_scenario.rb`, or keep them as helpers with a ruling. Required work: 1. Rename the nine files and update their callers — check: absent `class ChangedProjectFixture` in `plugins/os-sdlc/tests/**` 2. Split LessonFixture and create LessonScenario — check: present `LessonScenario` in `plugins/os-sdlc/tests/support/lesson_scenario.rb` 3. Rename the three helper files that are scenarios, or rule to keep them as helpers — orchestrator decides at batch time ## Acceptance criteria 1. Given the renamed files, when the os-sdlc suite runs, then it is green. 2. Given `plugins/os-sdlc/tests/support/*_fixture.rb`, when `grep -l 'File\|FileUtils\|Open3\|\.create'` runs on them, then it lists nothing. ## Owner sketch ```ruby ChangedProjectScenario CrcLedgerScenario EntryMapScenario EvidenceScenario GateCommandsProjectScenario GitRepoScenario LessonScenario DispatchScenario OpenImplementationScenario LessonFixture # FIELDS, yaml ``` ## Non-goals Record fixtures for lib records (see the other conversion tickets). Route: fast-batch. ## 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 fixture, Scenario, ChangedProjectFixture, GateCommandsProjectFixture, tests/support, record-fixtures, rename - Where: plugins/os-sdlc/tests/support/changed_project_fixture.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

Work started on branch fast-batch-22 (os-sdlc fast-batch). The ChangedProjectFixture and GateCommandsProjectFixture renames merge with #1269 into WorkingTreeChangesScenario.

Work started on branch fast-batch-22 (os-sdlc fast-batch). The ChangedProjectFixture and GateCommandsProjectFixture renames merge with #1269 into WorkingTreeChangesScenario.
Author
Owner

Resolution

Done: I/O-doing support fixtures are Scenarios: GitRepo, Dispatch, EntryMap, Evidence, OpenImplementation, CliNextInstruction (ruling O1), LessonScenario split from pure LessonFixture; ChangedProject + GateCommandsProject merged into WorkingTreeChangesScenario (#1269); CrcLedgerFixture merged into CrcLedgerScenario (ruling A1).

Evidence: fast-batch-22 merged to main 5f32ca8f; commits 2d2d88d7, af7f61df, 9ae47fd3, 01c96785. AC2: no tests/support/*_fixture.rb does File/FileUtils/Open3/create I/O. Full suite 2904 runs, 0 failures.

Follow-ups: dropped: leftovers (rescue_source require, SeededGitRepoHelpers#run_git status, CrcLedgerScenario write name) got a ticket-skeptic DROP (speculative hardening); list posted on #1019.

## Resolution **Done:** I/O-doing support fixtures are Scenarios: GitRepo, Dispatch, EntryMap, Evidence, OpenImplementation, CliNextInstruction (ruling O1), LessonScenario split from pure LessonFixture; ChangedProject + GateCommandsProject merged into WorkingTreeChangesScenario (#1269); CrcLedgerFixture merged into CrcLedgerScenario (ruling A1). **Evidence:** fast-batch-22 merged to main 5f32ca8f; commits 2d2d88d7, af7f61df, 9ae47fd3, 01c96785. AC2: no tests/support/*_fixture.rb does File/FileUtils/Open3/create I/O. Full suite 2904 runs, 0 failures. **Follow-ups:** dropped: leftovers (rescue_source require, SeededGitRepoHelpers#run_git status, CrcLedgerScenario write name) got a ticket-skeptic DROP (speculative hardening); list posted on #1019.
jared closed this issue 2026-10-28 19:01:44 +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#1463
No description provided.