---
title: "rollback"
description: "Restore to previous checkpoint"
canonical: "https://acs.synapti.ai/capabilities/rollback/"
last_updated: "2026-11-26T14:43:03+01:00"
---

# rollback

Restore to previous checkpoint

Generated from [schemas/capability_ontology.yaml](https://github.com/synaptiai/agent-capability-standard/blob/main/schemas/capability_ontology.yaml), [skills/rollback/SKILL.md](https://github.com/synaptiai/agent-capability-standard/blob/main/skills/rollback/SKILL.md) at commit 18c38b74ac21. Ontology version 2.2.0.

Layer: [VERIFY](https://acs.synapti.ai/layers/verify/index.md)

## Safety

| Property | Value |
| --- | --- |
| Risk | Medium |
| Changes state | Yes |
| Needs checkpoint | Yes, via requires edge |
| Needs approval | No |
| Overridable | No |
| Blocked from autonomy | No |

**Figure: Ordering rules for rollback in a workflow.** In a workflow, checkpoint must run before it (V102); and it never shares a parallel group with mutate and persist (F504).

| Where | Capability | Rule | Enforcement | Diagnostic |
| --- | --- | --- | --- | --- |
| Before rollback | [`checkpoint`](https://acs.synapti.ai/capabilities/checkpoint/index.md) | `requires` | MUST | V102 |
| Never in the same parallel group | [`mutate`](https://acs.synapti.ai/capabilities/mutate/index.md) | `conflicts_with` | MUST | F504 |
| Never in the same parallel group | [`persist`](https://acs.synapti.ai/capabilities/persist/index.md) | `conflicts_with` | MUST | F504 |

## Relationships

**Figure: Relationships of rollback: 5 relationships with 4 capabilities.** rollback has 5 relationships with 4 capabilities: 2 with edges into it, 1 with edges out of it, and 1 joined to it only by edges that run both ways; its conflicts_with edge with mutate runs both ways.

| Capability | Row | Relationships |
| --- | --- | --- |
| [`mutate`](https://acs.synapti.ai/capabilities/mutate/index.md) | Edges out of rollback | `conflicts_with` (both ways), `specializes` (out of) |
| [`verify`](https://acs.synapti.ai/capabilities/verify/index.md) | Edges into rollback | `enables` (into) |
| [`checkpoint`](https://acs.synapti.ai/capabilities/checkpoint/index.md) | Edges into rollback | `requires` (into) |
| [`persist`](https://acs.synapti.ai/capabilities/persist/index.md) | Either way | `conflicts_with` (both ways) |

- `requires`: Must run after [`checkpoint`](https://acs.synapti.ai/capabilities/checkpoint/index.md)
- `enables`: Unlocked by [`verify`](https://acs.synapti.ai/capabilities/verify/index.md)
- `conflicts_with`: May not share a parallel group with [`persist`](https://acs.synapti.ai/capabilities/persist/index.md), [`mutate`](https://acs.synapti.ai/capabilities/mutate/index.md)
- `specializes`: Specializes [`mutate`](https://acs.synapti.ai/capabilities/mutate/index.md)

## Contract

**Figure: Contract of rollback: 2 inputs (1 required), 11 outputs.** rollback takes 2 inputs, 1 required (filled pin) and 1 optional (hollow pin), and returns 11 outputs. The tables below list every field.

### Inputs

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checkpoint_id` | string | Yes | Checkpoint to restore |
| `scope` | string | No | Part of what the checkpoint captured to restore, in the host's naming; all of it when absent. An item it names that the checkpoint did not capture is unrestored (not_captured) (Standard v1.2 §4.4.1) |

### Outputs

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `restored` | boolean | Yes | True only if everything the rollback concerns is back in its checkpointed state, and then unrestored is empty; the step completes either way (Standard v1.2 §4.4.1) |
| `previous_state` | any | No | State before rollback |
| `restored_state` | any | No | State after rollback |
| `unrestored` | array of object | No | What the rollback concerns that is not back in its checkpointed state, including an item its scope names that the checkpoint did not capture; empty exactly when restored is true |
| `not_covered` | array of object | No | Changes since the checkpoint that it never covered, which no rollback to it restores; they do not make restored false |
| `changes_reverted` | array of object | No | What the rollback undid |
| `verification` | object | No | The digest of the restored content, computed as the checkpoint's was, and whether it matches the checkpoint's digest |
| `verification.digest` | string | No |  |
| `verification.match` | boolean | No |  |
| `evidence_anchors` | array of Anchor (or deprecated string or object) | Yes | What the output is based on, as evidence anchors (Standard v1.2 §6.5). An empty list grounds nothing, and the output is then marked inferred (§3.1). |
| `confidence` | number | No | The producer's probability that the output's claim is correct, self-reported; given when the output is inferred (Standard v1.2 §3.1, §4.1.1) From 0 to 1 |
| `inference_method` | string | No | How the output was reached when it is not grounded in evidence; with confidence it marks the output inferred (Standard v1.2 §3.1, §4.1.1). A producer should use model_knowledge, deduction, induction, abduction, analogy, statistical, simulation, assumption or an x- vendor value; a grounding policy (§5.20) requires one of them. |
| `uncertainty` | Uncertainty | No | The uncertainty of the output's principal value; its confidence equals the output's confidence (Standard v1.2 §4.1.1) |

The skill returns 11 fields: 9 are in rollback's output contract (2 required) and 2 are the skill's own, outside the contract; it leaves out 2 contract fields (inference_method, uncertainty).

| Field of the skill's output | In the output contract |
| --- | --- |
| `restored` | Yes, required |
| `unrestored` | Yes, optional |
| `not_covered` | Yes, optional |
| `changes_reverted` | Yes, optional |
| `verification` | Yes, optional |
| `previous_state` | Yes, optional |
| `restored_state` | Yes, optional |
| `next_actions` | No, the skill's own |
| `confidence` | Yes, optional |
| `evidence_anchors` | Yes, required |
| `assumptions` | No, the skill's own |
| `inference_method` | Yes, but the skill leaves it out |
| `uncertainty` | Yes, but the skill leaves it out |

## Used in workflows

**Figure: rollback in workflows.** 3 workflows use rollback, in 3 steps in all; its steps are the squares in an ink ring, and the key under the strips names the other squares.

- [`debug_code_change`](https://acs.synapti.ai/workflows/debug-code-change/index.md): step 10
- [`digital_twin_sync_loop`](https://acs.synapti.ai/workflows/digital-twin-sync-loop/index.md): step 19
- [`model_deployment`](https://acs.synapti.ai/workflows/model-deployment/index.md): step 7

## Claude Code skill

**Figure: What the rollback skill's tools can do, against the ontology.** The skill may use 3 tools: 1 only read and 2 run commands; the ontology marks rollback as changing state, and Bash and Git can make the change.

| What they can do | Tools |
| --- | --- |
| Only read | `Read` |
| Run commands, which can change state | `Bash`, `Git` |
| Change files | none |

**Figure: The field names each step of the rollback procedure uses.** 6 of the procedure's 6 steps use the name of an input or output field of the rollback skill as a word; 6 output fields of 11 are used by no step (previous_state, restored_state, next_actions, confidence, evidence_anchors, assumptions).

| Step | Inputs it uses by name | Output fields it uses by name |
| --- | --- | --- |
| 1. Find the checkpoint |  | `restored` |
| 2. Read what changed |  | `changes_reverted` |
| 3. Restore by mechanism | `scope` |  |
| 4. Verify |  | `verification` |
| 5. Report |  | `restored`, `unrestored`, `not_covered` |
| 6. Ground claims |  | `verification` |

Both examples of the skill write out every one of its 11 output fields.

**Figure: The field names each verification check of the rollback skill uses.** 3 of the 4 checks use the name of an input or output field as a word; 8 output fields of 11 are named by no check (not_covered, changes_reverted, previous_state, restored_state, next_actions, confidence, evidence_anchors and assumptions).

| Check | Inputs it uses by name | Output fields it uses by name |
| --- | --- | --- |
| 1. Rollback Verification: verification.match is true for what was restored (CRITICAL) |  | `restored`, `verification` |
| 2. Report Complete: restored is true exactly when unrestored is empty |  | `restored`, `unrestored` |
| 3. State Assertion: No file created since remains in scope | `scope` |  |
| 4. Evidence Grounding: Restore command execution is captured |  |  |

**Figure: The neighbours the skill lists for rollback, checked against the ontology and the catalogs.** The skill lists 7 capabilities as common neighbours of rollback; 3 of them have an edge with it in the ontology, and 2 run next to it, in that order, in a catalog workflow (audit most often, 3 times). Under each tile, an edge reads from its source to its target, with rollback's symbol in its place: "requires Rl" is a requires edge from the tile's capability to rollback, so the tile's capability must run before rollback; "Rl precedes" is a precedes edge from rollback to the tile's capability.

| Listed as | Capability | Ontology edge | Next to it in a workflow |
| --- | --- | --- | --- |
| commonly follows | [`verify`](https://acs.synapti.ai/capabilities/verify/index.md) | `enables` | 2 times |
| commonly follows | [`mutate`](https://acs.synapti.ai/capabilities/mutate/index.md) | `conflicts_with`, `conflicts_with` (into it), `specializes` (into it) | never |
| commonly follows | [`execute`](https://acs.synapti.ai/capabilities/execute/index.md) | none | never |
| commonly follows | [`checkpoint`](https://acs.synapti.ai/capabilities/checkpoint/index.md) | `requires` | never |
| commonly precedes | [`critique`](https://acs.synapti.ai/capabilities/critique/index.md) | none | never |
| commonly precedes | [`plan`](https://acs.synapti.ai/capabilities/plan/index.md) | none | never |
| commonly precedes | [`audit`](https://acs.synapti.ai/capabilities/audit/index.md) | none | 3 times |

### Intent

Execute **rollback** to return what a checkpoint captured to the state it had when the checkpoint was taken, whoever changed it since (STANDARD v1.2 §4.4.1). This is the recovery mechanism in the CAVR (Checkpoint-Act-Verify-Rollback) pattern, used when mutations fail or produce undesired outcomes.

A rollback changes the world back, not the account of it: the record of what happened (`.claude/`, which holds the plugin's audit log, `.audit/`, where earlier releases' skills logged, the host's checkpoint and approval state, the trace, the transcript) is never rolled back. It reaches only what its checkpoint captured: a transmission a `send` made since is reported as `not_covered` (`transmitted`), as is a delegate's change outside the checkpoint (`delegated`).

**Success criteria:**
- Everything the rollback concerns is back in its checkpointed state, and `restored` says so
- What could not be restored is listed in `unrestored`, with a reason
- The restored content's digest matches the checkpoint's (`verification`)

**Compatible schemas:**
- `schemas/output_schema.yaml`

### Inputs

| Parameter | Required | Type | Description |
|-----------|----------|------|-------------|
| `checkpoint_id` | Yes | string | ID of checkpoint to restore to |
| `scope` | No | string | Part of what the checkpoint captured to restore, in the host's naming (default: all of it). An item it names that the checkpoint did not capture is `unrestored` (`not_captured`) |

Inputs not listed here are outside the capability's contract: a workflow step that binds them gets W604 (STANDARD v1.1 §5.5).

### Procedure

1) **Find the checkpoint**: Look it up by ID where the host keeps checkpoint content
   - An expired or used checkpoint can still be restored while its content is kept: validity limits what a checkpoint authorises, not what it restores (STANDARD 1.2.0 §4.4.1, §5.2.2)
   - If its content is gone, report `restored: false` with `{item: "*", reason: discarded}`

2) **Read what changed** (read-only): `git diff --name-status <sha> -- <paths>` (tracked changes, for `changes_reverted`) and `git ls-files --others --exclude-standard -- <paths>`; files **created since** are the untracked ones not in the checkpoint's `excluded` and not under `.claude/` or `.audit/` (the record of what happened, never rolled back)

3) **Restore by mechanism**. The git form is one line, a gated `mutate` (a fresh checkpoint and an approval: it overwrites the current state):
   - `restore_kind: stash`: `git restore --source=<sha> --worktree -- <paths> && git restore --source=<sha>^2 --staged -- <paths>`; `restore_kind: head`: `git restore --source=<sha> --staged --worktree -- <paths>`
   - Then, only when files were created since, `&& rm -f -- <created paths>`; never `git clean` with an empty path list
   - `git stash apply <sha>` aborts once a file it touches changed since the checkpoint; a bare `git stash pop` or `apply` is refused (F503)
   - `file_copy`: copy each file back from the manifest, and remove the files created in scope since
   - Never touch `.claude/`, `.audit/` (the record of what happened) or the host's state
   - Under the plugin's hooks a restore runs only where Claude Code's strict sandbox is verified (hooks README, "The strict sandbox"); otherwise it is refused with F501

4) **Verify** (read-only): `git diff --quiet <sha> -- <paths>` and the untracked list again, for `verification`

5) **Report**: `unrestored` for what failed (`failed`), was never captured (`not_captured`) or is gone (`discarded`); `not_covered` for changes the checkpoint never covered (`outside_scope`, `transmitted`, and `HEAD` when commits were made since). `restored` is true only if `unrestored` is empty; the step completes either way

6) **Ground claims**: the rollback's own record, the restore and the verification commands

### Output Contract

Return a structured object:

```yaml
restored: boolean  # true only if everything the rollback concerns is back; the step completes either way (§4.4.1)
unrestored:  # what the rollback concerns that is not back; empty exactly when restored is true
  - item: string
    reason: failed | conflict | discarded | not_captured | x-...
    detail: string
not_covered:  # changes since the checkpoint that it never covered; they do not make restored false
  - item: string
    reason: transmitted | delegated | outside_scope | x-...
    detail: string
changes_reverted:
  - item: string
    operation: create | modify | delete | other  # what was undone
    summary: string
verification:
  digest: string  # digest of the restored content, computed as the checkpoint's was (over all it captured)
  match: boolean  # whether it matches the checkpoint's digest
previous_state:  # state before rollback
  summary: string
restored_state:  # state after rollback
  summary: string
next_actions: array[string]  # Suggested follow-up
confidence: number  # probability that the state now matches the checkpoint (§4.1.1)
evidence_anchors: [{ref: "rollback:<checkpoint_id>", kind: record}, {ref: "tool:bash:...", kind: tool}, {ref: "file:...", kind: file}]  # the restore's own record grounds the output (STANDARD v1.2 §3.1)
assumptions: []
```

#### Field Definitions

| Field | Type | Description |
|-------|------|-------------|
| `restored` | boolean | True only if everything the rollback concerns is back (workflows gate on `${<step>.restored}`, §12.5 Checked Rollback) |
| `unrestored` | array | Items not back, each with `failed`, `conflict`, `discarded`, `not_captured` or an `x-` reason |
| `not_covered` | array | Changes the checkpoint never covered: `transmitted`, `delegated`, `outside_scope` or an `x-` reason |
| `changes_reverted` | array | Each `item` and the `operation` undone |
| `verification` | object | The restored content's `digest`, and whether it `match`es the checkpoint's |
| `previous_state` | any | State before rollback |
| `restored_state` | any | State after rollback |
| `next_actions` | array | What to do next (re-plan, investigate, etc.) |
| `confidence` | number | Probability, 0.0-1.0, that the state now matches the checkpoint (§4.1.1) |
| `evidence_anchors` | array of evidence anchors (§6.5) | Proof of restoration |
| `assumptions` | array | Explicit assumptions made |

An item holds no secret (§6.7): name a file, not its content, and redact a URL's credentials.

### Examples

#### Example 1: Git Rollback After Failed Tests

**Input:**
```yaml
checkpoint_id: "chk_20240115_143022_a7b3c9"
```

Reason for the rollback: tests failed after refactoring. The checkpoint's restore point is a stash commit; one file was created since.

**Output:**
```yaml
restored: true
unrestored: []
not_covered: []
changes_reverted:
  - item: "src/api/handlers/user.py"
    operation: modify
    summary: "Reverted refactored get_user() function"
  - item: "src/api/handlers/auth.py"
    operation: modify
    summary: "Reverted auth token validation changes"
  - item: "src/api/handlers/tokens.py"
    operation: create
    summary: "Removed a file the refactoring added"
verification:
  digest: "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
  match: true
previous_state:
  summary: "3 handler files with refactored, failing code"
restored_state:
  summary: "Handlers as of the checkpoint"
next_actions:
  - "critique: Analyze why refactoring broke tests"
  - "plan: Create new plan with smaller incremental changes"
confidence: 1.0
evidence_anchors:
  - {ref: "rollback:chk_20240115_143022_a7b3c9", kind: record}
  - {ref: "tool:bash:git diff --name-status 4f1d2c3b5a6978877665544332211009988aabbc -- src/api/handlers", kind: tool}
  - {ref: "tool:bash:git restore --source=4f1d2c3b5a6978877665544332211009988aabbc --worktree -- src/api/handlers", kind: tool}
  - {ref: "tool:bash:git diff --quiet 4f1d2c3b5a6978877665544332211009988aabbc -- src/api/handlers", kind: tool}
assumptions:
  - "No commit was made since the checkpoint"
```

**Evidence pattern:** the changes read before the restore, the restore line, and the verification diff.

---

#### Example 2: Partial Rollback After a Send

**Input:**
```yaml
checkpoint_id: "chk_20240115_150000_config"
scope: "config/production.yaml config/secrets.env"
```

Reason for the rollback: the config migration caused a service failure, after a notification was sent.

**Output:**
```yaml
restored: false
unrestored:
  - item: "config/secrets.env"
    reason: not_captured
    detail: "excluded from the checkpoint: it holds secrets"
not_covered:
  - item: "send to https://hooks.example.com/deploys (run-7:12)"
    reason: transmitted
changes_reverted:
  - item: "config/production.yaml"
    operation: modify
    summary: "Reverted database connection string changes"
verification:
  digest: "sha256:9b74c9897bac770ffc029102a200c5de0b1d5e5d3c1b0e2f4a6c8e0a2b4c6d8e"
  match: true
previous_state:
  summary: "Migrated database connection string"
restored_state:
  summary: "Original production config; secrets.env as it is now"
next_actions:
  - "inquire: secrets.env was never captured; ask how to restore it"
  - "send: tell the deploy channel the migration was rolled back"
confidence: 0.9
evidence_anchors:
  - {ref: "rollback:chk_20240115_150000_config", kind: record}
  - {ref: "tool:bash:git restore --source=1a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d --staged --worktree -- config/production.yaml", kind: tool}
  - {ref: "file:config/production.yaml:1", kind: file}
assumptions:
  - "The notification cannot be recalled; a new send corrects it"
```

### Verification

Apply the following verification patterns:

- [ ] **Rollback Verification**: `verification.match` is true for what was restored (CRITICAL)
- [ ] **Report Complete**: `restored` is true exactly when `unrestored` is empty
- [ ] **State Assertion**: No file created since remains in scope
- [ ] **Evidence Grounding**: Restore command execution is captured

**Verification tools:** Bash (for restore and hash), Git (for the diff and the restore)

### Safety Constraints

- `mutation`: true (modifies files to restore state)
- `requires_checkpoint`: false (but a `checkpoint` MUST precede it: the ontology's `checkpoint` → `rollback` `requires` edge, else V102)
- `requires_approval`: false
- `risk`: medium

**Capability-specific rules:**
- CRITICAL: Never rollback without a checkpoint_id that exists
- CRITICAL: Never report `restored: true` for a rollback that did not complete
- Clean up the files created in scope since the checkpoint
- An expired or used checkpoint can be restored (STANDARD 1.2.0 §5.2.2); the safety layer refuses a restore only when no checkpoint was ever taken (F503)
- Never roll back the record of what happened: `.claude/` (the plugin's audit log), `.audit/` (earlier releases' logs), the host's checkpoint and approval state
- A transmission is not undone: report it `transmitted`, and compensate in a step of its own
- If verification fails, STOP and alert - do not proceed

### Composition Patterns

**Commonly follows:**
- `verify` - When verify returns `passed: false`, trigger rollback (CAVR pattern)
- `mutate` / `execute` - If the side effect fails or verify returns `passed: false`, rollback
- `checkpoint` - Rollback requires prior checkpoint (dependency)

**Commonly precedes:**
- `critique` - After rollback, analyze what went wrong
- `plan` - Create new plan after understanding failure
- `audit` - Record the rollback event

**Anti-patterns:**
- CRITICAL: Never rollback without existing checkpoint
- CRITICAL: Never continue mutations after rollback without new checkpoint
- Never skip verification after rollback
- Never delete checkpoint until rollback verification passes

**Workflow references:**
- See `reference/composition_patterns.md#checkpoint-act-verify-rollback` for CAVR pattern
- See `reference/verification_patterns.md#pattern-4-rollback-verification` for rollback verification
- See `reference/composition_patterns.md#debug-code-change` for rollback-then-critique flow
