cultnet error message parity: TS type + Python builder/decoder, shared C#/Rust vectors #14

Merged
libby merged 3 commits from libby/cultnet-error-parity into main 2026-11-07 12:11:39 +00:00
Member

Brings cultnet-ts and cultnet-py to the cultnet.error.v0 contract (routingHint, closed code enum incl. null, details {field,value,asOf,current}; every key on the wire).

  • contracts/cultnet/interop/error-vectors.json: the C#-captured bytes from cultnet-rs/tests/error_message.rs (Rust encodes to exactly these bytes). A new Rust test pins the file to the inline captures so it cannot drift.
  • cultnet-ts: CultNetErrorMessage gains routingHint/code/details, CULTNET_ERROR_CODES + CultNetErrorCode closed union. Refusal of unknown codes was already done by the Ajv schema; a test now pins the union to the schema enum. Legacy gamecult.networking.v0 error decode fills the new fields with null.
  • cultnet-py: error_message() builder (byte-identical to the C# captures), CULTNET_ERROR_CODES, and parse_message now refuses cultnet.error.v0 bodies with an unknown code, missing keys, or malformed details.
  • Tests decode the shared bytes in TS and Py, round-trip byte-for-byte, and include negatives (unknown code, dropped code/details/routingHint, bad details).

Known, not changed: cultnet-py interop_peer.unsupported_schema_version_error emits code unsupported_schema_version (outside the closed enum, no routingHint) and schema_catalog.py still describes the error schema as {error, code:string, details}. Both need a ruling (add a code to the enum across all runtimes, or retire the emission) before they can conform.

TS has one failing test unrelated to this change (esbuild content bundle, environment).

🤖 Generated with Claude Code

Brings cultnet-ts and cultnet-py to the cultnet.error.v0 contract (routingHint, closed `code` enum incl. null, details {field,value,asOf,current}; every key on the wire). - contracts/cultnet/interop/error-vectors.json: the C#-captured bytes from cultnet-rs/tests/error_message.rs (Rust encodes to exactly these bytes). A new Rust test pins the file to the inline captures so it cannot drift. - cultnet-ts: CultNetErrorMessage gains routingHint/code/details, `CULTNET_ERROR_CODES` + `CultNetErrorCode` closed union. Refusal of unknown codes was already done by the Ajv schema; a test now pins the union to the schema enum. Legacy gamecult.networking.v0 error decode fills the new fields with null. - cultnet-py: `error_message()` builder (byte-identical to the C# captures), `CULTNET_ERROR_CODES`, and `parse_message` now refuses cultnet.error.v0 bodies with an unknown code, missing keys, or malformed details. - Tests decode the shared bytes in TS and Py, round-trip byte-for-byte, and include negatives (unknown code, dropped code/details/routingHint, bad details). Known, not changed: cultnet-py `interop_peer.unsupported_schema_version_error` emits code `unsupported_schema_version` (outside the closed enum, no routingHint) and `schema_catalog.py` still describes the error schema as {error, code:string, details}. Both need a ruling (add a code to the enum across all runtimes, or retire the emission) before they can conform. TS has one failing test unrelated to this change (esbuild content bundle, environment). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
cultnet-py: error_message builder and closed-code/full-key validation in parse_message
Some checks failed
CultMesh QUIC native / Build win32-x64 (pull_request) Has been skipped
CultMesh QUIC native / Build linux-x64 (pull_request) Has been skipped
CultMesh QUIC native / Release native binaries (pull_request) Has been skipped
CultMesh portability and performance / ubuntu-latest one-command multiplayer onboarding (pull_request) Has been cancelled
CultMesh portability and performance / windows-latest one-command multiplayer onboarding (pull_request) Has been cancelled
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Has been cancelled
CultMesh portability and performance / windows-latest reactive semantics and leases (pull_request) Has been cancelled
CultNet cross-runtime interop / C# / TypeScript / Rust / Python / Kotlin (pull_request) Has been cancelled
CultMesh QUIC native / Verify committed binaries match SHA256SUMS (pull_request) Has been cancelled
3250ba49d3
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
libby merged commit d76b4033bf into main 2026-11-07 12:11:39 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
GameCult/CultLib!14
No description provided.