Readability vectors: a legacy array with bytes after it

Rust's read path let a legacy envelope array with trailing bytes through when the
whole-array check was loosened, and no vector caught it. Add the vector; every
runtime refuses it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-09-30 02:39:29 +02:00
commit ae0f545a06
6 changed files with 7 additions and 3 deletions

View file

@ -17,6 +17,7 @@ vectors = {
"empty-array": pack([]),
# A legacy envelope array: an array of maps. Rust, TypeScript and Python read it; C# has no legacy reader.
"legacy-envelopes": pack([{"key": "old", "type": "old.type", "payload": pack([]), "storedAt": "2026-01-01T00:00:00Z"}]),
"legacy-trailing": None, # filled below: the legacy array plus bytes after it
"ints": pack([1, 2, 3]),
"nil-first": pack([None, "x"]),
"nested-array": pack([["cultcache.store.v9", [], []]]),
@ -28,6 +29,7 @@ vectors = {
"trailing-bytes": whole + b"\x01\x02\x03",
"trailing-store": whole + whole,
}
vectors["legacy-trailing"] = vectors["legacy-envelopes"] + b""
for name, data in vectors.items():
(here / f"{name}.bin").write_bytes(data)
print(len(vectors), "vectors")

View file

@ -0,0 +1 @@
‘„£key£old¤type¨old.type§payloadÄ<01>¨storedAt´2026-01-01T00:00:00Z

View file

@ -4,6 +4,7 @@
zero-byte.bin reads reads reads reads
empty-array.bin reads reads reads reads
legacy-envelopes.bin refuses reads reads reads
legacy-trailing.bin refuses refuses refuses refuses
ints.bin refuses refuses refuses refuses
nil-first.bin refuses refuses refuses refuses
nested-array.bin refuses refuses refuses refuses