Commit graph CultLib/packages/cultcache-py/tests/test_payload_codec.py
Author SHA1 Message Date
Meta Vens
d9f73281f0 cultcache-py convert: delete the dead refused flag and guard; pin the late refusal path; README states the C# NaN-key bytes exactly
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 04:43:53 +02:00
Meta Vens
3b70479ffd cultcache-py tests: the no-path refusal test makes its canary directory per store kind
The previous commit's test reused one directory name across the two store kinds and errored on the second. Not run on this workstation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 03:35:25 +02:00
Meta Vens
ecfbaa8baa cultcache-py convert: create the destination inside its cleanup scope; refusals name the argument and a code, never a path
Fixes s4 interrupt-window-leaves-destination and convert-refusals-echo-paths. The mixed-width NaN
documented-refusal test reads the README paragraph of the previous commit. Not run on this workstation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 03:21:40 +02:00
Meta Vens
9dd58010ba cultcache-py tests: fix the unterminated newline literals of the JSON Lines bytes test (160048b8 does not import)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 02:35:53 +02:00
Meta Vens
160048b896 cultcache-py tests: pin the JSON Lines file bytes and a destination removed mid-convert
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 02:27:44 +02:00
Meta Vens
6e13b5df3c cultcache-py tests: open the converted store under the default definitions without the unlisted type
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 02:16:36 +02:00
Meta Vens
cc9612ce9a cultcache-py tests: ConvertTests replace MigratePayloadsTests; codec rows for ext, NaN, read depth, timestamps; JSONL pull_all
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 02:11:50 +02:00
Meta Vens
8263a998e0 cultcache-py tests: root integer bounds, a consumer codec's depth fault, the foreign-store TypeError text, and a vanished backup do not escape unpinned
Kills the mutmut survivors in _check_writable (root range ends), _fault_refusal (depth_limit branch) and migrate_payloads (TypeError text, unlink missing_ok).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 07:49:31 +02:00
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