Skip to content

RFC-0003: its decisions in full

Rows of the decision inventory, from the RFC.

RFC-0003-1: Every robot speaks the duck's JSON-RPC shape; the NXT gets the subset the brain needs, with the same names

  • Decided: Use the duck's contract (JSON-RPC 2.0, newline-delimited, methods by namespace: hello, robot.subscribe/robot.state, robot.move, robot.stop, robot.do, robot.health, robot.autonomous, sensor streams) as the reference; the NXT implements the subset with the same names, and the web UI becomes one client of it.
  • Why: "Two interfaces mean two brains" (§1); the duck's is "designed, documented and in use" and a new interface designed for both was rejected "for now" (§5).
  • How: RFC-0003 §2.1 table.
  • Alternatives rejected: keep the NXT's own HTTP API and teach the brain two interfaces; a new interface for both (§5).
  • RFC status and section: Proposed, revision 2, §2.1, §5.
  • Who decided and when: direction agreed by the operator, 2026-11-14: "good idea to align next LEGO on one JSON-RPC interface for everything" (§6, header).
  • Existing ADR: partly: ADR-0020 "Robots behind our own interfaces: robotd and ROS 2 are peer backends" sets the later interface principle but I did not verify it adopts the duck-shaped JSON-RPC for the NXT.
  • Later changed by: RFC-0014 §3.8 line 671 (the NXT was driven through nxt-web's HTTP API, "later the RFC-0003 JSON-RPC when its Python service exists"); RFC-0014 line 677 (an adapter boundary "in the RFC-0003 JSON-RPC shape"); ADR-0020; RFC-0025 (navigator contract in libs/runner/CONTRACT.md). RFC-0033 gap 4 then built the NXT JSON-RPC service (nxt-web's gate socket).
  • In code: grep -rn "robot.subscribe" apps/nxt-web/src was not run; apps/mission-control/src/mission_control/nxt.py now calls nxt-web's gate socket (apps/nxt-web/src/nxt_lab/gate.py), so the NXT JSON-RPC service exists.

RFC-0003-2: A deadman program on the brick (robotd-lite) stops the motors after 0.5 s without a command; it is the default drive mode

  • Decided: A small NXC program on the brick receives move commands through message boxes, stops the motors when no command arrives for 0.5 s, stops on the ultrasonic (forward motion within 15 cm) and, later, on bumpers, and reports state through a response mailbox. The service's drive mode is deadman by default and refuses to drive without it; direct (PC watchdog only) is flagged in the header. It is "the first thing to build on the NXT, before more features".
  • Why: the stock firmware keeps the last motor command, so a crashed server or lost link leaves the motors running; "Twice on 2026-11-14 our own test code showed what that means" (§1, §2.3).
  • How: apps/nxt-web/programs/robotd.nxc, nxt_lab/deadman.py, apps/nxt-web/tests/{test_deadman,hw_deadman}.py (§2.3 "As built").
  • Alternatives rejected: deadman in the NXT service only ("cannot help when the service or the link is what failed"); replacing the firmware (leJOS) (§5).
  • RFC status and section: Proposed, revision 2, §2.3, §5; built 2026-11-14, real-brick check not yet run at the time.
  • Who decided and when: not stated as an operator decision; written after the two incidents of 2026-11-14 (§6).
  • Existing ADR: none.
  • Later changed by: RFC-0017 line 304 and 467 (robotd-lite's 0.5 s deadman "has not yet been" checked on the real brick; still open); RFC-0014 §3.8 (the page's STOP works with the web UI and robotd-lite). Not reversed. Checked: RFC-0010 to RFC-0032 by grep.
  • In code: Yes: apps/nxt-web/programs/robotd.nxc, apps/nxt-web/src/nxt_lab/deadman.py, DRIVE_MODES = ("deadman", "direct") default deadman in config.py.

RFC-0003-3: The robotd-lite mailbox protocol is fixed-width: D/S/Q commands, a seq,left,right,dist,flags,ms reply

  • Decided: Commands in mailbox 1, fixed width (D seq, left+100, right+100, forward flag, 12 bytes; S stop; Q query that answers but does not feed the deadman). Every command is answered after it is applied in response mailbox 1 with seq,left,right,dist,flags,ms; flags 1 deadman stop, 2 obstacle stop, 4 bad command. The tracks are ports C and B; the service refuses deadman driving with any other Setup. Stop is belt and braces (robotd S, then the motors directly); SIGTERM sends S first.
  • Why: the RFC gives no reason beyond the NXC and message-box limits; throughput numbers are in §2.3 (a move every 200 ms uses about 40 % of the Bluetooth link).
  • How: apps/nxt-web/programs/robotd.nxc, nxt_lab/deadman.py.
  • Alternatives rejected: none named.
  • RFC status and section: Proposed, revision 2, §2.3 "As built".
  • Who decided and when: not stated.
  • Existing ADR: none.
  • Later changed by: not found in my RFCs (RFC-0010 to RFC-0032 by grep; RFC-0003 §4 item 3 lists message-box throughput as to measure).
  • In code: Yes: apps/nxt-web/programs/robotd.nxc exists; the byte layout was not compared.

RFC-0003-4: robotd-lite is the one program under which driving is allowed; any other program keeps the interlock

  • Decided: The service sends motion only through robotd-lite's message boxes (direct motor commands only as robot.stop's belt and braces); sensors and odometry then come from robotd-lite's state box; a missing deadman program means the service shows it and refuses to move, unless the operator chooses direct drive with the PC watchdog, visibly flagged.
  • Why: "robotd-lite is itself a program" and RFC-0001 refuses driving while any program runs (§2.4).
  • How: RFC-0003 §2.4; apps/nxt-web/src/nxt_lab/robot.py, deadman.py.
  • Alternatives rejected: none named.
  • RFC status and section: Proposed, revision 2, §2.4.
  • Who decided and when: not stated.
  • Existing ADR: none.
  • Later changed by: not found in my RFCs (RFC-0010 to RFC-0032 by grep).
  • In code: Partial: deadman.py and lock.py exist; the interlock exception was not read.

RFC-0003-5: The NXT interface lives in a Python service on the PC; an ESP32 would be a dumb Wi-Fi to Bluetooth byte bridge

  • Decided: Two layers: the JSON-RPC interface in the Python NXT service (today's nxt-web grown up), and the link (USB, PC Bluetooth, or an ESP32 bridge speaking nxt-python's nxt-server protocol: 0x98 asks the link type, 0x99 closes, anything else is forwarded). The ESP32 must be an original ESP32 (classic Bluetooth).
  • Why: nothing above the bridge changes; the alternative (JSON-RPC on the ESP32) costs "C++ firmware for every change" (§2.2).
  • How: RFC-0003 §2.2 diagram; not built.
  • Alternatives rejected: the JSON-RPC interface on the ESP32 itself ("revisit if the NXT must work with no computer at all").
  • RFC status and section: Proposed, revision 2, §2.2, §4.1 (open: "the operator decides once the current pieces work").
  • Who decided and when: not decided; the operator deferred it on 2026-11-14 (§6).
  • Existing ADR: none.
  • Later changed by: not found in my RFCs; RFC-0017 treats NXT access but I did not read it for this point.
  • In code: No: no ESP32 bridge or nxt-server client found in apps/nxt-web/src file list (ls only).

RFC-0003-6: Two bricks, one robot: a robotd-lite on each brick, whole-robot stop if either trips, an arm.* namespace

  • Decided: The arm robot uses two bricks (BODY, ARM) behind one service; bricks[] in robot.health/robot.state, an arm.* namespace (joint targets, gripper, arm.state), a robotd-lite on both bricks, and if either drops off or its deadman trips the whole robot stops; robot.stop stops both.
  • Why: safety must hold across the whole robot (§2.5); the RFC gives no further reason.
  • How: RFC-0003 §2.5; no code.
  • Alternatives rejected: none named.
  • RFC status and section: Proposed, revision 2, §2.5.
  • Who decided and when: not stated.
  • Existing ADR: none.
  • Later changed by: not found in my RFCs (RFC-0010 to RFC-0032 by grep).
  • In code: No: grep "arm\.\|bricks" apps/nxt-web/src returned nothing.

RFC-0003-7: Firing is irreversible: always propose in a mission and refused unless the shooter is enabled

Architecture ADR: ADR-0024.

  • Decided: robot.do fire is always propose in a mission (never auto) and refused unless the shooter is enabled.
  • Why: "Firing is irreversible" (§2.3); RFC-0005 §2.3 repeats it for flotilla.
  • How: RFC-0003 §2.3, RFC-0005 §2.3; RFC-0014 enforces it at the API.
  • Alternatives rejected: none named.
  • RFC status and section: Proposed, revision 2, §2.3 end.
  • Who decided and when: review round 2, 2026-11-14 (RFC-0005 §6); not an operator quote.
  • Existing ADR: none.
  • Later changed by: RFC-0014 §3.8 (docs/rfc/RFC-0014 line 715): "firing over MCP or from an agent: decided no (§3.8)", firing only as an explicit call by the operator. Same direction, stricter.
  • In code: Partial: shooter_enabled and irreversible skills are in the RFC-0014 description of the API; I did not grep the code.