Instruct test-writer to split tests by independent AC so shard-plan can parallelize #271

Open
opened 2026-08-04 21:04:00 +00:00 by jared · 2 comments
Owner

Context

Recent implement runs dispatch a single programmer despite the sharding pipeline. Investigation (2026-08-04) showed shard_plan.rb maps one test file to one shard (unchanged since 12d76a2) and plugins/os-sdlc/agents/test-writer.md gives no file-organization guidance, so it usually writes one test file per ticket — single shard, working as designed but defeating the parallel-programmers intent. Fix is prompt-side: add a rule to test-writer.md to write one test file per independent acceptance criterion/concern; existing shard-plan overlap/reserved-set handling already supports multi-file output.

## Context Recent implement runs dispatch a single programmer despite the sharding pipeline. Investigation (2026-08-04) showed shard_plan.rb maps one test file to one shard (unchanged since 12d76a2) and plugins/os-sdlc/agents/test-writer.md gives no file-organization guidance, so it usually writes one test file per ticket — single shard, working as designed but defeating the parallel-programmers intent. Fix is prompt-side: add a rule to test-writer.md to write one test file per independent acceptance criterion/concern; existing shard-plan overlap/reserved-set handling already supports multi-file output.
Author
Owner

Spec (verified unimplemented 2026-08-06; ready-for-agent):

Root cause: lib/os_sdlc/shard_plan.rb:48-52 already maps one shard per test file (correct, do not touch). But agents/test-writer.md gives no file-organization guidance, so the test-writer emits one test file per ticket — collapsing every plan to a single shard/programmer and defeating the parallel-sharding machinery.

Seam: the "Rules" bullet list in plugins/os-sdlc/agents/test-writer.md. Prompt-only change; no Ruby changes.

Tasks:

  1. Add a rule to test-writer.md Rules: identify the independent acceptance criteria/concerns in the ticket and write one test file per independent concern (following the target test path's existing naming/module conventions); return the full file list. Include a guard against over-splitting: criteria that exercise the same collaborators belong in one file (shard-plan's overlap handling and fallback_to_single_programmer? make artificial splits pointless).
  2. Run bin/refresh-plugins from the repo root so the edit reaches sessions.

Acceptance criteria:

  • test-writer.md contains the new rule; wording is a behavioral instruction only — no gate/sequencing logic in the prompt (per ADR-0097 / os-sdlc Forbidden Moves).
  • No changes to shard_plan.rb or any lib/ code; full suite stays green (ruby tests/all.rb from plugins/os-sdlc).
  • Spot-check: given a multi-AC ticket, a test-writer dispatch emits >1 test file and shard-plan then yields >1 shard (run-based verification; no unit test pins prompt content).
Spec (verified unimplemented 2026-08-06; ready-for-agent): **Root cause:** `lib/os_sdlc/shard_plan.rb:48-52` already maps one shard per test file (correct, do not touch). But `agents/test-writer.md` gives no file-organization guidance, so the test-writer emits one test file per ticket — collapsing every plan to a single shard/programmer and defeating the parallel-sharding machinery. **Seam:** the "Rules" bullet list in `plugins/os-sdlc/agents/test-writer.md`. Prompt-only change; no Ruby changes. **Tasks:** 1. Add a rule to test-writer.md Rules: identify the independent acceptance criteria/concerns in the ticket and write one test file per independent concern (following the target test path's existing naming/module conventions); return the full file list. Include a guard against over-splitting: criteria that exercise the same collaborators belong in one file (shard-plan's overlap handling and `fallback_to_single_programmer?` make artificial splits pointless). 2. Run `bin/refresh-plugins` from the repo root so the edit reaches sessions. **Acceptance criteria:** - test-writer.md contains the new rule; wording is a behavioral instruction only — no gate/sequencing logic in the prompt (per ADR-0097 / os-sdlc Forbidden Moves). - No changes to shard_plan.rb or any lib/ code; full suite stays green (`ruby tests/all.rb` from plugins/os-sdlc). - Spot-check: given a multi-AC ticket, a test-writer dispatch emits >1 test file and shard-plan then yields >1 shard (run-based verification; no unit test pins prompt content).
Author
Owner

Frozen in the 2026-08-16 backlog reset — see #419 for the expiry procedure. Do not work unless a live run rediscovers this issue.

Frozen in the 2026-08-16 backlog reset — see #419 for the expiry procedure. Do not work unless a live run rediscovers this issue.
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#271
No description provided.