cultcache-py: convert keeps the source store's header; README and CHANGELOG state the format limits exactly; stale references fixed
All checks were successful
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Successful in 24m50s

Soul pass on #179: a v3 source converted to v1 (now carried, pinned by the v3-base vector and
mutation-checked); README states the one-digit JSON exception once and the object-slot byte
difference from C#; CHANGELOG records the entry-type codec inheritance, the doubled walk and the
accepted JSON depth refusal; the store-reader docstring and test name no longer overstate
'codec alone'; stale payload_decoder/_refuse_past_depth_limit references fixed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Libby 2026-11-17 02:21:05 +00:00
commit b36cf5ed91
8 changed files with 42 additions and 24 deletions

View file

@ -625,7 +625,7 @@ class PayloadCodecTests(unittest.TestCase):
refused.pull_all_backing_stores()
self.assertEqual(caught.exception.code, "not_one_value")
def test_a_legacy_inline_payload_key_is_judged_by_the_codec_alone(self) -> None:
def test_a_legacy_inline_payload_key_is_judged_by_the_store_reader_for_every_record(self) -> None:
def store_of(payload: object, name: str) -> SingleFileMessagePackBackingStore:
path = self.directory / f"inline-{name}.cc"
path.write_bytes(
@ -685,6 +685,18 @@ class ConvertTests(unittest.TestCase):
cache.pull_all_backing_stores()
return cache.get_all(document)
def test_convert_keeps_the_header_the_source_was_read_under(self) -> None:
vector = Path(__file__).resolve().parents[3] / "tests" / "vectors" / "document-variants-c2a" / "v3-base.msgpack"
source_path = self.directory / "v3.cc"
source_path.write_bytes(vector.read_bytes())
destination = self.directory / "out.cc"
self.assertEqual(convert(SingleFileMessagePackBackingStore(source_path), destination, []), 0)
header = msgpack.unpackb(destination.read_bytes(), raw=False)[0]
self.assertEqual(header, "cultcache.store.v3")
again = SingleFileMessagePackBackingStore(destination)
self.assertEqual(sorted(e.key for e in again.pull_all()), ["alpha", "beta"])
self.assertEqual(again._format, "cultcache.store.v3")
def test_convert_writes_a_new_store_of_the_same_kind(self) -> None:
records = {"k1": b"5", "k2": b"53", "k3": b'{"n": 1}'}
definition = define_document_type("tests.mig", encode=lambda value: value)