Skip to content

RFC-0017: its decisions in full

Rows of the decision inventory, from the RFC.

RFC-0017-1: One gate process in front of each robot, a pass-through that every command of our clients must pass; it is the one door for our clients, not a security boundary on the duck

Architecture ADR: ADR-0024.

  • Decided: the check lives in one process per robot (the gate) that forwards RFC-0003's method shapes unchanged and adds gate.acquire, release, who, takeover. The same library fronts the fake robot, the simulator's robotd (socket proxy), and the NXT's Controller. On the real duck the gate runs on the navigator's computer, not on the duck, and other doors (Pollen's app, gamepad, autod) stay; the navigator watches move.source.
  • Why: operator, 2026-11-18: "we should not allow two things to drive the same robot ... by not being allowed to work together" (§1). The advisor: robotd's socket cannot be made private without risking mapd and RFC-0002's "no code of ours on the duck" (§3.2).
  • How: libs/gate/src/robotgate/__init__.py (was duck/src/duck_lab/gate.py); labrunner/gate.py (lab-gate, was duck-gate); apps/nxt-web/src/nxt_lab/lock.py.
  • Alternatives rejected: a lock in the client library; a lock service; Bluetooth alone; a broker with ACLs; ROS 2 / DDS-Security; last-writer-wins; one shared password; a gate that makes robotd's socket private (§6).
  • RFC status and section: Accepted, revision 2 (2026-11-18); §3.1, §3.2, §6.
  • Who decided and when: the operator on the rule; "Take the advisor version, all is good feedback" (2026-11-18, §7).
  • Existing ADR: partly: ADR-0020 context and decision 2 build on it (its robot.* methods become "our own robot interface"); no ADR records the gate itself.
  • Later changed by: ADR-0020 decision 2 and RFC-0025 §3.3 (2026-11-23): the gate's robot methods become a written "robot interface 1.0" with connectors; the deadman becomes "a last-hop watchdog on the computer wired to the motor controller, in every placement"; RFC-0022 §3.2: gate proxy to libs/gate (robotgate.proxy); RFC-0025 line 354 and RFC-0018 §10 note the NXT lock is a second copy of the rules.
  • In code: Yes: libs/gate/src/robotgate/__init__.py, libs/runner/src/labrunner/gate.py, apps/nxt-web/src/nxt_lab/lock.py exist.

RFC-0017-2: The lease is bound to the connection, with no fencing token; it ends on release, disconnect, STOP, takeover or 10-30 s of silence by the gate's own clock

Architecture ADR: ADR-0024.

  • Decided: a lease belongs to the connection that acquired it; any command on another connection is refused. A reconnect is a new session. The lease lasts 10 to 30 s without a motion command or keepalive, evaluated by the gate's clock; a closed connection frees the robot at once. It is deliberately longer than the robot's 0.5 s deadman. A lease id grows for the log only.
  • Why: "The gate is both the lock and the resource, so no token is sent in commands" (§3.3); "At 0.5 s any hiccup would lose the goal and the robot."
  • How: LEASE_SECONDS = 20.0 in libs/gate/src/robotgate/__init__.py ("RFC-0017 §3.3: 10 to 30 s, not the deadman's 0.5 s").
  • Alternatives rejected: a fencing token in every command (revision 1); a lease equal to the deadman time (§1.1, §6).
  • RFC status and section: Accepted rev. 2; §3.3, §6.
  • Who decided and when: the advisor's review replaced revision 1; operator accepted 2026-11-18.
  • Existing ADR: none.
  • Later changed by: RFC-0025 §3.3 restates it as part of "robot interface 1.0" (gate.acquire, release, keepalive, takeover, who); no change of rule found.
  • In code: Yes: LEASE_SECONDS = 20.0 in libs/gate/src/robotgate/__init__.py.

RFC-0017-3: STOP is accepted from any connection, always; it latches by ending the holder's lease; there is no flag to refuse it

Architecture ADR: ADR-0024.

  • Decided: STOP never needs a lease, is logged with the connection's name, and ends the holder's lease with reason stopped_by <who>, so the navigator's 10 Hz resend cannot restart the motors. The gate's stop is robot.stop then an explicit zero robot.move. The reply is {ok, confirmed, errors}.
  • Why: "A refused STOP risks a collision; an unwanted one stands the robot still" (§3.4). robotd holds the last request after its deadman, and mapd never sees a stop.
  • How: libs/gate/src/robotgate/__init__.py (the module docstring names confirmed, errors).
  • Alternatives rejected: an open_stop flag refusing STOP from unpaired clients (revision 1; §6).
  • RFC status and section: Accepted rev. 2; §3.4, §6.
  • Who decided and when: the advisor's review, accepted by the operator 2026-11-18.
  • Existing ADR: none.
  • Later changed by: RFC-0025 §3.3 keeps it ("STOP from any connection, always, latching"); no change found.
  • In code: Yes: libs/gate/src/robotgate/__init__.py docstring and apps/nxt-web/src/nxt_lab/lock.py ("STOP is accepted ...") exist.

RFC-0017-4: Peers cannot eject each other; only names on a per-robot takeover list may take a robot, and the takeover is recorded and announced

Architecture ADR: ADR-0024.

  • Decided: gate.takeover is allowed to client names in a config file (a plain file, one name per line, duck-gate --takeover-names), stops the robot, ends the holder's lease (taken_over_by <name>), sends lease_lost, and writes who/from whom/when. "A borrowed robot's owner may take it back, and among owners of different robots nobody ejects anybody." An agent over MCP is on no list. A takeover makes a running goal interrupted; a STOP makes it cancelled.
  • Why: the operator's room scenario, 2026-11-18: "while you're connected, others cannot eject you" (§1).
  • How: takeover-names file; gate jsonl log forwarded to Mission Control's event stream (§3.6); §3.5.
  • Alternatives rejected: several owners' lists and gate.request, deferred (§3.9).
  • RFC status and section: Accepted rev. 2; §3.3, §3.5, §8 question 1.
  • Who decided and when: the operator, 2026-11-18 ("The operator's rule, 2026-11-18" in §3.3).
  • Existing ADR: none.
  • Later changed by: not found in my RFCs (RFC-0024 and RFC-0025 cite the lease; RFC-0032 line 49 cites "the lease"). libs/simhost/src/simhost/host.py carries takeover_names in the NXT host file.
  • In code: Yes: takeover_names in libs/simhost/src/simhost/host.py (grep).

RFC-0017-5: v1 is dev / home-lab mode: the tailnet is the trust; pairing, keys, TLS, roles and discovery are cut and wait for a second person's laptop

Architecture ADR: ADR-0024.

  • Decided: a client names itself in hello {client: ...}; watching (state, map, stream) needs no lease; "no lease, no motion". Key pairs, TLS, the pairing code, mDNS, roles, gate.request, the idle cap and unpair are deferred, with the trigger "when a second person brings a laptop".
  • Why: "The threat is a stale or second client of ours on a trusted tailnet, not a stranger" (§3.9); Python's ssl cannot make keys, so TLS is "a dependency decision".
  • How: §3.9 table; §3.7 (discovery stays with Mission Control's registry; mDNS does not cross Docker bridges).
  • Alternatives rejected: key pairs and TLS now; mDNS discovery (§3.9, §6).
  • RFC status and section: Accepted rev. 2; §2.2, §3.1, §3.9.
  • Who decided and when: the advisor's review; operator 2026-11-18.
  • Existing ADR: none.
  • Later changed by: not found in my RFCs.
  • In code: Yes (as designed): no pairing code found; grep -n "pairing" in libs/gate/src/robotgate/__init__.py returns nothing.

RFC-0017-6: One client holding many robots acquires one lease per robot in the order of the robot ids and releases all on a failure

Architecture ADR: ADR-0024.

  • Decided: a team goal run acquires leases in robot-id order; if one fails it releases those it took and fails naming the held robot. Losing one lease interrupts that robot's part only; the run decides the rest.
  • Why: "so two runs cannot each hold half a team and wait for the other" (§3.5.3).
  • How: §3.5.3; the nav server acquires at goal.start (§3.2).
  • Alternatives rejected: none named.
  • RFC status and section: Accepted rev. 2; §3.5.3.
  • Who decided and when: the advisor's review (revision 2, 2026-11-18).
  • Existing ADR: none.
  • Later changed by: not found in my RFCs (RFC-0030 line 854 cites per-goal leases as "assumed").
  • In code: Unknown: multi-robot team runs are not built in the files I looked at.

RFC-0017-7: The gate protocol carries a number (protocol: 1); a client refuses a newer one and accepts a missing one as 0 with a warning

Architecture ADR: ADR-0024.

  • Decided: protocol: 1 appears in gate.who, every other gate.* reply, a refusal's data and the hello answer; the robot's own replies carry none. A change that adds a field keeps the number; one that changes or removes meaning raises it. Clients check at hello (robotgate.check_protocol).
  • Why: RFC-0018 §5.3 "a contract changes only by adding" (cited at §3.1).
  • How: PROTOCOL and check_protocol in libs/gate/src/robotgate/__init__.py.
  • Alternatives rejected: none named.
  • RFC status and section: Accepted (added to §3.1 at phase 5, 2026-11-23, per RFC-0018 §5.3).
  • Who decided and when: RFC-0018 phase 5 (2026-11-23); no separate operator quote.
  • Existing ADR: none.
  • Later changed by: RFC-0025 §3.3 plans a written "robot interface 1.0" with its own version (ADR-0020 consequences: "needs its own written contract and a version").
  • In code: Yes: PROTOCOL, check_protocol in libs/gate/src/robotgate/__init__.py.

RFC-0017-8: "An MCP agent may not fire" is enforced by Mission Control, not the gate; an agent is Mission Control's client and cannot take over

Architecture ADR: ADR-0024.

  • Decided: the gate does not tell agents from other clients; Mission Control does not pass fire to an agent, and an agent is on no takeover list.
  • Why: "revision 1 wrongly said [the gate] did" (§3.8).
  • How: Mission Control's per-client tokens (RFC-0014 §3.9) (§3.8).
  • Alternatives rejected: gate-enforced agent identity (revision 1; dropped).
  • RFC status and section: Accepted rev. 2; §3.5.7, §3.8.
  • Who decided and when: the advisor's review (2026-11-18).
  • Existing ADR: none.
  • Later changed by: not found in my RFCs.
  • In code: Unknown: not checked in apps/mission-control. ---