Infrastructure · Primitives
Compensate
Structured rollback via logged inverses in LIFO order
Definition
Mechanism
Execute inverse actions to undo partial coordination across the System after BREAK. On receiving BREAK, agent retrieves compensation_log (built during forward execution—each action logged its inverse). Execute inverses in REVERSE chronological order (LIFO). For each inverse: attempt execution, if fail retry (inverses must be idempotent), if still fail log and continue or escalate. Report COMPENSATE_RESULT: {completed: [steps undone], failed: [steps that couldn't undo], clean: bool, downstream_confirmed: bool}. Multi-agent coordination: each agent compensates their own scope. BREAK propagates with upstream_agents hint for cross-agent dependencies—downstream agents compensate first, confirm, then upstream proceeds. Compensation cannot introduce NEW coordinated work (only cleanup and notification). Triggered by Break, it reads the TimeWarpLog in reverse to execute the idempotent inverse of each prior action.
Preconditions
- Compensation mechanism available
- Detected failure/loss
Postconditions
- A status report exists naming which inverses succeeded and which did not
Invariants
- Every forward action logs its inverse as it executes; an action with no logged inverse is not compensable.
- Inverses execute in reverse chronological order.
- Inverses are idempotent, so a retried compensation does not compound.
- Reports per-inverse outcome, including which inverses failed.
Risks
Failure modes
Inverse wasn't logged (can't compensate what wasn't tracked).
Inverse isn't truly idempotent (retry corrupts state).
External state changed between action and compensation (assumption invalid).
Compensation creates new failure (cascading compensation).
Time-sensitive compensation (too late to undo, window passed).
Compensation log lost or corrupted.
Downstream agent doesn't confirm (blocks upstream compensation).
Caution
Compensation must not erase the audit trail of what was rolled back — log both the forward action and the compensation.
Relationships
Builds on
References
Failure-announcement signal {severity, reason, recoverable}, ACK-required
Complex whole of interacting parts
Handling relativistic event ordering
Used by
Composes with
Society
Declaration and execution in a single turn
Society
High-velocity solver requiring parallel runtime
Society
Progressive deployment with canary gating and recorded compensation
References
Society
Hardware-interrupt kill switch
Mind
Typed failure signaling that lateral reframing, not retry, is required
Society
Stewardship and maintenance
Mind
Classified re-attempt with backoff conditioned on failure type
Reference
