Files
microduck/AGENTS.md
T
Pierre RouanetandClaude Opus 5 2dd630ad42 docs: WebRTC is the default transport, and a FAQ that says so
Three things this repository could not tell somebody who wanted to run a model
too heavy for the board.

There was no page about it at all. `spaces/` appears nowhere under `docs/` —
not in the index, not linked, nothing. The only writing was a Space card
published to Hugging Face and a lot of source comments.

What writing existed argued the wrong way. `media.stream` was built when the
relay endpoint was dead and WebRTC genuinely could not connect from a data
centre, so `stream.rs` made its case at length and, once the dead-endpoint
premise was removed, read as though outbound frames were the preferred design.
They are not. WebRTC carries encrypted media, a control channel on the same
session and a return path; `media.stream` has none of those and exists for a
program consuming frames only on a long-running stream, where a relay's metered
bandwidth is the cost that matters.

And nothing recorded the rule for whoever changes this next, which is how it
would have been re-derived backwards from the volume of prose in `stream.rs`.

So: `docs/faq.md`, task-shaped rather than linear, because somebody arrives at
this with a situation and not a curiosity. `AGENTS.md` with `CLAUDE.md`
symlinked to it, carrying the transport rule and three others. `stream.rs`
demoted to the fallback it is, with what it gives up stated rather than implied.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 13:24:44 +02:00

2.3 KiB

Working in this repository

CONTRIBUTING.md is the reference: building, testing, layout, conventions, releasing. This page is the short list of things that are easy to get backwards, and where the answer lives when they are not here.

Docs own mechanisms; one page each

docs/README.md assigns every mechanism to one design doc. When a fact belongs to a page listed there, every other page says one sentence and links. When two pages disagree, the one that does not own the mechanism is the bug — and when behaviour and a design doc disagree, the doc is the bug. docs/faq.md is the task-shaped front door for someone building against a robot rather than changing it.

A consumer uses WebRTC. media.stream is the fallback

The robot publishes H.264 over WebRTC, and that is the default for anything consuming a duck's camera — it is encrypted end to end, it carries the control channel on the same session, and it has a return path. It works from a data centre because the robot offers a relay candidate (remote-access-design.md §6).

media.stream — the robot dialling an outbound WebSocket and pushing frames to you — is the fallback for a program consuming frames only on a long-running stream, where relay metering is the thing that matters. It has no return path and no control channel.

This is worth stating because the repository reads the other way round if you only follow the code: media.stream was built when the relay endpoint was dead and WebRTC genuinely could not connect from a data centre, so its module doc argues its own case at length. That endpoint is fixed. Do not conclude from the volume of prose that it is the preferred path.

Never design around a version difference

One user, one robot. An old component's limits are a question to raise, not something to route around — bump API_VERSION and name the install consequence. A version skew is logged and served, never refused; only a genuinely missing route or an unknown parameter may refuse.

Releases are how a fix reaches a robot

main being fixed is not a robot being fixed. Robots on the stable channel move when a release is cut, and a dev build from a branch is superseded by the next daemon-dev-main the board's six-hourly check finds. docs/design/updater-design.md owns the mechanism.