4.5 KiB
Changelog
Unreleased (breaking; version 0.x, so the next minor)
-
decode_witness_artifact_bundle_payload(andCultNetWitnessArtifactBundle.from_payload) read the payload throughcultcache_py.read_payload_tree: bytes after its first MessagePack value raiseValueErrorcultnet.witness_artifact_bundle payload has N bytes after its first MessagePack value (refused on read).instead ofmsgpack.ExtraData, and a payload nested past 256 raisesCultCachePayloadDepthError. Needscultcache-py0.4.0, the release that exportsread_payload_tree: the dependency is nowcultcache-py>=0.4.0(it was>=0.2.0, which admits releases whoseimport cultnet_pyfails), andtests/test_declared_dependency_ranges.pyfails when a declared bound admits a tagged release lacking a name the package imports. The same check foundcultmesh-pyimportingcache.index_text, whichcultcache-py0.2.0 lacks; its bound iscultcache-py>=0.4.0too (it has no changelog of its own).resolve_document_for_raw_recordreads the schema hint from a raw record's first value whether or not bytes follow it, so a record routed by its stamp is refused by count when applied (ValueError, in a snapshot, a shard log and a direct apply) like one routed by a registered schema id;apply_shard_log_responseused to skip it silently as an unknown schema. A tail on a payload whose first value names no registered schema is stillKeyError, which a shard log skips. -
apply_raw_document_recordandapply_raw_snapshotraiseSchemaConflictErrorwhen a remote record is of another type than the one the cache holds at its key (cultcache-pyholds one record per key whatever its type); the cache is unchanged, and the caller decides whether to drop the record or the peer.cultmesh-py's server answers such a put withmessage_invalid; its client'sread_next_changelets the error out. -
CultNetDatabaseChangecarriescommit_idandcommit_count(commitId/commitCount; None outside a multi-record commit, as C# writes nil):from_wirerefuses an empty or non-string id and a count that is not an integer of at least 2,to_wirewrites them when set, and the publisheddatabase_change_rawschema lists both. Python applies no batch. Thesimulation_factdocument'sshard,frame,subjectandclaim_kindaliases areroles(many facts share each); the catalog bytes do not move. -
Decodes the write receipt frames of
contracts/cultnet/interop/write-receipt.md:parse_messagevalidatescultnet.write_admitted.v0andcultnet.error.v1against their closed schemas (unknown keys, empty or non-string ids, an unknown operation or code are refused;error.v1requiresmessageId, string or null;limit_reachediserror.v1only). AddedCULTNET_ERROR_V1_CODES,CULTNET_WRITE_RECEIPT_MESSAGE_VERSIONS,write_content_hashandhello_advertises_write_receipts;hellotakessupported_message_versions.tests/test_write_receipt.pyreplays the vectors'contentHash,wireandschemaInvalidsections. Not implemented here: the client write tracker (scenarios) and the server rules (dedupe,blankFields); this package has no receipt server and no write client. -
Added
message_invalidtoCULTNET_ERROR_CODESandmessage_invalid_error(field, reason), byte-identical to the C#ForMessageInvalid.cultmesh-pyrefuses a malformed put or delete with it instead of the out-of-schemamalformed_document_putandmalformed_document_delete, which are removed. -
Added
CultNetRudpSocketTransportServer(cultnet_py.rudp_server): one UDP socket serving many RUDP peers, one session per remote endpoint, ported from the C#CultNetRudpSocketTransportServerand held to its bytes bytests/vectors/rudp-multipeer-server/transcript.txt. The caller drives it (try_receive_once,poll_resends). Like the C# listener it never reaps idle peers.CultNetRudpSessiongainednext_sequence,withdraw_sendandend_with, andCultNetTransportStatsgainedsend_failures. -
Removed
resolve_document_and_schema_id_for_raw_recordfrom the package exports. A raw record resolves to one local schema id, the one its document registers, so there is no wire id to return. Useresolve_document_for_raw_record(documents_by_schema_id, schema_id, record), which returns the document; take the schema id fromdocument.catalog_entry().schema_id. -
apply_raw_document_record,apply_raw_snapshotandapply_shard_log_responsereport and stamp the local schema id, also for a record that arrived under a compatible id or the schema name.