Add record-fixture reference, lens link, and test-writer index line #1458

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

Add record-fixture reference, lens link, and test-writer index line [capture]

Problem

Test authors hand-build records such as ticket bodies and project.yaml Hashes, because no written rule says how to build a test record. The test-writer agent also never learns which fixtures exist. The fixture survey of 2026-10-28 found 16 test files that hand-build a complete ticket body.

Approach

Required work:

  1. Create the record-fixtures reference, at most 40 lines — check: present Object Mother in plugins/os-sdlc/skills/lens-testing/references/record-fixtures.md
  2. Add one sentence after line 13 of the lens-testing skill that links the reference — check: present references/record-fixtures.md in plugins/os-sdlc/skills/lens-testing/SKILL.md
  3. Add one bullet after line 59 of the test-writer agent — check: present record fixtures live in tests/support/*_fixture.rb; list them before you build a record in plugins/os-sdlc/agents/test-writer.md

The reference states five rules:

  • Rule 1: A fixture returns a value and does no I/O. Scenarios own the disk. Fakes own behavior.
  • Rule 2: build(**overrides) passes overrides to the real constructor and never re-states a constructor default.
  • Rule 3: Variants are named methods, never .sub on a returned value.
  • Rule 4: A test asserts only on values it passed or on a preset's documented property.
  • Rule 5: One record per file, one constant, Zeitwerk-loaded.

The reference holds one TicketFixture example with build(**overrides) and without(section).
The reference names each pattern with its source:

  • Object Mother (Schuh and Punke)
  • Test Data Builder (Pryce, GOOS ch. 22)
  • Meszaros, xUnit Test Patterns: Creation Method, Parameterized Creation Method, Anonymous Creation Method, General Fixture, Mystery Guest

The reference stays general, so other plugins adopt it unchanged. No ADR: none of these rules is a one-way door.

Route: by hand.

Acceptance criteria

  1. Given the new reference, when a reader counts lines, then it has 40 lines or fewer and states the five rules, one example, and every pattern name with its source.
  2. Given lens-testing SKILL.md, when a reader opens it, then one sentence links references/record-fixtures.md.
  3. Given a test-writer dispatched from either map, when its prompt is rendered, then the index line appears exactly once.
  4. Given the three changed files, when /os-aidd-lint:check runs Tier 1, then it reports no new offense.

Owner sketch

Prose artifact; no Ruby owner

Non-goals

  • Do not add a cop. Re-measure after the first pipeline batch that writes tests (see ticket 4).
  • Do not convert os-adr, os-me, or os-backlog.

Origin

  • Trigger: fixture survey re-verified 2026-10-28 for #1019
  • Improvised this session: none
  • Chain: hand-built test records ← no fixture convention and no delivery to the test-writer ← DESIGN (#1019 memo comment 2026-10-28)
  • Root candidate: none found; searched per skeptic (see VERDICT)
  • Where: plugins/os-sdlc/skills/lens-testing/references/record-fixtures.md
  • 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

# Add record-fixture reference, lens link, and test-writer index line [capture] ## Problem Test authors hand-build records such as ticket bodies and project.yaml Hashes, because no written rule says how to build a test record. The test-writer agent also never learns which fixtures exist. The fixture survey of 2026-10-28 found 16 test files that hand-build a complete ticket body. ## Approach Required work: 1. Create the record-fixtures reference, at most 40 lines — check: present `Object Mother` in `plugins/os-sdlc/skills/lens-testing/references/record-fixtures.md` 2. Add one sentence after line 13 of the lens-testing skill that links the reference — check: present `references/record-fixtures.md` in `plugins/os-sdlc/skills/lens-testing/SKILL.md` 3. Add one bullet after line 59 of the test-writer agent — check: present `record fixtures live in tests/support/*_fixture.rb; list them before you build a record` in `plugins/os-sdlc/agents/test-writer.md` The reference states five rules: - Rule 1: A fixture returns a value and does no I/O. Scenarios own the disk. Fakes own behavior. - Rule 2: `build(**overrides)` passes overrides to the real constructor and never re-states a constructor default. - Rule 3: Variants are named methods, never `.sub` on a returned value. - Rule 4: A test asserts only on values it passed or on a preset's documented property. - Rule 5: One record per file, one constant, Zeitwerk-loaded. The reference holds one `TicketFixture` example with `build(**overrides)` and `without(section)`. The reference names each pattern with its source: - Object Mother (Schuh and Punke) - Test Data Builder (Pryce, GOOS ch. 22) - Meszaros, xUnit Test Patterns: Creation Method, Parameterized Creation Method, Anonymous Creation Method, General Fixture, Mystery Guest The reference stays general, so other plugins adopt it unchanged. No ADR: none of these rules is a one-way door. Route: by hand. ## Acceptance criteria 1. Given the new reference, when a reader counts lines, then it has 40 lines or fewer and states the five rules, one example, and every pattern name with its source. 2. Given lens-testing SKILL.md, when a reader opens it, then one sentence links `references/record-fixtures.md`. 3. Given a test-writer dispatched from either map, when its prompt is rendered, then the index line appears exactly once. 4. Given the three changed files, when `/os-aidd-lint:check` runs Tier 1, then it reports no new offense. ## Owner sketch Prose artifact; no Ruby owner ## Non-goals - Do not add a cop. Re-measure after the first pipeline batch that writes tests (see ticket 4). - Do not convert os-adr, os-me, or os-backlog. ## Origin - Trigger: fixture survey re-verified 2026-10-28 for #1019 - Improvised this session: none - Chain: hand-built test records ← no fixture convention and no delivery to the test-writer ← DESIGN (#1019 memo comment 2026-10-28) - Root candidate: none found; searched per skeptic (see VERDICT) - Where: plugins/os-sdlc/skills/lens-testing/references/record-fixtures.md - 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: Reference skills/lens-testing/references/record-fixtures.md (30 lines) with the five rules, one TicketFixture example, and pattern sources; lens-testing SKILL.md links it in one sentence; agents/test-writer.md step 2 carries the index line once.

Evidence: commit 902a7bbd on main; adr-find on the three paths returned no candidates; aidd-lint Tier 1 shows no finding on the added lines (one step-bulk advisory on the reference's prose line after the example; pre-existing findings on old lines untouched); bin/refresh-plugins synchronized.

Follow-ups: none; #1459-#1461 and the #1011 occurrence carry the build work

## Resolution **Done:** Reference skills/lens-testing/references/record-fixtures.md (30 lines) with the five rules, one TicketFixture example, and pattern sources; lens-testing SKILL.md links it in one sentence; agents/test-writer.md step 2 carries the index line once. **Evidence:** commit 902a7bbd on main; adr-find on the three paths returned no candidates; aidd-lint Tier 1 shows no finding on the added lines (one step-bulk advisory on the reference's prose line after the example; pre-existing findings on old lines untouched); bin/refresh-plugins synchronized. **Follow-ups:** none; #1459-#1461 and the #1011 occurrence carry the build work
jared closed this issue 2026-10-28 15:42:49 +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#1458
No description provided.