The five-part loop

Run → capture → find the failure → fix → run again

robot_learning is a live failure-recovery learning loop built for the Alloy × OpenAI Physical AI Hackathon (5 December 2026, Sydney). A SO-101 arm runs in simulation while every observation, command, stall and recovery streams over a Robot Bus into runs/bus/*.jsonl — that log is the dataset. A deterministic stall detector (30 Hz) catches the failure, and Laya — a tiny calibrated classifier, System 1 — names it in about 1.4 s. Only then is the local GLM-4.7 reasoner, System 2, woken to diagnose: it returns a bounded symbolic plan, and a deterministic safety shield clamps every command to the workspace box before it reaches the arm. Each recovery is labelled and fed back into System 1's training set, so over the day System 2 teaches System 1 — the escalation rate falls. That falling curve is the demo: a march of nines. In parallel, recorded episodes train an ACT policy in LeRobot so the base controller itself fails less.

 run ──▶ capture ──▶ find the failure ─────────▶ fix ──────────────▶ run again
 sim/real  bus blackboard   Laya S1 (~1.4 s)     alexei S2 (acts in ~2 s   measured
           runs/bus/*.jsonl  typed + calibrated   via streaming; plan in    failure-rate
                             identification       ~5 s) via safety shield  delta = the
                                                                                  demo ("nines")
                            ▲                                         │
                            └──── every recovery is labelled: S2 teaches S1 ──┘
The loop, from the project README — every recovery is labelled: S2 teaches S1.
Status

Verified on this machine

Ran it, not just wrote it — every number below was measured on the team's build machine, 24 Nov 2026. Evidence lives in the repo's README and docs/TEAM_HANDOVER.md.

CheckResultWhere
Robot Bus protocol round-trip PASS agents/test_bus.py
Full stall-recovery loop, live models 16 eps → 5 stalls → 5 Laya verdicts → 5 alexei-class plans → labelled rows → metrics scripts/acceptance.sh
Laya S1 (robot-ops domain) warm 1.35 s/decision, schema-correct control/laya_client.py
GLM 4.7 S2 (local, resident) 15–30 s/plan, ~14 tok/s, shield-clean JSON plans control/glm_s2.py
Three.js ARMSMITH sim (Unity port) PASS headless-Chromium smoke · IK ~1 cm (Unity had 7) sim/armsmith_web/test/smoke.sh
MuJoCo 4.0.1, CPU SO-101 89k steps/s · EGL render 216 fps @480p · 1.38M steps/s @32 envs scripts/bench/bench_mujoco.py
LeRobot 0.7.0, CPU env PASS dataset + one real ACT train step · zero NVIDIA wheels training/.venv
Bus log → LeRobotDataset converter PASS tests (state 7, action 4) training/to_lerobot_dataset.py
MediaPipe hands → EE target 17 checks · 110 fps @480p CPU vision/hand_tracking/
HSV tape tracker · ArUco pose 9 + 12 checks PASS vision/tape_tracker/
Local AMD iGPU torch (ROCm) 8.7 TFLOPS fp32 with HSA_OVERRIDE_GFX_VERSION=11.0.0 scripts/gpu-python.sh

The loop, turning, visibly.

Sim runs, the detector catches the stall, Laya names it, GLM fixes it, the label feeds back — and the escalation rate falls over the day.