WorkOrderFixture.build for the 73 tests that hand-build WorkOrder #1464

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

Problem

OsSdlc::Implementation::WorkOrder is a Data.define(:session_id, :ticket, :map_name, :target) in plugins/os-sdlc/lib/os_sdlc/implementation/work_order.rb.
Its constructor requires session_id, ticket, and map_name; target defaults to nil.
73 test files outside support build it by hand, for example plugins/os-sdlc/tests/implementation_complete_stamp_test.rb:14.
Each copy is a Mystery Guest.

Approach

Add plugins/os-sdlc/tests/support/work_order_fixture.rb:

module WorkOrderFixture
  DEFAULTS = {session_id: "session-1", ticket: "1", map_name: "toy"}.freeze
  def self.build(**overrides) = OsSdlc::Implementation::WorkOrder.new(**DEFAULTS, **overrides)
end

DEFAULTS holds only the three required fields, with the smallest valid values.
Migrate each call site that passes default-like values.
A site that passes a distinctive value keeps passing it as an override (rule 5).

Required work:

  1. Create the fixture module — check: present module WorkOrderFixture in plugins/os-sdlc/tests/support/work_order_fixture.rb
  2. Migrate the hand-built sites — check: absent WorkOrder.new(session_id: in plugins/os-sdlc/tests/*.rb

Acceptance criteria

  1. Given the migrated tests, when the os-sdlc suite runs, then it is green with no assertion changes.
  2. Given plugins/os-sdlc/tests outside support, when WorkOrder.new( is counted, then the count is 0, or the only hits are in the class's own test.

Owner sketch

module WorkOrderFixture
  def self.build(**overrides)
end

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 WorkOrder, work_order, WorkOrderFixture, hand-build, Mystery Guest, fixture
  • Where: plugins/os-sdlc/lib/os_sdlc/implementation/work_order.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 `OsSdlc::Implementation::WorkOrder` is a `Data.define(:session_id, :ticket, :map_name, :target)` in `plugins/os-sdlc/lib/os_sdlc/implementation/work_order.rb`. Its constructor requires session_id, ticket, and map_name; target defaults to nil. 73 test files outside support build it by hand, for example `plugins/os-sdlc/tests/implementation_complete_stamp_test.rb:14`. Each copy is a Mystery Guest. ## Approach Add `plugins/os-sdlc/tests/support/work_order_fixture.rb`: ```ruby module WorkOrderFixture DEFAULTS = {session_id: "session-1", ticket: "1", map_name: "toy"}.freeze def self.build(**overrides) = OsSdlc::Implementation::WorkOrder.new(**DEFAULTS, **overrides) end ``` DEFAULTS holds only the three required fields, with the smallest valid values. Migrate each call site that passes default-like values. A site that passes a distinctive value keeps passing it as an override (rule 5). Required work: 1. Create the fixture module — check: present `module WorkOrderFixture` in `plugins/os-sdlc/tests/support/work_order_fixture.rb` 2. Migrate the hand-built sites — check: absent `WorkOrder.new(session_id:` in `plugins/os-sdlc/tests/*.rb` ## Acceptance criteria 1. Given the migrated tests, when the os-sdlc suite runs, then it is green with no assertion changes. 2. Given `plugins/os-sdlc/tests` outside support, when `WorkOrder.new(` is counted, then the count is 0, or the only hits are in the class's own test. ## Owner sketch ```ruby module WorkOrderFixture def self.build(**overrides) end ``` ## 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 WorkOrder, work_order, WorkOrderFixture, hand-build, Mystery Guest, fixture - Where: plugins/os-sdlc/lib/os_sdlc/implementation/work_order.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.

Work started on branch fast-batch-22.
Author
Owner

Resolution

Done: WorkOrderFixture.build (DEFAULTS session-1/1/toy) replaces hand-built WorkOrder records in os-sdlc tests; overrides kept where a test relies on them; default-equal overrides dropped by ruling S5.

Evidence: fast-batch-22 merged to main 5f32ca8f; commits a1b6fbba, c5d8aff3. WorkOrder.new outside support: 87 sites in 73 files -> 1 (work_order_test.rb). Full suite 2904 runs, 0 failures. Memo docs/crc/os-sdlc/fast-batch-22/finding-d-work-order-fixture.md.

Follow-ups: none

## Resolution **Done:** WorkOrderFixture.build (DEFAULTS session-1/1/toy) replaces hand-built WorkOrder records in os-sdlc tests; overrides kept where a test relies on them; default-equal overrides dropped by ruling S5. **Evidence:** fast-batch-22 merged to main 5f32ca8f; commits a1b6fbba, c5d8aff3. WorkOrder.new outside support: 87 sites in 73 files -> 1 (work_order_test.rb). Full suite 2904 runs, 0 failures. Memo docs/crc/os-sdlc/fast-batch-22/finding-d-work-order-fixture.md. **Follow-ups:** none
jared closed this issue 2026-10-28 18:59:58 +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#1464
No description provided.