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

  1. Compensation mechanism available
  2. Detected failure/loss

Postconditions

  1. A status report exists naming which inverses succeeded and which did not

Invariants

  1. Every forward action logs its inverse as it executes; an action with no logged inverse is not compensable.
  2. Inverses execute in reverse chronological order.
  3. Inverses are idempotent, so a retried compensation does not compound.
  4. Reports per-inverse outcome, including which inverses failed.

Risks

Failure modes

  1. Inverse wasn't logged (can't compensate what wasn't tracked).

  2. Inverse isn't truly idempotent (retry corrupts state).

  3. External state changed between action and compensation (assumption invalid).

  4. Compensation creates new failure (cascading compensation).

  5. Time-sensitive compensation (too late to undo, window passed).

  6. Compensation log lost or corrupted.

  7. 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

Break

Failure-announcement signal {severity, reason, recoverable}, ACK-required

System

Complex whole of interacting parts

Used by

Composes with

Society

AtomicBid

Declaration and execution in a single turn

Society

Rollout

Progressive deployment with canary gating and recorded compensation

References

Mind

FrameError

Typed failure signaling that lateral reframing, not retry, is required

Society

Gardener

Stewardship and maintenance

Mind

Retry

Classified re-attempt with backoff conditioned on failure type

Reference

Identity

Ref
Compensate#4b87
Sema ID
sema:Compensate#mh:SHA-256:4b87623f38564fcc95b87d2cbf5df2f5ff41ef27e617ccafd76c7b7896b144e7
Ring
0
Tier
1
Updated
2026-11-11
Supersedes
  • sema:Compensate#mh:SHA-256:269dac24b3d83ede5ad2419fd9d78e0e0368090c677bbd272880b1b8e6921af3
  • sema:Compensate#mh:SHA-256:81a5e6a4b35f905a4b19391777572e3905883ec599b49fdd35e0ab785af01bc7
  • sema:Compensate#mh:SHA-256:e23bc7c0d3825460855e7ee5e2e41f512ff8e318ad741b1ba4e0303cb66e39b9
  • sema:Compensate#mh:SHA-256:9b3b07b7a02d00b6df1ecc3ee69fa3dcd2b33e07f045c67f26deb6cf311694f2
  • sema:Compensate#mh:SHA-256:447fb91007e09d8674d66ab2698189026a2e9f70a2b66fbaaed406006fb8b8eb