R8 of cleanup R-a (plan .claude/projects/2026-11-07-cleanup-r-a, appendix A). The live tests of the round files move into the test named after their source; each moved test was seen red under a mutation of its source. New: tests/lib/lib-imports.test.mjs, tests/lib/timing.test.mjs (from timing-under-load). The [#1] --gates rule and shim-line pins move into tests/lib/autonomy-gate.test.mjs. Removed: the round test files (retterunde, retterunde-prose-pins, trial-mechanical-fixes, trial2-fixes, trial2-minor, trial2-minor-prose-pins, fix-round-4-5a-prose, fix-round-4-5b2-b-prose, timing-under-load), the 8 R8 e2e scripts, and seven round test files on the R-a removal list that pinned them (fix-round-4-5b-prose, fix-round-4-5b-part-2/3/4-scripts, fix-round-4-5b-part-4-prose, fix-round-4-5b2-b/c-scripts). The diff-mode e2e pin (test 24) and the red-script round-wrapper cases go too. tests/synthetic/plan-run-C.md becomes tests/fixtures/plan-run-c.md, regenerated from buildPlan({ version: '1.9' }). The red judge, reporter and judge test headers now name the shared red script. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2.6 KiB
2.6 KiB
Test plan
Plan quality: A (92/100) — APPROVE
Generated by trekplan v6.1.1 on 2026-10-06 —
plan_version: 1.9·ceremony: architectural
Context
Why: the brief asks for a parser CLI.
Design
Architecture
Two modules: a parser and a CLI on top of it.
Data Flow
CLI argv → parser → result JSON on stdout.
Interfaces
parse(text) → {ok, items}
Data Models
Item = {name: string, n: number}
Error Handling
Unreadable input → exit 2; invalid input → exit 1.
Module Map
graph TD
cli[src/cli.mjs] --> parser[src/parser.mjs]
parser --> util[src/util.mjs]
Architecture Rules
| Rule | Enforced by | Proof |
|---|---|---|
| The parser never imports the CLI | checked by node_modules/.bin/depcruise --config .dependency-cruiser.cjs src |
Step 1 |
| Prefer pure functions in the parser | advisory — .claude/rules/parser.md |
— |
Requirements Check
No conflicts or gaps found between the brief's requirements.
Implementation Plan
Step 1: Build module 1
- Files:
src/mod1.mjs - Changes: Add
run1()tosrc/mod1.mjs. (new file) - Test first:
- File:
tests/mod1.test.mjs(new) - Verifies: run1() returns the value the next step reads
- Pattern:
tests/lib/plan-schema.test.mjs
- File:
- Verify:
node --test tests/mod1.test.mjs→ expected: pass - On failure: revert —
git checkout -- src/mod1.mjs - Checkpoint:
git commit -m "feat(x): step 1" - Manifest:
manifest: expected_paths: - src/mod1.mjs - tests/mod1.test.mjs min_file_count: 2 commit_message_pattern: "^feat\\(x\\):" bash_syntax_check: [] forbidden_paths: [] must_contain: []
Step 2: Build module 2
- Files:
src/mod2.mjs - Changes: Add
run2()tosrc/mod2.mjs. (new file) - Test first:
- File:
tests/mod2.test.mjs(new) - Verifies: run2() returns the value the next step reads
- Pattern:
tests/lib/plan-schema.test.mjs
- File:
- End-to-end:
bash tests/e2e.sh→ expected: exit 0 and the CLI prints a result - Verify:
node --test tests/mod2.test.mjs→ expected: pass - On failure: revert —
git checkout -- src/mod2.mjs - Checkpoint:
git commit -m "feat(x): step 2" - Manifest:
manifest: expected_paths: - src/mod2.mjs - tests/mod2.test.mjs min_file_count: 2 commit_message_pattern: "^feat\\(x\\):" bash_syntax_check: [] forbidden_paths: [] must_contain: []
Test Strategy
- Framework: node:test
Verification
npm test→ expected: exit 0bash tests/e2e.sh→ expected: exit 0