Commit graph CultLib/packages/cultcache-py/tests/test_payload_codec.py
Author SHA1 Message Date
Meta Vens
65ff258f1b cultcache-py: migrate_payloads copies the store to a backup that must not exist, rewrites from the copy, and swaps only an unchanged store
The backup is the rerun guard (payload bytes cannot say whether a store was migrated), the source is never written, a changed store or any refused record removes the backup and leaves the store as it was, and any exception class is named without its text. Tests: f32 collisions, the 256/257 seam, legacy inline keys, backup, rerun, existing backup, concurrent writer, refusal classes, zero count.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 07:40:03 +02:00
Meta Vens
57f85acd6e cultcache-py test: a NUL byte in the migration test source made the module unimportable
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 06:37:34 +02:00
Meta Vens
d61ab8899c cultcache-py tests: the write walk's bound, fault text, schema-field forwarding, migration by schema name and by refusal class
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 06:35:31 +02:00
Meta Vens
0b0a2f2c04 cultcache-py test: migrated records are read directly, the unlisted-type record is not a registered type
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 06:25:57 +02:00
Meta Vens
eef1cb151b cultcache-py: the codec's write walk stops where packb does, not at the definition's depth limit; test fixes
The previous commit does not pass its own tests (5 errors in test_payload_codec and test_union_parity).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 06:22:45 +02:00
Meta Vens
ed0dc50243 cultcache-py: the MessagePack codec owns map keys and 64-bit integers both ways, one default author, payload-free refusals, atomic migrate_payloads
Fix batch h2 for cut py-msgpack-default (r2). The codec's read hook (_checked_map) and
write check carry the C# reference's key rule; PayloadCodecFault and a coded
CultCachePayloadFormatError replace the map_keys walk and the JSON remedy sentence;
refusals are raised after the except block so no decoder exception rides on
__context__. migrate_payloads rewrites a 0.3 store whole or not at all. The store's
schema-stamp recovery and the optional-msgpack guards are deleted.

Not yet run: this commit's tests are verified by the next commit's job.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 06:15:30 +02:00
Meta Vens
7f2c747743 cultcache-py tests: the format refusals pin their exact text and their type, codec and direction
Kills the mutants that rewrote the remedy sentence and the write refusal's attributes. Builds.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 03:42:44 +02:00
Meta Vens
c042100729 cultcache-py: a definition's PayloadCodec owns its payload format; MessagePack is the default
define_document_type payloads are MessagePack (ruling py-msgpack-default). PayloadCodec,
MESSAGEPACK_PAYLOAD_CODEC and JSON_PAYLOAD_CODEC replace the payload_encoder/payload_decoder pair,
_STACK_FAULTS and the optional-msgpack guards. A payload that is not one value of the codec's format
is CultCachePayloadFormatError naming the remedy; a map key the default cannot read back is refused on
write; JSON reads past the interpreter stack are the depth refusal. interop_peer drops its lambdas.
Breaking: 0.3 JSON stores read with payload_codec=JSON_PAYLOAD_CODEC. Builds; not yet run on Yggdrasil.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 03:21:33 +02:00