aws-samples / aws-samples/sample-autonomous-cloud-coding-agents
RFC: Checkpoint rewind and fork for off-track tasks
- Vorherrschende Sprache
- TypeScript
- Sterne
- 143
- Forks
- 46
- Ø Merge
- 3 T. 10 Std.
- Gemergte PRs (30 T.)
- 24
Beschreibung
## Primary area
Cross-cutting / multiple
## Related issue or feature request
- [WORKFLOWS.md](https://github.com/aws-samples/sample-autonomous-cloud-coding-agents/blob/main/docs/design/WORKFLOWS.md) — `workflow_state.json` checkpoints
- #252 (step-aware event supersede on orchestrator replay — distinct concern)
- #484 (S3-backed SDK session store — recommended before v1)
- #560 (workflow commit trailers — git lineage)
## Summary
Expose **operator-driven rewind and fork** for workflow execution: resume a terminal or failed task from an earlier completed step without full cold-start, or branch a new task from a checkpoint to explore an alternate approach.
```bash
bgagent rewind --list
bgagent rewind --to implement
bgagent fork --to plan
```
## Use case and motivation
When an agent goes off-track late in a workflow, operators re-submit tasks or manually check out branches — losing checkpoint context and burning cold-start cost. Rewind reduces waste; fork supports A/B exploration under audit.
Distinct from #252, which fixes **duplicate progress events** when the orchestrator replays durable steps — not operator-initiated rewind to an earlier workflow step.
## Proposal
1. Extend `workflow_state.json` (and TaskRecord metadata) with ordered checkpoint entries: `step_name`, `step_kind`, `sdk_session_id`, `git_commit_sha`, artifact pointers.
2. **Rewind:** new task pinned to checkpoint; skip completed deterministic steps; re-enter agent at selected step; `rewound_from` lineage.
3. **Fork:** same without archiving source; `forked_from` lineage.
4. CLI commands + orchestrator create-task path.
## Out of scope
- Automatic rewind on verify failure (#457)
- Per-step orchestrator durable checkpoints (agent-side only per ADR-014)
- Compensation/rollback of side effects (e.g. unpublish PR)
## Potential challenges
- Session resume without #484 may restart agent at turn 0 even if steps are skipped.
- `ensure_pr` / `deliver_artifact` idempotency on re-entry.
- Admission limits for new RUNNING tasks.
---
**Note:** Non-triaged RFCs may not get timely review. PRs on non-triaged issues might not be accepted.
Beitragsleitfaden
Rechercherichtung
Beginne mit dem Lesen von docs/design/WORKFLOWS.md und dem Checkpoint-Modell workflow_state.json. Verfolge anschließend die in der Proposal erwähnten CLI-Befehle und den create-task-Pfad des Orchestrators. Vergleiche das Design mit ADR-014 und den zugehörigen Issues #252, #484 und #560; als abgeschlossen würde ein abgestimmtes Design gelten, das Checkpoint-Metadaten, Rewind-/Fork-Abstammung, Session-Handhabung, Idempotenz und Admission-Limits abdeckt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- aws, git, typescript
- Bereich
- backend, cli, distributed-systems
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100