Runtime SDK: generate one complete Rust and TypeScript event contract from one owner
- Dominant language
- Rust
- Stars
- 41k
- Forks
- 3.6k
- Avg merge
- 13h 59m
- Merged PRs (30d)
- 299
Description
The release checkout at b00afeb3a carries Rust runtime event models and handwritten Runtime SDK TypeScript declarations under `npm/runtime-sdk/index.d.ts`; Schemars 1.2.2 is already present in Cargo.lock. Research suggests a bounded contract-generation experiment, not a demonstrated live wire failure.
Choose one complete existing runtime event family. Compare reuse of Schemars with ts-rs only where needed, generate the consumer declaration, migrate every consumer of that family, and delete its duplicate handwritten definition. Keep runtime validation and the existing event/store authority.
Acceptance: Rust serialization to TypeScript fixtures preserve tagged variants, u64 boundaries, flatten behavior, absent versus null, unknown-field policy, and reconnect/event cursor handling. Generation is deterministic and CI detects stale output; strict consumer compilation and actual decoder checks pass. Stop if a second schema authority survives, runtime validation weakens, the migration covers only one of several consumers, or emitted types claim a wire shape the serializer does not produce.
Backlog experiment after the 0.9.13 cut; no dependency upgrade or release blocker is created by this issue. Hmbown/Codewhale#3155 and Hmbown/Codewhale#3163 retain their completed original protocol/SDK scope.
Contributor guide
Research direction
Start at the Rust runtime event models in release checkout b00afeb3a and the handwritten declarations in npm/runtime-sdk/index.d.ts; inspect Cargo.lock for the existing Schemars version and trace every consumer of a chosen event family. Compare Schemars with ts-rs only where needed, then define fixture and CI checks for serialization, decoding, deterministic output, and stale generated files. Done means one generated authority replaces the duplicate definition without weakening runtime validation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, typescript
- Domain
- api, backend-api-design
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100