Require only Ruby files in the diff-test command #888

Closed
opened 2026-10-01 17:17:35 +00:00 by jared · 2 comments
Owner

Problem

The diff-test gate loads every changed file under the test root with require_relative, including YAML fixture maps. Ruby cannot load a YAML file, so the gate fails with LoadError whenever a ticket changes or adds a fixture under tests/fixtures/. A test-writer cannot get past its own gate on such a ticket.

Observed

In #872 implementation 1, test-writer dispatches 3 and 4 both failed the diff-test step with exit 1:

-e:1:in 'Kernel#require_relative': cannot load such file -- /home/jared/dev/cc-os/.claude/worktrees/ticket-872/plugins/os-sdlc/tests/fixtures/maps/agent_type_enrich.yaml (LoadError)

#872 Approach item 7 requires the fixture-map conversion, so no test-writer change can pass the gate.

Reproduce

n/a: needs a pipeline run whose diff changes a .yaml file under plugins/os-sdlc/tests/fixtures/maps/; the unit test below reproduces it through DiffTestPlan#command.

Approach

DiffTestPlan#test_paths keeps only Ruby files: add path.end_with?(".rb") to the existing select in plugins/os-sdlc/lib/os_sdlc/model/diff_test_plan.rb. A changed fixture alone then gives no file to require. The other Project::Changes#test_paths consumers do not change.

Required work:

  1. Require only Ruby test files in the diff-test command — check: present end_with?(".rb") in plugins/os-sdlc/lib/os_sdlc/model/diff_test_plan.rb

Rejected: filter in Project::Changes#test_paths — other consumers read that list, and the defect is only in what the plan requires.

Acceptance criteria

  1. Given changes that include a Ruby test file and a YAML fixture under the test root, when the diff-test command is built, then it requires the Ruby test file and does not name the YAML file.
  2. Given changes whose only test-root change is a YAML fixture and no unmapped code, when the diff-test command is built, then the command is nil.

Owner sketch

class OsSdlc::DiffTestPlan
  def command
  private
  def test_paths # Ruby files only
end

Origin

  • Trigger: /os-sdlc:implement 872 (implementation 1), 2026-10-01
  • Improvised this session: none; #872 waits for this fix (WIP commit 58f1eb3f on branch ticket-872)
  • Chain: test-writer gate fails with LoadError ← DiffTestPlan#test_paths keeps every existing changed path under the test root (diff_test_plan.rb:41) ← Project::Test#include? is a prefix test (model/project/test.rb:10) ← DESIGN (plugins/os-sdlc/lib/os_sdlc/model/diff_test_plan.rb)
  • Root candidate: none
  • Where: plugins/os-sdlc/lib/os_sdlc/model/diff_test_plan.rb
  • Session: 48007765-88b8-473d-a30b-3a551275ef48
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/48007765-88b8-473d-a30b-3a551275ef48.jsonl

VERDICT: CREATE — confirmed in diff_test_plan.rb:41; blocks the user-filed #872 (ticket-skeptic, 2026-10-01).

## Problem The `diff-test` gate loads every changed file under the test root with `require_relative`, including YAML fixture maps. Ruby cannot load a YAML file, so the gate fails with `LoadError` whenever a ticket changes or adds a fixture under `tests/fixtures/`. A test-writer cannot get past its own gate on such a ticket. ## Observed In #872 implementation 1, test-writer dispatches 3 and 4 both failed the `diff-test` step with exit 1: ``` -e:1:in 'Kernel#require_relative': cannot load such file -- /home/jared/dev/cc-os/.claude/worktrees/ticket-872/plugins/os-sdlc/tests/fixtures/maps/agent_type_enrich.yaml (LoadError) ``` #872 Approach item 7 requires the fixture-map conversion, so no test-writer change can pass the gate. ## Reproduce n/a: needs a pipeline run whose diff changes a `.yaml` file under `plugins/os-sdlc/tests/fixtures/maps/`; the unit test below reproduces it through `DiffTestPlan#command`. ## Approach `DiffTestPlan#test_paths` keeps only Ruby files: add `path.end_with?(".rb")` to the existing `select` in `plugins/os-sdlc/lib/os_sdlc/model/diff_test_plan.rb`. A changed fixture alone then gives no file to require. The other `Project::Changes#test_paths` consumers do not change. Required work: 1. Require only Ruby test files in the diff-test command — check: present `end_with?(".rb")` in `plugins/os-sdlc/lib/os_sdlc/model/diff_test_plan.rb` Rejected: filter in `Project::Changes#test_paths` — other consumers read that list, and the defect is only in what the plan requires. ## Acceptance criteria 1. Given changes that include a Ruby test file and a YAML fixture under the test root, when the diff-test command is built, then it requires the Ruby test file and does not name the YAML file. 2. Given changes whose only test-root change is a YAML fixture and no unmapped code, when the diff-test command is built, then the command is nil. ## Owner sketch ```ruby class OsSdlc::DiffTestPlan def command private def test_paths # Ruby files only end ``` ## Origin - Trigger: /os-sdlc:implement 872 (implementation 1), 2026-10-01 - Improvised this session: none; #872 waits for this fix (WIP commit 58f1eb3f on branch ticket-872) - Chain: test-writer gate fails with LoadError ← `DiffTestPlan#test_paths` keeps every existing changed path under the test root (`diff_test_plan.rb:41`) ← `Project::Test#include?` is a prefix test (`model/project/test.rb:10`) ← DESIGN (`plugins/os-sdlc/lib/os_sdlc/model/diff_test_plan.rb`) - Root candidate: none - Where: plugins/os-sdlc/lib/os_sdlc/model/diff_test_plan.rb - Session: 48007765-88b8-473d-a30b-3a551275ef48 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/48007765-88b8-473d-a30b-3a551275ef48.jsonl VERDICT: CREATE — confirmed in diff_test_plan.rb:41; blocks the user-filed #872 (ticket-skeptic, 2026-10-01).
Author
Owner

Work started on branch ticket-888 (os-sdlc pipeline, map poodr-ticket-implementation).

Work started on branch ticket-888 (os-sdlc pipeline, map poodr-ticket-implementation).
Author
Owner

Resolution

Done: DiffTestPlan#test_paths keeps only Ruby files; the diff-test command no longer requires YAML fixtures (both ACs tested).

Evidence: main f128fdcd (Runner commit, implementation 1 implementation_complete, 8 dispatches, 0 retries), 2f86fb08 History row; bin/test on main: 9 suites passed.

Follow-ups: none

## Resolution **Done:** DiffTestPlan#test_paths keeps only Ruby files; the diff-test command no longer requires YAML fixtures (both ACs tested). **Evidence:** main f128fdcd (Runner commit, implementation 1 implementation_complete, 8 dispatches, 0 retries), 2f86fb08 History row; bin/test on main: 9 suites passed. **Follow-ups:** none
jared closed this issue 2026-10-01 17:23:26 +00:00
jared referenced this issue from a commit 2026-10-01 18:24:32 +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#888
No description provided.