7.3 KiB
Changelog
All notable changes to @gamecult/cultnet-ts are recorded here, following
Keep a Changelog.
Unreleased
Breaking
decodeManifestrefuses a manifest with bytes after its first MessagePack value (CDN artifact manifest has N bytes after its first MessagePack value.), as the C# reference does; before, the tail was ignored.contracts/cultmesh/content-acceptance-vectors.jsonnow holdstrailing_nil,trailing_reserved_codeandtrailing_truncated_arrayas refused.
Added
-
Fork card (
contracts/cultnet/governance/fork-card.md):raised_at, a required key holding an RFC3339 instant string or nil (the question's first admission time), outsideoptions_hash; the card vectors are re-pinned with the key, three negatives (epoch integer, date-only string, missing key) and a nil-raised_atvalid card; everyoptionsHashdigest is unchanged. -
Fork card reader views (
fork-card.md, "Reader views"): the card gainsdecider_count(required, 1 to 64) anddecidersmay be empty (ids withheld from a non-decider); the record gainsanswerer_count(distinct answerers over every stored answer, refusals included);answereris nullable inside a record shown to a non-decider. Card and record vectors are re-pinned (card map headerDE0011toDE0012, record85to86); withheld twins, the R-card, R-record, R-entry, R-list and R-answer-result rule vectors and a no-leak byte check are new; everyoptionsHashandbodyDigestsdigest is unchanged. -
Fork card vectors: a nil
answereris now pinned for Revision and Retraction as well as Counted and Refused (deskAnswerwithheld_answerer_revision,withheld_answerer_retraction; entriesopen_counted_revision_and_retractionand its withheld twin; a list scenario pair; negatives for a nil answerer in ananswer_resultand for a named Retraction or an over-count in a withheld entry). Additive: every existing vector,optionsHashandbodyDigestsdigest is unchanged. -
WriteTracker: a write sent aftersessionEndsettles unconfirmedsession_endedwhen it is sent (it stayed unanswered forever). The replay runner now fails on an event key outsidescenarios.semanticsand on a vector count that differs from the file'scounts; seven tracker vectors are new. A blank text in a raw frame is Unicode White_Space, notString.prototype.trim(). -
Write receipt, client side (
contracts/cultnet/interop/write-receipt.md):cultnet.write_admitted.v0andcultnet.error.v1(v0 plusmessageId; its closed code set addslimit_reached,CULTNET_ERROR_V1_CODES) parse and encode, andCULTNET_WRITE_RECEIPT_MESSAGE_VERSIONS/helloAdvertisesWriteReceiptsname the hello capability.cultnet.error.v0and its code set are unchanged.WriteTrackersettles each write as admitted, refused or unconfirmed (windowsRECEIPT_RESULT_WINDOW_MS5000 andLEGACY_RESULT_WINDOW_MS500, counted from the send; late answers recorded asadmitted_late/refused_late), andtools/replay-write-receipt-vectors.mjsreplays the vectors against it (see README, "Write receipt replay runner"). The interop schemas are read fromcontracts/cultnet/interop/. -
message_invalidjoins the closedcultnet.error.v0code set, withcultNetMessageInvalidError(field, reason)(details.fieldnames the request field at fault), byte-identical to the C#ForMessageInvalid. -
cultNetWriteNotAuthorizedError(recordKey, reason?): the typedwrite_not_authorizedrefusal (code anddetails.recordKey), byte-identical to the C#ForRemoteWriteRefusedvector inerror-vectors.json.CultNetDocumentRegistry.canonicalSchemaId(schemaId)resolves the id a put or delete writes under, for a server's write authority. -
cultNetTextError(error): the text-onlycultnet.error.v0refusal, withroutingHint,codeanddetailsnull. The legacy-union error decode uses it, so there is one place that spells the null members. -
CultNetRudpSocketTransportServer: one UDP socket serving many peers, each remote address and port with its own reliable session (peerConnected,frame,peerDisconnectedevents;send(peer, ...)answers on the peer a frame came from). A second client no longer replaces the first; Connects beyondmaxPeers(default 256) are dropped, andclose()resolves once every peer's goodbye has left the socket. The shape follows the RustCultNetRudpServerHuband C#CultNetRudpSocketTransportServer, and the wire format is unchanged. The optionalpeerTimeoutMs(idle peers ended and told so; default off) exists only in TypeScript.CultNetRudpSocketTransportConnectioninservermode still serves exactly one peer. -
The
cultnet.snapshot_request.v1,cultnet.database_subscribe.v1andcultnet.snapshot_response_raw.v1carriers and the selection payload types (CultNetSelection,CultNetRawDocumentHeader,CultNetEdge).parseCultNetMessageaccepts them (absent members arrive as absent keys; a page carries exactly one ofheaders/documents; an empty or blankschemas/keysentry throwsCultNetSelectionInvalidErrornaming its field), andencodeCultNetMessageForWirewrites the reference's nil-keyed, declaration-ordered map. Judged against bytes the C# reference wrote (contracts/cultnet/interop/carrier-vectors.cs-written.json) and the selection vectors C# and Rust wrote. The selection engine (evaluation, cursors, the declaration-dependent door checks) is not ported.
Breaking
-
The Idunn runtime presence publisher is send-only (
sendPresenceDocument): it returns"sent"once Odin's transport has acknowledged the put and no longer waits up to 500 ms for a success reply, which was never admission. It rejectsIdunnPresenceRefusedErrorfor acultnet.error.v0, or acultnet.error.v1naming the put or nothing, that arrives by the ack; a refusal after the ack is not awaited, and no other frame, one carrying the put's id included, counts as success. -
The package is renamed
cultnet-tsto@gamecult/cultnet-ts(the repo already scopes@gamecult/cultcache-ts), so the unscoped name cannot be claimed by someone else. Import from@gamecult/cultnet-tsand its subpaths; the API is unchanged. -
CultNetErrorMessagecarriesroutingHint,codeanddetails(null when absent), as the reference writes them andcultnet.error.schema.jsonrequires; the interface previously dropped them. NewCultNetErrorCode,CultNetErrorDetailsandCultNetShardRoutingHinttypes. -
CultMeshCdnChunkRefcarriesid(slot 4), the reference's element id.encodeManifestwrites five-slot chunk references andpackContentsets the decimal offset as the id, as the reference does; a manifest written before ids reads""and is rewritten with the slot. Content vectors regenerated from the reference. -
Needs the cultcache-ts release that ships with this change (its manifest range moves with that release): the Idunn runtime authority reader calls
readSingleFileStore, which 0.14.x does not export. An absent authority file is now a plainErrorwithout a code.
[0.3.0]
Added
cultnet-ts/content: the CultMesh CDN content plane. Manifest and chunk types, canonical manifest encode and decode,packContent, SHA-256 helpers, and the chunk and artifact record keys, with wire parity to the C# reference.
Changed
- Depends on
@gamecult/cultcache-ts^0.14.1, which exportscheckPayloadDepth.