Skip to content

feat(sdk): fold sdk/typescript into the clients gate + fix ts-rs u64/i64→bigint drift - #1746

Merged
joelteply merged 1 commit into
canaryfrom
feat/asha-intelligence-latency
Jul 3, 2026
Merged

joelteply merged 1 commit into
canaryfrom
feat/asha-intelligence-latency

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

What

Task #120. Brings sdk/typescript under the clippy-grade clients gate and fixes the ts-rs u64/i64 → bigint drift 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 u64 and i64 to TS bigint, which throws in JSON.stringify at runtime and fails numeric-0 fixtures 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/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 bar with root fixes, not suppressions:

  • handler interfaces (Raw*/Event/Handle) → 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
  • spec non-null assertions → fail-loud must() / lastSocket() accessors that name the missing precondition (fallbacks-are-illegal doctrine)

Validation

npm run check:clients → EXIT 0:

  • eslint: 0 warnings across packages / apps/web / apps/tui / sdk/typescript
  • tsc --noEmit: sdk-typescript, chat-view, web, tui all pass
  • vitest: 44 SDK (StateConnection 9, WebSocketTransport 6, conformance 29) + 6 chat-view + 12 tui pass

Scope note: other bigint fields 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

…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
@joelteply
joelteply merged commit e56ee09 into canary Jul 3, 2026
4 checks passed
@joelteply
joelteply deleted the feat/asha-intelligence-latency branch July 3, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant