Skip to content

feat: git snapshot + revert before each EXECUTE retry #65

@dougss

Description

@dougss

Summary

Before each EXECUTE attempt in retry loop, snapshot worktree state. On validation failure, revert to clean state before next attempt — prevents executor from inheriting broken code.

Current State

  • runPipeline() loops EXECUTE↔VALIDATE with previousError text only
  • No state cleanup between retries — executor starts from dirty state of failed attempt

Plan

  1. Create src/core/snapshot.ts:
    • createSnapshot(repoPath): string — lightweight git tag
    • restoreSnapshot(repoPath, ref): voidgit checkout + clean
    • cleanupSnapshot(repoPath, ref): void — remove tag
  2. In runPipeline(), snapshot before retry loop, restore on failure
  3. Cleanup on success or final failure

Files

  • src/core/snapshot.ts (NEW)
  • src/core/pipeline.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Critical priorityenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions