Skip to content

Per-issue state markers and resume-or-reset crash recovery #24

Description

@Ryan-Atkinson87

Implement per-issue state markers and the resume-or-reset crash-recovery rule (Spec §18.3, §18.4). The engine writes a marker per in-flight issue recording the last completed wave-loop step; on restart it reads markers and either resumes (deterministic/idempotent step) or discards-and-restarts (died mid-AI-session). Deferred here from Phase 2 because it consumes the wave-loop steps defined in this phase.

Spec §18.3 (per-issue state markers), §18.4 (mid-AI-session crash: discard and restart), §18.2 (stopping points table), §18.1 (recovery principle — git/GitHub is truth, markers are hints).

Acceptance criteria

  • A per-issue marker persisted in the engine's own SQLite (SQLite state store: schema baseline, WAL mode, connection management #3), not the trackers, recording the last completed wave-loop step (Spec §4.2 steps a–h) for each in-flight issue.
  • On restart, recovery reads markers and, per issue, resumes at the next step if the last completed step was deterministic and idempotent, or resets the issue if it died mid-AI-session (§18.3).
  • Discard-and-restart (§18.4): if a feature branch has uncommitted changes, or commits but no opened internal PR, the branch is discarded and the issue restarts clean from the agent branch — the partial diff is not salvaged or preserved (confirmed policy).
  • Markers are treated as hints only: if a marker disagrees with git/GitHub, git wins (§18.1). Recovery never trusts a marker over observed git state.
  • The §18.2 stopping-points table is implemented as the recovery decision logic (each "Died during" row → its recovery action).
  • Recovery evaluates only in-flight issues (bounded by the concurrency cap, Wave concurrency scheduler (parallel-across-repos, serialised merge queue, configurable cap) #25), not the whole wave.
  • Tests: marker write/read; resume after an idempotent step (test gate re-run); reset after a mid-implement crash discards the branch; a marker contradicting git defers to git.

Notes

This is the engine's crash log, distinct from board state. It pairs with the concurrency scheduler (#25), which bounds how many issues can ever be in flight.

Depends on: #3

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions