Rollback and Recovery: Checkpoints and Reconciliation
Discover and preview rollback checkpoints with /rollback; reconcile interrupted operations with /recover. Shell and remote effects are never reversible.
Use this file to discover all available pages before exploring further.
thcode’s checkpoint system creates durable snapshots before built-in file mutations. The /rollback command lets you discover and preview those checkpoints; /recover helps you reconcile operations that were interrupted before they reached a terminal outcome. Both commands are read-safe: inspecting a checkpoint does not stage or apply anything.
Rollback honesty principle (AD-19): Automatic rollback covers only checkpointed built-in create_file, edit_file, and delete_file effects. Shell commands, process invocations, remote API calls, permission changes, symlink side-effects, and external effects are never claimed reversible. A checkpoint summary never implies that the whole Prompt Round is reversible — only the specifically covered file targets can be rolled back.
Alias:/rb Requires approval: No/rollback lists eligible rollback checkpoints for the current session and lets you inspect individual checkpoints before any rollback is staged or applied. Listing and inspecting are always read-only.
Checkpoints are sorted most-recent-first. By default, only apply-eligible checkpoints are shown. Pass --include-hidden to also see expired, corrupt, and locked checkpoints as non-authoritative recovery records.
All targets have complete pre/post-image artifacts
✅
partially protected
Some targets covered, some not
✅
unprotected
Checkpoint exists but no target artifacts
✅
expired
Retention has evicted this checkpoint
Hidden
corrupt
Integrity verification failed — data may be altered
Non-authoritative
locked
Recovery-locked — cannot be used for rollback
Non-authoritative
apply-eligible includes fully protected, partially protected, and unprotected — the coverage level affects how much can be reversed, but all three allow a rollback attempt. expired, corrupt, and locked checkpoints are hidden from the default listing but remain inspectable.
Every CheckpointSummary carries an ExcludedEffects structure. These are effects that occurred during the Prompt Round but are never claimed reversible by the rollback system.
Each ExcludedEffectEntry has a target, reason, reasonCode, and status ('excluded' or 'never-protected').
If the risk field in a RollbackPreview reports a non-zero excludedCount, some effects from that Prompt Round cannot be reversed by any rollback operation. Review the excluded effects list before applying. Rolling back the file targets does not undo shell commands, remote calls, permission grants, process launches, or any external side-effects.
The risk disclosure in every RollbackPreview always includes both sentences:
Automatic rollback covers checkpointed built-in create/edit/delete ONLY.
Shell, process, remote, permission, symlink-side, and external effects are NEVER claimed reversible.
Alias:/rc Requires approval: No/recover addresses operations that were interrupted — by a crash, a cancellation, or a process termination — before they reached a durable terminal outcome. It classifies the operation from the journal and offers only safe actions. It never replays a native effect automatically.
Seven mutually exclusive recovery states derived from the journal:
State
Condition
Residual risk
not-sent
No lifecycle-fact or terminal events for this operation
None
prepared
Proposal/preparation events exist but no dispatch commit
Low — checkpoint material may be incomplete
dispatch-committed
EffectDispatchCommitted event exists but no terminal event
High — native mutation may have committed
succeeded
OperationSucceeded event exists
None
failed
OperationFailed event exists
None
cancelled
OperationCancelled (or OperationBlocked) event exists before dispatch commit
None
unknown-outcome
OperationUnknownOutcome event or no terminal proof
High — native mutation may have committed
Operations in dispatch-committed or unknown-outcome state carry high residual risk. The native mutation may have already committed on disk or on a remote. /recover will only offer inspect, reconcile, export-safe-evidence, and exit. Blind retry is always blocked for these states.
Both /rollback and /recover return typed AD-9 failure envelopes when an operation cannot be completed. Each failure carries a category, retryable flag, scope, human-readable message, and machine-readable causeCode.
/rollback failures
/recover failures
Category
Retryable
Meaning
checkpoint-not-found
No
The requested checkpoint ID does not exist
checkpoint-unreadable
No
The checkpoint record is present but cannot be parsed
session-not-found
No
No session record found for the given session ID
internal-error
No
Unexpected failure during discovery or inspection
Category
Retryable
Meaning
operation-not-found
No
No journal events found for the given operation ID
journal-unavailable
No
The event journal cannot be accessed
checkpoint-unavailable
No
Checkpoint material is not accessible
reconciliation-failed
No
Reconcile attempt could not clean up incomplete stages