Problem
validateAfterExecution runs after the tool already wrote the file. On failure it only marks the step success: false; rollback is conditional on step.validation.some(v => v.required) — and LLM-generated plans routinely emit an empty validation array. Net effect: the invalid file stays on disk.
Evidence
In the frozen 30-task benchmark (benchmarks/results/2026-07-12-sdd-ablation.md), markdown code fences were written verbatim into .tsx files and persisted, failing tsc with TS1127: Invalid character — in both arms, with the guard active.
Fix options
- Validate generated content before the write (preferred: no bad state ever exists).
- Or roll back unconditionally when post-write validation fails, regardless of
step.validation.
Add a regression test: a create/patch step whose content is syntactically invalid must not leave the file on disk.
Problem
validateAfterExecutionruns after the tool already wrote the file. On failure it only marks the stepsuccess: false; rollback is conditional onstep.validation.some(v => v.required)— and LLM-generated plans routinely emit an emptyvalidationarray. Net effect: the invalid file stays on disk.Evidence
In the frozen 30-task benchmark (
benchmarks/results/2026-07-12-sdd-ablation.md), markdown code fences were written verbatim into.tsxfiles and persisted, failingtscwithTS1127: Invalid character— in both arms, with the guard active.Fix options
step.validation.Add a regression test: a create/patch step whose content is syntactically invalid must not leave the file on disk.