RediWM is a Wayland compositor written in Zig (OpenGL ES) that includes everything in one process
Printing
cups.zigqueries the configured Unix or cleartext TCP CUPS endpoint. TLS and authentication are explicit unsupported states; never fall back to a different server. Configuration read failures are not missing files. Both administration backends target the canonical local socket, never a custom Unix or remote endpoint.admin.zigselects cups-pk-helper when present, otherwisedirect.zigruns therediwm-cupshelper (src/cups_main.zig+direct.c, frames indirect_protocol.zig). Never retry an uncertain mutation through another backend.- The compositor never links libcups. libcups drags in gnutls, nettle,
p11-kit and friends, which would be mapped in every session for a page used
rarely; only
rediwm-cupslinks it (build/printing.zig), and the compositor stays free of it (checkldd;tests/printers_direct.pychecks the mappings). The helper starts on the first administration request (a read-only page never starts it), dies withWorker.destroy(SIGKILL: instant, even mid-prompt) and with the compositor (EOF on its socket, PDEATHSIG). A helper that dies fails the request in flight as uncertain, never retried; the next request starts a fresh one. It runs as the desktop user, non-dumpable, never as root, and refuses methods and argument countsdirect.cdoes not implement. - Inside the helper,
direct.c's worker alone uses libcups (including its thread-local authentication state). UI credentials use locked storage and are wiped on submit/cancel/hide; they travel from that storage into asendmsgiovec (no copy) and are received into a locked page, never the plain frame buffer (Receiverpicks the destination by frame kind, reading exactly the bytes a frame lacks). A chain may reuse its CUPS connection, but completion closes it and wipes the worker password. The deadline watcher owns a duplicated socket descriptor, never a borrowed descriptor that libcups could close/reuse during authentication. The helper has no timed wakeups while idle or waiting for user input: its loop sleeps inpoll(-1). Keepdirect.c's C API stable:tests/printers_direct.pydrives it directly through ctypes. Workercallbacks may free the worker: the frame reader handles one frame per event-loop call and touches nothing after the callback. The helper's state frames are checked against the request state (a prompt only while a request runs); anything else drops the connection.- IPP and HTTP replies are untrusted and bounded. Socket operations share an absolute deadline and include the worker cancellation fd in every wait.
cups.Snapshotowns an arena. Parser helpers allocate into that arena; borrowed decoder fields must not escape it. Display strings are sanitized, but URI identity uses the complete validated value, never truncated text.usb_sysfsonly reads sysfs and stats nodes. A unique serial can identify a USB queue; product strings and VID:PID alone cannot. Missingusblpis normal for libusb. Missing/inaccessible evidence stays unknown.- The ladder is pure and reports evidence, not physical printing. A CUPS completed state or sheet counter alone cannot establish paper output. Reports exclude arbitrary names, messages, serials and URI authorities/paths.
- Worker lifetime and widget ownership:
src/control_center/AGENTS.md. Remaining features and hardware/distro qualification:docs/plans/printers.md.