mirror of
https://github.com/l0ng-ai/tty7.git
synced 2026-09-22 08:02:24 +00:00
`client_roundtrip` and `daemon_roundtrip` are hand-written lists, so a variant added later goes untested unless somebody remembers it — and nothing said otherwise. Eleven had drifted out of the two lists; five of those (`Handoff`, `QueryProcs`, `Image`, `DeleteImage`, `Procs`) were not encoded or decoded by *any* test in the module. `Image` is the one carrying arbitrary binary through a length-prefixed frame, which is exactly where a framing bug would hide. All eleven are added and all of them round-trip; nothing was broken. `Image` gets 70,000 bytes cycling through every value, so it crosses the read buffer, plus an empty one; `DeleteImage` gets a payload containing the APC bytes a naive framer might resynchronise on; `Procs` gets both a populated `PaneProcs` and an empty one; `AuthResponse` and `SshStatus` get each of their own shapes. The guard reads this file's own text: the variants `pub enum ClientMsg` and `pub enum DaemonMsg` declare, against the ones the matching test names. One list instead of two, for the usual reason. It asserts it parsed more than twenty variants first, so a change in how the file is written fails loudly rather than passing for the wrong reason. Note what this does *not* need to catch: a brand-new variant does not compile until `encode` and `read` handle it, so the compiler has that half. What it catches is the half the compiler cannot — a variant that is wired up correctly and simply never tested. Verified by dropping `QueryProcs` back out of the list, which it names.