awp-sim is the reference world. It is built on the protocol layer of the Python SDK. It exposes a simulated arm, arm_01, and optionally a gripper, gripper_01, in either time model, and exists to exercise the protocol: moves take real time, aborts decelerate, and connections can be dropped mid-motion. It targets 0.1-draft.12.
The world
Beyond Core
Each is off by default and enabled with--features (comma-separated):
--stream-binding ws offers frames on a ws stream connection at /stream as well as inline (AWP-TRN-003, AWP-TRN-012..013).
Serving
- Authentication. On a non-loopback address the server refuses to start without
--token(or$AWP_SIM_TOKEN) and TLS (--tls-cert,--tls-key), unless--insecureis given. It accepts the token inAuthorizationor as theawp.bearer.<token>subprotocol and rejects any URL that carries one (AWP-SEC-001..006). - Audit log. One JSON Lines file per session in
./awp-audit(--audit-dir): credentials redacted, frames recorded as header plus payload hash, records hash-chained (AWP-AUD-001..007).--record-diradditionally writes each session’s wire trace in the trace format. - E-stop.
kill -USR1engages it andkill -USR2releases it (AWP-EVT-002). - Timing.
--watchdog-ms,--heartbeat-ms,--reconnect-window-ms, and--tick-msoverride the defaults. - Latest-wins delivery. On the inline binding a frame not yet sent on a
latest-winschannel is replaced by a newer one rather than queued behind it (AWP-TRN-009).
Scenarios
awp-sim scenarios runs real clients against the world on a virtual clock and checks the outcome; --out DIR writes one trace per agent and a report.json. Every recorded trace passes the specification’s own trace checker.
Using it in tests
The world is a sans-IO engine:awp_sim.world.World takes messages and the current time and returns what to send. awp_sim.loopback.Loopback connects it in-process to real ClientConnections on a virtual clock, with fault injection for dropped, half-open, and lossy connections and World.disturb for an external disturbance of the arm, so agent code can be tested deterministically without a socket.
Not implemented
Grant expiry; stream bindings other thanws and inline; the robotics profile.