`[update_gate] auto_rollback` in robotd.toml, default false, a row in
`robotctl configure`. It gates every path that reverts without being
asked:
- the health gate after `update apply`, `select` and `rollback`;
- the boot counter on a trial that never confirmed;
- `robot-boot-check` handing over to `robot-rescue`.
Off, the gate still runs and decides. A release that fails stays live,
reported `Stuck` with `robotctl update rollback <component>` in the
reason; the trial is cleared, and the journal entry is aborted rather
than rolled back, so `known_bad` does not blacklist it. The boot check
names the failed units and the manual `robot-rescue --reboot`, and exits
2. `--dry-run` is unchanged, since the OS slot gate reads it.
Releases now reach robots as tested Yocto images, and a separate daemon
update is the dev-board case, where an unasked revert replacing the
code under whoever holds the robot does more damage than it prevents.
A soft deprecation: the code stays, tested, one setting away.
`updaterd` reads the key from `robotd_config` (new, defaults to
/etc/robot/robotd.toml), both layers, at the moment of deciding, like
`allow_community` and the board. Test fixtures turn it on where they
test what a revert does.
Assisted-by: Claude:claude-opus-5-5
Making a board take branch builds meant copying team.dev.pub into
/etc/robot/trusted_keys under exactly the right name, sed-ing
allow_dev_keys in updater.toml, and restarting updaterd. On the Yocto
image both live in /etc, which an A/B OS update replaces, so the board
quietly stopped being a dev board at the next OS update.
updaterd now carries the dev public key built in (always dev-only), and
dev keys count when `allow-dev-builds` exists in its state_dir, under
/var/lib/robot, which survives OS updates. `sudo robotctl configure
--allow-dev-daemon on|off` writes or removes it and restarts updaterd.
allow_dev_keys = true in updater.toml still works, so provisioned boards
are unchanged; the shipped config keeps it false and nothing ships the
marker.
Needs an updaterd from a release that carries this: an older one
ignores the marker.
Docs: updater-design.md §5.4 owns the mechanism; install-dev,
cheatsheet-dev, dev-push, architecture, deploy READMEs, config comments,
--ref help text, xtask keygen and the dev.yml note point at the command.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The image's account is `microduck`, not `radxa`. `duckctl ssh`/`scp`
and `dev-push.sh` fall back to it when neither `--user` nor
`DUCK_BOARD_USER` is set, and every doc example follows.
Assisted-by: Claude:claude-opus-5-5
`duckctl ssh` already resolves the robot's address and hands the terminal
over; copying a file off a robot still meant `scp radxa@$(duckctl ip):…`,
which is the substitution `ssh` exists to remove.
The robot side is `scp`'s own `host:path` with the host left out, so
`duckctl scp report.md :/tmp/` sends one up and
`duckctl scp :/var/log/robotd.log .` brings one down. The rewrite is
textual and only ever looks at the first character, which is what keeps
`-r`, `-P 2222`, several sources and a path with a colon in the middle of
it working without this tool having to understand any of them.
Both directions, then, out of one command that answers to the name people
reach for — rather than a `push` and a `pull` that nobody typing `scp`
would find.
A copy with no `:` anywhere in it is refused before the radio is turned
on. `scp` performs that copy happily, locally, and nothing in its output
says the robot was never involved; refusing it after the scan would also
charge eight seconds for the diagnosis.
The `exec` that makes `ssh` become `ssh` is now `become_program`, shared
by both, so the progress meter, the key prompts and the exit status are
`scp`'s own for the same reason they were ssh's.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`duckctl ssh` is `ssh <user>@$(duckctl ip)` without the substitution: the
address comes from the advertisement the way `ip` finds it (and from
net.status over BLE when nothing advertised one), then the process becomes
ssh, so the terminal, the prompts and the exit status are ssh's own. Words
after `--` run on the robot instead of opening a shell.
The user is --user, else a non-empty DUCK_BOARD_USER -- the variable
dev-push.sh already reads -- else radxa, the image's account. An emptied
variable is unset, as DUCK_ROBOT is, rather than a login of `@host`.
Run from this laptop against graphite: `duckctl ssh --user microduck -- hostname`
scanned, exec'd, answered `radxa-zero3`.
Closes#245.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Each was found by the docs audit (#154) and written down there rather than
fixed, because a docs change is not the place for code.
**`cargo test --workspace` now works on a Mac.** `vendor/platform.c` reaches
the bus through `linux/i2c.h`, so `build.rs` compiles it only when the *target*
is Linux — read from `CARGO_CFG_TARGET_OS`, since a build script is compiled
for the host and `cfg!` there would answer for the laptop. The driver's calls
go with it, and off a board `Sensor` is uninhabited: `open` is the only
constructor and it always fails, so the compiler discharges every other method
instead of leaving a body that could one day invent a frame. `tofd` still
builds, `tofd --fake` still serves, and 942 tests pass with nothing excluded.
**`install.sh` stops reporting `tofd` as a daemon it forgot.** The hook enables
every unit with an `[Install]` section a step earlier, so the warning was noise
on every fresh install. Named as known, with no `enable_unit` of its own:
nothing depends on it, so there is no ordering to have an opinion about.
**`dev-push.sh` checks all seven daemons**, not six — and the comment saying
five, restarted in a set of three, was two daemons out of date.
That last one could not work on its own, and finding out why turned up two
faults rather than one:
- **`tofd` published no identity.** Six daemons call `log_startup_identity!`;
`tofd` had a hand-rolled `warn!` that logged a version and wrote no
`/run/tofd/identity.json`. That macro exists because `padd` was once the one
daemon whose journal could not say which build was running — and its own doc
comment predicts this: "a shared definition makes the next daemon's omission
a missing call rather than a missing idea". `tofd` was the next daemon.
- **`configd::units::MANAGED` was still five units.** `mediad` and `tofd`
shipped units two releases ago. So the `units` block of `robotctl health` —
the one a person reads after an update to find which daemon is still on the
old release — could not report either of them at all. Same defect as the
restart set in `restart-order.md` that #154 fixed, one file over.
Docs follow the code: the macOS caveat in CONTRIBUTING, the `tofd` note in
`restart-order.md` §6, and `dev-push.md`, which claimed `robotctl version`
could answer for `tofd` — it could not, for both reasons above.
Verified: `cargo test --workspace` 942 passing on macOS with no exclusions,
`cargo board -p tof --bins` still cross-compiles the driver for the board,
clippy clean for what this touches, `shellcheck -S warning` clean on both
scripts.
Assisted-by: Claude:claude-opus-5[1m]
Six crates and two daemons landed after the pages that describe the system
were written. `mediad` and `tofd` ship units with `[Install]` sections;
`kinematics`, `odometry`, `sounds`, `pet-detect` and `robotd-params` are
libraries `robotd` drives. The docs still said five daemons and `mediad`
not built.
The one that would have cost someone an afternoon is `restart-order.md`:
it named `configd, padd, robotd` as the restart set, which is the page you
read while diagnosing a version skew. It is `configd, mediad, padd, robotd,
tofd` — derived from shipped units, exactly as that page's own rule says,
and `deploy/updater.toml` had said so for two releases.
Also:
- `architecture.md`: the overview and the diagram, which still boxed
`mediad` as not built while §1's own table described it.
- `robotd-design.md`: odometry left the deferred list — `monitor`'s path
map reads it now, which was the objection. New §4.4 for it, and §4.5 for
the voice, theremin, chorale and pet detection, saying why none of them
earns a design page and where each one's reasoning lives.
- `CONTRIBUTING.md`: 508 tests was 936; 13 board checks were 60. Neither
Linux nor macOS builds `cargo test --workspace` out of the box any more —
Linux wants libudev and GStreamer, and `tof` does not compile on a Mac at
all. Both written down, with the commands.
- `roadmap.md`: M5 is in progress rather than unstarted, and the crate
layout defers to CONTRIBUTING rather than keeping a second copy.
- `docs/README.md`: `pad-minimal-pairing.md` and the whole `ideas/`
directory were off the index.
- `cheatsheet.md`: the monitor's 3D robot view, its ToF contact points and
the odometry path map were documented nowhere. `d`, `[`, `]`.
- `_build-release.yml`: a comment claiming `mediad.service` has no
`[Install]`, two releases after it grew one.
- two dead links: `updater.example.toml` from `updater-design.md`, and
`README.md#drive-it` from `pair-a-gamepad.md`, whose target the README
rewrite removed.
Assisted-by: Claude:claude-opus-5
`duck-btctl` was an example of `btd`, and both halves of that stop fitting.
`mediad` gives a robot a second transport, and the two reach different method
sets by design — `robot.move` is refused over BLE and permitted over WebRTC,
`net.connect` the other way round — so a tool named after one radio teaches
everyone that it is the way in, at the moment it stops being the only one.
Its own crate, because a transport-agnostic client cannot be an example of the
BLE daemon: it would need btleplug and a WebSocket client, and only one of those
belongs to `btd`. The guarantee the example arrangement bought — btleplug never
in a release — survives as something stated rather than incidental: nothing on
the robot depends on `duckctl`. `advwatch` comes too; it is a scanner, and
scanners run on laptops.
`default-members` is what keeps it off the board. `cargo board --bins` builds
every default member for aarch64, and cross-compiling a Bluetooth stack for a
board that must never see one is both wasted and wrong. One list, rather than
naming binaries at each of the two `--bins` call sites.
No shim: `duck-btctl` is gone rather than aliased. `docs/project/` keeps
saying it, because those are records of a moment and a tool did not have this
name when they were written — their links are repointed, their prose is not.
Assisted-by: Claude:claude-opus-5
`DUCK_BOARD=radxa@192.168.1.42` is the one setting about a board that cannot be
kept in a shell profile: a reflash, a router reboot or a different network hands
it a new lease, and mDNS on this image is unreliable enough that a `.local` name
is not the answer either. The way that reads is a push that hangs until ssh
times out, followed by finding the address again by hand.
A name does not move. `--name`, or `DUCK_ROBOT` — the same variable `duck-btctl`
already defaults `--name` to, so one exported name serves both tools — and the
address comes from the robot itself over BLE, which is the one channel that
works precisely when the network does not.
Cached in `~/.cache/duck/boards`, and re-resolved only when ssh cannot reach the
cached address. BLE discovery costs ten to twenty seconds and this script exists
to be quick, so the steady state is one ssh probe and the moved-board case pays
one scan before going back to being quick.
Each failure is a different next move, so each says which one it was: a robot
that is not advertising, one that answered but is on no network — joinable over
the same radio, no ssh needed — and one that refused `net.status`, which is a
PIN rather than an address. Re-resolving to the address ssh just failed on says
so too, because the address is then not the problem and a reflashed board with
new host keys looks identical until somebody says it.
An address still wins over a name and skips the radio entirely, so nothing that
worked before changes. `DUCK_BOARD_USER` is for a board whose ssh user is not
`radxa`.
Assisted-by: Claude:claude-opus-5
`updaterd.service` sets `PrivateTmp=yes`, which gives the unit its own
`/tmp` *and* its own `/var/tmp`. `scripts/dev-push.sh` copied the release
to `/var/tmp/duck-sideload`, so the files landed in the pair the shell
sees and the daemon read the pair the namespace gave it. Every push
failed at
error: network error: no manifest for version 0.5.1-dev.local.… in
/var/tmp/duck-sideload
against a directory whose `ls` lists that exact manifest, its signature
and the artifact — a sentence with nothing in it to act on, which is why
it cost an afternoon rather than a minute. The tests never caught it:
they point `LocalDir` at a fixture root, where no namespace applies.
Three changes, one per way this could recur:
- The push now sideloads from the board user's home, resolved on the
board. It keeps the property `/var/tmp` was chosen for — writable by
the ssh user, so no sudo to copy into it — and is outside the unit's
namespace.
- Preflight gains `Check::SideloadDir`: a `--from` directory this process
cannot see fails before any lookup, and when the path is under `/tmp`
or `/var/tmp` the failure names `PrivateTmp=yes` and says where to put
the release instead. A board that does not privatise `/var/tmp` passes
it without noticing it exists, and `updaterd install --from` — which
runs as a CLI, outside the namespace — is unaffected.
- `xtask/tests/sideload.rs` holds the two files against each other: the
script may not name a path the unit hides, and while it sideloads from
a home directory the unit may not set `ProtectHome=`. Neither file can
check that alone, and a third test fails if both halves stop applying
so the file cannot go quietly vacuous.
Assisted-by: Claude:claude-opus-5[1m]
Building on a laptop and installing straight on the board was a section
inside the dev-board cheat sheet, which is the wrong place for the thing a
developer does dozens of times a day: the setup, the container build, the
dry run and every failure mode were compressed to fit alongside the
`--ref` commands, and the debugging half of the loop — journal, log level,
what a stale daemon looks like — was not there at all.
`docs/robot/dev-push.md` is now the page for it, and every pointer that
used to send readers to the cheat sheet for setup goes there instead. The
cheat sheet keeps one entry and a link.
Assisted-by: Claude:claude-opus-5[1m]