name: action-journaling
description: Record every action in a write-ahead journal with inputs, outputs, and reversal notes, and use the journal to reconstruct or undo state after failures.
metadata:
source: skills/04-action-execution/action-journaling.md
category: 04-action-execution
version: "v1"
Action Journaling
Description
Record every action in a write-ahead journal with inputs, outputs, and reversal notes, and use the journal to reconstruct or undo state after failures. The procedure is constrained by explicit inputs and acceptance criteria rather than best-effort judgment alone.
When to Use
- actions must be reconstructible and reversible after a partial failure before downstream steps can proceed safely.
- Ambiguity or missing evidence would change the outcome.
- The result must be recorded with reasons and evidence for later verification.
Inputs / Outputs
| Area |
Contract |
| Inputs |
Task context, candidate inputs, and explicit acceptance criteria for action journaling work. |
| Outputs |
A decision or artifact with recorded reasons, rejected alternatives, and verification evidence. |
| Safety |
Failures must fail closed and be reported with evidence rather than retried silently. |
Procedure
- Define the goal, the constraints, and the boundary of what this procedure may change.
- Inventory the available inputs and flag gaps or ambiguities that block progress.
- Execute the action journaling steps in a bounded, checkpointed way.
- Compare the actual outcome against the expected outcome and record deviations.
- On failure, apply the declared fallback path, and never widen permissions to recover.
- Emit a structured result with evidence and provenance for downstream consumers.
Runnable Example
def replay(journal, state):
for entry in journal:
state = entry["apply"](state)
return state
journal = [{"apply": lambda s: s + 1}, {"apply": lambda s: s * 2}]
assert replay(journal, 3) == 8
journal2 = [{"apply": lambda s: s + 1}]
assert replay(journal2, 3) == 4 # partial journal replays to a consistent prefix state
Failure Modes
- Journaling after the action instead of before.
- Recording inputs without enough context to reverse.
- Never testing replay on a clean state.
- Journaling to the same store the actions modify.
- Removing entries once actions complete.
Boundary
This skill operates inside the declared task boundary. It does not grant permissions, bypass approval gates, or widen access to achieve its result.
Evidence
Recoverable agent execution is a recurring 2026 reliability pattern, including durable-execution guarantees in public framework coverage; this is a dated signal, not an adoption metric.
Related
- action-result-verification.md
- compensating-actions.md
- idempotent-retries.md
1---2name: action-journaling-23description: Record every action in a write-ahead journal with inputs, outputs, and reversal notes, and use the journal to reconstruct or undo state after failures.4---5---6name: action-journaling7description: Record every action in a write-ahead journal with inputs, outputs, and reversal notes, and use the journal to reconstruct or undo state after failures.8metadata:9 source: skills/04-action-execution/action-journaling.md10 category: 04-action-execution11 version: "v1"12---1314# Action Journaling1516## Description17Record every action in a write-ahead journal with inputs, outputs, and reversal notes, and use the journal to reconstruct or undo state after failures. The procedure is constrained by explicit inputs and acceptance criteria rather than best-effort judgment alone.1819## When to Use20- actions must be reconstructible and reversible after a partial failure before downstream steps can proceed safely.21- Ambiguity or missing evidence would change the outcome.22- The result must be recorded with reasons and evidence for later verification.2324## Inputs / Outputs25| Area | Contract |26|---|---|27| Inputs | Task context, candidate inputs, and explicit acceptance criteria for action journaling work. |28| Outputs | A decision or artifact with recorded reasons, rejected alternatives, and verification evidence. |29| Safety | Failures must fail closed and be reported with evidence rather than retried silently. |3031## Procedure321. Define the goal, the constraints, and the boundary of what this procedure may change.332. Inventory the available inputs and flag gaps or ambiguities that block progress.343. Execute the action journaling steps in a bounded, checkpointed way.354. Compare the actual outcome against the expected outcome and record deviations.365. On failure, apply the declared fallback path, and never widen permissions to recover.376. Emit a structured result with evidence and provenance for downstream consumers.3839## Runnable Example40```python41def replay(journal, state):42 for entry in journal:43 state = entry["apply"](state)44 return state4546journal = [{"apply": lambda s: s + 1}, {"apply": lambda s: s * 2}]47assert replay(journal, 3) == 848journal2 = [{"apply": lambda s: s + 1}]49assert replay(journal2, 3) == 4 # partial journal replays to a consistent prefix state50```5152## Failure Modes53- Journaling after the action instead of before.54- Recording inputs without enough context to reverse.55- Never testing replay on a clean state.56- Journaling to the same store the actions modify.57- Removing entries once actions complete.5859## Boundary60This skill operates inside the declared task boundary. It does not grant permissions, bypass approval gates, or widen access to achieve its result.6162## Evidence63Recoverable agent execution is a recurring 2026 reliability pattern, including durable-execution guarantees in public framework coverage; this is a dated signal, not an adoption metric.6465## Related66- action-result-verification.md67- compensating-actions.md68- idempotent-retries.md