Skip to content

feat(runtime): Phase G RestorePoint capture and restore - #736

Merged
delete-cloud merged 5 commits into
mainfrom
feat/adr-0085-phase-g-checkpoint
Sep 3, 2026
Merged

delete-cloud merged 5 commits into
mainfrom
feat/adr-0085-phase-g-checkpoint

Conversation

@delete-cloud

Copy link
Copy Markdown
Owner

Summary

Phase G1–G3 for new-runtime sessions: RestorePoint checkpoints replace the Phase F blanket 409.

  • Matching agentkit-1 sessions can capture/restore RestorePoints (checkpoint_format=agentkit-1, empty tape/plugin_states).
  • Capture stamps OperationStateVersion (run_id/revision/projection_epoch/commit_ref). Restore checks that stamp before mutation.
  • Committed EventRecord.projection_epoch is immutable; same-epoch lost-ack returns the original; post-restore retries fail CAS.
  • HTTP dogfood: two turns, POST /checkpoints 200, restore 200, third turn completed. Frozen operation-state values are JSON-plained; a new turn after restore seeds CAS at the current projection epoch.
  • Production new_sessions_enabled stays off.

Tests

  • uv run pytest tests/coding_agent/test_phase_g_restore_point.py tests/coding_agent/test_phase_g_epoch.py tests/coding_agent/test_runtime_checkpoint_capture_service.py tests/coding_agent/test_phase_f_checkpoint_rejection.py tests/coding_agent/test_phase_f_serving.py tests/agentkit/checkpoint/test_service.py
  • Local daemon dogfood on agentkit-1 (flag flipped only in local sqlite, then set back to 0)

Out of scope

  • Production activation flag
  • Phase H legacy pipeline removal
  • Full G2 immutable-epoch SQL on committed facts beyond dropping event epoch promotion

Phase G1: matching agentkit-1 sessions capture and restore RestorePoint
snapshots (empty tape/plugin_states). Tape snapshots and cross-version
checkpoints still reject before mutation.
Phase G2: same-epoch lost-ack returns the original event without
rewriting session state. A retry after restore opens a new epoch
fails CAS. Drop event epoch promotion SQL.
Capture writes run_id/revision/epoch/commit_ref into RestorePoint extra.
Restore checks that stamp against live operation state before mutation.
JSON-plain frozen operation state values so HTTP capture can save.
Seed a new turn's CAS at the current projection epoch after restore.
Duplicate event_id lost-acks no longer rewrite mailbox. Restore then
the same event_id fails CAS instead of promoting projection_epoch.
@delete-cloud
delete-cloud merged commit e3636dc into main Sep 3, 2026
1 check passed
@delete-cloud
delete-cloud deleted the feat/adr-0085-phase-g-checkpoint branch September 3, 2026 13:03
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.

1 participant