The October brain, brought up to main. Beyond the conflicts:
- The pad's handoff (silent until touched, lets go after pad_idle_s) is
now pad_map::engage, since main moved padd's mapping into pad-map. A pad
nobody was touching going away no longer sits the robot down: the brain
was driving, not the pad.
- autod walks at the pad's [pad_drive] full stick rather than the removed
robotd_params::drive constants.
- [map]'s template values are commented out like [laser] and [soccer]:
they never shipped live, so they do not belong in EVER_SHIPPED.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cache-apt-pkgs-action installs without a fresh apt-get update. On its
first run here two packages had moved on the mirror, the install 404'd,
and the action reported success with an empty cache, so the build
failed to link GStreamer. Cache apt's archive directory instead: apt
runs as normal, fails as normal, and only fetches what is missing.
Assisted-by: Claude:claude-opus-5-5
plugins-bad pulls ~250 MB of OpenCV, VTK and ffmpeg from
azure.archive.ubuntu.com on every run. That normally takes under a
minute, but a slow mirror today turned it into 20-26 minutes of the
`check` job. Caching the installed packages takes the mirror out of
the path after the first run.
Assisted-by: Claude:claude-opus-5-5
robotd/emotions/ holds the 13 emotions from microduck_emotions (431c73d),
cut by scripts/vendor-emotions.py, and every packaging site includes them as
emotions/ (xtask --include now takes a directory). robotd loads the shipped
set from the release, then [emotions] dir on top: a file there adds one or
replaces the shipped one of the same name. A robot installed or updated to
this build has them with nothing to copy. The simulator reads the
checkout's set.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit f6822d9894)
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>
After the PyPI publish, a homebrew job renders the formula for the version
just released from PyPI's wheels and pushes it to pierre-rouanet/homebrew-tools,
so brew upgrade duckctl follows the releases. It writes with a deploy key
scoped to the tap, held by a homebrew environment.
Assisted-by: Claude:claude-opus-5-5
main took API v42–v44 for the vet book, so map.* moves to v45. netpadd
joins mapd in the release units, the restart order and configd's MANAGED
list (now ten); the Call variant count is 77 with both sides' routes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
udp-pad reads the laptop's pad through gilrs, which links libudev on Linux
and has no vendored build, so maturin failed in the manylinux_2_28
container that main's duckctl build moved to. The container gets
systemd-devel, and maturin's auditwheel repair grafts libudev.so.1 into the
wheel.
Assisted-by: Claude:claude-opus-5-5
padd's mapping lives in pad-map on this branch, so main's v8 pad defaults
(vx ±0.4, vyaw ±1.0, bumpers unbound) reach padd through robotd-params and
pad-map's tests now expect them. padd's moved tests are dropped from the
conflict; deploy/robotd.toml takes main's [pad_drive] and keeps [netpad].
Assisted-by: Claude:claude-opus-5-5
`Topic :: Scientific/Engineering :: Robotics` is not a trove classifier,
and PyPI refused daemon-v0.16.2's upload over it (400, nothing
uploaded). It is now `Topic :: System :: Hardware`, and
`_build-duckctl.yml` checks the list against trove-classifiers on every
push, so the same mistake fails a branch rather than a release.
0.16.3 because the wheel is built from the tag's files: 0.16.2 carries
the bad metadata for good.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A dispatch runs the workflow files of the ref it starts from, and
daemon-v0.16.1 has neither this workflow nor duckctl/pyproject.toml.
The pypi environment now exists.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
duckctl becomes a PyPI package: maturin's `bin` bindings put the CI-built
binary in a wheel per platform, so `uvx duckctl` (or `uv tool install
duckctl`) downloads and runs it with no toolchain. Wheels only, no sdist,
so nothing ever compiles on the user's machine.
libdbus is now compiled in on Linux (libdbus-sys `vendored`), which makes
the Linux wheels genuine manylinux_2_28 rather than ones with a grafted
library, and drops the apt step from building it.
The build moves out of dev.yml into `_build-duckctl.yml`, which builds the
wheel and takes the branch tarball/zip back out of it: one binary, two
forms. The Linux archives are manylinux_2_28 too now, not the runner's
glibc. `duckctl-pypi.yml` publishes the wheels on every `daemon-v*` tag
via trusted publishing, and refuses a tag that disagrees with Cargo.toml.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The duckctl builds move into dev.yml and publish onto
`daemon-dev-<branch>`, rather than a `duckctl-dev-<branch>` of their own.
Separate workflows could not share a release, because dev.yml deletes and
recreates it. One workflow can: the daemon job now hands its signed dist
to a publish job that waits for both. Only the daemon is required there,
so a failed duckctl build leaves its file out and never holds back what
boards install.
The updater fetches assets by exact name, so these files sit beside the
board's without being seen. duckctl.yml and the prune case for
`duckctl-dev-` go.
Assisted-by: Claude:claude-opus-5-5
Every branch push now publishes `duckctl-dev-<branch>`, beside the
daemon's `daemon-dev-<branch>`, so a branch's client is a download for
anyone without a Rust toolchain or a GitHub login:
`scripts/install-duckctl.sh [branch]` on Linux and macOS, a zip on
Windows. A release of its own rather than assets on the daemon's, which
dev.yml recreates on every push in parallel with this. The updater lists
only its own prefixes, and prune-dev-releases removes these with their
branch.
Assisted-by: Claude:claude-opus-5-5
duckctl runs on a laptop, not a robot. Build it on every push for linux
x86_64/aarch64, macOS arm64/x86_64 and Windows x86_64, uploaded as run
artifacts rather than release assets, which are what the updater reads.
duck-ipc-proto's clock is Unix-only now, with libc a Unix dependency:
clock_gettime does not exist on Windows, and only the daemons stamp with
it.
duckctl.md gains the two ways to get it without a clone: the CI build,
and `cargo install --git`.
Assisted-by: Claude:claude-opus-5-5
It goes to main as its own PR and comes back here with the next merge of
main: nothing in it depends on this branch.
Assisted-by: Claude:claude-opus-5-5
duckctl is the client for `udp-pad` and the BLE commands, and it runs on
a laptop, not a robot. Build it on every push for linux x86_64/aarch64
and macOS arm64/x86_64, uploaded as run artifacts rather than release
assets, which are what the updater reads.
Assisted-by: Claude:claude-opus-5-5
mapd subscribes to robot.state and tof.frame like any client, feeds the maploc
mapper on its own thread, keeps the map in /var/lib/mapd/map.json across
reboots, and answers map.status, map.stream, map.grid and map.wipe on
/run/mapd/map.sock. It commands nothing: the robot walks without it, and the
head moves by robotd's own idle glances.
The map file is replaced atomically, saved every autosave_s, when the pose has
moved 30 cm and on shutdown; a file it cannot read is set aside as
map.json.bad-<secs>, never overwritten.
[map] in robotd.toml (on by default); robotctl map / map show / map wipe;
routed over WebRTC by mediad, refused over BLE. Packaged in both release
workflows and dev-push, named in install.sh, configd's unit list and
updater.toml. docs/design/mapping-design.md owns the mechanism.
Checked end to end against a recorded living-room session served over real
sockets: same 21 stops as the offline replay, saved on SIGTERM, and after a
restart relocalized within four stops onto the first run's nodes (2-3 cm).
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
padd took two changes on main while it was being split into pad-map: the robot sitting down
when a driving pad drops out (#372), and the Home button toggling the flashlight (#375). Both
land in the split shape. The pad-loss state machine and the reading of the robot's answers move
to pad_map::loss so netpadd can share them; Home is pad_map::Buttons bit 12, which was reserved
on the wire and is now the middle button.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A push by Dependabot runs with Dependabot secrets only, so MINISIGN_DEV_SECRET_KEY is empty
and the publish job fails at the signing guard (seen on #376). Skip the job for that actor,
as it is already skipped in forks.
Assisted-by: Claude:claude-opus-5-5
A policy keeps stepping when the duck is lifted, so a robot picked up mid-walk
thrashes in the hand until somebody presses Start. `[pickup] enabled = true`
runs a small classifier over the last second of what the loop already reads
(gyro, gravity, joint positions/velocities, last commanded target) and pauses
the walking/standing networks while a hand carries the robot: the legs ramp to
the walking policy's own standing stance at the policy gain, and the policy
takes the robot back ~0.2 s after it is set down on its feet.
- duck_control::pickup: feature row, 1 s window, ONNX detector, hysteresis
latch and pause pose -- the contract with the training code in microduck_rl
(pickup_detector branch); model vendored at duck-control/models and packaged
at all three release sites, with a tripwire test
- robotd/src/pickup.rs: the loop's side; watches only walk/stand in walk mode,
any other owner (skill, sit, limp-fall, disable, shutdown) ends a pause, a
failing detector lets go; off means nothing is loaded or run
- robotd-params [pickup]: enabled (feature switch in robotctl configure,
restarts robotd), model, pause/resume thresholds (validated as a band)
- docs: robotd-design.md 2.4.2, cheatsheet "Picking the robot up"
Trained in simulation only. Closed loop in the RL sim: pick-ups detected 100 %
(median 0.20 s), set-downs resumed median 0.18 s, under ~1 false pause per hour
of walking. End to end against duck-body (robotd --sim, velstand, a scripted
hand): three pick-ups paused in 0.22-0.28 s, three set-downs resumed in
0.20-0.24 s, no false pause while walking, standing or turning.
Assisted-by: Claude:claude-opus-5-5
The bench script becomes a daemon that ships in the release. nfcd owns the
CLRC663 reader on /dev/ttyACM0, a Rust port of winnie's ntag663 cut down to
selecting a tag and reading its NDEF, and polls it at 5 Hz. On a tag's
arrival it takes the first Bluetooth address in the records: a pad already
connected means nothing happens, otherwise configd pairs that one
(pad.pair) and robotd quacks (robot.sound). One attempt per touch.
No reader is the ordinary case — one log line and a retry every 30 s, so
plugging one in is all it takes. Unprivileged: dialout for the port, robot
for the sockets, and configd names it in --allow-user since pad.pair is
mutating.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A contributor's push runs the dev workflow in their own fork, where
MINISIGN_DEV_SECRET_KEY does not exist. Every such run built, then
failed at the signing step, so a fork's branch was always red and a
real build failure there looked the same as the missing key.
The job now skips when the repository is a fork. ci.yml on the pull
request is what checks the change.
Assisted-by: Claude:claude-opus-5-5
`scripts/duck-sim up` printed two `command not found` lines on every start.
`updater-$name.toml` is written from an unquoted heredoc — that is what expands
`$REPO` and `$STATE` — so the two backtick pairs in the comment above
`policy_library` were command substitutions, and the shell ran `policy.fetch`
and `Permission` as commands. The generated file was correct apart from its own
mangled comment, which is why nothing failed and nobody looked.
**The comment above that heredoc already warned about exactly this**, and that
is the part worth fixing rather than the two lines. It was written in `a092f6f`,
and the very same author added the unescaped backticks in `2581a38` two hours
later; the `robotd.toml` heredoc above it carries its own instance of the
warning. Two prose warnings were not enough. A comment cannot fail a build.
So `scripts/duck-sim` joins CI's shellcheck list, where a bare backtick pair in
an unquoted heredoc is SC2006 and fails the build. It should have been there
already: `README.md` and `docs/robot/simulation.md` both send a newcomer with no
robot to this script, and nothing had ever run it in CI.
The rest is the four other findings shellcheck reports on the file, cleared so
the step can pass:
- Two `ls <glob> | head -1` for onnxruntime became `find -name ... -type f`,
which is what `setup-board.sh` already does for the same library. `-type f`
is load-bearing rather than copied: without it, `find` also matches a bare
`libonnxruntime.so` symlink, and `stage` names the container's symlink after
`basename` of what it finds — so a wheel shipping that symlink would have
produced a self-referential one, inside the container, where nothing would
notice until a policy failed to load. The current wheel does not ship it, so
nothing is broken today; `-type f` is what keeps that true for the next one.
Same result as before on Linux, on macOS, with two virtualenvs, and empty
when there is no venv at all, which is what the caller's `die` depends on.
- `mountpoint ... && umount ... || true` became an `if`, the shape the two lines
above it already use. SC2015 is reported on the old shape and the `if` states
the intent, which is "run `umount` if it is mounted" rather than an exit status
nobody was reading. That `|| true` inside the `if` is not decoration, though,
and it is the one line here a reader might tidy away: the script is under
`set -eu`, so dropping it turns a busy overlay into an aborted `down` — the
remaining ducks left booted, `robotd` never stopped, exit status 32 from
`umount` standing in for the exit status of `down_containers`. Measured with
the real function body against a mocked `umount` that fails on the second
duck, not reasoned about. Neither shellcheck version reports the removal, so
the function carries a comment saying so rather than relying on CI.
- `$AUDIO_BIND` keeps its deliberate word split, marked like the other four
unquoted lists in this script.
Assisted-by: Codex
The endpoint `mediad::turn` fetched from was dead for three months before
anybody noticed, and it was already dead when the default that named it
shipped. Nothing in this repository would have caught that: the only symptom is
a warning in a journal and a missing candidate type, and every check we have
pairs two peers on one network, which never looks at a relay.
One authenticated GET, asserting 200 and at least one turn:/turns: entry.
Three deliberate choices. The URL is read out of turn.rs with sed rather than
copied, because a check carrying its own endpoint drifts from what the daemon
compiles in, and a green check on a URL no robot uses reads as proof while
proving nothing. It is scheduled rather than on pull_request: the failure being
guarded against is nobody touching this for months, which a PR trigger cannot
see, and somebody else's outage must not block unrelated work. And a missing
HF_TOKEN fails rather than skips, because a check that skips itself into
permanent silence is precisely the failure mode it exists to end.
It will fail until an HF_TOKEN secret is set on the repository.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
mediad reads its model from /opt/robot/detector/current rather than from
inside the release. The release's postinstall hook seeds that directory
from a pin in [workspace.metadata.detector] (pollen-robotics/
microduck-duck-detector@duck-v1) with scripts/seed-detector.sh, which is
seed-policies.sh with a fixed file list and the same rules: a floor not a
ceiling, nothing partial goes live, never touch a set it did not install.
`robotctl detect check` and `sudo robotctl detect update [--version]`
are `policy check`/`update` against the other root — new updaterd calls
detector.check / detector.install (API v28), sharing the policy set's
types, provenance record and install path. An install restarts mediad,
which is where the model is loaded, and reports whether that took.
The 14 MB of vendored weights leave the repository and the three
packaging sites; xtask holds the pin, the file list (script, updater,
robotd-params) and the packaging together.
The model repo shares its name with the dataset repo. The robot only
addresses the model (resolve/ without a datasets/ prefix, api/models/),
which is written down where the URLs are built.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Every boot of the Armbian image runs /usr/lib/armbian/armbian-apt-updates from an
`@reboot` line in /etc/cron.d/armbian-updates: a simulated `apt-get upgrade -s -qq`
that pins one core for several seconds while robotd is starting, to produce an update
count that only the stock login banner reads. The robot updates through updaterd, so
nothing on it reads that number.
scripts/setup-quiet-boot.sh empties that cron file (kept as a file so the package that
owns it does not put its lines back) and masks apt-daily.timer and apt-daily-upgrade.timer,
the other unattended apt work a board does — including, on the Ubuntu-based images,
unattended package upgrades nobody asked for. `apt-get` by hand is untouched.
Run by install.sh and by hooks/postinstall, so every board already in the field gets it at
its next update (updater-design.md §9.1); packaged by both workflows and dev-push.sh, which
the xtask guards insisted on. board-test.sh asserts the cron file is emptied and both timers
masked, from install.sh and from the hook alone.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Both sides spent `API_VERSION` 17 — main on `UnitState`'s `Restarting` and
`Failed`, this branch on `robot.policies` and `robot.loadPolicy`. Main's is
released, so it keeps the number and the policy channel's entries become v18
through v22, with the two docs that quote the bump moving with them.
The `padd` conflict is only adjacency: the `--config` argument this branch adds
sits on the line above the `hz` doc comment main reworded.
Assisted-by: Claude:claude-opus-5[1m]
A fork's `pull_request` run gets a read-only `GITHUB_TOKEN` no matter what the
job's `permissions:` block asks for, so `gh pr comment` fails with
GraphQL: Resource not accessible by integration (addComment)
and the whole `coverage` job goes red — on the step that decorates the run, after
the step that gates it has already passed. Every outside contribution hits this;
#188 is where it turned up.
Reporting is now two steps. The summary is written as before, so the table is
there for anyone who opens the run; the comment is its own step, skipped when the
head repository is not this one. Posting for a fork as well would mean a
`workflow_run` workflow holding the base repository's token, which is more
machinery than a comment justifies.
Assisted-by: Claude:claude-opus-5[1m]
`cargo llvm-cov --fail-under-lines` was piped into `tee`, and the default shell
for a `run:` block is `bash -e` without `pipefail` — so the step's status was
`tee`'s and the gate could not fail. Under `bash -e` a `false | tee` pipeline
exits 0; that is the whole bug.
It was not hypothetical. Line coverage is 71.03% against a floor of 72, and was
70.53% back in August, so every coverage run for weeks should have been red and
none was. The comment beside the floor still claimed "a few points under today's
~77%", a number that had stopped being true without anything saying so.
So `set -o pipefail`, and the floor drops to 70 — the deliberate, explained
commit the comment there asks for. 70 is a point under the real number, which is
roughly 375 uncovered lines of slack: enough that ordinary work does not trip
it, tight enough that a collapse still does.
Assisted-by: Claude:claude-opus-5[1m]
The set is on the Hub at pollen-robotics/microduck-policies, so the copies here
have nothing left to do. Verified before deleting: the real fetch pulls all nine
files and every one is byte-identical to what was vendored.
Gone with them: the nine --include lines at each of the three packaging sites,
and every_policy_in_the_repo_is_packaged, which existed to keep those three
lists honest against this directory and now guards nothing. The transitional
fallback goes too — seed-policies.sh no longer takes a release directory,
because there is no longer a release copy to fall back on.
A board that cannot reach the Hub on a first install therefore has no gait, and
that is the accepted shape rather than an oversight: robotd holds its pose and
reports degraded, so the update gate passes and nothing rolls back, and the next
update fetches. It is the bargain setup-board.sh already makes for ONNX Runtime
and setup-gstreamer.sh for the plugins — a board needs a network once. What the
seeder must never do is *fail*, since a non-zero exit from the post-install hook
would roll back a release over a network problem that had nothing to do with it;
every error path exits zero and says so on stderr.
The provenance table moves to policy-channel-design.md §10 rather than being
deleted with the README. It records which upstream training run each role name
points at — including the roller_crouch typo fix — and that mapping is not
recoverable from the file names on the Hub, so this repository was about to be
the only place it had ever been written down and then not be.
The pin is still v1 and the tag does not exist yet, so boards keep whatever they
have and the fetch starts working the moment it is created.
Assisted-by: Claude:claude-opus-5[1m]
robotd read its policies out of /opt/robot/daemon/current/policies, which is
what made a gait retrain need a daemon release and a daemon fix re-ship six
megabytes of unchanged weights. It now reads /opt/robot/policies/current, and
that is the whole point: one runtime source for a policy, whoever put it there,
with no precedence rule between a release copy and anything else to get wrong
later.
Nothing publishes a policy bundle yet, so until something does the release is
what fills that directory. scripts/seed-policies.sh — run by hooks/postinstall
on every update and by install.sh on a fresh board, which between them are every
way policies reach a robot today — copies the .onnx files the release still
carries into releases/seed-<version>/ and points `current` at it, in the same
releases/ + symlink layout the updater already swaps.
One rule makes that a bootstrap rather than a second home: it never touches a
set it did not install. A `current` pointing anywhere but a seed-* directory
means something else put policies there, and the release stops overwriting them
for good. The handover therefore needs no flag and nothing to remember — whatever
ends up publishing bundles just installs one, and the seeding is over. A newer
seed does replace an older one, because while the release is the only source of
policies a daemon update is still how a retrained gait reaches a board; a seeder
that only ever filled an empty directory would freeze every board on whatever
first seeded it.
Two bugs found by testing the seeder rather than reasoning about it. The
`current` symlink was written with an absolute target, which resolves against
the wrong directory the moment the root is not the one it was written with — it
is now relative to its own directory, the way the updater writes it. And the
"is this ours" test was matching the absolute form, so with the fix it would
have stopped recognising its own seeds and never replaced one.
hooks/postinstall was not in the shellcheck list while being the one file that
runs on every board on every update — the argument that comment opens with,
applied to itself. It and seed-policies.sh are now linted.
What is NOT here, and why: the policies component on the Hub. Every artifact the
component path installs is signature-verified, unconditionally, by the same code
that installs daemon binaries — so an official set delivered that way has to be
signed, which is a decision about the engine rather than about policies and is
not one to take while nothing is published. Recorded as the open question in
policy-channel-design.md §13; the seeding holds until it is answered, and
policies/ stays in the repo because the seeding is what reads it.
Assisted-by: Claude:claude-opus-5[1m]
The asymmetry assertion described the hook as placing "units and accounts and nothing
else". That stopped being true when it took on the recovery scripts, then the voice bank,
and now the login-shell files — while the two `test !` lines under it went on pinning
exactly what they always did. The comment and the [ok] line now name those two things, the
journald drop-in and the robotctl symlink, and point at the half of §9.1 they are the
remainder of.
`setup-login.sh` joins the installer lint list, which is where `setup-gstreamer.sh`
already is: same class of script, run on a board, piped to `sh`.
Assisted-by: Claude:claude-opus-5
`install.sh` wrote three files nothing else writes: the `robotctl` completions, the motd
banner, and the `/etc/profile.d` snippet putting the robot's name in the prompt. It runs
once, on a board being set up, and it is not in the artifact — so no hook could run it
even if one tried. The board this was found on has been taking updates since 19 August
with the banner and the completions from that day and no prompt snippet at all, because
the prompt landed on the 26th and boards do not get provisioned twice.
`scripts/setup-login.sh` is those three functions, moved whole. `install.sh` runs it out
of the installed release — the copy a signature was checked against, like the sysusers
files — and `hooks/postinstall` runs it on every update, which is the caller that matters:
it is what puts a file on a board provisioned before that file was written. Idempotent by
construction, since each step rewrites its own file, and never fatal, because a shell
prompt is not worth rolling an update back for.
Moving them fixed an unrelated wart on the way: the comment explaining why the completions
are a loader rather than a snapshot had drifted forty lines from `install_completions` and
sat above the banner instead.
**And the test, which is the point.** §9.1 has now been broken four times and the fourth
happened the day before the rule was written down, so a fifth was a matter of time.
`every_install_sh_step_reaches_an_updated_board` reads `install.sh`'s call sites and fails
unless each one is either performed by a hook too or written down, with a reason, as
something only a fresh install does; its second half fails if `install.sh` runs a
`setup-*.sh` out of the release that no hook names. Both halves were confirmed to fail by
breaking them. It is a forcing function and not a proof — the escape hatch is a line in a
table — but every one of the four would have had to argue for that line.
`board-test.sh` deletes the three files before the postinstall-alone run and asserts the
hook puts them back, and drives the prompt snippet rather than only checking it exists:
it cannot edit PS1 directly, so it hooks PROMPT_COMMAND and rewrites PS1 at the first
prompt, and that indirection is the half that silently does nothing when it is wrong.
One gap stays open and is now named where the accounting is: `hooks/postinstall` installs
units but not the journald drop-in and not the `robotctl` symlink. That asymmetry is
deliberate and `board-test.sh` pins it, so it is not changed here.
Assisted-by: Claude:claude-opus-5
`robotctl configure` turns it on, `robotctl update` delivers it, and the
console draws boxes on the video.
**mediad runs it**, on the raw branch of the tee that has existed for
perception since the pipeline was written. Its own thread, because inference
is 60 ms of blocking work and the runtime here serves WebRTC signalling;
paced at 2 Hz, because flat out this takes the board to 95 °C and the CPU
throttles to 408 MHz — a robot that walks badly to see well. The camera's
mount rotation is folded into the resampling it already does, so upright
pixels cost nothing: rotating in the pipeline is what the commit before
this one was about.
**A list of models, not a choice.** The `.rknn` is preferred and the `.onnx`
is the fallback, tried in order: whether the NPU works is not something a
config file can know, and a board whose NPU is disabled in its device tree —
which is how Armbian ships this one — should still see, on the CPU, rather
than log one warning and do nothing for ever.
**`[detect]` lives in robotd.toml** even though `mediad` reads it, because
that is the file `robotctl configure` edits and a robot has one place for
its settings. Which meant teaching configure that a section can belong to
another daemon: `[detect]` restarts `mediad`, everything else `robotd`. That
uncovered a bug of its own — `save()` clears the pending map and the restart
decision is made after the editor closes, so it restarted *nothing*, ever;
the model now records what it wrote and a test pins it.
**The console** draws boxes on an SVG whose viewBox is the upright frame's
own pixels, in the same grid cell as the video. The wrapper is already the
upright space, so the boxes need to know nothing about the mount rotation
and neither does drag-to-look. Boxes expire after 2.5 s: at 2 Hz a longer
silence means the detector stopped, and the alternative is the last duck
painted on screen for ever, which looks exactly like a duck still standing
there.
Two things the boxes will not tell you, both measured. The score is one bit:
the head emits box coordinates (0..320) and scores (0..1) in one tensor
under one INT8 scale, so the scale is set by the coordinates and every real
detection reads exactly one step — two distinct values in the whole channel.
The label says "duck" and no number for that reason. And box edges land on
that same ~1.3 px grid at 320², about 5 px at full resolution. Splitting the
head before the concat is the fix when confidences start to matter.
Also: mediad needed the `render` group. The NPU is a DRM device
(/dev/dri/renderD129, root:render 660) and without it `rknn_init` returns a
number that says nothing about permissions.
Half of it was QEMU. The binaries under test were never the cost — thirty of
those checks ran in nine seconds — but the shell-heavy ones were: setup-board.sh
took 148s on its first run, ~17s per later variant, and install.sh four and a
half minutes. On an aarch64 runner the containers run natively.
cargo-zigbuild now arrives prebuilt, since a runner architecture change is what
makes rust-cache cold and that build from source was never actually free.
Assisted-by: Claude:claude-opus-5
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
The camera works and has no auto exposure, no white balance and no
denoise, because nothing converges the ISP: mediad pins one exposure at
startup and that is the picture, green and noisy, for every lighting
condition afterwards. The prototype solved this with Rockchip's rkaiq
engine, and it is still the only 3A on this platform — libcamera's IPA
drives mainline rkisp1, and mainline would cost us the hardware encoder
mediad depends on.
So scripts/setup-rkaiq.sh, a sibling of setup-gstreamer.sh with the same
contract: never prompt, never fatal, leave a copy at
/usr/local/sbin/robot-setup-rkaiq, and run from both provisioning (on by
default, --no-rkaiq to skip) and the pre-install hook, so a board
provisioned before this existed gets it from an ordinary update.
**One thing is deliberately not ported: the AE disable.** The prototype
zeroed ae_calib CommCtrl.Enable because its runtime owned exposure — a
software AE loop over decoded MJPEG, and pinned values in laser mode
that rkaiq clobbered into a black image. Neither reason survives here,
and auto exposure is the thing that is missing, so the engine owns it.
These being the same physical boards, a file left at 0 by that script is
the likeliest way to install an engine and still have no auto exposure,
so the script sets it back to 1 rather than trusting what is on disk.
Carried over intact: the LD_PRELOAD ioctl shim, without which the engine
segfaults on this kernel (the deb was built against different headers,
so the module-info ioctl number disagrees by a struct size), and the
sensor-mode pin before the engine starts — it reads the sensor
resolution once and programs the ISP with it, so the IMX219's 3280x2464
boot mode against mediad's 1920x1080 capture is CIF_ISP_PIC_SIZE_ERROR
and no frames at all.
Tested off-board, since none of this can be: the IQ patch against a
synthetic CRLF tuning file (renames applied once, idempotent, AE flipped
back on, line endings intact), the generated pin script against a
media-ctl topology stub (it emits exactly the call mediad's
pin_sensor_mode makes, and exits 0 on a camera-less board so it cannot
block boot), --help, and the shim's compile. A new xtask test packages
the shim beside the script that compiles it — which caught a third
packaging site, dev-push.sh, that the hook guard alone would have
missed.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
`setup-gstreamer.sh` has said so since it was written — "the download happens during provisioning
and, later, from the updater's preinstall hook, which runs with a cleared environment and no token",
which is why the plugins repository is public. The hook half was never written, so a board
provisioned before that script existed needed a command somebody remembered, and a board whose
plugins predate the version this release was built against failed with a missing element in a log.
The hook runs the release's own copy of the script rather than a second implementation of it. That
script owns the pinned plugins version, the Debian package list, the Rockchip MPP and RGA debs, the
udev rule for `/dev/mpp_service` and the encoder report — six things that would otherwise exist twice
and drift, which is the class of bug this repo keeps writing down. It is idempotent by design, so a
provisioned board pays a stamp comparison and two `dpkg -s` calls.
**Never fatal**, and that is the difference from the ONNX Runtime step above it. A release that
cannot load a policy is a robot that cannot stand, so that one aborts the update with the old release
still live. A board with no camera stack loses `mediad` and still walks, pairs and updates — refusing
the update over it would mean a board that cannot be fixed by the mechanism that fixes boards.
**The pre-install hook gets ten minutes instead of two.** It is the hook that installs what the
release needs and the board may not have, and on a board that has never had the media stack that is
around 100 MB of apt over whatever wifi the robot is on. It can afford the minutes precisely because
nothing has been swapped yet: the old release is still live and serving, so a long pre-install is a
slow update rather than a robot in an unclear state. The post-install hook keeps its two minutes,
where the same wait would sit between the swap and the restart.
Packaged at all three sites, with an xtask tripwire — `every_script_the_hooks_run_is_packaged` — for
the failure this would otherwise have: a script referenced and not packaged makes the step a no-op
that says so in a log nobody reads, on exactly the boards it exists for.
Assisted-by: Claude:claude-opus-5[1m]