fix(executor): add completion verification to prevent hallucinated success (#315)
Executor self-check after SUMMARY.md creation verifies key-files exist on disk and commit hashes exist in git log. Orchestrator spot-checks SUMMARY claims before trusting and proceeding to next wave. Segmented execution (execute-plan.md) gets the same self-check inline.
This commit is contained in:
@@ -337,6 +337,20 @@ Execute each wave in sequence. Autonomous plans within a wave run in parallel **
|
||||
- Read SUMMARY.md to extract what was built
|
||||
- Note any issues or deviations
|
||||
|
||||
**Spot-check claims before trusting SUMMARY:**
|
||||
|
||||
For each completed plan's SUMMARY.md:
|
||||
- Pick the first 2 files from `key-files.created` frontmatter — verify they exist on disk with `[ -f ]`
|
||||
- Check `git log --oneline --all --grep="{phase}-{plan}"` returns at least 1 commit
|
||||
- Check SUMMARY.md for `## Self-Check: FAILED` marker
|
||||
|
||||
If ANY spot-check fails:
|
||||
- Do NOT proceed silently
|
||||
- Report which plan failed verification and what was missing
|
||||
- Route to failure handler (step 4): ask user "Retry plan?" or "Continue with remaining waves?"
|
||||
|
||||
If spot-checks pass: proceed normally.
|
||||
|
||||
**Output:**
|
||||
```
|
||||
---
|
||||
|
||||
@@ -460,6 +460,13 @@ For Pattern A (fully autonomous) and Pattern C (decision-dependent), skip this s
|
||||
|
||||
D. Report completion
|
||||
|
||||
E. Self-check the aggregated SUMMARY:
|
||||
- Parse `key-files.created` from the SUMMARY frontmatter
|
||||
- Verify first 2 files exist on disk with `[ -f ]`
|
||||
- Check `git log --oneline --all --grep="{phase}-{plan}"` returns at least 1 commit
|
||||
- If any check fails: append `## Self-Check: FAILED` section to SUMMARY listing missing items
|
||||
- If all pass: append `## Self-Check: PASSED`
|
||||
|
||||
**Example execution trace:**
|
||||
|
||||
````
|
||||
|
||||
Reference in New Issue
Block a user