Transactional Mission Execution
165 words1 min read4 subsectionsFrom the README at ft 0.15.21
Multi-pane operations use a prepare/commit/compensate lifecycle borrowed from distributed transaction protocols.
Lifecycle
TxContract
│
▼
┌────────────────────────────────────────────┐
│ PREPARE │
│ - validate preconditions (policy, liveness)│
│ - reserve resources (pane reservations) │
│ - obtain approval tokens if required │
│ - persist PrepareReceipt │
└────────────────────────────────────────────┘
│ success
▼
┌────────────────────────────────────────────┐
│ COMMIT │
│ - execute steps in dependency order │
│ - persist per-step receipt │
│ - on failure: stop and trigger compensate │
└────────────────────────────────────────────┘
│ success
▼ done
or, on failure:
┌────────────────────────────────────────────┐
│ COMPENSATE │
│ - run compensating action for each │
│ committed step in reverse order │
│ - persist CompensationReceipt │
└────────────────────────────────────────────┘
│
▼ TxOutcome
Idempotency ledger
Every step execution is recorded with a content-hash idempotency key. If a tx crashes mid-flight and is resumed, steps whose receipts already exist are skipped. This makes tx safe to retry after operator-host crashes, network partitions, or operator Ctrl-C.
Kill switches
The mission engine exposes a kill-switch enum (MissionKillSwitchLevel in plan.rs) with three levels:
- Off — default; mission proceeds normally
- SafeMode — restrict the mission to non-mutating / read-only steps; operator can still resume
- HardStop — abort immediately; compensation runs for any committed steps
The transition graph is enforced as a state machine; illegal transitions return a typed error. The TLA+ model for the kill-switch invariants is the proofs/tx-killswitch attestation slot (ft-tf6g3.12). Adjacent enums govern the broader execution model: KillSwitchAction in tx_killswitch_model.rs and FleetKillSwitch in robot_fleet_state_machine.rs.
Failure injection
ft tx run --fail-step tx-step:commit triggers an injected failure at the named step. This is how compensation paths are exercised in tests and in operator dry-runs.