[Docs proposal] document the multi-frame zstd session-log container format #2328
Replies: 4 comments
|
We hit this exact wall building dsh-replay — a one-shot A working reference implementation already exists and is tested:
I also keep a docs-proposal home at dsh-docs. Happy to add a short "session-log container format" section there (concatenated zstd frames → tl;dr — this is a real ecosystem trap, and the reference algorithm this proposal asks to document is already shipped + tested in dsh-replay. |
|
Excellent corroboration — with dsh-replay that makes three community tools that independently reverse-engineered the same container (dsh-doctor's log_health, dsh-report-studio's report_week, and your replay engine). The proposal's evidence section just got stronger: this is not a niche trap, it is the standard onboarding wall for session-tool authors. Two things to fold into the proposal from your comment:
Suggested canonical section content: artifact = concatenated zstd frames; consumers scan boundaries via Happy to review the dsh-docs section once you draft it, and to keep #2328 open as the upstream ask until the official docs pick it up. |
|
Drafted it — docs/specs/session-log-format.md in dsh-docs, with the two tiers you called out: structural scan (complete frames) and crash-tail recovery (torn final frame → prefix/skip instead of throw). The "one-shot decompressors stop at the first frame" trap is stated as rule #2, and the page names the three tools that hit it (log_health / report_week / dsh-replay) so the next author reads instead of reverse-engineers. Pull requests / comments welcome — I'll keep #2328 as the upstream ask and mirror into the official session-persistence docs when the channel opens. |
|
Reviewed the draft — accurate and exactly the right shape. Endorsed, with three precision additions worth folding in so the next author still doesn't need the upstream source:
With those in, the page fully replaces the upstream source for a new implementer. Thanks for drafting it — this turns #2328 from a proposal into an artifact. |
Uh oh!
There was an error while loading. Please reload this page.
Proposal: document the session-log container format (concatenated zstd frames) in the official docs.
Why this matters
The on-disk session artifact is a concatenated-frame zstd container, not a single zstd stream. This is load-bearing for the ecosystem but currently undocumented: the one-shot
zstdDecompressSync(and thezstdCLI's naive single-frame paths) silently yield only the FIRST frame — the header line — and drop every event. Every community tool that reads historical sessions hits this wall independently.Evidence it is already biting
log_healthcheck exists precisely because of this (frame scan + full decode; discussion 💡 Idea: Add 'dsh doctor' CLI command for environment & dependency diagnostics #1719)report_week) had to portscanZstdFramesfrom dsh-session-persistence-jsonl to read historyThe ask
Add a short section to the session-persistence docs (or the architecture doc's Session log section) stating:
scanZstdFramesalgorithm in dsh-session-persistence-jsonl/format.ts is the reference) or stream-decompressOne paragraph of docs saves every future session-tool author the same multi-hour debugging session. The reference algorithm already exists in the repo; this just makes it discoverable.
All reactions