$ fssg build --deterministic --validate |

Why Agent Rollback Needs Two Checkpoints

IOSM

An agent can restore its conversation and still resume in the wrong repository state.

It can also restore the files perfectly and continue with a decision that only made sense before the rollback. I treat both cases as recovery failures. A reliable engineering runtime needs two checkpoints—one for execution state and one for the mutation surface—and a rule that prevents them from drifting apart.

This distinction matters in IOSM CLI because the runtime has both kinds of machinery. Sessions can be continued or resumed; swarm runs persist state, events and checkpoints; filesystem snapshot/restore is integrated into command execution with deterministic rollback order. These are complementary capabilities, not three names for the same feature.

Two states, two failure modes

A session checkpoint can contain the active task, messages, pending work, selected hypothesis and orchestration state. It answers:

What did the runtime believe it was doing?

A filesystem checkpoint captures the mutation surface that tools can change. It answers:

What bytes can the runtime put back?

The boundary is easy to miss because a coding agent observes both through one interface. But they have different lifecycles.

Checkpoint Preserves Cannot prove
Session/workflow task state, pending messages, decisions, executor state that the workspace still matches those decisions
Filesystem files, paths, permissions or a snapshot reference that the resumed plan is valid for those files

Restoring only the first creates workspace drift: the agent remembers a plan against files that have moved. Restoring only the second creates intent drift: the files go back, but the agent keeps conclusions derived from a discarded mutation.

The dangerous outcome is not always a crash. Often the run continues coherently enough to look healthy.

The dual-checkpoint invariant

I would bind both states in one recovery record:

{
  "recovery_id": "run-42:before-modularize:3",
  "session_checkpoint": "session:01JZ...:entry-184",
  "workspace_snapshot": "fs:sha256:7d8b...",
  "subject_revision": "git:6cb971c",
  "phase": "modularize",
  "hypothesis_revision": 4,
  "pending_effects": [],
  "created_after": "gate_S:pass",
  "resume_policy": "verify-both-or-replan"
}

The invariant is simple:

resume is valid only if
session.subject == workspace.subject
and hypothesis revision is current
and pending effects are reconciled

A checkpoint pair is therefore not just two identifiers stored together. The runtime must verify that they describe the same engineering moment.

subject_revision binds reasoning to code. phase and hypothesis_revision prevent an old plan from crossing a newer methodological decision. pending_effects separates recoverable local state from external operations that a filesystem restore cannot undo. The resume policy makes mismatch an explicit outcome: replan or stop, never silently continue.

Recovery is a join, not a rewind

I find the database analogy more useful than the undo-button analogy. Recovery joins several state domains:

session state
  + workspace state
  + IOSM artifact state
  + external-effect reconciliation
  = admissible resume

Each domain needs an identity and a compatibility check. A valid session checkpoint cannot compensate for a missing workspace snapshot. A clean Git tree cannot prove that the queued tool calls, gate result or hypothesis card are current. An IOSM phase report can preserve justification, but it does not restore either runtime memory or files.

This is narrower than the IOSM phase-handoff manifest. A handoff carries obligations between phases. A dual checkpoint establishes whether one interrupted execution can safely re-enter a phase at all. It also extends the broader argument that recoverability is an engineering property: recoverability needs a compatibility contract, not merely a snapshot button.

A fail-closed resume protocol

A practical protocol can stay small:

  1. Freeze admission. Do not dispatch new mutations while recovery is being evaluated.
  2. Load metadata before payloads. Read checkpoint identities, schema versions and digests before restoring executable state.
  3. Verify the pair. Match subject revision, phase, hypothesis revision and workspace digest.
  4. Reconcile effects. Classify every pending operation as not started, committed, compensated or ambiguous.
  5. Restore in declared order. Restore the workspace and then rehydrate session state against the verified subject, or use another documented order whose invariants are tested.
  6. Re-run admission gates. Freshness, authority and preconditions may have changed while the run was paused.
  7. Emit a recovery receipt. Record the pair used, checks performed and resulting decision.

The fifth step is intentionally policy-driven. IOSM CLI documents deterministic filesystem rollback ordering, while Microsoft Agent Framework checkpoints capture workflow executor state, pending messages and shared state at superstep boundaries. Different runtimes can choose different restore order. They cannot omit the compatibility proof between restored domains.

What the recovery receipt should say

A resume command should produce more than ok:

{
  "recovery_id": "run-42:before-modularize:3",
  "workspace": "restored",
  "session": "rehydrated",
  "compatibility": "verified",
  "effects": {"committed": 0, "ambiguous": 0},
  "gates_rechecked": ["authority", "freshness", "scope"],
  "decision": "resume"
}

Possible terminal decisions are small and meaningful:

  • RESUME — both checkpoints match and gates still pass;
  • REPLAN — state is recoverable, but the old intent is stale;
  • RECONCILE — an external effect is ambiguous;
  • ABORT — integrity, identity or authorization cannot be established.

This avoids false completion after recovery. It also gives later IOSM reports a concrete artifact instead of a narrative claim that “the agent resumed successfully.”

The boundary of the mechanism

Two checkpoints do not make arbitrary side effects reversible. They do not guarantee that an external API accepted nothing, that a database transaction was compensated, or that a model will produce the same proposal again. Those domains need effect identities, transaction boundaries and reconciliation.

The mechanism makes a narrower promise: the runtime will not confuse restored reasoning with a different workspace, or restored files with stale reasoning. That promise is testable.

I want resume to mean more than “load what we found.” In an engineering runtime, it should mean:

$ iosm resume run-42
verified: session + workspace + methodology state
external effects: reconciled
admission gates: pass
result: RESUME

A single checkpoint remembers one side of the interruption. A checkpoint pair restores the relationship between them. That relationship—not either snapshot alone—is the real unit of recovery.

Sources

FACET AI CLI Terminal
facet@ai:~$