fix(session-persistence-jsonl): reject empty zstd artifacts

A present zero-byte .jsonl.zstd file was treated as though no artifact existed because readRaw returned undefined when frame scanning found nothing. That contradicted both the plaintext path and the logical zstd reader, and it made the export endpoint answer 404 for on-disk corruption.

Treat a present artifact without a complete header frame as corruption and reuse the zstd reader's existing diagnostic. The regression test now distinguishes an existing empty file from an absent path, and the bilingual JSONL storage contract records that zero-frame artifacts reject alongside other header and frame failures.
This commit is contained in:
Tianyi Cui
2026-08-11 15:05:54 +08:00
parent e58cc13de4
commit 904c3f2c35
5 changed files with 9 additions and 9 deletions
@@ -2,5 +2,5 @@
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write packages/session/session-persistence-jsonl/README.md
README.md: 628833513a8092280970230c8657a50d00db4527
README.zh.md: 4eb2d4f2bebf9ed17190ef3cb21a2bc3c8d9123b
README.md: 540ddb6db67adb1a36c8feea946b6843e614e035
README.zh.md: 7e3ba5be4f2707ff6408d296ece1f43550d76286