fix(execute): every test file on the Test first line is read, locked and copied
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
6f342a2cdc
commit
8bf97cc834
4 changed files with 129 additions and 13 deletions
|
|
@ -35,10 +35,14 @@ and never touch a file the step does not list.
|
|||
|
||||
1. **Test first.** Read the step's `Test first:` and write that test (and only
|
||||
that test) first. Follow the `Pattern:` file's style when one is named.
|
||||
The step's test files are every file on the `Test first:` `File:` line
|
||||
(below plan_version 1.9 every backticked span on that line with the shape
|
||||
of a path; from 1.9 the backticked paths the line opens with).
|
||||
Then register every new file you created so the executor's diff sees it:
|
||||
`git add --intent-to-add -- <path>` (this stages nothing).
|
||||
2. **Prove it red before you build.** Run, from the repository root:
|
||||
`node {voyage_root}/lib/verification/red-proof.mjs --red-only --base {start_sha} --cmd "<the step's Verify command>" --tests <test files as ONE comma-separated argument: a,b> --plan "{plan}" --step {step}`
|
||||
(`--tests` lists every file on the `Test first:` `File:` line.)
|
||||
Exit 0 = the test fails at the start point: continue. Exit 1 = the test
|
||||
already passes at the start point, so it proves nothing: rewrite the test
|
||||
until it fails for the reason the step exists, and run the check again.
|
||||
|
|
@ -58,7 +62,8 @@ and never touch a file the step does not list.
|
|||
3. **Lock the tests** (when the CLI exists):
|
||||
`node {voyage_root}/lib/util/test-lock.mjs lock --files <test files> --step {step} --cmd "{Verify command}"`
|
||||
(the lock stores the step's test command; only that command can later
|
||||
mark the step green).
|
||||
mark the step green). `--files` lists every file on the `Test first:`
|
||||
`File:` line, the same list as `--tests`.
|
||||
If the file does not exist, write "not-locked (test-lock.mjs missing)" in the
|
||||
report. Never silent. Once locked you cannot edit the tests, and that is the
|
||||
point: the code changes to meet the test, never the reverse.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue