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>
_containers is the only depth counter (codec write, definition read and write); _PACK_DEPTH_LIMIT is gone. _check_writable refuses keys that collide once decoded (a Float32 beside an equal int, bool or float). The store's whole-file read and cultnet-py's stamp router read through the codec's reader instead of strict msgpack.unpackb, so no reader outside the codec decides key acceptability.
Does not pass the suite alone: two tests in test_payload_codec.py still assert the 511 bound; the next commit replaces them.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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>
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>
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>
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>
leaf-vectors-cs Soul-held at pass 3 (cultlib-gaps:verdict:cut-leaf-vectors-cs.s3); py-typed-leaves Soul-held at pass 2 (cultlib-gaps:verdict:cut-py-typed-leaves.s2).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Soul-held at pass 3 (cultlib-gaps:verdict:cut-union-bounds-ts.s3). Lands follow-up ts-codec-pin-gaps.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The wide-count test announced map32 as 32770 pairs, which fits in 16 bits, so a
count read as its low 16 bits survived. map32 now announces 65537 pairs and
array32 65540 children; both low halves close the container early.
Builds: yes.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Fixes the previous commit (05f9937b, mislabelled wip): its test file did not compile (TS2322) and the pack probe threw on a lazy codec's getters. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
leaves.py (string, boolean, bytes, int32, int64, float32, float64, any, list, array, nullable, lazy) held to the
numeric-leaves vectors. Removed: DatabaseEntryField.many, callable codecs and _resolve, the System.Object literal,
the present-nil default, the union's nil pass-through, interop.py's hand-written catalog. A float32 keeps its width
through _pack_tree. Nil is refused unless wrapped in nullable; a default fills only a slot past the payload's end.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Finding pack-denial-by-name: the package-internal readers (readWire, resolveDocumentFormatter, @msgpack decode) are loaded from the packed dist by path and searched by identity through every packed entry, including default and namespace members; every other exported function is shown a MessagePack map and must not return it decoded.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Findings custom-formatter-bytes-walked (ruling depth-walk-covers-library-msgpack: the owner skips the walk when the definition carries a formatter; the grey 0x91 image round-trips, plain and codec stay bounded; README says so) and wide-length-unpinned (bin32/str32/ext32 of 65539 bytes and array32/map32 of more than 65535 children before a chain at and past the limit). The same tests pin the inspector refusing to recover a stamp from a past-limit payload. Not yet built.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Finding inspector-recover-unwalked: one decodeBoundedPayload (walk, then decode) serves both the stamp recovery and the preview, so a payload past the limit is never decoded by either.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
leaf-record.msgpack is unchanged. The any leaf now has a ext refusal (d40100) and the record leaves read a complete second slot.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Kills the survivors of the first mutation sweep (fixext2 skip, 0xc1, the fixarray/fixmap/fixstr upper bounds, map16 and map32 child counts).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The C# cases and the TS assertions are here; the vector file is written from the reference in the next commit, so the
slot-nil tests of both runtimes fail at this commit.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
checkPayloadDepth is an iterative header walk run by decodeDocumentPayload before the formatter and by
encodeDocumentPayload on the formatter's bytes; the two plain-decode inspection doors call it first. The plain
formatter's encoder depth is set above the limit so the walk decides. Tests: the C# bounds vectors, the walk's
header and scalar rules, the owner, the inspector, the legacy version inference, and the mesh network doors;
test:pack:ts denies decoder-shaped exports by enumerating the packed entries.
Builds and passes untested at this commit (verification runs on Yggdrasil next).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The packed-consumer smoke now fails if the document entry exports it, at run time and at compile time.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Held to tests/vectors/slot-nil/reads.msgpack, written by the C# reference (SlotNilVectorTests): every accepted row
rewrites to the reference's bytes, nil in an int slot is refused. 94a26431c000c0 round-trips byte-identical.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>