Skip to content

Improve JavaScript SDK readability and add bridge benchmarks - #104

Merged
forhappy merged 1 commit into
mainfrom
codex/javascript-sdk-readability
Oct 23, 2026
Merged

forhappy merged 1 commit into
mainfrom
codex/javascript-sdk-readability

Conversation

@forhappy

Copy link
Copy Markdown
Contributor

The JavaScript SDK and bridge were difficult to read, and the SDK README lacked complete usage examples. This makes the public JavaScript/TypeScript API, shared facade, Rust adapter, and Node worker easier to follow while preserving their behavior and public APIs.

Changes

  • Expand condensed SDK implementation and type declarations; document requests/responses, storage, alarms, bindings, errors, and invocation lifetime with concrete examples.
  • Expand bridge protocol payloads and worker control flow. Explain cancellation, activation ownership, byte budgets, mutation outcomes, continuation identity, and process shutdown.
  • Align Cellar-owned Cargo and npm package versions and lockfile entries to 0.1.0, preserving third-party versions.
  • Add a repeatable V8/Node TypeScript benchmark with HTTP throughput, durable write TPS, latency distributions, resource samples, contention checks, and cold-storage reconciliation. Include the measurement report and portable evidence.

Validation

On updated main, using macOS arm64, Node 24.13.1, and Rust 1.98.1:

  • 21 Rust tests passed with both embed,node features: context isolation, cancellation, mutation refusal, watchdog/process cleanup, IPC framing, npm/native-addon compatibility, and storage recovery after restart.
  • Four JavaScript build tests passed; both example applications and benchmark TypeScript compile.
  • Affected-crate Clippy with warnings denied, repository format/layout, native dependency policy, documentation references, and diff whitespace checks passed. Existing vendor warnings remain.
  • The shared facade and Node worker produce identical normalized executable JavaScript before and after the readability edits.
  • Earlier SDK validation compiled all seven README TypeScript examples and ran the documented counter against V8 and Node, including fresh-node recovery.

Performance evidence and limits

The included campaign was measured at the explicitly recorded earlier source revision, before the version/readability changes; it is not a new measurement of this PR head. On the shared development machine, median 32-client 1 KiB echo throughput was 14,154 req/s for V8 and 11,088 for Node; sharded durable writes were 459 and 451 TPS. All 41,344 acknowledged increments, including warmup, reconciled after cold recovery.

The report preserves hot-cell conflicts and the V8 64 KiB/32-client failures, including one confirmed execution-budget failure and another dispatch failure whose cause was not established. This PR does not fix those runtime limitations. Results use a local SQLite development bucket and closed-loop traffic; they do not establish production fleet capacity.

@forhappy
forhappy merged commit 1455fb0 into main Oct 23, 2026
13 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant