Safety Operations Guide
This guide defines safe operating procedures for Anolis-managed hardware systems.
Core Principles
- Safe startup: runtime always starts in
IDLE. - Explicit control: mode transitions require operator action (
POST /v0/mode). - Controlled automation: in
AUTO, manual calls are policy-gated (BLOCKorOVERRIDE). - Visibility first: read-only diagnostics remain available across modes.
- Hardware safety remains external: software controls do not replace interlocks/E-stop systems.
Runtime Mode Safety Semantics
| Runtime Mode | Automation Loop | Control Operations (POST /v0/call) | Notes |
|---|---|---|---|
IDLE | Stopped | Blocked | Safe startup/standby mode |
MANUAL | Stopped | Allowed | Operator-driven commissioning/control |
AUTO | Running | Manual calls policy-gated | Automation calls continue normally |
FAULT | Stopped | Allowed | Recovery/diagnostic mode; transition restrictions still apply |
Transition rules:
IDLE <-> MANUALMANUAL <-> AUTOAny -> FAULT(valid transition target)FAULT -> MANUALFAULT -> AUTOis invalidAUTO -> IDLEis invalid
Note: FAULT is not globally auto-entered for every error condition in the current runtime; it is a defined mode and transition target with strict recovery pathing.
The runtime does enter FAULT autonomously in two cases:
- A behaviour-tree tick raises an exception (#279). The control logic has reached a state its author did not model, so autonomous actuation is halted rather than continued. Note this is reachable from ordinary tree edits, not only from internal errors: BT nodes guard their inputs but not their outputs, and a precondition script referencing an undefined blackboard entry throws on the first tick of a tree that loaded cleanly.
- A provider restart republishes an inventory that fails the refuse-hookless gate while in AUTO (#233).
In both cases the declared *->FAULT mode hooks run, and recovery is the ordinary FAULT -> MANUAL path. An operator who finds a machine in FAULT should check the runtime log and GET /v0/automation/status (execution_reason: terminal_failure indicates the engine faulted rather than an operator changing mode).
Standard Startup Sequence
- Start runtime (enters
IDLE). - Verify provider/device availability and safe initial states.
- Transition to
MANUAL. - Run manual verification/calibration checks.
- Transition to
AUTOonly after operator acceptance.
Use this canonical transition command:
curl -X POST http://127.0.0.1:8080/v0/mode \
-H "Content-Type: application/json" \
-d '{"mode":"MANUAL"}'Use the same command shape for AUTO, IDLE, and FAULT.
Mode Procedure Checklist
IDLE -> MANUAL
- Confirm providers are
AVAILABLE. - Confirm actuator signals are in safe states.
- Transition to
MANUAL.
MANUAL -> AUTO
- Validate behavior tree configuration and parameters.
- Confirm manual verification is complete.
- Transition to
AUTO. - Monitor
/v0/automation/statusand/v0/providers/health.
The runtime refuses
MANUAL -> AUTO(returnsFAILED_PRECONDITION) when the config has actuating outputs but no declaredmode_transition_hooksentry covers theAUTO -> FAULTtransition — autonomous actuation (which only runs in AUTO) must have a declared safe-state path that actually fires when a fault trips from AUTO. Declare a hook matchingAUTO -> FAULT(from: AUTO/"*"/ omitted andto: FAULT/"*"/omitted) that drives actuators to a safe value; a hook covering only another transition (e.g.AUTO -> MANUAL, or anIDLE -> FAULThook that never fires from AUTO) does not satisfy the gate. Manual control and the software e-stop remain available in the refused state.Satisfying this gate does not give you a software e-stop. The gate asks only for the autonomous path;
POST /v0/estoprunssafety.safe_state, which is a separate declaration the gate never checks. Declaring only the hook leaves the e-stop driving nothing and — because the latch engages before FAULT is entered — suppresses the hook that any other route into FAULT would have run. The refusal message says so when the ladder would drive nothing.
AUTO -> MANUAL
- Transition to
MANUALfor planned operator takeover. - Verify actuators and signals settle to expected state.
MANUAL -> IDLE
- Command actuators to safe outputs.
- Verify safe state via
/v0/state. - Transition to
IDLE.
Any -> FAULT, then FAULT -> MANUAL
- Enter
FAULTwhen explicit recovery isolation is needed. - Diagnose and resolve root cause.
- Transition
FAULT -> MANUAL. - Re-verify before returning to
AUTO.
Emergency Response
- Immediate software stop:
POST /v0/estopengages the latching software safe-state (runs the declared safe-state ladder and refuses further actuating calls untilPOST /v0/estop/clear). It works whether or not automation is enabled; on an automation machine it also drivesFAULT. - If software path is insufficient: terminate runtime process.
- If physical hazard persists: use hardware E-stop / power isolation.
- After incident: inspect hardware, collect logs, and restart from full startup checklist.
The software e-stop is a convenience within reach of an operator; per principle 5 it does not replace the hardware E-stop / interlocks. A machine that declares no software safe-state (safety.safe_state) reports software_safe_state: "none" and still latches, but performs no safe-state actuation.
Common Risks and Mitigations
- Skipping IDLE checks:
- Always validate safe initial state before
MANUAL.
- Always validate safe initial state before
- Unsafe power-on assumptions:
- Providers must actively drive safe defaults on startup.
- Invalid FAULT recovery path:
- Never attempt
FAULT -> AUTO; recover throughMANUAL.
- Never attempt
- Manual interference in AUTO:
- Prefer
manual_gating_policy: BLOCKfor production.
- Prefer
- Ignored provider health degradation:
- Monitor
/v0/providers/healthand supervision fields continuously.
- Monitor
Hardware Integration Safety Checklist
Provider safety
- Provider startup sets actuators to safe defaults.
- Communication failures surface as degraded quality/error status.
- Restart behavior does not create unsafe transient outputs.
Capability and limits
- Function argument constraints match physical limits.
- Signals represent actionable safety state.
- Device fault conditions are exposed clearly.
Operational readiness
- Startup/recovery SOP exists and is tested.
- Emergency stop SOP exists and is tested.
- Site-specific hazard analysis is complete.
Development vs Production Policy
Development/testing:
- Runtime still starts in
IDLE. - Faster workflows are acceptable after minimal safety verification.
OVERRIDEmay be acceptable for controlled bench testing.
Production/hardware operation:
- Keep explicit IDLE verification and full startup checklist.
- Use
manual_gating_policy: BLOCKunless a written override policy exists. - Require documented recovery steps for FAULT entry and exit.
