Skip to content

ADR-0031 — An abstraction across robots is built when three different cases have recorded runs

Status: Accepted by the operator on 2026-12-03: "write down this abstraction guidance as well in some docs and lets follow it, this is actually part of the strategy". Earlier the same day: "I do agree that generalising before there are three real, different cases usually produces the wrong abstraction", and "I want to set the gate on when we generalise: I can fly my drone, we will get ducks soon". Date: 2026-12-03 Revisions: 2026-12-03 accepted with a ledger per component; 2026-12-03 one ledger for the platform, since the abstractions cross the parts (decision 4; confirmed by the operator: "yes on one"). Context documents: docs/wip/OBSERVATORY-ROADMAP.md (the Observatory's MVP v1 to v4), docs/wip/PLATFORM-ROADMAP.md (the platform's ledger), RFC-0025 (MVP 2: the TurtleBot3 Burger), RFC-0034 (the physical robot's reference)

Context

The lab's code is meant to serve more robots than the one it was written for. The plan names them: the simulated duck and the NXT today; the TurtleBot3 Burger in Gazebo (MVP v2); the real ducks (v3); the real Burger doing SLAM (v4); the operator's drone, which can fly now; lidars later.

The Observatory shows the pull. Part of it is general already: runs as MCAP, one timeline, an estimate against the truth per tick, decisions with their reasons, detectors over a recording. Part of it is the duck's: scenes as boxes on a floor, a 2D pose, top-down views, the 8x8 depth sensor. Making the second part general (a 3D pose, a world that plugs in, detectors that declare what they need, an estimate/truth pair for any quantity) is the right direction. The question is when.

An abstraction drawn from two cases that are alike fits those two and has to be rebuilt for the third. The duck and the NXT are both ground robots on a flat floor, so an abstraction of "the pose" drawn from them would be a 2D pose with a new name.

Decision

  1. The gate is per abstraction, not one moment for the whole code base. Each abstraction names its axis: what varies between the cases it would cover (where the truth comes from, the pose's dimensions, what the world is made of, the sensors, the recording format).
  2. An abstraction is built when all three hold:
  3. three cases that differ on its axis (a third flat-floor robot is a third case for the sensors, not for the pose);
  4. each case has recorded runs in the lab's data folder (a planned robot, a datasheet or a sample file from the internet does not count);
  5. a design written from those recordings, as an ADR or RFC, and the operator's go.
  6. Until its gate opens, the code stays specific behind the seams the lab already has: the shared libraries (runfile's scene and run readers), a module per measurement, the MCAP format, the components' contracts (CONTRACT.md). A new case's code goes beside the old in the same seam, not into a general framework written ahead of its cases.
  7. One ledger for the platform lists the abstractions: the axis, the seams it crosses (RFC-0033's register), the cases in hand, the cases still needed. It is one ledger, not one per component, because an abstraction crosses the parts (the pose is in the navigator API, the run format and the Observatory at once). It is in docs/wip/PLATFORM-ROADMAP.md. A review of a change that generalises checks the ledger first.
  8. The drone counts as soon as one flight is recorded. A case is a recording, so a robot the operator already has can open a gate before a planned one arrives.

Consequences

Positive

  • Every abstraction is drawn from data that shows what varies, so the third robot does not force a rewrite.
  • The ledger says what a new robot would unlock, which tells the operator what recording is worth making next (one drone flight opens half of the pose's gate).
  • Work on the current robot is not slowed by framework work for robots that are not here.

Negative

  • A third robot's arrival costs a refactor: the specific code of the first two is rewritten behind the new abstraction. That cost is accepted; it is smaller than rebuilding a wrong abstraction.
  • Duplication between two cases is tolerated until the third arrives.

Neutral

  • MCAP and the written contracts stay the cheap insurance: they keep the general layer separable without generalising it.
  • This does not stop a robot-specific feature for a new robot (an importer for the Burger's bags); it stops a general framework built before its cases.

Alternatives considered

  • Generalise now, from the plan's list of robots. Rejected: the plan says which robots, not what their recordings hold; the abstraction would be drawn from assumptions.
  • Never generalise; one Observatory per robot. Rejected: the operator's goal is one lab across robots, and the estimate/truth pair is already shared by every robot in the plan.
  • Two cases. Rejected: the two cases in hand are alike on most axes, and two alike cases show no variation to abstract over.

Not covered

  • Whether a simulated and a real run of the same robot are two cases: on the axis "where the truth comes from" they are; on the pose's axis they are not. Each ledger decides per axis.
  • The drone's model and what its log holds are not known here.