feat: add test-first validation gate in Do phase

This commit is contained in:
2026-04-04 07:35:19 +02:00
parent 7f99d52a09
commit 8af9db2c12
2 changed files with 48 additions and 0 deletions

View File

@@ -245,6 +245,28 @@ After Maker returns:
**Critical:** Verify the Maker committed its changes before proceeding. If uncommitted changes exist, instruct the Maker to commit.
#### 2a-ii. Test-First Validation
After Maker completes, check `do-maker-files.txt` for test files:
```bash
TEST_FILES=$(grep -iE '(test|spec)' ".archeflow/artifacts/${RUN_ID}/do-maker-files.txt" || true)
```
If `TEST_FILES` is empty and domain is not `writing`:
1. Check if `plan-creator.md` contains a `### Test Strategy` section
2. If yes: re-run Maker with targeted test instruction (one retry within Do phase)
3. If no test strategy specified: emit WARNING event and proceed
```bash
./lib/archeflow-event.sh "$RUN_ID" decision do "" \
'{"what":"test_first_gate","chosen":"<pass|warn|retry>","rationale":"<reason>"}' "$SEQ_MAKER_COMPLETE"
```
The re-run prompt for the retry case:
> "The proposal specified these test cases: <test strategy section>. No test files were found in your changes. Add the specified tests before finishing."
This is one retry within the Do phase, not a full PDCA cycle. If the retry also produces no tests, emit WARNING and proceed to Check.
#### 2b. Phase Transition: Do to Check
```bash