Repository navigation
feat(sdk): fold sdk/typescript into the clients gate + fix ts-rs u64/i64→bigint drift - #1746
Merged
Merged
Conversation
…ix ts-rs u64/i64→bigint drift Task #120. Two coupled changes so the SDK stops silently drifting from the contract it publishes. 1. ts-rs bigint drift (contract event payloads). ts-rs maps u64 AND i64 to TS `bigint`, which throws in JSON.stringify at runtime and fails numeric-0 fixtures at typecheck. The four contract payloads that cross the SDK conformance seam (contract:proposed / :bid / :paid / :executing) now carry `#[ts(type = "number")]` on their escrow-amount (u64) and Unix-ms (i64) fields — safe, none approach 2^53. Rust source is the single truth (event_classes.rs); protocol/ + sdk/generated regenerated to match. 2. Gate coverage. sdk/typescript joins packages/apps under lint:clients / typecheck:clients / test:clients (eslint --max-warnings 0, strictTypeChecked + stylisticTypeChecked). Removed the sdk/** eslint ignore; fixed every source + spec file to the same clippy-grade bar with root fixes, not suppressions: - handler interfaces (Raw*/Event/Handle) converted method-shorthand → property-function syntax (kills unbound-method at the root) - de-async'd no-await Promise methods → Promise.resolve/reject (require-await) - dropped single-use type params (Handle.execute<R>), inline type imports - WsServerMessage single-variant handled by a COMPILE-TIME destructure guard (a future variant stops compiling) instead of an always-true runtime switch - non-null assertions in specs replaced with fail-loud `must()`/`lastSocket()` accessors that name the missing precondition ([[fallbacks-are-illegal-fail-loud]]) check:clients is green: eslint 0 warnings, tsc across all 4 workspaces, 44 SDK + 6 chat-view + 12 tui vitest tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Task #120. Brings
sdk/typescriptunder the clippy-grade clients gate and fixes the ts-rsu64/i64 → bigintdrift on the contract event payloads that cross the SDK conformance seam.Two coupled changes so the SDK stops silently drifting from the contract it publishes:
1. ts-rs bigint drift (contract event payloads)
ts-rs maps both
u64andi64to TSbigint, which throws inJSON.stringifyat runtime and fails numeric-0fixtures at typecheck. The four contract payloads on the conformance seam (contract:proposed/:bid/:paid/:executing) now carry#[ts(type = "number")]on their escrow-amount (u64) and Unix-ms (i64) fields — safe, none approach 2^53. Rust source is the single truth (event_classes.rs);protocol/+sdk/generatedregenerated to match.2. Gate coverage
sdk/typescriptjoinspackages/+apps/underlint:clients/typecheck:clients/test:clients(eslint--max-warnings 0,strictTypeChecked+stylisticTypeChecked). Removed thesdk/**eslint ignore; fixed every source + spec file to the same bar with root fixes, not suppressions:Raw*/Event/Handle) → property-function syntax (killsunbound-methodat the root)Promise.resolve/reject(require-await)Handle.execute<R>), inline type importsWsServerMessagesingle-variant handled by a compile-time destructure guard (a future variant stops compiling) instead of an always-true runtime switchmust()/lastSocket()accessors that name the missing precondition (fallbacks-are-illegal doctrine)Validation
npm run check:clients→ EXIT 0:--noEmit: sdk-typescript, chat-view, web, tui all passScope note: other
bigintfields across unrelated generated types (AvatarState, model_registry, sentinel, orm…) are pre-existing and belong to the separate #80 emit-drift task — deliberately not touched here.🤖 Generated with Claude Code