# Contributing to pdtv26 The [README](README.md) says what pdtv26 does and why; this is how to work on it. ## Development The tools come from the flake. To run every folder's tests, as [CI](.gitea/workflows/check.yaml) should on each push: ``` nix flake check ``` To work in one folder: ``` cd ir-pico nix develop make help make test ``` Each module's docstring says what it is. Docs are only for what isn't code, such as [wiring](ir-pico/wiring.md). ## Design ### Capabilities on the wire The connections are [Cap'n Web](https://github.com/cloudflare/capnweb) over WebSockets, on a private network such as a Tailscale tailnet. A server listens with a [gate](speech/gate.js), not the capability itself: the gate hands the capability to whoever presents its key, compared in constant time, and a client can open and call in one round trip. Keys reach services through systemd's `LoadCredential` (`$CREDENTIALS_DIRECTORY`), never through argv, the environment, or the Nix store. ### Confinement The box's services run under systemd with `ProtectSystem=strict`, `DynamicUser` where possible, `DevicePolicy=closed` and only the devices they need (the GPIO chip and ALSA for the button; the Pico's tty for `ir`), and `IPAddressAllow` limited to the private network, plus the camera's LAN for `look` alone. `look` won't take a frame unless the button service is there to show it: it connects to the button's socket, whose group is look's alone, and waits for the box to flash and tap. [box/module.nix](box/module.nix) has the details.