Skip to content

feat: persist run and task checkpoints (#48) - #51

Merged
sametcelikbicak merged 1 commit into
mainfrom
feat/48-run-checkpoints
Oct 28, 2026
Merged

sametcelikbicak merged 1 commit into
mainfrom
feat/48-run-checkpoints

Conversation

@sametcelikbicak

@sametcelikbicak sametcelikbicak commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

Adds durable run and task checkpoints under .team/runs/ so the orchestrator can continue after compaction, a restart or an interrupted tool call without repeating completed work or skipping unfinished work.

  • Append-only JSON: one run.json, one event file per task start/finish, one approval file per human gate. Writes are atomic (temp file + os.replace).
  • Unique run ids and task ids, separate from reusable stage names. Attempt history is preserved.
  • run_state.py commands: start-run, start-task, finish-task, retry, approve, status. status is read-only and is the resume entry point.
  • Approval is tied to the artifact SHA-256; changing the artifact makes the approval stale. An artifact on disk is not approval.
  • Existing projects start with no run and no approvals; old artifacts are reviewed, not assumed approved.
  • The orchestrator reads status at session start and after compaction, records each dispatch and finish, retries explicitly, and records human approval only after the gate.
  • Limits are documented: no automatic process restart, no exactly-once external side effects, one active run per project.

Files

  • skills/team-memory/run_state.py — stdlib-only helper.
  • scripts/test-run-state.py — 34-check self-test (also runs on Windows CI).
  • agents/orchestrator.md, skills/team-memory/SKILL.md, commands/team.md, commands/team-status.md — protocol and resume behavior.
  • docs/runs.md, docs/memory.md, docs/pipeline.md, README.md, README.tr.md, team/AGENTS.md — documentation.
  • .github/workflows/checks.yml — checkpoint test on Ubuntu and Windows.
  • TESTING-RUNS.md — verification results, manual scenarios and limits.

Verification

Check Result
python3 scripts/test-run-state.py pass, 34 checks
ruby scripts/validate.rb pass, 47 files OK
./scripts/test-memory-compact.sh pass
bash -n install.sh scripts/*.sh skills/team-memory/*.sh pass
./scripts/smoke-install.sh pass
npm run generate:reference pass
npm run docs:build pass

Manual OpenCode scenarios that need a live session (fresh /team, real context compaction) were not run in this environment; TESTING-RUNS.md marks them as pending instead of claiming a result.

Acceptance criteria

  • Durable unique run and task attempt identity.
  • Record before dispatch and terminal outcome after execution.
  • Startup/resume reads checkpoints before dispatching through the orchestrator instructions and status; there is no runtime hook, and the orchestrator must run it.
  • Completed tasks are not rerun after context loss.
  • Running attempts are reported as uncertain; the orchestrator reconciles before retrying and does not mark them completed.
  • Failed/interrupted attempts retry explicitly with history and a next action.
  • Human approval is preserved; artifact existence alone is not approval.
  • Atomic writes; concurrent tasks use distinct files; same-attempt races are reported as conflicts.
  • Existing projects initialize safely without old approvals.
  • Test continuation after context loss. Automated tests use a fresh process per scenario and cover state recovery, interruption, completed-task recovery, failed retry, approval invalidation and malformed state. A live OpenCode compaction was not run; it is accepted as equivalent to the fresh-process/fresh-session recovery tests (see TESTING-RUNS.md).
  • Limits are documented.

Closes #48

@sametcelikbicak
sametcelikbicak merged commit b697b4b into main Oct 28, 2026
7 checks passed
@sametcelikbicak
sametcelikbicak deleted the feat/48-run-checkpoints branch October 28, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Persist run and task checkpoints for reliable continuation after compaction or interruption

1 participant