Infrastructure · Data Structures
Step
Atomic action with pre/post conditions
Definition
Mechanism
A unit of action that declares its own boundaries. It specifies: 1. Preconditions (what must be true before), 2. Action (what to do), 3. Postconditions (what will be true after), 4. Rollback (how to undo if needed). It acts as a node in a causal graph.
Invariants
- Declares whether it can be rolled back, and how. A step that cannot be undone says so.
- Causal closure: preconditions are satisfiable by prior steps or the initial state.
Risks
Failure modes
Precondition violation
executed when preconditions were not met.
Postcondition failure
completes without achieving its postconditions.
Rollback failure
the declared undo does not restore the prior state, so the step is neither done nor undone.
Relationships
Root pattern: builds on nothing in this library.
Used by
References
An ordered sequence of steps to achieve a goal
Mind
Evaluates execution feasibility of a plan
Society
Directed graph of operations
Reference
Data schema
{
"type": "object",
"required": [
"step_id",
"action_type",
"params",
"preconditions",
"postconditions",
"rollback"
],
"properties": {
"step_id": {
"type": "string"
},
"action_type": {
"type": "string",
"description": "The verb or tool to invoke"
},
"params": {
"type": "object",
"description": "Arguments for the action"
},
"dependencies": {
"type": "array",
"items": {
"type": "string"
},
"description": "IDs of steps that must complete first"
},
"retry_policy": {
"type": "object",
"properties": {
"max_attempts": {
"type": "integer"
},
"backoff_strategy": {
"type": "string"
}
}
},
"preconditions": {
"type": "array",
"description": "What must be true before the action runs."
},
"postconditions": {
"type": "array",
"description": "What will be true after it succeeds."
},
"rollback": {
"type": "object",
"description": "How to undo the action, or an explicit statement that it cannot be undone."
}
}
}