Skip to content

feat(javascript): add V8 and Node.js application backends - #99

Merged
forhappy merged 4 commits into
mainfrom
codex/js-ts-bridge-design
Oct 23, 2026
Merged

forhappy merged 4 commits into
mainfrom
codex/js-ts-bridge-design

Conversation

@forhappy

@forhappy forhappy commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Behavior

Applications can implement Cellar business logic and durable cells in JavaScript or TypeScript while the native Rust host retains routing, ownership, storage, and durability. The optional V8 backend runs closed bundles; the optional Node backend runs real Node.js with ESM/CommonJS, dynamic imports, built-ins, native npm addons, and React server rendering. Native-only applications remain engine-free.

Both backends use the shared Python guest operation boundary and a typed npm SDK. Invocation authority follows async work and is revoked on cancellation; worker failure stops the application without replaying mutations. TypeScript builds retain the normal npm module graph for Node, and a separate bundler produces closed V8 applications.

Node now supports native fleet build, publish, and install. Builds capture an immutable Node/application/npm inventory before Cargo and bind it to the executable digest. Publication verifies content-addressed archives before changing the deployment selector. Installation restores checked files at the exact compiled prefix before publishing the executable; admission rejects a mismatched runtime inventory. A relocatable directory package remains available for local-graph delivery. Runtime directory publication is shared with Python and preserves traversal permissions under restrictive installer umasks.

Validation

  • 25 Rust tests across guest operations, V8, Node, and native routing/storage/restart integrations; 11 tests in Node-only mode.
  • Real staged package published to a private SQLite development bucket, then restored with the captured runtime tree moved aside. The installed executable passed package validation, exercised CommonJS/React SSR/native Argon2 over HTTP, and recovered acknowledged counter writes in a second process with fresh local storage. Both hosts drained and joined.
  • Node archive tests cover integrity, traversal/depth, symlinks, malformed entries, tampering, and refusal before selector/executable publication. Native protocol/admission tests require the exact executable/inventory pair. Python archive regressions and private-staging directory permission checks pass.
  • Seven npm tooling tests pass. Node integration covers Zod, Lodash, React SSR, Argon2, built-ins, dynamic imports, and relocated runtime delivery.
  • The initial SDK CI exposed a Python request-limit diagnostic regression from shared guest conversion. A typed limit error now preserves the Python diagnostic. The unchanged operating-defaults qualification passes mixed concurrency, body limits, saturation, killed-owner recovery and shutdown; its six report guards pass. After merging main's Python optimization, all 13 Python unit tests, the full bridge/startup harnesses, and 16 encoding/runner guards pass while retaining raw-byte HTTP transport and overload semantics.
  • Combined and Node-only adapter Clippy, core library/tests Clippy, Python adapter Clippy, formatting, layout, engine dependency boundaries, documentation and whitespace checks pass locally. Linux JavaScript/Node CI passed, including native runtime archive restoration, process recovery and SDK packaging. Python example CI also passed.

Remaining limits

Node supervision supports macOS/Linux; Windows remains open. Node and native addons still require the target distribution's system libraries; system-library closure capture is not implemented. Fleet runtime prefixes must match between build and serving machines.

The Cellar guest transport uses bounded buffered HTTP values. Cellar streaming/WebSocket upgrades, workflows, RPC, JS-authored Raft commands, arbitrary framework ingress adapters, and broader production fleet fault/performance qualification remain separate work. Direct Node OS effects are outside Cellar transaction and cancellation guarantees; application execution is trusted. Tests qualify the documented packages and paths rather than universal npm compatibility.

@forhappy
forhappy marked this pull request as ready for review October 23, 2026 01:52
@forhappy
forhappy merged commit 8deee71 into main Oct 23, 2026
9 of 13 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