Problem
The automated spec generator used by owloop go can produce specs that are invalid or self-defeating, which causes the autonomous loop to stall or waste iterations.
Observed in a real refactor run on xyz-data-website:
- Generated specs were missing the
# Title / front-matter title, so the spec table showed truncated filenames instead of readable titles.
- The
## Exclusions section listed the very files the spec needed to modify (e.g. the target API file was excluded from modification), making the task impossible to complete.
- Acceptance criteria sometimes referenced shell commands that did not match the actual project layout (e.g. wrong paths or missing test commands).
- Ruff/test baselines written into specs did not match the actual measured baselines on the target branch, forcing the implementation agent to re-measure every time.
Root cause
The spec generator performs static investigation (reading files, grepping, counting call sites) but does not execute the acceptance criteria commands or verify consistency before writing specs to disk. As a result, specs contain plausible-looking but incorrect numbers and contradictory constraints.
Suggested fixes
-
Add a spec validation / grounding pass after the worktree is created and before the autonomous loop starts.
- Verify every shell command in the spec is syntactically valid and executable in the worktree.
- Measure actual ruff / pytest baselines on the unmodified target files and update the spec accordingly.
- Ensure
## Files and ## Exclusions do not overlap.
- Ensure the title field is present and non-empty.
- Resolve all
Depends On references to existing spec files.
-
If validation fails, stop and surface the problem instead of entering the loop.
- Either regenerate the offending spec or ask the user for confirmation.
- Do not let an invalid spec burn implementation iterations.
-
Keep the rule that the loop agent cannot edit specs, but give the pre-loop validator permission to reject or request regeneration.
-
Add test coverage for the spec generator that includes pathological cases (overlapping Files/Exclusions, missing titles, bad commands, stale baselines).
Related
Problem
The automated spec generator used by
owloop gocan produce specs that are invalid or self-defeating, which causes the autonomous loop to stall or waste iterations.Observed in a real refactor run on
xyz-data-website:# Title/ front-matter title, so the spec table showed truncated filenames instead of readable titles.## Exclusionssection listed the very files the spec needed to modify (e.g. the target API file was excluded from modification), making the task impossible to complete.Root cause
The spec generator performs static investigation (reading files, grepping, counting call sites) but does not execute the acceptance criteria commands or verify consistency before writing specs to disk. As a result, specs contain plausible-looking but incorrect numbers and contradictory constraints.
Suggested fixes
Add a spec validation / grounding pass after the worktree is created and before the autonomous loop starts.
## Filesand## Exclusionsdo not overlap.Depends Onreferences to existing spec files.If validation fails, stop and surface the problem instead of entering the loop.
Keep the rule that the loop agent cannot edit specs, but give the pre-loop validator permission to reject or request regeneration.
Add test coverage for the spec generator that includes pathological cases (overlapping Files/Exclusions, missing titles, bad commands, stale baselines).
Related