Replace hand-built ticket bodies and project.yaml Hashes in os-sdlc tests with fixtures #1461

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

Replace hand-built ticket bodies and project.yaml Hashes in os-sdlc tests with fixtures [capture]

Problem

16 os-sdlc test files hand-build a complete ticket body, and 6 hand-build a project.yaml Hash with targets. TicketFixture and ProjectScenario#write_multi_target_project_yaml already exist. The hand-built copies drift from the real record shape.

Approach

Measurement, run from plugins/os-sdlc (baseline at d5cf9f96 is yaml=10 body=16):

printf 'yaml=%s body=%s\n' "$(grep -rlE '"targets" *=> *\{|^ *targets:$|\\ntargets:|targets:\\n' --include='*.rb' tests eval/ticket-takedown/test | xargs -r grep -l 'project\.yaml' | grep -vc 'support/project_scenario\.rb')" "$(grep -rl '## Problem' --include='*.rb' tests | xargs -r grep -l '## Acceptance criteria' | grep -vc 'support/ticket_fixture\.rb')"

Required work:

  1. Replace each hand-built complete ticket body with TicketFixture.complete_body, without, or with_required_work. Sites: tests/ticket_shape_parity_test.rb, tests/implementation_map_digest_test.rb, tests/support/design_placement_scenario.rb, tests/support/mutation_check_scenario.rb, tests/support/unchanged_check_scenario.rb, tests/command/required_work_typed_check_test.rb, tests/command/implementation/reroute_refresh_test.rb, tests/command/implementation/reroute_target_path_check_test.rb, tests/implementation/open_category_test.rb, tests/implementation/open_retired_tests_test.rb, tests/implementation/open_structure_change_test.rb, tests/implementation/open_design_base_test.rb, tests/implementation/open_map_name_test.rb, tests/implementation/open_flagged_ticket_shape_test.rb, tests/implementation/open_retires_file_entries_test.rb, tests/implementation/open_ticket_shape_test.rb — check: absent COMPLETE_BODY = in plugins/os-sdlc/tests/implementation/*.rb
  2. Replace each hand-built project.yaml Hash with write_multi_target_project_yaml. Sites: tests/crc_boot_entry_test.rb, tests/support/fast_gate_scenario.rb, tests/support/crc_census_scenario.rb, tests/project/config_test.rb, tests/project/config_load_selected_test.rb, tests/crc/placement_rulings_boot_test.rb — check: absent "targets" => in plugins/os-sdlc/tests/crc_boot_entry_test.rb

Keep a literal only where the text is the input under test, for example a body that a shape test must break on purpose. Record each kept literal as a kept row in the batch-state file.

Cop decision rule: after the first pipeline batch that writes tests following ticket 5, run the measurement again. If yaml or body rises above the post-ticket-5 value, file a cop for that record through mine-lints. If both stay flat, file no cop and close #1019.

Route: fast-batch. File the body finding and the yaml finding as separate findings.

Acceptance criteria

  1. Given the suite after the change, when it runs, then it is green and no assertion changed.
  2. Given the measurement command, when run from plugins/os-sdlc after the change, then body equals 0 plus the kept rows and yaml equals 4.

Owner sketch

module TicketFixture
  def self.complete_body(**sections); end
end

class ProjectScenario
  def write_multi_target_project_yaml(targets:, **shared); end
end

Non-goals

  • Do not touch the 4 takedown eval sites. Ticket 5 does that.
  • Do not rename the three FakeRunner fakes.

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/tests/support/ticket_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
Depends on: #1459, #1460

# Replace hand-built ticket bodies and project.yaml Hashes in os-sdlc tests with fixtures [capture] ## Problem 16 os-sdlc test files hand-build a complete ticket body, and 6 hand-build a project.yaml Hash with targets. `TicketFixture` and `ProjectScenario#write_multi_target_project_yaml` already exist. The hand-built copies drift from the real record shape. ## Approach Measurement, run from `plugins/os-sdlc` (baseline at d5cf9f96 is `yaml=10 body=16`): ``` printf 'yaml=%s body=%s\n' "$(grep -rlE '"targets" *=> *\{|^ *targets:$|\\ntargets:|targets:\\n' --include='*.rb' tests eval/ticket-takedown/test | xargs -r grep -l 'project\.yaml' | grep -vc 'support/project_scenario\.rb')" "$(grep -rl '## Problem' --include='*.rb' tests | xargs -r grep -l '## Acceptance criteria' | grep -vc 'support/ticket_fixture\.rb')" ``` Required work: 1. Replace each hand-built complete ticket body with `TicketFixture.complete_body`, `without`, or `with_required_work`. Sites: `tests/ticket_shape_parity_test.rb`, `tests/implementation_map_digest_test.rb`, `tests/support/design_placement_scenario.rb`, `tests/support/mutation_check_scenario.rb`, `tests/support/unchanged_check_scenario.rb`, `tests/command/required_work_typed_check_test.rb`, `tests/command/implementation/reroute_refresh_test.rb`, `tests/command/implementation/reroute_target_path_check_test.rb`, `tests/implementation/open_category_test.rb`, `tests/implementation/open_retired_tests_test.rb`, `tests/implementation/open_structure_change_test.rb`, `tests/implementation/open_design_base_test.rb`, `tests/implementation/open_map_name_test.rb`, `tests/implementation/open_flagged_ticket_shape_test.rb`, `tests/implementation/open_retires_file_entries_test.rb`, `tests/implementation/open_ticket_shape_test.rb` — check: absent `COMPLETE_BODY = ` in `plugins/os-sdlc/tests/implementation/*.rb` 2. Replace each hand-built project.yaml Hash with `write_multi_target_project_yaml`. Sites: `tests/crc_boot_entry_test.rb`, `tests/support/fast_gate_scenario.rb`, `tests/support/crc_census_scenario.rb`, `tests/project/config_test.rb`, `tests/project/config_load_selected_test.rb`, `tests/crc/placement_rulings_boot_test.rb` — check: absent `"targets" => ` in `plugins/os-sdlc/tests/crc_boot_entry_test.rb` Keep a literal only where the text is the input under test, for example a body that a shape test must break on purpose. Record each kept literal as a kept row in the batch-state file. Cop decision rule: after the first pipeline batch that writes tests following ticket 5, run the measurement again. If `yaml` or `body` rises above the post-ticket-5 value, file a cop for that record through mine-lints. If both stay flat, file no cop and close #1019. Route: fast-batch. File the body finding and the yaml finding as separate findings. ## Acceptance criteria 1. Given the suite after the change, when it runs, then it is green and no assertion changed. 2. Given the measurement command, when run from `plugins/os-sdlc` after the change, then `body` equals 0 plus the kept rows and `yaml` equals 4. ## Owner sketch ```ruby module TicketFixture def self.complete_body(**sections); end end class ProjectScenario def write_multi_target_project_yaml(targets:, **shared); end end ``` ## Non-goals - Do not touch the 4 takedown eval sites. Ticket 5 does that. - Do not rename the three `FakeRunner` fakes. ## 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/tests/support/ticket_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 Depends on: #1459, #1460
Author
Owner

Resolution

Done: 13 hand-built ticket bodies now come from TicketFixture and 6 hand-built project.yaml sites from ProjectScenario#write_multi_target_project_yaml. 12 literals kept as parser inputs (ticket_shape_parity_test 9 constants; open_ticket_shape_test NO_LISTED_CASE_BODY, CONTEXT_AS_PROBLEM_BODY; open_design_base_test). Duplicate success test in open_ticket_shape_test deleted (ruling R1, predicted 90).

Evidence: fast-batch-21 commits 94da30c7 8e635f3b + fix list, merged to main 70ecc103; measurement from plugins/os-sdlc: yaml=10→4 (all 4 in eval/ticket-takedown, owned by #1011), body=16→3 (kept files only); full suite 2903 runs 0 failures; memo docs/crc/os-sdlc/fast-batch-21/finding-c-body-and-yaml-copies.md with the kept-rows table

Follow-ups: none; the 4 eval sites are an occurrence on #1011; the cop re-measure is on #1019

## Resolution **Done:** 13 hand-built ticket bodies now come from TicketFixture and 6 hand-built project.yaml sites from ProjectScenario#write_multi_target_project_yaml. 12 literals kept as parser inputs (ticket_shape_parity_test 9 constants; open_ticket_shape_test NO_LISTED_CASE_BODY, CONTEXT_AS_PROBLEM_BODY; open_design_base_test). Duplicate success test in open_ticket_shape_test deleted (ruling R1, predicted 90). **Evidence:** fast-batch-21 commits 94da30c7 8e635f3b + fix list, merged to main 70ecc103; measurement from plugins/os-sdlc: yaml=10→4 (all 4 in eval/ticket-takedown, owned by #1011), body=16→3 (kept files only); full suite 2903 runs 0 failures; memo docs/crc/os-sdlc/fast-batch-21/finding-c-body-and-yaml-copies.md with the kept-rows table **Follow-ups:** none; the 4 eval sites are an occurrence on #1011; the cop re-measure is on #1019
jared closed this issue 2026-10-28 16:46:20 +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#1461
No description provided.