Pin the C0 refusal vectors shared by every runtime
An unknown store header, a record slot beyond four with a full payload, the v2 variant record C1 will write, and a v1 store written by the base-commit Python writer. Every runtime's tests read these bytes. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
69a21bb057
commit
2cb694d612
6 changed files with 38 additions and 0 deletions
3
tests/vectors/document-variants-c0/.gitattributes
vendored
Normal file
3
tests/vectors/document-variants-c0/.gitattributes
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Refusal vectors are byte-exact; never convert line endings.
|
||||
* binary
|
||||
*.py text
|
||||
Binary file not shown.
34
tests/vectors/document-variants-c0/generate.py
Normal file
34
tests/vectors/document-variants-c0/generate.py
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
"""Generates the shared C0 refusal vectors from the pre-Cut 2 v1 store (written before any
|
||||
variant code existed). Every runtime's tests read the committed bytes; nothing regenerates them
|
||||
at test time. Run: python generate.py (needs msgpack).
|
||||
|
||||
unknown-header.msgpack header cultcache.store.v9, otherwise the v1 store
|
||||
extra-slot-full-payload.msgpack v1 header, record item:anvil gains slot 4, payload stays full
|
||||
v1-base.msgpack NOT generated here: written once by the Python runtime at CultLib
|
||||
69a21bb (SingleFileMessagePackBackingStore.push of alpha and
|
||||
beta, type vectors.item, before any C0 code existed)
|
||||
variant-v2.msgpack what C1 writes for a variant: header v2, record slot 4 =
|
||||
[baseKey, overrides[]], empty payload (override op Set = 0,
|
||||
path steps are [slot, elementId])
|
||||
"""
|
||||
import pathlib
|
||||
|
||||
import msgpack
|
||||
|
||||
here = pathlib.Path(__file__).resolve().parent
|
||||
source = here.parent.parent / "GameCult.Caching.Tests" / "Fixtures" / "pre-cut2" / "single-file-v1" / "store.msgpack"
|
||||
header, catalog, records = msgpack.unpackb(source.read_bytes(), raw=False)
|
||||
assert header == "cultcache.store.v1"
|
||||
anvil = records[0]
|
||||
assert anvil[0] == "item:anvil"
|
||||
|
||||
|
||||
def write(name, snapshot):
|
||||
(here / name).write_bytes(msgpack.packb(snapshot, use_bin_type=True))
|
||||
|
||||
|
||||
write("unknown-header.msgpack", ["cultcache.store.v9", catalog, records])
|
||||
write("extra-slot-full-payload.msgpack",
|
||||
[header, catalog, [anvil + [["item:bellows", []]]] + records[1:]])
|
||||
variant = ["item:anvil-big", anvil[1], anvil[2], b"", ["item:anvil", [[0, [[1, ""]], "", 99]]]]
|
||||
write("variant-v2.msgpack", ["cultcache.store.v2", catalog, records + [variant]])
|
||||
BIN
tests/vectors/document-variants-c0/unknown-header.msgpack
Normal file
BIN
tests/vectors/document-variants-c0/unknown-header.msgpack
Normal file
Binary file not shown.
1
tests/vectors/document-variants-c0/v1-base.msgpack
Normal file
1
tests/vectors/document-variants-c0/v1-base.msgpack
Normal file
|
|
@ -0,0 +1 @@
|
|||
“²cultcache.store.v1‘—¬vectors.item¬vectors.item¯vectors.item.v1¬vectors.itemÙL{"schemaName":"vectors.item","schemaVersion":"vectors.item.v1","members":[]}‘¬vectors.item<65>’”¥alpha¬vectors.item¹2026-09-29T00:00:00+00:00Ä’¥alpha”¤beta¬vectors.item¹2026-09-29T00:00:01+00:00Ä’¤beta
|
||||
BIN
tests/vectors/document-variants-c0/variant-v2.msgpack
Normal file
BIN
tests/vectors/document-variants-c0/variant-v2.msgpack
Normal file
Binary file not shown.
Loading…
Reference in a new issue