Skip to content

Spec auto-generator emits invalid specs with missing titles and self-contradictory Exclusions #73

Description

@caoergou

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

  1. 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.
  2. 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.
  3. Keep the rule that the loop agent cannot edit specs, but give the pre-loop validator permission to reject or request regeneration.

  4. Add test coverage for the spec generator that includes pathological cases (overlapping Files/Exclusions, missing titles, bad commands, stale baselines).

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions