D45 — Replay logs as zstd-compressed JSON lines¶
Decision¶
Replay logs stay JSON lines (the live protocol, doc 13), zstd-compressed as independent frames when the file ends in .zst (snapshot in its own frame, frames closed every 1 MiB, checksums); plain .jsonl stays the default. Heatmaps are coarse grids (≤ 128 cells a side) of A* expansions and PathFinder history, sent by work done (every max(200k, budget / 40) expansions)
Alternatives¶
FlatBuffers for the protocol and the log now (doc 09 §2, §6); a custom binary record format; gzip
Reason¶
FlatBuffers is installed (flatc 23.5) but the message set is still changing (escape plan, component rules added in M9/M13), every message would need a schema in C++ and TypeScript plus a viewer decoder, and the gain is decode speed the viewer does not need yet. zstd on the JSON gives the compactness (12–13× on C-BISCUIT and CANadapter, 260 kB → 20 kB) with one small dependency, stays readable with zstd -dc, and keeps the Python tools (report/render_events.py, the record/replay test) working on the same text. Independent frames bound the loss when a run is killed and leave room for a seek index. FlatBuffers stays an open M3 task for when the message set is stable