From e5ea2aa8b6c23ff60d7a01a0a4e4c97d67de1868 Mon Sep 17 00:00:00 2001 From: Lann Martin Date: Fri, 21 Aug 2026 23:12:56 -0400 Subject: [PATCH] polyengine 0.3.0 (the deltic rename); @polymorph/websocket 0.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The engine renamed deltic -> polyengine (@deltic/* -> @polyengine/* on JSR) and cut 0.3.0; the runner core @polymorph/test cut 0.2.0 with its exports renamed to match. Full rename here: js/deltic -> js/polyengine, conformance/driver-ct/deltic -> polyengine, examples/deltic-demo -> polyengine-demo, the wpt parity carrier/stub files, justfile targets (exam-polyengine, polyengine-module-check), driver ids polyengine-deno/ polyengine-browser, and the extract script + its artifact name. Brand strings follow upstream: polyengine.witError/1, polyengine.stream/1. Pins: exact jsr:@polyengine/*@0.3.0 in the conformance config, caret ^0.3.0 in the published package (bumped 0.2.0 -> 0.3.0); @polymorph/test@0.2.0/polyengine-worker-main; locks regenerated. The Rust component-test-* pins bump to 38bfedf2 (the @polymorph/test 0.2.0 release rev) per the bump-together contract, with ci.yml action refs. Gates: exam-polyengine, runner-js-pin-check, polyengine-module-check (14/14), conformance run-polyengine/run-wasmtime/run-composed (55/55 each), lock-check, wpt parity, both demos, gha::rust-checks — green locally; browser legs to CI. --- .github/justfile | 4 +- .github/workflows/ci.yml | 14 ++--- .github/workflows/jsr-publish.yml | 4 +- AGENTS.md | 49 +++++++-------- Cargo.lock | 26 ++++---- Cargo.toml | 8 +-- README.md | 21 +++---- conformance/README.md | 10 ++-- conformance/driver-ct/deltic/README.md | 60 ------------------- .../driver-ct/deltic/browser-bundle-entry.ts | 18 ------ .../driver-ct/deltic/browser/worker-entry.ts | 36 ----------- conformance/driver-ct/deltic/deno.json | 15 ----- conformance/driver-ct/deltic/deno.lock | 60 ------------------- conformance/driver-ct/deltic/package.json | 10 ---- conformance/driver-ct/justfile | 34 +++++------ conformance/driver-ct/matrix.md | 6 +- .../driver-ct/{deltic => polyengine}/.npmrc | 0 conformance/driver-ct/polyengine/README.md | 60 +++++++++++++++++++ .../polyengine/browser-bundle-entry.ts | 18 ++++++ .../polyengine/browser/worker-entry.ts | 37 ++++++++++++ conformance/driver-ct/polyengine/deno.json | 15 +++++ conformance/driver-ct/polyengine/deno.lock | 60 +++++++++++++++++++ conformance/driver-ct/polyengine/package.json | 10 ++++ .../{deltic => polyengine}/pnpm-lock.yaml | 10 ++-- .../{deltic => polyengine}/run-browser.mjs | 24 ++++---- .../driver-ct/{deltic => polyengine}/run.ts | 42 ++++++------- conformance/driver-ct/targets.toml | 16 ++--- conformance/server/echod.mjs | 8 +-- examples/justfile | 22 +++---- .../{deltic-demo => polyengine-demo}/run.ts | 28 ++++----- js/componentize/README.md | 6 +- js/componentize/websocket.js | 2 +- js/componentize/wpt/README.md | 12 ++-- js/componentize/wpt/justfile | 34 +++++------ js/componentize/wpt/parity/legs.mjs | 6 +- js/componentize/wpt/parity/losses-chromium.js | 2 +- js/componentize/wpt/parity/losses-file.mjs | 2 +- js/componentize/wpt/parity/losses.js | 2 +- js/componentize/wpt/parity/package.json | 2 +- ...eltic-carrier.ts => polyengine-carrier.ts} | 32 +++++----- js/componentize/wpt/parity/roundtrip.mjs | 10 ++-- js/componentize/wpt/parity/run-browser.mjs | 20 +++---- js/componentize/wpt/parity/smoke-run.mjs | 8 +-- ...deltic.mjs => sockets-stub-polyengine.mjs} | 8 +-- js/componentize/wpt/reporter.js | 2 +- js/componentize/wpt/smoke.js | 4 +- js/deltic/deno.json | 21 ------- js/{deltic => polyengine}/README.md | 30 +++++----- js/polyengine/deno.json | 21 +++++++ js/{deltic => polyengine}/deno.lock | 16 ++--- .../tests/echo_server.ts | 0 .../tests/websocket_test.ts | 26 ++++---- js/{deltic => polyengine}/websocket.ts | 4 +- justfile | 49 +++++++-------- justfile.shared.just | 27 +++++---- ...or.py => extract-polyengine-translator.py} | 20 +++---- scripts/setup.sh | 4 +- 57 files changed, 552 insertions(+), 543 deletions(-) delete mode 100644 conformance/driver-ct/deltic/README.md delete mode 100644 conformance/driver-ct/deltic/browser-bundle-entry.ts delete mode 100644 conformance/driver-ct/deltic/browser/worker-entry.ts delete mode 100644 conformance/driver-ct/deltic/deno.json delete mode 100644 conformance/driver-ct/deltic/deno.lock delete mode 100644 conformance/driver-ct/deltic/package.json rename conformance/driver-ct/{deltic => polyengine}/.npmrc (100%) create mode 100644 conformance/driver-ct/polyengine/README.md create mode 100644 conformance/driver-ct/polyengine/browser-bundle-entry.ts create mode 100644 conformance/driver-ct/polyengine/browser/worker-entry.ts create mode 100644 conformance/driver-ct/polyengine/deno.json create mode 100644 conformance/driver-ct/polyengine/deno.lock create mode 100644 conformance/driver-ct/polyengine/package.json rename conformance/driver-ct/{deltic => polyengine}/pnpm-lock.yaml (61%) rename conformance/driver-ct/{deltic => polyengine}/run-browser.mjs (83%) rename conformance/driver-ct/{deltic => polyengine}/run.ts (84%) rename examples/{deltic-demo => polyengine-demo}/run.ts (82%) rename js/componentize/wpt/parity/{deltic-carrier.ts => polyengine-carrier.ts} (68%) rename js/componentize/wpt/parity/{sockets-stub-deltic.mjs => sockets-stub-polyengine.mjs} (88%) delete mode 100644 js/deltic/deno.json rename js/{deltic => polyengine}/README.md (68%) create mode 100644 js/polyengine/deno.json rename js/{deltic => polyengine}/deno.lock (57%) rename js/{deltic => polyengine}/tests/echo_server.ts (100%) rename js/{deltic => polyengine}/tests/websocket_test.ts (93%) rename js/{deltic => polyengine}/websocket.ts (99%) rename scripts/{extract-deltic-translator.py => extract-polyengine-translator.py} (58%) diff --git a/.github/justfile b/.github/justfile index 7b0d3db..8bdc8e9 100644 --- a/.github/justfile +++ b/.github/justfile @@ -31,10 +31,10 @@ rust-checks: @just gha::_step test conformance-checks: - @just gha::_step exam-deltic + @just gha::_step exam-polyengine @just gha::_step runner-js-pin-check @just gha::_step conformance-ct::all - @just gha::_step deltic-module-check + @just gha::_step polyengine-module-check @just gha::_step wpt::parity @just gha::_step wpt::parity-chromium @just gha::_step demo::test diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 36ddf29..6ae2aa5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,7 +51,7 @@ jobs: # Owns the rev derivation, the rev-keyed tools cache, the # install, and the pins gate; the justfile's _ct-tools # recognizes the stamped install and does not repeat it. - uses: polymorph-components/polymorph-test/actions/setup@b4444a25a22106ad4128549bdc9e579552e62210 + uses: polymorph-components/polymorph-test/actions/setup@38bfedf2b989522b82ddce5320fc1557a2f61461 with: tools: component-test-cli - uses: pnpm/action-setup@v4 @@ -76,7 +76,7 @@ jobs: uses: actions/cache/restore@v4 with: path: ${{ steps.pnpm-store.outputs.path }} - key: pnpm-store-v2-${{ runner.os }}-${{ hashFiles('conformance/driver-ct/deltic/pnpm-lock.yaml', 'js/componentize/wpt/parity/pnpm-lock.yaml') }} + key: pnpm-store-v2-${{ runner.os }}-${{ hashFiles('conformance/driver-ct/polyengine/pnpm-lock.yaml', 'js/componentize/wpt/parity/pnpm-lock.yaml') }} restore-keys: pnpm-store-v2-${{ runner.os }}- - name: Install dependencies run: ./scripts/setup.sh @@ -95,7 +95,7 @@ jobs: if: github.ref == 'refs/heads/main' && steps.pnpm-cache.outputs.cache-hit != 'true' with: path: ${{ steps.pnpm-store.outputs.path }} - key: pnpm-store-v2-${{ runner.os }}-${{ hashFiles('conformance/driver-ct/deltic/pnpm-lock.yaml', 'js/componentize/wpt/parity/pnpm-lock.yaml') }} + key: pnpm-store-v2-${{ runner.os }}-${{ hashFiles('conformance/driver-ct/polyengine/pnpm-lock.yaml', 'js/componentize/wpt/parity/pnpm-lock.yaml') }} # The WPT parity Chromium leg always runs Playwright's own build, # pinned by playwright-core's version in the parity lockfile, so # losses-chromium.js measures one engine everywhere. The cache key @@ -120,7 +120,7 @@ jobs: npx playwright-core install --with-deps chromium fi - run: just gha::conformance-checks - # The deltic-browser adapter finds the runner's preinstalled Chrome + # The polyengine-browser adapter finds the runner's preinstalled Chrome # via its candidate paths; CHROME_PATH overrides if ever needed. # Presentation, not verdict: the just recipe above already gated @@ -131,15 +131,15 @@ jobs: # against the pin. - name: Publish the conformance matrix if: always() && hashFiles('conformance/driver-ct/results/*.jsonl') != '' - uses: polymorph-components/polymorph-test/actions/aggregate@b4444a25a22106ad4128549bdc9e579552e62210 + uses: polymorph-components/polymorph-test/actions/aggregate@38bfedf2b989522b82ddce5320fc1557a2f61461 with: lock: conformance/guest-ct/tests.lock manifest: conformance/driver-ct/targets.toml results: | wasmtime=conformance/driver-ct/results/wasmtime.jsonl composed=conformance/driver-ct/results/composed.jsonl - deltic-deno=conformance/driver-ct/results/deltic-deno.jsonl - deltic-browser=conformance/driver-ct/results/deltic-browser.jsonl + polyengine-deno=conformance/driver-ct/results/polyengine-deno.jsonl + polyengine-browser=conformance/driver-ct/results/polyengine-browser.jsonl summary-title: Conformance matrix cli: target/ct-tools/bin/component-test cargo-lock: Cargo.lock diff --git a/.github/workflows/jsr-publish.yml b/.github/workflows/jsr-publish.yml index 0268b10..68d0d48 100644 --- a/.github/workflows/jsr-publish.yml +++ b/.github/workflows/jsr-publish.yml @@ -1,4 +1,4 @@ -# Publish @polymorph/websocket (js/deltic) to JSR. +# Publish @polymorph/websocket (js/polyengine) to JSR. # # Auth is GitHub Actions OIDC: the package's GitHub-repository link on # jsr.io authorizes runs from this repository — no tokens. Dispatch @@ -20,4 +20,4 @@ jobs: with: deno-version: "2.9.5" - run: deno publish - working-directory: js/deltic + working-directory: js/polyengine diff --git a/AGENTS.md b/AGENTS.md index f9efc90..89425ed 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -28,25 +28,26 @@ Layout (each directory's justfile module in parentheses): - `rust/wasmtime/` — the `wasmtime-websocket` host crate. Its knobs (the connect/close bounds, the inbound-buffer bound) live on `WasiWebsocketCtx`; the crate reads no ambient environment. -- `js/deltic/` (`just deltic-module-check`) — `websocket.ts`, THE +- `js/polyengine/` (`just polyengine-module-check`) — `websocket.ts`, THE browser-first JS host module, over - [deltic](https://github.com/lann/deltic)'s embedder conventions (typed - streams, `ComponentException`) for its runtime-linked, no-transpile legs - (`conformance/driver-ct/deltic/`, the WPT parity round trip, the demo). + [polyengine](https://github.com/polymorph-components/polyengine)'s (formerly + `deltic`) embedder conventions (typed streams, `ComponentException`) for + its runtime-linked, no-transpile legs + (`conformance/driver-ct/polyengine/`, the WPT parity round trip, the demo). Its knobs are exported functions (`configure`, `setMaxInboundBufferBytes`, `setConnectTimeoutMs`, `setCloseTimeoutMs`); the module reads no ambient configuration. The - deltic release is pinned in TWO import maps — `js/deltic/deno.json` and - `conformance/driver-ct/deltic/deno.json` — as exact-pinned JSR - prereleases (`jsr:@deltic/@0.1.0-pre.g`; a version names one - upstream commit) which must agree on the `@deltic/runtime` version - (deltic's `wasi-shims` imports `@deltic/runtime/embedder` by bare + polyengine release is pinned in TWO import maps — `js/polyengine/deno.json` and + `conformance/driver-ct/polyengine/deno.json` — as exact-pinned JSR + prereleases (`jsr:@polyengine/@0.3.0-pre.g`; a version names one + upstream commit) which must agree on the `@polyengine/runtime` version + (polyengine's `wasi` module imports `@polyengine/runtime/embedder` by bare specifier internally, so a drift would load the embedder module twice and split the runtime/translator plan-format pairing; value recognition - itself is brand-based — deltic's `@deltic/protocol` predicates, not + itself is brand-based — polyengine's `@polyengine/protocol` predicates, not `instanceof` — and survives a multi-copy graph); the root - justfile's `exam-deltic` recipe (CI-wired) asserts one version - repo-wide. Bump procedure: `conformance/driver-ct/deltic/README.md`. + justfile's `exam-polyengine` recipe (CI-wired) asserts one version + repo-wide. Bump procedure: `conformance/driver-ct/polyengine/README.md`. - `js/componentize/` (`just wpt::…`) — `websocket.js`, the WHATWG-API shim for componentize-js guests (deviations registry in its header), and the WPT parity gate (`wpt/README.md` is the vendoring policy; losses @@ -54,21 +55,21 @@ Layout (each directory's justfile module in parentheses): - `conformance/` (`just conformance-ct`) — the conformance suite on the `polymorph:test` harness: `guest-ct/` (the suite component; the committed `tests.lock` is the corpus inventory), - `driver-ct/` (wasmtime + composed + deltic-deno + deltic-browser legs, + `driver-ct/` (wasmtime + composed + polyengine-deno + polyengine-browser legs, `targets.toml` with the expected-fail mechanism, the committed `matrix.md`), and `server/` (echod; `server/PROTOCOL.md` is its wire contract, `server/echod.mjs` the shared Node spawn helpers). The suite crates consume the harness as rev-pinned git dependencies (the two `[workspace.dependencies]` entries in the root `Cargo.toml`), the - deltic-browser driver consumes its JS runner core from JSR - (`@jsr/polymorph__test` in `driver-ct/deltic/package.json`), and + polyengine-browser driver consumes its JS runner core from JSR + (`@jsr/polymorph__test` in `driver-ct/polyengine/package.json`), and the `component-test` CLI is cargo-installed at the rev Cargo.lock records (`conformance-ct::_ct-tools`). Both sides of a bump name one polymorph-test release; the root `Cargo.toml` comment is the bump checklist. There is no transpiler dependency anywhere: the JS host legs are runtime-linked by the pinned - deltic JSR prereleases (single pin site: `driver-ct/deltic/{deno.json, + polyengine JSR prereleases (single pin site: `driver-ct/polyengine/{deno.json, deno.lock}`). - `examples/` (`just demo::…`) — the echo-demo guest and its host runners. @@ -92,13 +93,13 @@ places listed failing at run time. The sites: `examples/wasmtime-demo/src/lib.rs`; - `wit_bindgen::generate!` in the suite (`conformance/guest-ct/src/lib.rs`) and its import paths in `guest-ct/src/body.rs`; -- the deltic imports records, keyed by verbatim versioned WIT id and - failing at run time rather than build time: `js/deltic/websocket.ts` +- the polyengine imports records, keyed by verbatim versioned WIT id and + failing at run time rather than build time: `js/polyengine/websocket.ts` (`CONNECTIONS_INTERFACE`, `websocketImports`), the parity carrier - (`js/componentize/wpt/parity/deltic-carrier.ts`), and the exported - export ids in `examples/deltic-demo/run.ts`; -- the deltic host module's exported resource-class names, which the - embedder maps by resource name: `js/deltic/websocket.ts`. + (`js/componentize/wpt/parity/polyengine-carrier.ts`), and the exported + export ids in `examples/polyengine-demo/run.ts`; +- the polyengine host module's exported resource-class names, which the + embedder maps by resource name: `js/polyengine/websocket.ts`. Before designing WIT or touching async/stream plumbing, consult [`lann/wasm-component-starter`](https://github.com/lann/wasm-component-starter) @@ -114,10 +115,10 @@ decision to record, not a refactor. defined exactly once, at the root `wit/`. Components pull it in through `wit/deps` **symlinks** back to the root. Do not copy the package into a component or replace those symlinks with real directories. -- **The JS host must stay browser-compatible.** `js/deltic/websocket.ts` +- **The JS host must stay browser-compatible.** `js/polyengine/websocket.ts` uses only the standard `WebSocket` API — no `node:` modules, no Deno-only APIs: the same file must load in a browser unchanged (the - deltic-browser conformance row and the Chromium parity leg both depend + polyengine-browser conformance row and the Chromium parity leg both depend on it). - **The browser API bounds the portable surface.** Capabilities the browser `WebSocket` cannot serve (headers, client certs, ping/pong, trust diff --git a/Cargo.lock b/Cargo.lock index 7ac0c80..46a07e2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -179,8 +179,8 @@ dependencies = [ [[package]] name = "component-test-core" -version = "0.1.0" -source = "git+https://github.com/polymorph-components/polymorph-test?rev=b4444a25a22106ad4128549bdc9e579552e62210#b4444a25a22106ad4128549bdc9e579552e62210" +version = "0.1.1" +source = "git+https://github.com/polymorph-components/polymorph-test?rev=38bfedf2b989522b82ddce5320fc1557a2f61461#38bfedf2b989522b82ddce5320fc1557a2f61461" dependencies = [ "arcstr", "serde", @@ -188,8 +188,8 @@ dependencies = [ [[package]] name = "component-test-formats" -version = "0.1.0" -source = "git+https://github.com/polymorph-components/polymorph-test?rev=b4444a25a22106ad4128549bdc9e579552e62210#b4444a25a22106ad4128549bdc9e579552e62210" +version = "0.1.1" +source = "git+https://github.com/polymorph-components/polymorph-test?rev=38bfedf2b989522b82ddce5320fc1557a2f61461#38bfedf2b989522b82ddce5320fc1557a2f61461" dependencies = [ "anyhow", "component-test-core", @@ -203,8 +203,8 @@ dependencies = [ [[package]] name = "component-test-results" -version = "0.1.0" -source = "git+https://github.com/polymorph-components/polymorph-test?rev=b4444a25a22106ad4128549bdc9e579552e62210#b4444a25a22106ad4128549bdc9e579552e62210" +version = "0.1.1" +source = "git+https://github.com/polymorph-components/polymorph-test?rev=38bfedf2b989522b82ddce5320fc1557a2f61461#38bfedf2b989522b82ddce5320fc1557a2f61461" dependencies = [ "anyhow", "component-test-core", @@ -214,8 +214,8 @@ dependencies = [ [[package]] name = "component-test-runner" -version = "0.1.0" -source = "git+https://github.com/polymorph-components/polymorph-test?rev=b4444a25a22106ad4128549bdc9e579552e62210#b4444a25a22106ad4128549bdc9e579552e62210" +version = "0.1.1" +source = "git+https://github.com/polymorph-components/polymorph-test?rev=38bfedf2b989522b82ddce5320fc1557a2f61461#38bfedf2b989522b82ddce5320fc1557a2f61461" dependencies = [ "anyhow", "component-test-core", @@ -230,8 +230,8 @@ dependencies = [ [[package]] name = "component-test-sdk" -version = "0.1.0" -source = "git+https://github.com/polymorph-components/polymorph-test?rev=b4444a25a22106ad4128549bdc9e579552e62210#b4444a25a22106ad4128549bdc9e579552e62210" +version = "0.1.1" +source = "git+https://github.com/polymorph-components/polymorph-test?rev=38bfedf2b989522b82ddce5320fc1557a2f61461#38bfedf2b989522b82ddce5320fc1557a2f61461" dependencies = [ "component-test-core", "component-test-sdk-macro", @@ -242,8 +242,8 @@ dependencies = [ [[package]] name = "component-test-sdk-macro" -version = "0.1.0" -source = "git+https://github.com/polymorph-components/polymorph-test?rev=b4444a25a22106ad4128549bdc9e579552e62210#b4444a25a22106ad4128549bdc9e579552e62210" +version = "0.1.1" +source = "git+https://github.com/polymorph-components/polymorph-test?rev=38bfedf2b989522b82ddce5320fc1557a2f61461#38bfedf2b989522b82ddce5320fc1557a2f61461" dependencies = [ "component-test-core", "proc-macro2", @@ -1814,7 +1814,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" dependencies = [ "fastrand", - "getrandom 0.3.4", + "getrandom 0.4.3", "once_cell", "rustix", "windows-sys 0.61.2", diff --git a/Cargo.toml b/Cargo.toml index aea718e..eac62a3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,11 +28,11 @@ default-members = [ # .github/workflows/ci.yml` with the release-tag commit, `cargo update # -p component-test-sdk -p component-test-runner`, then set the # matching release version on the `@jsr/polymorph__test` dependency in -# conformance/driver-ct/deltic/package.json and `pnpm --dir -# conformance/driver-ct/deltic install` — the cargo pins gate, the +# conformance/driver-ct/polyengine/package.json and `pnpm --dir +# conformance/driver-ct/polyengine install` — the cargo pins gate, the # runner-js pin gate, and the CI ref guard fail on skew. -component-test-sdk = { git = "https://github.com/polymorph-components/polymorph-test", rev = "b4444a25a22106ad4128549bdc9e579552e62210" } -component-test-runner = { git = "https://github.com/polymorph-components/polymorph-test", rev = "b4444a25a22106ad4128549bdc9e579552e62210" } +component-test-sdk = { git = "https://github.com/polymorph-components/polymorph-test", rev = "38bfedf2b989522b82ddce5320fc1557a2f61461" } +component-test-runner = { git = "https://github.com/polymorph-components/polymorph-test", rev = "38bfedf2b989522b82ddce5320fc1557a2f61461" } anyhow = "1" bytes = "1" futures = "0.3" diff --git a/README.md b/README.md index 1a7ef0f..90d17c1 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,11 @@ deliberately mirroring their architecture. One guest component binary runs unchanged against: -- a **browser-first** JS host ([`js/deltic`](js/deltic)): the standard +- a **browser-first** JS host ([`js/polyengine`](js/polyengine)): the standard `WebSocket` API only, zero runtime dependencies — the same file loads in a browser, under Deno, and under Node, runtime-linked by - [deltic](https://github.com/lann/deltic) with no transpile step and no + [polyengine](https://github.com/polymorph-components/polyengine) (formerly + `deltic`) with no transpile step and no engine flag; - a **native Rust** host ([`rust/wasmtime`](rust/wasmtime)): Wasmtime + [`tokio-tungstenite`], modeled after `wasmtime_wasi_http::p3`. @@ -30,7 +31,7 @@ Everything here is **unstable** (0.x), but [releases](../../releases) are **caret-honest**: within a minor line they stay backward-compatible, and anything breaking bumps the minor. Consumption is pinned at a release's commit — cargo git dependencies, vendored WIT, the release-pinned -deltic/JSR graph — and bumped deliberately. +polyengine/JSR graph — and bumped deliberately. ## Why this exists @@ -55,12 +56,12 @@ in-guest. | Path | Deliverable | | --- | --- | | [`wit/`](wit) | The `polymorph:websocket` package: a `types` interface for structural types and a `connections` interface owning the `websocket` resource. One copy at the root; consumers pull it in via `wit/deps` symlinks. Package-wide contracts live in [`wit/README.md`](wit/README.md). | -| [`js/deltic`](js/deltic) | The **browser-first JS host module** (`websocket.ts`): the standard `WebSocket` API only, no `node:` modules, no runtime dependencies, over [deltic](https://github.com/lann/deltic)'s embedder conventions (typed streams, `ComponentException`). Shared verbatim by the demo runner, the conformance JS-host rows, and the WPT parity round trip. | +| [`js/polyengine`](js/polyengine) | The **browser-first JS host module** (`websocket.ts`): the standard `WebSocket` API only, no `node:` modules, no runtime dependencies, over [polyengine](https://github.com/polymorph-components/polyengine)'s embedder conventions (typed streams, `ComponentException`). Shared verbatim by the demo runner, the conformance JS-host rows, and the WPT parity round trip. | | [`rust/wasmtime`](rust/wasmtime) | The **Wasmtime host crate** (`wasmtime-websocket`): `add_to_linker` + `WasiWebsocketView`, per-store `WasiWebsocketCtx` knobs for the bounds the WIT leaves implementation-defined. | -| [`js/componentize`](js/componentize) | The **browser-API shim** for componentize-js guests: the WHATWG `WebSocket` interface implemented over the WIT imports — the inverse of `js/deltic` — plus the **WPT parity gate**: vendored web-platform-tests run round-trip (shim → WIT → deltic → platform WebSocket) and held to the platform baseline's pass set. | +| [`js/componentize`](js/componentize) | The **browser-API shim** for componentize-js guests: the WHATWG `WebSocket` interface implemented over the WIT imports — the inverse of `js/polyengine` — plus the **WPT parity gate**: vendored web-platform-tests run round-trip (shim → WIT → polyengine → platform WebSocket) and held to the platform baseline's pass set. | | [`rust/guest-provider`](rust/guest-provider) | The **in-guest provider** (`websocket-guest-provider`): a WebSocket client stack over `wasi:sockets` TCP, exporting the package surface as a composable component; `wss:` via the composed [`polymorph:tls`](https://github.com/polymorph-components/polymorph-tls) component. See its README for the TLS posture and configuration channel. | -| [`conformance/`](conformance) | The **cross-implementation conformance suite** on the [`polymorph:test`](https://github.com/polymorph-components/polymorph-test) harness: a shared guest suite (`guest-ct`, its committed `tests.lock` the corpus inventory), a suite-owned echo server with fault-injection modes, and the driver (`driver-ct`) that runs every target (wasmtime, composed, deltic under stock Deno, and deltic inside headless Chromium) into [the matrix](conformance/README.md). | -| [`examples/`](examples) | The **echo-demo guest component** plus native (`just demo::wasmtime`) and JS (`just demo::deltic`) runners against the suite echo server. | +| [`conformance/`](conformance) | The **cross-implementation conformance suite** on the [`polymorph:test`](https://github.com/polymorph-components/polymorph-test) harness: a shared guest suite (`guest-ct`, its committed `tests.lock` the corpus inventory), a suite-owned echo server with fault-injection modes, and the driver (`driver-ct`) that runs every target (wasmtime, composed, polyengine under stock Deno, and polyengine inside headless Chromium) into [the matrix](conformance/README.md). | +| [`examples/`](examples) | The **echo-demo guest component** plus native (`just demo::wasmtime`) and JS (`just demo::polyengine`) runners against the suite echo server. | ## The interface @@ -98,7 +99,7 @@ channel as interchangeable message transports. ## Running it Prerequisites: `rustup`, Node 24+ (the Node-side drivers), Deno (the -deltic legs; no engine flags anywhere), a Chrome/Chromium for the browser +polyengine legs; no engine flags anywhere), a Chrome/Chromium for the browser conformance target (discovered from the usual locations, or set `CHROME_PATH`), and `./scripts/setup.sh` (installs the pinned `wasm-tools`/`wac`/`just`/`pnpm` and the JS package @@ -107,9 +108,9 @@ trees). ```sh ./scripts/setup.sh just check # fmt + clippy + WIT validation + native tests -just conformance-ct # the full matrix: wasmtime, composed, deltic-deno, deltic-browser +just conformance-ct # the full matrix: wasmtime, composed, polyengine-deno, polyengine-browser just demo::wasmtime # the echo demo on the native host -just demo::deltic # the same component runtime-linked under deltic +just demo::polyengine # the same component runtime-linked under polyengine just ci # exactly what CI runs ``` diff --git a/conformance/README.md b/conformance/README.md index ea5f2d7..bdb3dcb 100644 --- a/conformance/README.md +++ b/conformance/README.md @@ -27,7 +27,7 @@ section. | --- | --- | | [`guest-ct/`](guest-ct) | The suite component: `#[case]`s importing `polymorph:websocket/connections`, owning **every assertion**. One wasm binary, run unchanged against every target. The committed `tests.lock` is its inventory (drift fails `lock-check` and the runner's own cross-check). | | [`server/`](server) | The suite-owned echo/reference server (`conformance-echod`): echo plus the fault modes the close-semantics rows need. Wire contract in [`server/PROTOCOL.md`](server/PROTOCOL.md); `server/echod.mjs` holds the Node-side spawn helpers every JS leg shares. | -| [`driver-ct/`](driver-ct) | The legs and the aggregate. `ct-driver` (Rust) embeds the wasmtime host (and, with `--composed`, runs the wac-composed in-guest provider under WASI p2+p3 instead); `deltic/` runs the same suite **runtime-linked** — no transpile step, no generated tree, no engine flag — under stock Deno (`run.ts`) and inside headless Chromium (`run-browser.mjs` plus the bundled `browser/worker-entry.ts` worker), thin glue (SUT import wiring, config) over the upstream runner core (`@deltic/ct-runner` and `@jsr/polymorph__test`'s page driver), which owns the case loop, verdict mapping, and tag-inventory drift check. `targets.toml` declares targets, features, and expected-fail entries; `component-test aggregate` validates and renders the matrix. The composed leg executes a different artifact by construction (the suite with the provider plugged in), so it binds its results envelope to the uncomposed suite's bytes (`--suite-artifact`, the runner's `bind_suite_artifact` attestation) and the aggregate's cross-target artifact agreement covers all four legs. | +| [`driver-ct/`](driver-ct) | The legs and the aggregate. `ct-driver` (Rust) embeds the wasmtime host (and, with `--composed`, runs the wac-composed in-guest provider under WASI p2+p3 instead); `polyengine/` runs the same suite **runtime-linked** — no transpile step, no generated tree, no engine flag — under stock Deno (`run.ts`) and inside headless Chromium (`run-browser.mjs` plus the bundled `browser/worker-entry.ts` worker), thin glue (SUT import wiring, config) over the upstream runner core (`@polyengine/ct-runner` and `@jsr/polymorph__test`'s page driver), which owns the case loop, verdict mapping, and tag-inventory drift check. `targets.toml` declares targets, features, and expected-fail entries; `component-test aggregate` validates and renders the matrix. The composed leg executes a different artifact by construction (the suite with the provider plugged in), so it binds its results envelope to the uncomposed suite's bytes (`--suite-artifact`, the runner's `bind_suite_artifact` attestation) and the aggregate's cross-target artifact agreement covers all four legs. | | [`wit/`](wit) | The suite's world (`sut-imports`): only the surface under test — the export surface comes from the component-test SDK. The `polymorph:websocket` package arrives through the `deps/polymorph-websocket` symlink, never a copy. | ### The result stream @@ -44,13 +44,13 @@ aggregate do not change. ### Timing and buffer bounds Every leg configures the implementation under test with the same bounds -(declared in `driver-ct/src/main.rs`, mirrored by the deltic runners): an +(declared in `driver-ct/src/main.rs`, mirrored by the polyengine runners): an inbound-buffer bound small enough that the overflow rows trigger with a bounded flood (it rides the `WS_CONFORMANCE_MAX_INBOUND_BUFFER_BYTES` store environment, so the guest floods against exactly the configured value), and connect/close bounds short enough that the `/stall` and `/ignore-close` probes resolve well inside the per-case wall bound. That -bound (60s, the runner's `--case-timeout`; mirrored by the deltic +bound (60s, the runner's `--case-timeout`; mirrored by the polyengine runners' `CASE_TIMEOUT_MS`) runs a single attempt, **no retries**: a nondeterministic failure is a real signal and must surface, not be masked by a second attempt. Message @@ -106,8 +106,8 @@ records the resolution). The `component-test` CLI used by the lockfile and aggregate recipes is cargo-installed into `target/ct-tools` at the rev read back out of Cargo.lock (`conformance-ct::_ct-tools`), so the libraries and the CLI cannot drift apart. Registry dependencies replace -the git pins when component-test publishes. The deltic-browser driver +the git pins when component-test publishes. The polyengine-browser driver consumes the JS runner core from JSR: `@jsr/polymorph__test` in -`driver-ct/deltic/package.json`, set to the release version matching +`driver-ct/polyengine/package.json`, set to the release version matching the cargo entries (both sides of a bump name one polymorph-test release — the root `Cargo.toml` comment is the bump checklist). diff --git a/conformance/driver-ct/deltic/README.md b/conformance/driver-ct/deltic/README.md deleted file mode 100644 index a591971..0000000 --- a/conformance/driver-ct/deltic/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# `conformance/driver-ct/deltic` — the deltic-native conformance leg - -The `deltic-deno` target in the conformance matrix: the suite runs -runtime-linked under stock Deno — no transpile step, no generated tree, -no engine flag (the WIT contract's async exports run on the callback ABI) -— against [`js/deltic/websocket.ts`](../../../js/deltic/websocket.ts). -This is the deltic analogue of the retired jco Node leg (removed with the -jco legs; see git history); see `run.ts`'s header for the -exact mirror. - -## Running it - -```sh -just conformance-ct::run-deltic -``` - -which builds the suite + echod and runs the suite through `ct-runner`, -writing `conformance/driver-ct/results/deltic-deno.jsonl`. The translator -comes from the packaged `@deltic/translator` JSR prerelease through the -module graph — no fetch step, no net grant. - -## The pin - -deltic publishes `@deltic/{runtime,translator,wasi-shims,ct-runner}` to -JSR as exact-pinned prereleases (`0.1.0-pre.g`, the same short -hash as the corresponding GitHub release — a version names one exact -upstream commit; see deltic's README "Consuming the unstable -prereleases"). It is pinned in **two** places, both required to agree: - -- `deno.json` (this directory) — import-map versions - (`jsr:@deltic/@0.1.0-pre.g`) for `@deltic/ct-runner`, - `@deltic/runtime/embedder`, `@deltic/runtime/shim`, `@deltic/wasi-shims`, - `@deltic/translator`. `deno.lock` carries integrity hashes for that - module graph, enforced with `--frozen`. -- [`../../../js/deltic/deno.json`](../../../js/deltic/deno.json) — the - SAME `@deltic/runtime` version (the module-identity constraint: deltic's - `wasi-shims` imports `@deltic/runtime/embedder` by bare specifier - internally, so every config resolving it must agree, or the embedder - module loads twice — the host module's brand-based value recognition - survives that, but a second copy splits the runtime/translator - plan-format pairing). - -`@deltic/translator` ships the translator wasm asset **for the same -commit** as `@deltic/runtime`, so the plan-format coupling is -self-consistent per graph by construction — there is no separate sha256 -to track. The root justfile's `exam-deltic` recipe (wired into CI) is the -one-version-everywhere gate: it asserts every `jsr:@deltic/*` import -across both `deno.json` files names the identical version. - -Both `deno.json`s carry -`"minimumDependencyAge": { "age": "P1D", "exclude": ["jsr:@deltic/*"] }` -(verbatim from deltic's README): Deno's 24-hour supply-chain gate would -otherwise block resolving a same-day publish. - -To bump: update the version in both `deno.json` import maps, delete -**both** `deno.lock` files (this directory and `js/deltic/`), regenerate -with `deno install` (or `deno check`) in each directory, then re-run -`just conformance-ct::run-deltic` and commit the diff (including the -regenerated `matrix.md`, via `just conformance-ct::matrix-update`). -`exam-deltic` fails loud on any drift between the two configs. diff --git a/conformance/driver-ct/deltic/browser-bundle-entry.ts b/conformance/driver-ct/deltic/browser-bundle-entry.ts deleted file mode 100644 index 6ea0313..0000000 --- a/conformance/driver-ct/deltic/browser-bundle-entry.ts +++ /dev/null @@ -1,18 +0,0 @@ -// The deltic-browser worker's bundle entry for the engine surface: -// upstream's tools/release-bundle/entry.ts public surface, reproduced -// locally now that deltic publishes JSR prereleases instead of a -// pinned raw-URL release bundle (see ../../../README.md's deltic pin -// story and js/deltic/deno.json's MODULE-IDENTITY comment). -// -// Bundled with `deno bundle --platform browser` from THIS directory (so -// every re-export resolves through this directory's deno.json import -// map — the single deltic pin site), the emitted module is what -// browser/worker-entry.ts imports as `@deltic/release-bundle-entry` -// used to. Same export surface: instantiate/Translator/runSuite/ -// wasi/ComponentException/artifactsFromEnvelope and friends (49 exports -// verified against the retired upstream entry). -export * from "@deltic/runtime/embedder"; -export { Translator } from "@deltic/runtime/shim"; -export * from "@deltic/ct-runner"; -export { wasi } from "@deltic/wasi"; -export type { WasiImports, WasiOptions } from "@deltic/wasi"; diff --git a/conformance/driver-ct/deltic/browser/worker-entry.ts b/conformance/driver-ct/deltic/browser/worker-entry.ts deleted file mode 100644 index ea84a82..0000000 --- a/conformance/driver-ct/deltic/browser/worker-entry.ts +++ /dev/null @@ -1,36 +0,0 @@ -// The deltic-browser shard worker's bundle entry: the deltic engine -// surface (the local browser-bundle-entry.ts, re-exporting the pinned -// JSR packages' public surface), the upstream worker message loop, and -// this repo's deltic host module, resolved through ONE import map so the -// emitted bundle carries exactly one embedder module instance — one -// runtime/translator plan-format pairing, one copy on the runtime's -// copy census (workers resolve no import maps, so bundling is the only -// sound shape; see @jsr/polymorph__test's runner-deltic README). -// -// Built by `just conformance-ct::run-deltic-browser` with -// `deno bundle --platform browser` into target/deltic-browser/, and -// served to the page from there as runSuitesInPage's workerUrl. - -import * as deltic from "../browser-bundle-entry.ts"; -import { workerMain } from "@polymorph/test/deltic-worker-main"; -import { configure, websocketImports } from "../../../../js/deltic/websocket.ts"; - -// The suite bounds, matching every other leg (run-node.mjs, run.ts, the -// wasmtime driver): one behavioral floor across targets. Connections -// capture them at connect, so configuring the module once per run -// message covers every instance. -const MAX_INBOUND_BUFFER_BYTES = 256 * 1024; -const CONNECT_TIMEOUT_MS = 5000; -const CLOSE_TIMEOUT_MS = 3000; - -workerMain({ - deltic, - suiteImports: () => { - configure({ - maxInboundBufferBytes: MAX_INBOUND_BUFFER_BYTES, - connectTimeoutMs: CONNECT_TIMEOUT_MS, - closeTimeoutMs: CLOSE_TIMEOUT_MS, - }); - return websocketImports(); - }, -}); diff --git a/conformance/driver-ct/deltic/deno.json b/conformance/driver-ct/deltic/deno.json deleted file mode 100644 index f012c83..0000000 --- a/conformance/driver-ct/deltic/deno.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "//": "MODULE-IDENTITY CONSTRAINT: deltic's wasi module imports @deltic/runtime/embedder by bare specifier internally. The @deltic/runtime/embedder entry here must resolve to the IDENTICAL @deltic/runtime version as ../../../js/deltic/deno.json's caret range (in both deno.locks), or the embedder module loads twice: value recognition survives that (websocket.ts recognizes deltic values by @deltic/protocol brand predicates, not instanceof), but a second copy splits the runtime/translator plan-format pairing, and stateful handles (streams/futures) minted by one copy are refused by the other. Pin story: exact-pinned JSR releases (caret-honest upstream: within a minor line releases stay compatible, breaking bumps the minor; per-commit `-pre.g` prereleases exist between releases — pin exactly); @deltic/translator ships the translator wasm for that SAME commit; deno.lock carries integrity, --frozen enforced everywhere; one version repo-wide is asserted by the pin gate (justfile: exam-deltic).", - "imports": { - "@deltic/ct-runner": "jsr:@deltic/ct-runner@0.2.0", - "@deltic/runtime/embedder": "jsr:@deltic/runtime@0.2.0/embedder", - "@deltic/runtime/shim": "jsr:@deltic/runtime@0.2.0/shim", - "@deltic/wasi": "jsr:@deltic/wasi@0.2.0", - "@deltic/translator": "jsr:@deltic/translator@0.2.0", - "@polymorph/test/deltic-worker-main": "jsr:@polymorph/test@0.1.1/deltic-worker-main" - }, - "minimumDependencyAge": { "age": "P1D", "exclude": ["jsr:@deltic/*", "jsr:@polymorph/*"] }, - "tasks": { - "check": "deno check run.ts browser/worker-entry.ts browser-bundle-entry.ts" - } -} \ No newline at end of file diff --git a/conformance/driver-ct/deltic/deno.lock b/conformance/driver-ct/deltic/deno.lock deleted file mode 100644 index 135ed4e..0000000 --- a/conformance/driver-ct/deltic/deno.lock +++ /dev/null @@ -1,60 +0,0 @@ -{ - "version": "5", - "specifiers": { - "jsr:@deltic/ct-runner@0.2.0": "0.2.0", - "jsr:@deltic/protocol@0.2": "0.2.0", - "jsr:@deltic/runtime@0.2": "0.2.0", - "jsr:@deltic/runtime@0.2.0": "0.2.0", - "jsr:@deltic/translator@0.2.0": "0.2.0", - "jsr:@deltic/wasi@0.2.0": "0.2.0", - "jsr:@polymorph/test@0.1.1": "0.1.1" - }, - "jsr": { - "@deltic/ct-runner@0.2.0": { - "integrity": "810eec021dc07dbc7efe00e0e7df900f557c5b30bd11f077195eeb44bcce81b4", - "dependencies": [ - "jsr:@deltic/runtime@0.2" - ] - }, - "@deltic/protocol@0.2.0": { - "integrity": "028be6a3623c5e910598aa7a199209b85e8931ae484ac7f6638d610ddb0e19fa" - }, - "@deltic/runtime@0.2.0": { - "integrity": "cf8b0bdd9e6bc4488ba78cc91661103bfcbd78f5a5c4ff99132799618a9db4bb", - "dependencies": [ - "jsr:@deltic/protocol" - ] - }, - "@deltic/translator@0.2.0": { - "integrity": "8104b54e2acdccfd75f5ddc941d72b581e7defbbe31c05bbc66598d2df7a34f9", - "dependencies": [ - "jsr:@deltic/runtime@0.2" - ] - }, - "@deltic/wasi@0.2.0": { - "integrity": "82c76d4fda0a1c9238a91f8ebc7fdbac952a03aa06d4a2a820213df2654f5c24", - "dependencies": [ - "jsr:@deltic/protocol", - "jsr:@deltic/runtime@0.2" - ] - }, - "@polymorph/test@0.1.1": { - "integrity": "50ce81310c97591c523bbfdbe74e18a806e709ae1c09f47297da98267b5be8b3" - } - }, - "workspace": { - "dependencies": [ - "jsr:@deltic/ct-runner@0.2.0", - "jsr:@deltic/runtime@0.2.0", - "jsr:@deltic/translator@0.2.0", - "jsr:@deltic/wasi@0.2.0", - "jsr:@polymorph/test@0.1.1" - ], - "packageJson": { - "dependencies": [ - "npm:@jsr/polymorph__test@0.1.1", - "npm:playwright-core@^1.61.1" - ] - } - } -} diff --git a/conformance/driver-ct/deltic/package.json b/conformance/driver-ct/deltic/package.json deleted file mode 100644 index c63662d..0000000 --- a/conformance/driver-ct/deltic/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "@polymorph/websocket-conformance-deltic-browser", - "private": true, - "type": "module", - "description": "Node driver + bundled worker inputs for the deltic-browser conformance row: the suite runtime-linked inside headless Chromium with this repo's deltic host module, through the upstream page driver and deltic worker-main.", - "dependencies": { - "@jsr/polymorph__test": "0.1.1", - "playwright-core": "^1.61.1" - } -} diff --git a/conformance/driver-ct/justfile b/conformance/driver-ct/justfile index 4cce623..01a2f30 100644 --- a/conformance/driver-ct/justfile +++ b/conformance/driver-ct/justfile @@ -17,7 +17,7 @@ results := root / "conformance/driver-ct/results" default: all # Build + lockfile gate + run every leg + aggregate + matrix gate. -all: build lock-check run-wasmtime run-composed run-deltic run-deltic-browser aggregate matrix-check +all: build lock-check run-wasmtime run-composed run-polyengine run-polyengine-browser aggregate matrix-check # ----- builders --------------------------------------------------------------- @@ -129,8 +129,8 @@ run-composed: compose-suite build-driver build-echod --composed --suite-artifact {{suite_wasm}} \ --jsonl --jobs 4 --target composed > {{results}}/composed.jsonl -# The deltic-native leg: runtime-linked under stock Deno, no transpile -# step. The translator comes from the packaged `@deltic/translator` JSR +# The polyengine-native leg: runtime-linked under stock Deno, no transpile +# step. The translator comes from the packaged `@polyengine/translator` JSR # prerelease through the module graph — no fetch step, no sha256 # bookkeeping, no net grant. run.ts owns the suite run. Scoped # permissions throughout, EXCEPT --allow-run: Deno refuses a *scoped* @@ -142,41 +142,41 @@ run-composed: compose-suite build-driver build-echod # is still just the echod binary. DENO_CERT provisions trust for the # suite's committed test PKI, the Deno analogue of the NODE_EXTRA_CA_CERTS # the retired jco Node leg carried (see git history). -run-deltic: build-suite build-echod +run-polyengine: build-suite build-echod #!/usr/bin/env bash set -euo pipefail mkdir -p {{results}} DENO_CERT={{root}}/conformance/server/tls/ca.pem {{timeout_cmd}} deno run \ - --config {{root}}/conformance/driver-ct/deltic/deno.json --frozen \ + --config {{root}}/conformance/driver-ct/polyengine/deno.json --frozen \ --allow-read={{root}} \ --allow-write={{results}} \ --allow-net=127.0.0.1,localhost \ --allow-run \ --allow-env=DENO_CERT \ - {{root}}/conformance/driver-ct/deltic/run.ts \ - --out {{results}}/deltic-deno.jsonl --target deltic-deno + {{root}}/conformance/driver-ct/polyengine/run.ts \ + --out {{results}}/polyengine-deno.jsonl --target polyengine-deno -# The deltic browser driver's npm tree (the upstream page driver + +# The polyengine browser driver's npm tree (the upstream page driver + # worker message loop + playwright-core; no transpiler). -_deltic-browser-prepared: +_polyengine-browser-prepared: #!/usr/bin/env bash set -euo pipefail - cd {{root}}/conformance/driver-ct/deltic + cd {{root}}/conformance/driver-ct/polyengine if [ pnpm-lock.yaml -nt node_modules/.modules.yaml ]; then pnpm install --silent fi -# The suite runtime-linked inside headless Chromium against the deltic +# The suite runtime-linked inside headless Chromium against the polyengine # host module: the worker is one deno-bundled module (engine + host # module + message loop; browser/worker-entry.ts), so no transpile step # and no generated tree. -run-deltic-browser: build-suite build-echod _deltic-browser-prepared (extract-deltic-translator root / "target/deltic-browser") +run-polyengine-browser: build-suite build-echod _polyengine-browser-prepared (extract-polyengine-translator root / "target/polyengine-browser") #!/usr/bin/env bash set -euo pipefail - cd {{root}}/conformance/driver-ct/deltic - mkdir -p {{root}}/target/deltic-browser + cd {{root}}/conformance/driver-ct/polyengine + mkdir -p {{root}}/target/polyengine-browser deno bundle --config deno.json --frozen --platform browser \ - -o {{root}}/target/deltic-browser/websocket-worker.mjs browser/worker-entry.ts + -o {{root}}/target/polyengine-browser/websocket-worker.mjs browser/worker-entry.ts mkdir -p {{results}} {{timeout_cmd}} node run-browser.mjs @@ -188,8 +188,8 @@ aggregate: _ct-tools --manifest {{root}}/conformance/driver-ct/targets.toml \ --results wasmtime={{results}}/wasmtime.jsonl \ --results composed={{results}}/composed.jsonl \ - --results deltic-deno={{results}}/deltic-deno.jsonl \ - --results deltic-browser={{results}}/deltic-browser.jsonl \ + --results polyengine-deno={{results}}/polyengine-deno.jsonl \ + --results polyengine-browser={{results}}/polyengine-browser.jsonl \ -o {{results}}/matrix.md # The committed matrix is the cross-target review surface; regenerate diff --git a/conformance/driver-ct/matrix.md b/conformance/driver-ct/matrix.md index 0b35d1c..59c7093 100644 --- a/conformance/driver-ct/matrix.md +++ b/conformance/driver-ct/matrix.md @@ -1,6 +1,6 @@ # Test matrix -| Case | composed | deltic-browser | deltic-deno | wasmtime | +| Case | composed | polyengine-browser | polyengine-deno | wasmtime | | --- | --- | --- | --- | --- | | websocket (55 cases) | pass | pass | pass | pass | @@ -11,6 +11,6 @@ None. ## Summary - `composed`: 55 pass (55 total) -- `deltic-browser`: 55 pass (55 total) -- `deltic-deno`: 55 pass (55 total) +- `polyengine-browser`: 55 pass (55 total) +- `polyengine-deno`: 55 pass (55 total) - `wasmtime`: 55 pass (55 total) diff --git a/conformance/driver-ct/deltic/.npmrc b/conformance/driver-ct/polyengine/.npmrc similarity index 100% rename from conformance/driver-ct/deltic/.npmrc rename to conformance/driver-ct/polyengine/.npmrc diff --git a/conformance/driver-ct/polyengine/README.md b/conformance/driver-ct/polyengine/README.md new file mode 100644 index 0000000..e3fdc82 --- /dev/null +++ b/conformance/driver-ct/polyengine/README.md @@ -0,0 +1,60 @@ +# `conformance/driver-ct/polyengine` — the polyengine-native conformance leg + +The `polyengine-deno` target in the conformance matrix: the suite runs +runtime-linked under stock Deno — no transpile step, no generated tree, +no engine flag (the WIT contract's async exports run on the callback ABI) +— against [`js/polyengine/websocket.ts`](../../../js/polyengine/websocket.ts). +This is the polyengine analogue of the retired jco Node leg (removed with the +jco legs; see git history); see `run.ts`'s header for the +exact mirror. + +## Running it + +```sh +just conformance-ct::run-polyengine +``` + +which builds the suite + echod and runs the suite through `ct-runner`, +writing `conformance/driver-ct/results/polyengine-deno.jsonl`. The translator +comes from the packaged `@polyengine/translator` JSR prerelease through the +module graph — no fetch step, no net grant. + +## The pin + +polyengine publishes `@polyengine/{runtime,translator,wasi,ct-runner}` to +JSR as exact-pinned prereleases (`0.3.0-pre.g`, the same short +hash as the corresponding GitHub release — a version names one exact +upstream commit; see polyengine's README "Consuming the unstable +prereleases"). It is pinned in **two** places, both required to agree: + +- `deno.json` (this directory) — import-map versions + (`jsr:@polyengine/@0.3.0-pre.g`) for `@polyengine/ct-runner`, + `@polyengine/runtime/embedder`, `@polyengine/runtime/shim`, `@polyengine/wasi`, + `@polyengine/translator`. `deno.lock` carries integrity hashes for that + module graph, enforced with `--frozen`. +- [`../../../js/polyengine/deno.json`](../../../js/polyengine/deno.json) — the + SAME `@polyengine/runtime` version (the module-identity constraint: polyengine's + `wasi` module imports `@polyengine/runtime/embedder` by bare specifier + internally, so every config resolving it must agree, or the embedder + module loads twice — the host module's brand-based value recognition + survives that, but a second copy splits the runtime/translator + plan-format pairing). + +`@polyengine/translator` ships the translator wasm asset **for the same +commit** as `@polyengine/runtime`, so the plan-format coupling is +self-consistent per graph by construction — there is no separate sha256 +to track. The root justfile's `exam-polyengine` recipe (wired into CI) is the +one-version-everywhere gate: it asserts every `jsr:@polyengine/*` import +across both `deno.json` files names the identical version. + +Both `deno.json`s carry +`"minimumDependencyAge": { "age": "P1D", "exclude": ["jsr:@polyengine/*"] }` +(verbatim from polyengine's README): Deno's 24-hour supply-chain gate would +otherwise block resolving a same-day publish. + +To bump: update the version in both `deno.json` import maps, delete +**both** `deno.lock` files (this directory and `js/polyengine/`), regenerate +with `deno install` (or `deno check`) in each directory, then re-run +`just conformance-ct::run-polyengine` and commit the diff (including the +regenerated `matrix.md`, via `just conformance-ct::matrix-update`). +`exam-polyengine` fails loud on any drift between the two configs. diff --git a/conformance/driver-ct/polyengine/browser-bundle-entry.ts b/conformance/driver-ct/polyengine/browser-bundle-entry.ts new file mode 100644 index 0000000..f65f45e --- /dev/null +++ b/conformance/driver-ct/polyengine/browser-bundle-entry.ts @@ -0,0 +1,18 @@ +// The polyengine-browser worker's bundle entry for the engine surface: +// upstream's tools/release-bundle/entry.ts public surface, reproduced +// locally now that polyengine publishes JSR prereleases instead of a +// pinned raw-URL release bundle (see ../../../README.md's polyengine pin +// story and js/polyengine/deno.json's MODULE-IDENTITY comment). +// +// Bundled with `deno bundle --platform browser` from THIS directory (so +// every re-export resolves through this directory's deno.json import +// map — the single polyengine pin site), the emitted module is what +// browser/worker-entry.ts imports as `@polyengine/release-bundle-entry` +// used to. Same export surface: instantiate/Translator/runSuite/ +// wasi/ComponentException/artifactsFromEnvelope and friends (49 exports +// verified against the retired upstream entry). +export * from "@polyengine/runtime/embedder"; +export { Translator } from "@polyengine/runtime/shim"; +export * from "@polyengine/ct-runner"; +export { wasi } from "@polyengine/wasi"; +export type { WasiImports, WasiOptions } from "@polyengine/wasi"; diff --git a/conformance/driver-ct/polyengine/browser/worker-entry.ts b/conformance/driver-ct/polyengine/browser/worker-entry.ts new file mode 100644 index 0000000..f122121 --- /dev/null +++ b/conformance/driver-ct/polyengine/browser/worker-entry.ts @@ -0,0 +1,37 @@ +// The polyengine-browser shard worker's bundle entry: the polyengine +// engine surface (the local browser-bundle-entry.ts, re-exporting the +// pinned JSR packages' public surface), the upstream worker message +// loop, and this repo's polyengine host module, resolved through ONE +// import map so the emitted bundle carries exactly one embedder module +// instance — one runtime/translator plan-format pairing, one copy on +// the runtime's copy census (workers resolve no import maps, so +// bundling is the only sound shape; see @jsr/polymorph__test's +// runner-polyengine README). +// +// Built by `just conformance-ct::run-polyengine-browser` with +// `deno bundle --platform browser` into target/polyengine-browser/, and +// served to the page from there as runSuitesInPage's workerUrl. + +import * as polyengine from "../browser-bundle-entry.ts"; +import { workerMain } from "@polymorph/test/polyengine-worker-main"; +import { configure, websocketImports } from "../../../../js/polyengine/websocket.ts"; + +// The suite bounds, matching every other leg (run-node.mjs, run.ts, the +// wasmtime driver): one behavioral floor across targets. Connections +// capture them at connect, so configuring the module once per run +// message covers every instance. +const MAX_INBOUND_BUFFER_BYTES = 256 * 1024; +const CONNECT_TIMEOUT_MS = 5000; +const CLOSE_TIMEOUT_MS = 3000; + +workerMain({ + polyengine, + suiteImports: () => { + configure({ + maxInboundBufferBytes: MAX_INBOUND_BUFFER_BYTES, + connectTimeoutMs: CONNECT_TIMEOUT_MS, + closeTimeoutMs: CLOSE_TIMEOUT_MS, + }); + return websocketImports(); + }, +}); diff --git a/conformance/driver-ct/polyengine/deno.json b/conformance/driver-ct/polyengine/deno.json new file mode 100644 index 0000000..17b8abf --- /dev/null +++ b/conformance/driver-ct/polyengine/deno.json @@ -0,0 +1,15 @@ +{ + "//": "MODULE-IDENTITY CONSTRAINT: polyengine's wasi module imports @polyengine/runtime/embedder by bare specifier internally. The @polyengine/runtime/embedder entry here must resolve to the IDENTICAL @polyengine/runtime version as ../../../js/polyengine/deno.json's caret range (in both deno.locks), or the embedder module loads twice: value recognition survives that (websocket.ts recognizes polyengine values by @polyengine/protocol brand predicates, not instanceof), but a second copy splits the runtime/translator plan-format pairing, and stateful handles (streams/futures) minted by one copy are refused by the other. Pin story: exact-pinned JSR releases (caret-honest upstream: within a minor line releases stay compatible, breaking bumps the minor; per-commit `-pre.g` prereleases exist between releases — pin exactly); @polyengine/translator ships the translator wasm for that SAME commit; deno.lock carries integrity, --frozen enforced everywhere; one version repo-wide is asserted by the pin gate (justfile: exam-polyengine).", + "imports": { + "@polyengine/ct-runner": "jsr:@polyengine/ct-runner@0.3.0", + "@polyengine/runtime/embedder": "jsr:@polyengine/runtime@0.3.0/embedder", + "@polyengine/runtime/shim": "jsr:@polyengine/runtime@0.3.0/shim", + "@polyengine/wasi": "jsr:@polyengine/wasi@0.3.0", + "@polyengine/translator": "jsr:@polyengine/translator@0.3.0", + "@polymorph/test/polyengine-worker-main": "jsr:@polymorph/test@0.2.0/polyengine-worker-main" + }, + "minimumDependencyAge": { "age": "P1D", "exclude": ["jsr:@polyengine/*", "jsr:@polymorph/*"] }, + "tasks": { + "check": "deno check run.ts browser/worker-entry.ts browser-bundle-entry.ts" + } +} diff --git a/conformance/driver-ct/polyengine/deno.lock b/conformance/driver-ct/polyengine/deno.lock new file mode 100644 index 0000000..8a304c2 --- /dev/null +++ b/conformance/driver-ct/polyengine/deno.lock @@ -0,0 +1,60 @@ +{ + "version": "5", + "specifiers": { + "jsr:@polyengine/ct-runner@0.3.0": "0.3.0", + "jsr:@polyengine/protocol@0.1": "0.1.0", + "jsr:@polyengine/runtime@0.3": "0.3.0", + "jsr:@polyengine/runtime@0.3.0": "0.3.0", + "jsr:@polyengine/translator@0.3.0": "0.3.0", + "jsr:@polyengine/wasi@0.3.0": "0.3.0", + "jsr:@polymorph/test@0.2.0": "0.2.0" + }, + "jsr": { + "@polyengine/ct-runner@0.3.0": { + "integrity": "d58720da80bf29cb6a975e4750a53bbe9b75ab6e3bde1340299ed69726702174", + "dependencies": [ + "jsr:@polyengine/runtime@0.3" + ] + }, + "@polyengine/protocol@0.1.0": { + "integrity": "0c97f34166f22ba55e7b084148df96e47aebe47cd9dd13930057759c9161bb1c" + }, + "@polyengine/runtime@0.3.0": { + "integrity": "97d7648c104dd0f08b4d10e1ed0117ab0cb5243db68c139f1f3df25755ed4e60", + "dependencies": [ + "jsr:@polyengine/protocol" + ] + }, + "@polyengine/translator@0.3.0": { + "integrity": "1d9fcd09d360850bc08927ed1cf8124d50a0fed09ed8c80f354a6d3aedfcad25", + "dependencies": [ + "jsr:@polyengine/runtime@0.3" + ] + }, + "@polyengine/wasi@0.3.0": { + "integrity": "991adfdd39f795f94bba91a523322b88d45ff42800669b5b472356676e3c97e7", + "dependencies": [ + "jsr:@polyengine/protocol", + "jsr:@polyengine/runtime@0.3" + ] + }, + "@polymorph/test@0.2.0": { + "integrity": "a0d716133b0221cd0efd4f28c5c3d85d6e3ac330207d15889a6a981c8d0c5e37" + } + }, + "workspace": { + "dependencies": [ + "jsr:@polyengine/ct-runner@0.3.0", + "jsr:@polyengine/runtime@0.3.0", + "jsr:@polyengine/translator@0.3.0", + "jsr:@polyengine/wasi@0.3.0", + "jsr:@polymorph/test@0.2.0" + ], + "packageJson": { + "dependencies": [ + "npm:@jsr/polymorph__test@0.2.0", + "npm:playwright-core@^1.61.1" + ] + } + } +} diff --git a/conformance/driver-ct/polyengine/package.json b/conformance/driver-ct/polyengine/package.json new file mode 100644 index 0000000..57c3247 --- /dev/null +++ b/conformance/driver-ct/polyengine/package.json @@ -0,0 +1,10 @@ +{ + "name": "@polymorph/websocket-conformance-polyengine-browser", + "private": true, + "type": "module", + "description": "Node driver + bundled worker inputs for the polyengine-browser conformance row: the suite runtime-linked inside headless Chromium with this repo's polyengine host module, through the upstream page driver and polyengine worker-main.", + "dependencies": { + "@jsr/polymorph__test": "0.2.0", + "playwright-core": "^1.61.1" + } +} diff --git a/conformance/driver-ct/deltic/pnpm-lock.yaml b/conformance/driver-ct/polyengine/pnpm-lock.yaml similarity index 61% rename from conformance/driver-ct/deltic/pnpm-lock.yaml rename to conformance/driver-ct/polyengine/pnpm-lock.yaml index 8305485..76c9a85 100644 --- a/conformance/driver-ct/deltic/pnpm-lock.yaml +++ b/conformance/driver-ct/polyengine/pnpm-lock.yaml @@ -9,16 +9,16 @@ importers: .: dependencies: '@jsr/polymorph__test': - specifier: 0.1.1 - version: 0.1.1 + specifier: 0.2.0 + version: 0.2.0 playwright-core: specifier: ^1.61.1 version: 1.62.1 packages: - '@jsr/polymorph__test@0.1.1': - resolution: {integrity: sha512-bu0jE52btthChm83f04rQo+twOLszJ/JN7nLGl/5W/66cZb8tQrlZG+Lnd4/XierTlBgy0PpW75bjbqQBY2nDg==, tarball: https://npm.jsr.io/~/11/@jsr/polymorph__test/0.1.1.tgz} + '@jsr/polymorph__test@0.2.0': + resolution: {integrity: sha512-fM1IYIy4HnBJm2IlZn/3Gk0d9AmQZz9Kg6JkY0E+fPAhFb2hrAW+4G7TCRQsJ4PStl0rzuBqF9VI6w30f7xCMA==, tarball: https://npm.jsr.io/~/11/@jsr/polymorph__test/0.2.0.tgz} playwright-core@1.62.1: resolution: {integrity: sha512-wPYSwEBJY9GHraISXqyqtx0na0LpO3XEX7jNDhntbex7tzUS7kLnZsOlFruFJB4Hi/rhDMjXGqHewDZ68nYZVw==} @@ -27,6 +27,6 @@ packages: snapshots: - '@jsr/polymorph__test@0.1.1': {} + '@jsr/polymorph__test@0.2.0': {} playwright-core@1.62.1: {} diff --git a/conformance/driver-ct/deltic/run-browser.mjs b/conformance/driver-ct/polyengine/run-browser.mjs similarity index 83% rename from conformance/driver-ct/deltic/run-browser.mjs rename to conformance/driver-ct/polyengine/run-browser.mjs index bfef5be..7bcb511 100644 --- a/conformance/driver-ct/deltic/run-browser.mjs +++ b/conformance/driver-ct/polyengine/run-browser.mjs @@ -1,9 +1,9 @@ -// The deltic-browser leg: the suite runtime-linked inside a real -// headless Chromium against this repo's deltic host module -// (js/deltic/websocket.ts over the browser's native WebSocket) — no +// The polyengine-browser leg: the suite runtime-linked inside a real +// headless Chromium against this repo's polyengine host module +// (js/polyengine/websocket.ts over the browser's native WebSocket) — no // transpile step, no generated tree. The page, worker pool, stall // watchdog, and Chrome ladder live in the upstream browser driver; the -// worker is this repo's own bundle (browser/worker-entry.ts: the deltic +// worker is this repo's own bundle (browser/worker-entry.ts: the polyengine // engine + host module + upstream message loop in one module — see the // entry's header for why one bundle is the sound shape). This file is // the frame: the echo server, the environment, target configuration, @@ -28,10 +28,10 @@ import { writeResultsFile } from "@jsr/polymorph__test/node-runner"; import { spawnEchod, unreachableUrl } from "../../server/echod.mjs"; -const DELTIC_DIR = dirname(fileURLToPath(import.meta.url)); -const REPO_ROOT = resolve(DELTIC_DIR, "..", "..", ".."); -const WORKER_URL = "/target/deltic-browser/websocket-worker.mjs"; -const TRANSLATOR_URL = "/target/deltic-browser/deltic-translator-shim.wasm"; +const POLYENGINE_DIR = dirname(fileURLToPath(import.meta.url)); +const REPO_ROOT = resolve(POLYENGINE_DIR, "..", "..", ".."); +const WORKER_URL = "/target/polyengine-browser/websocket-worker.mjs"; +const TRANSLATOR_URL = "/target/polyengine-browser/polyengine-translator-shim.wasm"; const MAX_INBOUND_BUFFER_BYTES = 256 * 1024; const CASE_TIMEOUT_MS = 60_000; const STALL_TIMEOUT_MS = 90_000; @@ -42,7 +42,7 @@ const { values } = parseArgs({ type: "string", default: join(REPO_ROOT, "conformance", "driver-ct", "results"), }, - target: { type: "string", default: "deltic-browser" }, + target: { type: "string", default: "polyengine-browser" }, server: { type: "string" }, "tls-server": { type: "string" }, "echod-bin": { @@ -54,8 +54,8 @@ const { values } = parseArgs({ async function main() { for (const [what, rel] of [ - ["bundled worker (run `just conformance-ct::run-deltic-browser`)", WORKER_URL], - [`translator asset (run \`just conformance-ct::run-deltic-browser\`)`, TRANSLATOR_URL], + ["bundled worker (run `just conformance-ct::run-polyengine-browser`)", WORKER_URL], + [`translator asset (run \`just conformance-ct::run-polyengine-browser\`)`, TRANSLATOR_URL], ["suite component (run `just conformance-ct::build-suite`)", "/target/wasm32-wasip2/release/conformance_guest_ct.wasm"], ]) { try { @@ -104,7 +104,7 @@ async function main() { executablePath: await findChrome(), repoRoot: REPO_ROOT, html: buildHarnessPage({ - title: "polymorph:websocket conformance (deltic-browser)", + title: "polymorph:websocket conformance (polyengine-browser)", config, }), stallTimeoutMs: STALL_TIMEOUT_MS, diff --git a/conformance/driver-ct/deltic/run.ts b/conformance/driver-ct/polyengine/run.ts similarity index 84% rename from conformance/driver-ct/deltic/run.ts rename to conformance/driver-ct/polyengine/run.ts index 4a882e4..934cf90 100644 --- a/conformance/driver-ct/deltic/run.ts +++ b/conformance/driver-ct/polyengine/run.ts @@ -1,7 +1,7 @@ -// The repo's own deltic leg of the component-test conformance harness: +// The repo's own polyengine leg of the component-test conformance harness: // this repo's flagship gate is `just conformance-ct` running EVERY target -// (wasmtime, composed, deltic-deno, deltic-browser) against the shared -// suite; this is the deltic-native Deno target. It began as the deltic +// (wasmtime, composed, polyengine-deno, polyengine-browser) against the shared +// suite; this is the polyengine-native Deno target. It began as the deltic // analogue of the jco Node leg (`conformance/driver-ct/jco/run-node.mjs`, // retired with the jco legs; see git history), mirroring it exactly: // @@ -14,27 +14,27 @@ // `runSuite(...)` (component-test-js) | `runSuite(...)` (ct-runner) // `NODE_EXTRA_CA_CERTS=…/tls/ca.pem` | `DENO_CERT=…/tls/ca.pem` // -// deltic is a runtime linker: there is no transpile step, no generated +// polyengine is a runtime linker: there is no transpile step, no generated // tree, and no engine flag — the WIT contract's async // exports run on the callback ABI under stock Deno. // -// just conformance-ct::run-deltic # the full leg +// just conformance-ct::run-polyengine # the full leg // … run.ts [--translator ] [--only SUBSTRING] [--jspi] // // `DENO_CERT` must name the suite's committed test CA so the three // `websocket/tls/*` cases can complete their handshake; the -// `conformance-ct::run-deltic` justfile recipe supplies it. NO cases are +// `conformance-ct::run-polyengine` justfile recipe supplies it. NO cases are // excluded: the TLS leg runs headlessly under Deno exactly as the ws: // leg does. // -// MODULE-IDENTITY CONSTRAINT: deltic's wasi module imports -// `@deltic/runtime/embedder` by bare specifier internally; this leg's -// `deno.json` AND `js/deltic/deno.json` must map that specifier to the +// MODULE-IDENTITY CONSTRAINT: polyengine's wasi module imports +// `@polyengine/runtime/embedder` by bare specifier internally; this leg's +// `deno.json` AND `js/polyengine/deno.json` must map that specifier to the // IDENTICAL exact-pinned JSR version, or the embedder module loads twice // and the graph carries two runtime/translator plan-format pairings (the // host module's value recognition is brand-based and survives that). // -// The translator comes from the packaged `@deltic/translator` JSR +// The translator comes from the packaged `@polyengine/translator` JSR // prerelease (defaultTranslator()) by default — no fetch step, no // sha256 bookkeeping, no net grant; `--translator ` remains as an // optional override for a locally-built translator shim. @@ -44,14 +44,14 @@ // artifact has the provider plugged in-guest and would exercise no host // module at all. -import { Translator } from "@deltic/runtime/shim"; -import type { ComponentArtifacts } from "@deltic/runtime/embedder"; -import { defaultTranslator } from "@deltic/translator"; -import { runSuite } from "@deltic/ct-runner"; -import { wasi } from "@deltic/wasi"; -import { configure, websocketImports } from "../../../js/deltic/websocket.ts"; +import { Translator } from "@polyengine/runtime/shim"; +import type { ComponentArtifacts } from "@polyengine/runtime/embedder"; +import { defaultTranslator } from "@polyengine/translator"; +import { runSuite } from "@polyengine/ct-runner"; +import { wasi } from "@polyengine/wasi"; +import { configure, websocketImports } from "../../../js/polyengine/websocket.ts"; -// This file sits at conformance/driver-ct/deltic/run.ts, so the repo +// This file sits at conformance/driver-ct/polyengine/run.ts, so the repo // root is three levels up. const ROOT = new URL("../../../", import.meta.url); const ECHOD_BIN = new URL("target/debug/conformance-echod", ROOT).pathname; @@ -83,8 +83,8 @@ interface Cli { function parseArgs(argv: string[]): Cli { const cli: Cli = { jspi: false, - out: new URL("conformance/driver-ct/results/deltic-deno.jsonl", ROOT).pathname, - target: "deltic-deno", + out: new URL("conformance/driver-ct/results/polyengine-deno.jsonl", ROOT).pathname, + target: "polyengine-deno", }; for (let i = 0; i < argv.length; i++) { switch (argv[i]) { @@ -162,7 +162,7 @@ function unreachableUrl(): string { } /** The echod binary is a build artifact this driver does not produce - * itself (unlike deltic's own port, which is inside a checkout that + * itself (unlike polyengine's own port, which is inside a checkout that * owns the cargo build): `just conformance-ct::build-echod` owns it. */ async function ensureEchod(): Promise { try { @@ -195,7 +195,7 @@ async function main() { `trusted, so the three websocket/tls/* cases will fail their ` + `connect. Re-run with DENO_CERT=${CA_PEM} (the Deno analogue of ` + `run-node.mjs's NODE_EXTRA_CA_CERTS; see the ` + - `conformance-ct::run-deltic justfile recipe).`, + `conformance-ct::run-polyengine justfile recipe).`, ); } diff --git a/conformance/driver-ct/targets.toml b/conformance/driver-ct/targets.toml index e05a171..ede0fdd 100644 --- a/conformance/driver-ct/targets.toml +++ b/conformance/driver-ct/targets.toml @@ -2,11 +2,11 @@ # (the #48-mechanism successor to ../targets.toml). # # The wasmtime rows run under the generic component-test host runner and -# the composed row runs the wac-composed in-guest provider; the deltic +# the composed row runs the wac-composed in-guest provider; the polyengine # rows runtime-link the same suite artifact under the release-pinned -# deltic runtime — on stock Deno (driver-ct/deltic/run.ts) and inside -# headless Chromium (driver-ct/deltic/run-browser.mjs), with no transpile -# step and no engine flag. +# polyengine runtime — on stock Deno (driver-ct/polyengine/run.ts) and +# inside headless Chromium (driver-ct/polyengine/run-browser.mjs), with no +# transpile step and no engine flag. # # No [features]: every current target serves the whole polymorph:websocket # surface. When a capability gap appears, declare it here (`[features.x] @@ -25,11 +25,11 @@ missing-features = [] [targets.composed] missing-features = [] -[targets.deltic-deno] +[targets.polyengine-deno] missing-features = [] # The same suite runtime-linked inside headless Chromium against the -# deltic host module (js/deltic/websocket.ts over the browser's native -# WebSocket): one deno-bundled worker, no transpile step. -[targets.deltic-browser] +# polyengine host module (js/polyengine/websocket.ts over the browser's +# native WebSocket): one deno-bundled worker, no transpile step. +[targets.polyengine-browser] missing-features = [] diff --git a/conformance/server/echod.mjs b/conformance/server/echod.mjs index 19a448e..4e937b5 100644 --- a/conformance/server/echod.mjs +++ b/conformance/server/echod.mjs @@ -1,8 +1,8 @@ // Node-only helpers for everything that drives the suite echo server from -// Node (the deltic-browser conformance driver, the WPT parity legs): +// Node (the polyengine-browser conformance driver, the WPT parity legs): // spawning the `conformance-echod` binary and deriving the unreachable // URL. Colocated with the server it spawns. The Deno-side drivers -// (conformance/driver-ct/deltic/run.ts, examples/deltic-demo/run.ts) port +// (conformance/driver-ct/polyengine/run.ts, examples/polyengine-demo/run.ts) port // the same LISTENING-line contract rather than importing this module. import { spawn } from "node:child_process"; import net from "node:net"; @@ -65,9 +65,9 @@ export function unreachableUrl() { /** * Fail fast, with the reason, on a Node older than this repo's floor. No - * engine flag is involved anywhere any more — deltic's callback ABI needs + * engine flag is involved anywhere any more — polyengine's callback ABI needs * none — but the Node-side drivers and their toolchain (the parity legs, - * the deltic-browser page driver) are only exercised on Node 24+. + * the polyengine-browser page driver) are only exercised on Node 24+. */ export function requireNode24() { const major = Number(process.versions.node.split(".")[0]); diff --git a/examples/justfile b/examples/justfile index 7c33503..d747ee0 100644 --- a/examples/justfile +++ b/examples/justfile @@ -17,24 +17,24 @@ test: component build-echod wasmtime count="100": component build-echod cargo run -p wasmtime-demo -- {{root}}/target/components/echo-demo.wasm {{count}} -# Run the JS-host demo by hand: `just demo::deltic [count]` — the same -# component runtime-linked under deltic on stock Deno against -# js/deltic/websocket.ts, with no transpile step and no engine flag. The -# translator comes from the packaged `@deltic/translator` JSR prerelease -# through the module graph — no fetch step. The deltic pin is single-site: -# the import map is conformance/driver-ct/deltic/deno.json. -deltic count="100": component build-echod +# Run the JS-host demo by hand: `just demo::polyengine [count]` — the same +# component runtime-linked under polyengine on stock Deno against +# js/polyengine/websocket.ts, with no transpile step and no engine flag. The +# translator comes from the packaged `@polyengine/translator` JSR prerelease +# through the module graph — no fetch step. The polyengine pin is single-site: +# the import map is conformance/driver-ct/polyengine/deno.json. +polyengine count="100": component build-echod #!/usr/bin/env bash set -euo pipefail - # --allow-run is unscoped for the same reason run-deltic's is: Deno + # --allow-run is unscoped for the same reason run-polyengine's is: Deno # refuses a scoped --allow-run whenever dynamic-linker vars sit in the - # ambient environment (see the conformance-ct::run-deltic comment). + # ambient environment (see the conformance-ct::run-polyengine comment). deno run \ - --config {{root}}/conformance/driver-ct/deltic/deno.json --frozen \ + --config {{root}}/conformance/driver-ct/polyengine/deno.json --frozen \ --allow-read={{root}} \ --allow-net=127.0.0.1,localhost \ --allow-run \ - {{root}}/examples/deltic-demo/run.ts {{count}} + {{root}}/examples/polyengine-demo/run.ts {{count}} [private] build-echod: diff --git a/examples/deltic-demo/run.ts b/examples/polyengine-demo/run.ts similarity index 82% rename from examples/deltic-demo/run.ts rename to examples/polyengine-demo/run.ts index 7b3e060..efc3813 100644 --- a/examples/deltic-demo/run.ts +++ b/examples/polyengine-demo/run.ts @@ -1,6 +1,6 @@ // Deno runner for the echo-demo component: the guest is **runtime-linked** -// under deltic against this repo's deltic host module -// (js/deltic/websocket.ts over Deno's native `WebSocket`) and driven +// under polyengine against this repo's polyengine host module +// (js/polyengine/websocket.ts over Deno's native `WebSocket`) and driven // against a spawned suite echo server. No transpile step, no generated // tree, no engine flag — the WIT contract's async exports run on the // callback ABI. @@ -9,25 +9,25 @@ // with the jco legs; see git history), which transpiled the same // component and drove the same `demo.run(url, count)` export. // -// just demo::deltic [count] +// just demo::polyengine [count] // … run.ts [--translator ] [count] // -// The deltic pin is SINGLE-SITE: this runner resolves `@deltic/*` through -// conformance/driver-ct/deltic/deno.json. The translator comes from the -// packaged `@deltic/translator` JSR prerelease by default (no fetch +// The polyengine pin is SINGLE-SITE: this runner resolves `@polyengine/*` through +// conformance/driver-ct/polyengine/deno.json. The translator comes from the +// packaged `@polyengine/translator` JSR prerelease by default (no fetch // step); `--translator ` remains as an optional override for a // locally-built translator shim. The same import map keeps one embedder // instance — one runtime/translator plan-format pairing — in the graph // (see that deno.json's MODULE-IDENTITY note). -import { Translator } from "@deltic/runtime/shim"; -import type { ComponentArtifacts } from "@deltic/runtime/embedder"; -import { instantiate, isComponentException } from "@deltic/runtime/embedder"; -import { defaultTranslator } from "@deltic/translator"; -import { wasi } from "@deltic/wasi"; -import { websocketImports } from "../../js/deltic/websocket.ts"; +import { Translator } from "@polyengine/runtime/shim"; +import type { ComponentArtifacts } from "@polyengine/runtime/embedder"; +import { instantiate, isComponentException } from "@polyengine/runtime/embedder"; +import { defaultTranslator } from "@polyengine/translator"; +import { wasi } from "@polyengine/wasi"; +import { websocketImports } from "../../js/polyengine/websocket.ts"; -// This file sits at examples/deltic-demo/run.ts, so the repo root is two +// This file sits at examples/polyengine-demo/run.ts, so the repo root is two // levels up. const ROOT = new URL("../../", import.meta.url); const ECHOD_BIN = new URL("target/debug/conformance-echod", ROOT).pathname; @@ -59,7 +59,7 @@ function parseArgs(argv: string[]): Cli { } /** `spawnEchod` (conformance/server/echod.mjs), ported to Deno exactly as - * conformance/driver-ct/deltic/run.ts ports it: start the binary and + * conformance/driver-ct/polyengine/run.ts ports it: start the binary and * scrape its one `LISTENING ` line. */ async function spawnEchod(): Promise<{ base: string; shutdown: () => void }> { const child = new Deno.Command(ECHOD_BIN, { diff --git a/js/componentize/README.md b/js/componentize/README.md index 1c39dbf..2bba65b 100644 --- a/js/componentize/README.md +++ b/js/componentize/README.md @@ -1,6 +1,6 @@ # `js/componentize` — the browser-API shim -`websocket.js` is the inverse of `js/deltic/websocket.ts`: where that module +`websocket.js` is the inverse of `js/polyengine/websocket.ts`: where that module implements the `polymorph:websocket` **imports** over the standard browser `WebSocket` API, this one implements the standard browser API **over the WIT imports**, for JS guests componentized with @@ -28,8 +28,8 @@ documents the sourcing and the escape hatches (`COMPONENTIZE_JS`, ## The WPT parity gate `wpt/` runs vendored web-platform-tests WebSocket suites through this shim -**round trip** — shim → WIT → component ABI → deltic → -`js/deltic/websocket.ts` → the platform's own WebSocket — against the same suite echo server a +**round trip** — shim → WIT → component ABI → polyengine → +`js/polyengine/websocket.ts` → the platform's own WebSocket — against the same suite echo server a plain-Node baseline leg uses, and holds the round trip to the baseline's pass set. See [`wpt/README.md`](wpt/README.md). diff --git a/js/componentize/websocket.js b/js/componentize/websocket.js index 08872bf..7741723 100644 --- a/js/componentize/websocket.js +++ b/js/componentize/websocket.js @@ -3,7 +3,7 @@ // componentize-js (https://github.com/lann/componentize-js, the wit-dylib // reboot of ComponentizeJS), backed by the `polymorph:websocket` imports. // -// This is the inverse of `js/deltic/websocket.ts`: that module implements +// This is the inverse of `js/polyengine/websocket.ts`: that module implements // the WIT *imports* over the standard browser API, while this one // implements the standard browser API *over* the WIT imports, so JS // application code written against `WebSocket` can be componentized and diff --git a/js/componentize/wpt/README.md b/js/componentize/wpt/README.md index 8af5c06..fa2ec61 100644 --- a/js/componentize/wpt/README.md +++ b/js/componentize/wpt/README.md @@ -7,10 +7,10 @@ WebSocket suites run twice against the same suite echo server: `WebSocket` (Node's built-in) — no shim, no WIT, no wasm; - **round trip** (`parity/roundtrip.mjs`): through the full carrier stack — `js/componentize/websocket.js` (the shim), the `polymorph:websocket` WIT - surface, the component ABI, deltic's runtime linking, and - `js/deltic/websocket.ts` — terminating in the same platform WebSocket. - The carrier is one deno-bundled module (`parity/deltic-carrier.ts` → - `parity/build/deltic-carrier.mjs`): no transpile step, no generated + surface, the component ABI, polyengine's runtime linking, and + `js/polyengine/websocket.ts` — terminating in the same platform WebSocket. + The carrier is one deno-bundled module (`parity/polyengine-carrier.ts` → + `parity/build/polyengine-carrier.mjs`): no transpile step, no generated tree, no engine flag. componentize-js — the *guest* toolchain that builds the runner component — is unchanged. @@ -27,8 +27,8 @@ without an exclusion list. `just wpt::parity` runs the gate; The leg bodies are engine-neutral (`parity/legs.mjs`); an engine driver supplies only the environment. `just wpt::parity-chromium` runs both legs inside a headless Chromium: the baseline measures Chromium's own -`WebSocket`, and the round trip loads the same carrier bundle (deltic's -wasi shims, plus `parity/sockets-stub-deltic.mjs` for the +`WebSocket`, and the round trip loads the same carrier bundle (polyengine's +wasi shims, plus `parity/sockets-stub-polyengine.mjs` for the `wasi:sockets` imports the componentize-js runtime declares but the runner never uses), served from a static mirror of the repository layout so every relative import — and the two wasm artifacts the carrier fetches — diff --git a/js/componentize/wpt/justfile b/js/componentize/wpt/justfile index 7327e72..94d20be 100644 --- a/js/componentize/wpt/justfile +++ b/js/componentize/wpt/justfile @@ -1,17 +1,17 @@ # The WPT parity gate: the vendored web-platform-tests WebSocket suites # run twice — directly against the platform's own WebSocket (the baseline) -# and through the componentized shim runtime-linked by deltic against -# js/deltic/websocket.ts (the round trip) — and the comparator holds the +# and through the componentized shim runtime-linked by polyengine against +# js/polyengine/websocket.ts (the round trip) — and the comparator holds the # round trip to the baseline's pass set, with known losses pinned in # parity/losses.js. Both legs end at the same platform WebSocket and the # same suite echo server, so the delta isolates exactly what the carrier -# stack (shim, WIT shape, component ABI, deltic) loses. See README.md +# stack (shim, WIT shape, component ABI, polyengine) loses. See README.md # (this directory) for the vendoring policy and architecture. # -# The deltic pin is single-site: the carrier bundle resolves @deltic/* -# through conformance/driver-ct/deltic/deno.json (exact-pinned JSR +# The polyengine pin is single-site: the carrier bundle resolves @polyengine/* +# through conformance/driver-ct/polyengine/deno.json (exact-pinned JSR # prereleases; see that deno.json's MODULE-IDENTITY comment) and its -# translator asset is extracted from the packaged `@deltic/translator` +# translator asset is extracted from the packaged `@polyengine/translator` # JSR package's lock-pinned module cache (no fetch step). import '../../../justfile.shared.just' @@ -33,8 +33,8 @@ update-losses: _artifacts {{timeout_cmd}} node {{root}}/js/componentize/wpt/parity/run-legs.mjs --update # The same parity gate inside a headless Chromium: the baseline measures -# Chromium's own WebSocket, the round trip runs the deltic carrier against -# js/deltic/websocket.ts in the environment it targets. Ratchets +# Chromium's own WebSocket, the round trip runs the polyengine carrier against +# js/polyengine/websocket.ts in the environment it targets. Ratchets # separately in parity/losses-chromium.js — a loss set is a fact about one # engine's baseline. The browser is always # Playwright's pinned Chromium build (install once with @@ -49,7 +49,7 @@ update-losses-chromium: _artifacts {{timeout_cmd}} node {{root}}/js/componentize/wpt/parity/run-browser.mjs --update # Componentize the pipeline smoke entry and run it under the same carrier: -# a fast bisector for toolchain or deltic-pin bumps, asserting nothing the +# a fast bisector for toolchain or polyengine-pin bumps, asserting nothing the # parity gate does not, but failing in minutes rather than suites. smoke: build-echod _carrier #!/usr/bin/env bash @@ -72,21 +72,21 @@ _artifacts: build-echod _carrier cd '{{root}}' ./js/componentize/wpt/component.sh build -# The round trip's carrier: the pinned deltic translator asset, plus the +# The round trip's carrier: the pinned polyengine translator asset, plus the # one bundle that carries the engine, the host module, and the reporter -# instance the runner's import is wired to (deltic-carrier.ts's header +# instance the runner's import is wired to (polyengine-carrier.ts's header # explains why one bundle is the sound shape). Both the extraction and the -# bundle run out of conformance/driver-ct/deltic — the single deltic pin -# site — mirroring conformance-ct::run-deltic-browser. +# bundle run out of conformance/driver-ct/polyengine — the single polyengine pin +# site — mirroring conformance-ct::run-polyengine-browser. [private] -_carrier: (extract-deltic-translator root / "target/deltic-browser") +_carrier: (extract-polyengine-translator root / "target/polyengine-browser") #!/usr/bin/env bash set -euo pipefail - cd '{{root}}/conformance/driver-ct/deltic' + cd '{{root}}/conformance/driver-ct/polyengine' mkdir -p {{root}}/js/componentize/wpt/parity/build deno bundle --config deno.json --frozen --platform browser \ - -o {{root}}/js/componentize/wpt/parity/build/deltic-carrier.mjs \ - {{root}}/js/componentize/wpt/parity/deltic-carrier.ts + -o {{root}}/js/componentize/wpt/parity/build/polyengine-carrier.mjs \ + {{root}}/js/componentize/wpt/parity/polyengine-carrier.ts [private] build-echod: diff --git a/js/componentize/wpt/parity/legs.mjs b/js/componentize/wpt/parity/legs.mjs index 3f94b42..7451032 100644 --- a/js/componentize/wpt/parity/legs.mjs +++ b/js/componentize/wpt/parity/legs.mjs @@ -12,7 +12,7 @@ // Since the carrier is a bundle, its reporter copy is distinct from this // repository's `../reporter.js` module — so the round-trip leg takes // BOTH `setSink` and the runner from the carrier and never imports -// `../reporter.js` itself (see deltic-carrier.ts's header). +// `../reporter.js` itself (see polyengine-carrier.ts's header). /** * The baseline leg: run the vendored WPT suites directly against this @@ -41,14 +41,14 @@ export async function runBaseline(wsBase) { /** * The round-trip leg: the same suites through the full carrier stack — - * shim, WIT, component ABI, deltic, js/deltic/websocket.ts — terminating + * shim, WIT, component ABI, polyengine, js/polyengine/websocket.ts — terminating * in the same platform `WebSocket` the baseline measured, against the * same echo server. Collects the records the runner streams through its * `wpt:parity/reporter` import and cross-checks the count `run` resolves * to; a record lost between the runner and the sink fails the leg. * * `carrier` is supplied by the engine driver, which owns byte loading: - * `url` is the bundled carrier module (build/deltic-carrier.mjs), + * `url` is the bundled carrier module (build/polyengine-carrier.mjs), * `translatorPath`/`componentPath` name the two wasm artifacts as * repository-relative paths, and `loadBytes` reads one (Node: fs; * browser: fetch against the static server). diff --git a/js/componentize/wpt/parity/losses-chromium.js b/js/componentize/wpt/parity/losses-chromium.js index 40878b5..6a1c417 100644 --- a/js/componentize/wpt/parity/losses-chromium.js +++ b/js/componentize/wpt/parity/losses-chromium.js @@ -1,5 +1,5 @@ // The WPT parity ratchet: every test the platform baseline passes that the -// round trip (shim -> WIT -> deltic -> js/deltic/websocket.ts) does not, keyed +// round trip (shim -> WIT -> polyengine -> js/polyengine/websocket.ts) does not, keyed // `group :: test name`. Generated by `just wpt::update-losses-chromium`; compare.mjs // fails on any loss not listed here and on any listed loss no longer // observed, so this file only changes deliberately and only shrinks as the diff --git a/js/componentize/wpt/parity/losses-file.mjs b/js/componentize/wpt/parity/losses-file.mjs index 71e6179..afcd906 100644 --- a/js/componentize/wpt/parity/losses-file.mjs +++ b/js/componentize/wpt/parity/losses-file.mjs @@ -22,7 +22,7 @@ export function updateRecipe(path) { */ export function writeLosses(path, keys) { const header = `// The WPT parity ratchet: every test the platform baseline passes that the -// round trip (shim -> WIT -> deltic -> js/deltic/websocket.ts) does not, keyed +// round trip (shim -> WIT -> polyengine -> js/polyengine/websocket.ts) does not, keyed // \`group :: test name\`. Generated by \`just ${updateRecipe(path)}\`; compare.mjs // fails on any loss not listed here and on any listed loss no longer // observed, so this file only changes deliberately and only shrinks as the diff --git a/js/componentize/wpt/parity/losses.js b/js/componentize/wpt/parity/losses.js index fb48664..50daa29 100644 --- a/js/componentize/wpt/parity/losses.js +++ b/js/componentize/wpt/parity/losses.js @@ -1,5 +1,5 @@ // The WPT parity ratchet: every test the platform baseline passes that the -// round trip (shim -> WIT -> deltic -> js/deltic/websocket.ts) does not, keyed +// round trip (shim -> WIT -> polyengine -> js/polyengine/websocket.ts) does not, keyed // `group :: test name`. Generated by `just wpt::update-losses`; compare.mjs // fails on any loss not listed here and on any listed loss no longer // observed, so this file only changes deliberately and only shrinks as the diff --git a/js/componentize/wpt/parity/package.json b/js/componentize/wpt/parity/package.json index 2b66295..2d3ca69 100644 --- a/js/componentize/wpt/parity/package.json +++ b/js/componentize/wpt/parity/package.json @@ -3,7 +3,7 @@ "version": "0.1.0", "private": true, "type": "module", - "description": "WPT parity gate: the vendored WebSocket suites run directly against the platform's WebSocket (baseline) and through the componentized shim runtime-linked by deltic against js/deltic/websocket.ts (round trip); compare.mjs holds the round trip to the baseline's pass set.", + "description": "WPT parity gate: the vendored WebSocket suites run directly against the platform's WebSocket (baseline) and through the componentized shim runtime-linked by polyengine against js/polyengine/websocket.ts (round trip); compare.mjs holds the round trip to the baseline's pass set.", "packageManager": "pnpm@10.34.5", "scripts": { "baseline": "node baseline.mjs", diff --git a/js/componentize/wpt/parity/deltic-carrier.ts b/js/componentize/wpt/parity/polyengine-carrier.ts similarity index 68% rename from js/componentize/wpt/parity/deltic-carrier.ts rename to js/componentize/wpt/parity/polyengine-carrier.ts index 000de1f..31453c5 100644 --- a/js/componentize/wpt/parity/deltic-carrier.ts +++ b/js/componentize/wpt/parity/polyengine-carrier.ts @@ -1,39 +1,39 @@ // The WPT parity round trip's carrier: everything between the parity // runner component and the platform's own `WebSocket`, bundled into ONE -// module (`build/deltic-carrier.mjs`) that both engine drivers load — +// module (`build/polyengine-carrier.mjs`) that both engine drivers load — // Node (roundtrip.mjs, smoke-run.mjs) and the browser page // (run-browser.mjs). // // It replaces the jco-era carrier (a `jco transpile` generated tree plus // `js/jco/websocket.js`, retired with the jco legs; see git history) with -// deltic's runtime linking: no transpile step, no generated tree, no +// polyengine's runtime linking: no transpile step, no generated tree, no // engine flag. componentize-js — the *guest* toolchain that builds the // runner component — is untouched. // // MODULE-IDENTITY TRAP (the same rationale as -// conformance/driver-ct/deltic/browser/worker-entry.ts's header, one +// conformance/driver-ct/polyengine/browser/worker-entry.ts's header, one // level up the stack): after bundling, this module's copy of // `../reporter.js` is a DISTINCT instance from any other import of that // file. The runner's `wpt:parity/reporter@0.1.0` import and the `setSink` // a leg installs must be the same instance, so both come from here — // legs.mjs must not import `../reporter.js` itself. // -// THE DELTIC PIN IS SINGLE-SITE: this module resolves `@deltic/*` through -// conformance/driver-ct/deltic/deno.json (exact-pinned JSR releases; +// THE POLYENGINE PIN IS SINGLE-SITE: this module resolves `@polyengine/*` through +// conformance/driver-ct/polyengine/deno.json (exact-pinned JSR releases; // the bundle recipe runs `deno bundle` from that directory) and the -// translator asset is extracted from the packaged `@deltic/translator` +// translator asset is extracted from the packaged `@polyengine/translator` // JSR package's lock-pinned module cache (no fetch step). Bundling from -// there also keeps `@deltic/runtime/embedder` a single module instance -// across this bundle and js/deltic/websocket.ts — one runtime/translator +// there also keeps `@polyengine/runtime/embedder` a single module instance +// across this bundle and js/polyengine/websocket.ts — one runtime/translator // plan-format pairing (value recognition is brand-based and would // survive a multi-copy bundle; the pairing would not). -import { Translator } from "@deltic/runtime/shim"; -import { instantiate } from "@deltic/runtime/embedder"; -import { wasi } from "@deltic/wasi"; -import { websocketImports } from "../../../deltic/websocket.ts"; +import { Translator } from "@polyengine/runtime/shim"; +import { instantiate } from "@polyengine/runtime/embedder"; +import { wasi } from "@polyengine/wasi"; +import { websocketImports } from "../../../polyengine/websocket.ts"; import { reporter, setSink } from "../reporter.js"; -import { socketsStubs } from "./sockets-stub-deltic.mjs"; +import { socketsStubs } from "./sockets-stub-polyengine.mjs"; /** The bundled reporter instance — see the MODULE-IDENTITY note above. */ export { setSink }; @@ -44,14 +44,14 @@ export { setSink }; const RUNNER_INTERFACE = "wpt:parity/runner@0.1.0"; /** - * Translate and instantiate the parity runner component under deltic, + * Translate and instantiate the parity runner component under polyengine, * wired to this repo's JS host module, and return its exported `runner` * facade (`run(serverUrl)`). * * Callback ABI: no `jspi` option is passed, so no engine flag is needed * anywhere. * - * @param translatorBytes the pinned deltic translator shim + * @param translatorBytes the pinned polyengine translator shim * @param componentBytes build/parity-runner.component.wasm */ export async function instantiateRunner( @@ -64,7 +64,7 @@ export async function instantiateRunner( ...wasi(), ...socketsStubs(), // The host module under test: the same import-record assembly the - // conformance leg uses (conformance/driver-ct/deltic/run.ts). + // conformance leg uses (conformance/driver-ct/polyengine/run.ts). ...websocketImports(), "wpt:parity/reporter@0.1.0": reporter, }); diff --git a/js/componentize/wpt/parity/roundtrip.mjs b/js/componentize/wpt/parity/roundtrip.mjs index 2535267..f2048f9 100644 --- a/js/componentize/wpt/parity/roundtrip.mjs +++ b/js/componentize/wpt/parity/roundtrip.mjs @@ -1,9 +1,9 @@ // The round-trip leg's Node driver: spawn the suite echo server, run the -// shared leg body (legs.mjs) through the deltic carrier bundle -// (build/deltic-carrier.mjs — see deltic-carrier.ts), and emit the +// shared leg body (legs.mjs) through the polyengine carrier bundle +// (build/polyengine-carrier.mjs — see polyengine-carrier.ts), and emit the // records as JSON on stdout, matching baseline.mjs. // -// No transpile step and no engine flag: deltic runtime-links the runner +// No transpile step and no engine flag: polyengine runtime-links the runner // component on the callback ABI. import { readFile } from "node:fs/promises"; @@ -17,8 +17,8 @@ const HERE = dirname(fileURLToPath(import.meta.url)); const REPO_ROOT = resolve(HERE, "..", "..", "..", ".."); const carrier = { - url: pathToFileURL(join(HERE, "build", "deltic-carrier.mjs")).href, - translatorPath: "target/deltic-browser/deltic-translator-shim.wasm", + url: pathToFileURL(join(HERE, "build", "polyengine-carrier.mjs")).href, + translatorPath: "target/polyengine-browser/polyengine-translator-shim.wasm", componentPath: "js/componentize/wpt/build/parity-runner.component.wasm", async loadBytes(path) { return new Uint8Array(await readFile(join(REPO_ROOT, path))); diff --git a/js/componentize/wpt/parity/run-browser.mjs b/js/componentize/wpt/parity/run-browser.mjs index 76f09cd..6ac671a 100644 --- a/js/componentize/wpt/parity/run-browser.mjs +++ b/js/componentize/wpt/parity/run-browser.mjs @@ -1,7 +1,7 @@ // The browser parity legs: the same two legs as run-legs.mjs — the shared // bodies in legs.mjs — run inside a real, headless Chromium, so the // baseline measures Chromium's own `WebSocket` and the round trip runs -// the deltic carrier bundle against js/deltic/websocket.ts in the +// the polyengine carrier bundle against js/polyengine/websocket.ts in the // environment it actually targets. The comparator is the same // compare.mjs; the ratchet is per-engine (losses-chromium.js), because a // loss set is a fact about one engine's baseline. @@ -10,8 +10,8 @@ // the served modules' relative imports (legs.mjs -> ../harness.js, the // vendored group modules) resolve with no bundling and the same URL // identity legs.mjs relies on; the carrier itself is one bundle -// (parity/build/deltic-carrier.mjs) and the two wasm artifacts it needs — -// the pinned deltic translator under /target/deltic-browser/ and the +// (parity/build/polyengine-carrier.mjs) and the two wasm artifacts it needs — +// the pinned polyengine translator under /target/polyengine-browser/ and the // parity runner component — are fetched from the same server. The page opens // `ws:` connections to the echo server directly: WebSocket is not subject // to CORS, and a localhost `http:` page may open `ws:` connections. @@ -20,7 +20,7 @@ // playwright-core's version (the parity lockfile), so losses-chromium.js // measures one engine everywhere — local runs and CI alike. Install it // once with `npx playwright-core install --with-deps chromium` (from this -// directory). No engine flag is involved: deltic runs the runner +// directory). No engine flag is involved: polyengine runs the runner // component's async exports on the callback ABI. // // Usage: node run-browser.mjs [--update] @@ -48,8 +48,8 @@ const MIME = { // The subtrees a page may read: the WPT gate's own tree (harness, groups, // reporter, parity modules, the carrier bundle and the runner component) -// and the pinned deltic translator asset the carrier translates with. -const SERVED_PREFIXES = ["/js/componentize/wpt/", "/target/deltic-browser/"]; +// and the pinned polyengine translator asset the carrier translates with. +const SERVED_PREFIXES = ["/js/componentize/wpt/", "/target/polyengine-browser/"]; /** Serve the repository layout, read-only, under SERVED_PREFIXES. */ function startServer() { @@ -95,8 +95,8 @@ async function runLegInPage({ base, wsBase, leg }) { const legs = await import(`${base}/js/componentize/wpt/parity/legs.mjs`); if (leg === "baseline") return legs.runBaseline(wsBase); const carrier = { - url: `${base}/js/componentize/wpt/parity/build/deltic-carrier.mjs`, - translatorPath: "target/deltic-browser/deltic-translator-shim.wasm", + url: `${base}/js/componentize/wpt/parity/build/polyengine-carrier.mjs`, + translatorPath: "target/polyengine-browser/polyengine-translator-shim.wasm", componentPath: "js/componentize/wpt/build/parity-runner.component.wasm", async loadBytes(path) { const resp = await fetch(`${base}/${path}`); @@ -109,9 +109,9 @@ async function runLegInPage({ base, wsBase, leg }) { async function main() { for (const [what, rel] of [ - ["carrier bundle (run `just wpt::parity-chromium`)", "js/componentize/wpt/parity/build/deltic-carrier.mjs"], + ["carrier bundle (run `just wpt::parity-chromium`)", "js/componentize/wpt/parity/build/polyengine-carrier.mjs"], ["parity runner component (run `js/componentize/wpt/component.sh build`)", "js/componentize/wpt/build/parity-runner.component.wasm"], - ["translator asset (run `just wpt::parity-chromium`)", "target/deltic-browser/deltic-translator-shim.wasm"], + ["translator asset (run `just wpt::parity-chromium`)", "target/polyengine-browser/polyengine-translator-shim.wasm"], ]) { try { await access(join(REPO_ROOT, rel)); diff --git a/js/componentize/wpt/parity/smoke-run.mjs b/js/componentize/wpt/parity/smoke-run.mjs index ea39c45..1696898 100644 --- a/js/componentize/wpt/parity/smoke-run.mjs +++ b/js/componentize/wpt/parity/smoke-run.mjs @@ -1,8 +1,8 @@ // The smoke entry's embedder (`just wpt::smoke`): instantiate the -// componentized smoke component under the SAME deltic carrier the +// componentized smoke component under the SAME polyengine carrier the // round-trip leg uses (it exports the same world) against the suite echo // server, and require the streamed marker back. No transpile step, no -// engine flag — a fast bisector for componentize-js or deltic-pin bumps. +// engine flag — a fast bisector for componentize-js or polyengine-pin bumps. import { readFile } from "node:fs/promises"; import { dirname, join, resolve } from "node:path"; import { fileURLToPath, pathToFileURL } from "node:url"; @@ -14,12 +14,12 @@ const REPO_ROOT = resolve(HERE, "..", "..", "..", ".."); const loadBytes = async (path) => new Uint8Array(await readFile(join(REPO_ROOT, path))); const { setSink, instantiateRunner } = await import( - pathToFileURL(join(HERE, "build", "deltic-carrier.mjs")).href + pathToFileURL(join(HERE, "build", "polyengine-carrier.mjs")).href ); setSink((record) => console.error("[smoke]", JSON.parse(record).name)); const [translatorBytes, componentBytes] = await Promise.all([ - loadBytes("target/deltic-browser/deltic-translator-shim.wasm"), + loadBytes("target/polyengine-browser/polyengine-translator-shim.wasm"), loadBytes("js/componentize/wpt/build/smoke.component.wasm"), ]); const runner = await instantiateRunner(translatorBytes, componentBytes); diff --git a/js/componentize/wpt/parity/sockets-stub-deltic.mjs b/js/componentize/wpt/parity/sockets-stub-polyengine.mjs similarity index 88% rename from js/componentize/wpt/parity/sockets-stub-deltic.mjs rename to js/componentize/wpt/parity/sockets-stub-polyengine.mjs index 2de63f5..fa077a0 100644 --- a/js/componentize/wpt/parity/sockets-stub-deltic.mjs +++ b/js/componentize/wpt/parity/sockets-stub-polyengine.mjs @@ -1,8 +1,8 @@ -// The `wasi:sockets` import fragment for the parity carrier's deltic +// The `wasi:sockets` import fragment for the parity carrier's polyengine // instantiation. // // The componentize-js runtime imports the seven `wasi:sockets@0.2` -// interfaces unconditionally, and deltic's `wasi()` deliberately +// interfaces unconditionally, and polyengine's `wasi()` deliberately // excludes sockets (mission scope: p2 baseline + p3 clocks). The parity // runner never opens a socket — every WebSocket it drives goes through // `polymorph:websocket/connections` — so every member here exists only to @@ -10,10 +10,10 @@ // mean the runner grew a socket dependency this stub is silently // breaking. // -// This is the deltic-keyed reshape of the jco-era `sockets-stub.mjs` +// This is the polyengine-keyed reshape of the jco-era `sockets-stub.mjs` // (same inventory, same throw-if-reached posture; removed with the jco // legs, see git history). Keys are compatibility-**track** keys (`@0.2`), -// the same registration form `@deltic/wasi` uses, so one provider +// the same registration form `@polyengine/wasi` uses, so one provider // serves whichever 0.2.x minor the guest's binary happens to name // (contracts/embedder-api.md §"Version canonicalization"). diff --git a/js/componentize/wpt/reporter.js b/js/componentize/wpt/reporter.js index a9bff5f..cfa7378 100644 --- a/js/componentize/wpt/reporter.js +++ b/js/componentize/wpt/reporter.js @@ -1,5 +1,5 @@ // The embedder half of the parity runner's `wpt:parity/reporter` import: -// the round trip's carrier bundle (parity/deltic-carrier.ts) provides +// the round trip's carrier bundle (parity/polyengine-carrier.ts) provides // this module as that interface, so whichever environment loads the // carrier installs its sink through the carrier's re-exported `setSink` // before invoking `run`, and receives each record as the test settles. diff --git a/js/componentize/wpt/smoke.js b/js/componentize/wpt/smoke.js index 4857cb1..accb186 100644 --- a/js/componentize/wpt/smoke.js +++ b/js/componentize/wpt/smoke.js @@ -1,7 +1,7 @@ // A pipeline smoke entry: proves the componentize-js toolchain, the shim, -// and the deltic round-trip host stack end to end before (and beside) the +// and the polyengine round-trip host stack end to end before (and beside) the // full WPT runner. Componentized against the same `wpt-parity-runner` -// world, so the round-trip leg's carrier (parity/deltic-carrier.ts) +// world, so the round-trip leg's carrier (parity/polyengine-carrier.ts) // serves it the same imports. import { report } from "wpt:parity/reporter@0.1.0"; import { WebSocket } from "./js/componentize/websocket.js"; diff --git a/js/deltic/deno.json b/js/deltic/deno.json deleted file mode 100644 index 45464b2..0000000 --- a/js/deltic/deno.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "@polymorph/websocket", - "version": "0.2.0", - "license": "Apache-2.0", - "exports": "./websocket.ts", - "//": "MODULE-IDENTITY CONSTRAINT: deltic's wasi module imports @deltic/runtime/embedder by bare specifier internally. This file's @deltic/runtime range and conformance/driver-ct/deltic/deno.json's exact pin must resolve to the IDENTICAL @deltic/runtime version in both deno.locks, or the embedder module loads twice: value recognition survives that (websocket.ts recognizes deltic values by @deltic/protocol brand predicates, not instanceof), but a second copy splits the runtime/translator plan-format pairing, and stateful handles (streams/futures) minted by one copy are refused by the other. Pin story: this published package takes a caret range (caret-honest upstream: within a minor line releases stay compatible, breaking bumps the minor); the repo-internal conformance harness exact-pins instead so its lock is the single source of truth for the resolved version; deno.lock carries integrity, --frozen enforced everywhere; one RESOLVED version repo-wide (across both locks) is asserted by the pin gate (justfile: exam-deltic).", - "imports": { - "@deltic/runtime/embedder": "jsr:@deltic/runtime@^0.2.0/embedder" - }, - "minimumDependencyAge": { "age": "P1D", "exclude": ["jsr:@deltic/*"] }, - "compilerOptions": { - "lib": ["dom", "dom.iterable", "dom.asynciterable", "deno.ns"] - }, - "tasks": { - "check": "deno check websocket.ts tests", - "test": "deno test --allow-net=127.0.0.1,localhost tests" - }, - "publish": { - "exclude": ["tests"] - } -} diff --git a/js/deltic/README.md b/js/polyengine/README.md similarity index 68% rename from js/deltic/README.md rename to js/polyengine/README.md index 0e41064..685cf39 100644 --- a/js/deltic/README.md +++ b/js/polyengine/README.md @@ -1,4 +1,4 @@ -# `js/deltic` — the deltic-native `polymorph:websocket` host module +# `js/polyengine` — the polyengine-native `polymorph:websocket` host module `websocket.ts` is **the** JS host for `polymorph:websocket`: the standard `WebSocket` API only, no `node:` modules, no runtime dependencies, and it @@ -8,11 +8,13 @@ port of the browser-first reference host `js/jco/websocket.js` (retired with the jco legs at commit c9252be; see git history), rewritten over deltic's embedder API (typed `Stream` / `ReadableStream` rather than bare-payload `Stream`, and `ComponentException` throws rather than -`throw { tag, val }`). It was developed as deltic's own -`ports/websocket` reference-host port and is upstreamed here per -[lann/deltic#14](https://github.com/lann/deltic/issues/14); the WIT -contract is [`wit/websocket.wit`](../../wit/websocket.wit), and every doc -comment quoting a contract quotes that file. +`throw { tag, val }`) — deltic has since been renamed +[polyengine](https://github.com/polymorph-components/polyengine). It was +developed as deltic's own `ports/websocket` reference-host port and was +upstreamed here per [lann/deltic#14](https://github.com/lann/deltic/issues/14) +(historical: predates the rename); the WIT contract is +[`wit/websocket.wit`](../../wit/websocket.wit), and every doc comment +quoting a contract quotes that file. ## Behavioral delta vs. the retired `websocket.js` @@ -32,14 +34,14 @@ identically on Deno. ## Module identity -`deno.json`'s `@deltic/runtime/embedder` import maps to the exact same -pinned URL as `conformance/driver-ct/deltic/deno.json`. deltic's +`deno.json`'s `@polyengine/runtime/embedder` import maps to the exact same +pinned URL as `conformance/driver-ct/polyengine/deno.json`. polyengine's `wasi-shims` module imports that specifier by bare name internally; if the two configs ever disagreed, the embedder module would load twice. This -module recognizes deltic values by `@deltic/protocol` brand predicates -(`isComponentException`, the `STREAM` brand), so recognition holds even in -a multi-copy graph — but a duplicated embedder still splits the -runtime/translator plan-format pairing, and stateful handles +module recognizes polyengine values by `@polyengine/protocol` brand +predicates (`isComponentException`, the `STREAM` brand), so recognition +holds even in a multi-copy graph — but a duplicated embedder still splits +the runtime/translator plan-format pairing, and stateful handles (streams/futures) minted by one copy are refused by the other. Keep both import maps byte-identical for that one entry. @@ -55,10 +57,10 @@ The Deno-default-lib configuration is covered by the conformance driver's `check` task, which imports this module. ```sh -cd js/deltic +cd js/polyengine deno task check deno task test ``` The full behavioral surface is exercised by the real conformance suite, -which lives at [`conformance/driver-ct/deltic/`](../../conformance/driver-ct/deltic). +which lives at [`conformance/driver-ct/polyengine/`](../../conformance/driver-ct/polyengine). diff --git a/js/polyengine/deno.json b/js/polyengine/deno.json new file mode 100644 index 0000000..00809f7 --- /dev/null +++ b/js/polyengine/deno.json @@ -0,0 +1,21 @@ +{ + "name": "@polymorph/websocket", + "version": "0.3.0", + "license": "Apache-2.0", + "exports": "./websocket.ts", + "//": "MODULE-IDENTITY CONSTRAINT: polyengine's wasi module imports @polyengine/runtime/embedder by bare specifier internally. This file's @polyengine/runtime range and conformance/driver-ct/polyengine/deno.json's exact pin must resolve to the IDENTICAL @polyengine/runtime version in both deno.locks, or the embedder module loads twice: value recognition survives that (websocket.ts recognizes polyengine values by @polyengine/protocol brand predicates, not instanceof), but a second copy splits the runtime/translator plan-format pairing, and stateful handles (streams/futures) minted by one copy are refused by the other. Pin story: this published package takes a caret range (caret-honest upstream: within a minor line releases stay compatible, breaking bumps the minor); the repo-internal conformance harness exact-pins instead so its lock is the single source of truth for the resolved version; deno.lock carries integrity, --frozen enforced everywhere; one RESOLVED version repo-wide (across both locks) is asserted by the pin gate (justfile: exam-polyengine).", + "imports": { + "@polyengine/runtime/embedder": "jsr:@polyengine/runtime@^0.3.0/embedder" + }, + "minimumDependencyAge": { "age": "P1D", "exclude": ["jsr:@polyengine/*"] }, + "compilerOptions": { + "lib": ["dom", "dom.iterable", "dom.asynciterable", "deno.ns"] + }, + "tasks": { + "check": "deno check websocket.ts tests", + "test": "deno test --allow-net=127.0.0.1,localhost tests" + }, + "publish": { + "exclude": ["tests"] + } +} diff --git a/js/deltic/deno.lock b/js/polyengine/deno.lock similarity index 57% rename from js/deltic/deno.lock rename to js/polyengine/deno.lock index d76d26b..eb303c8 100644 --- a/js/deltic/deno.lock +++ b/js/polyengine/deno.lock @@ -1,19 +1,19 @@ { "version": "5", "specifiers": { - "jsr:@deltic/protocol@0.2": "0.2.0", - "jsr:@deltic/runtime@0.2": "0.2.0", + "jsr:@polyengine/protocol@0.1": "0.1.0", + "jsr:@polyengine/runtime@0.3": "0.3.0", "jsr:@std/assert@1": "1.0.19", "jsr:@std/internal@^1.0.12": "1.0.14" }, "jsr": { - "@deltic/protocol@0.2.0": { - "integrity": "028be6a3623c5e910598aa7a199209b85e8931ae484ac7f6638d610ddb0e19fa" + "@polyengine/protocol@0.1.0": { + "integrity": "0c97f34166f22ba55e7b084148df96e47aebe47cd9dd13930057759c9161bb1c" }, - "@deltic/runtime@0.2.0": { - "integrity": "cf8b0bdd9e6bc4488ba78cc91661103bfcbd78f5a5c4ff99132799618a9db4bb", + "@polyengine/runtime@0.3.0": { + "integrity": "97d7648c104dd0f08b4d10e1ed0117ab0cb5243db68c139f1f3df25755ed4e60", "dependencies": [ - "jsr:@deltic/protocol" + "jsr:@polyengine/protocol" ] }, "@std/assert@1.0.19": { @@ -28,7 +28,7 @@ }, "workspace": { "dependencies": [ - "jsr:@deltic/runtime@0.2" + "jsr:@polyengine/runtime@0.3" ] } } diff --git a/js/deltic/tests/echo_server.ts b/js/polyengine/tests/echo_server.ts similarity index 100% rename from js/deltic/tests/echo_server.ts rename to js/polyengine/tests/echo_server.ts diff --git a/js/deltic/tests/websocket_test.ts b/js/polyengine/tests/websocket_test.ts similarity index 93% rename from js/deltic/tests/websocket_test.ts rename to js/polyengine/tests/websocket_test.ts index 0f4d686..96dbc9b 100644 --- a/js/deltic/tests/websocket_test.ts +++ b/js/polyengine/tests/websocket_test.ts @@ -9,7 +9,7 @@ // consumer's own conformance suite, executed by conformance/run.ts. import { assert, assertEquals, assertRejects, assertThrows } from "jsr:@std/assert@^1.0.0"; -import { ComponentException } from "@deltic/runtime/embedder"; +import { ComponentException } from "@polyengine/runtime/embedder"; import { currentConfig, resetConfig, @@ -213,21 +213,23 @@ Deno.test("receive-via-stream: single-use; pending receive is rejected", async ( }); }); -// The two tests below hand-roll deltic values from nothing but the -// @deltic/protocol registry brands (`Symbol.for` keys pinned by upstream's -// own tests): per the protocol contract, an object carrying the brand is a -// legal value from ANY runtime copy, so these prove the module's -// recognition sites work without class identity — the multi-copy exposure -// #48 closes. The literal keys are deliberate: a brand-generation bump -// upstream must fail here and force the recognition sites to be -// revisited. (Key spellings are stable across upstream renames: the -// `ComponentException` brand is still `deltic.witError/1`.) +// The two tests below hand-roll polyengine values from nothing but the +// @polyengine/protocol registry brands (`Symbol.for` keys pinned by +// upstream's own tests): per the protocol contract, an object carrying the +// brand is a legal value from ANY runtime copy, so these prove the +// module's recognition sites work without class identity — the +// multi-copy exposure #48 closes. The literal keys are deliberate: a +// brand-generation bump upstream must fail here and force the +// recognition sites to be revisited. (The `deltic.*` spellings were +// retired by upstream's own A18 project rename — pre-A18 copies and +// hand-rolled `deltic.*` brands do NOT interoperate with these by design; +// the `ComponentException` brand is now `polyengine.witError/1`.) Deno.test("send-via-stream: a foreign-copy ComponentException's payload passes through the error wrap", async () => { await withServer(async (s) => { const ws = await Websocket.connect(`${s.base}/echo`, []); const foreign = Object.assign(new Error("minted elsewhere"), { - [Symbol.for("deltic.witError/1")]: true, + [Symbol.for("polyengine.witError/1")]: true, payload: { kind: "invalid-argument", value: "minted by another copy" }, }); const producer = (async function* () { @@ -259,7 +261,7 @@ Deno.test("send-via-stream: a hand-rolled branded byte stream takes the batched- // route it to the batched-read branch. let reads = 0; const data = { - [Symbol.for("deltic.stream/1")]: true, + [Symbol.for("polyengine.stream/1")]: true, read(_max: number): Promise { reads += 1; return Promise.resolve(reads === 1 ? payload : new Uint8Array(0)); diff --git a/js/deltic/websocket.ts b/js/polyengine/websocket.ts similarity index 99% rename from js/deltic/websocket.ts rename to js/polyengine/websocket.ts index e68cf30..5a3ecce 100644 --- a/js/deltic/websocket.ts +++ b/js/polyengine/websocket.ts @@ -1,5 +1,5 @@ // Host module for `polymorph:websocket/connections@0.1.0`, ported to the -// deltic embedder conventions (contracts/embedder-api.md). +// polyengine embedder conventions (contracts/embedder-api.md). // // PORT PROVENANCE. This is a faithful translation of the consumer's // browser-first reference host, `polymorph-websocket/js/jco/websocket.js` @@ -33,7 +33,7 @@ import { STREAM, type Stream, type StreamSource, -} from "@deltic/runtime/embedder"; +} from "@polyengine/runtime/embedder"; // ----- WIT value types (contracts/embedder-api.md §"Value mapping") --------- diff --git a/justfile b/justfile index 5828521..aea3861 100644 --- a/justfile +++ b/justfile @@ -48,7 +48,7 @@ check-js: node --check js/componentize/wpt/runner.js node --check js/componentize/wpt/smoke.js node --check js/componentize/wpt/reporter.js - node --check js/componentize/wpt/parity/sockets-stub-deltic.mjs + node --check js/componentize/wpt/parity/sockets-stub-polyengine.mjs node --check js/componentize/wpt/parity/legs.mjs node --check js/componentize/wpt/parity/baseline.mjs node --check js/componentize/wpt/parity/roundtrip.mjs @@ -56,7 +56,7 @@ check-js: node --check js/componentize/wpt/parity/run-legs.mjs node --check js/componentize/wpt/parity/smoke-run.mjs node --check js/componentize/wpt/parity/compare.mjs - node --check conformance/driver-ct/deltic/run-browser.mjs + node --check conformance/driver-ct/polyengine/run-browser.mjs node --check conformance/server/echod.mjs @echo "js: ok" @@ -64,45 +64,46 @@ check-js: test: cargo test -# js/deltic's own unit-test gate (type-check + tests); the conformance -# leg itself is `conformance-ct::run-deltic`. -deltic-module-check: - cd js/deltic && deno task check && deno task test +# js/polyengine's own unit-test gate (type-check + tests); the +# conformance leg itself is `conformance-ct::run-polyengine`. +polyengine-module-check: + cd js/polyengine && deno task check && deno task test -# The one-version-everywhere gate: every `jsr:@deltic/*` package resolved -# in BOTH deno.locks (js/deltic and conformance/driver-ct/deltic) must -# agree on the exact same resolved version, or the embedder module can -# load twice across the module boundary (see js/deltic/deno.json's -# MODULE-IDENTITY comment). js/deltic's manifest takes a caret range -# (required for publishing to JSR) so the *lock*, not the manifest, is -# the source of truth for the resolved version. @deltic/protocol is -# excluded: it versions independently of the runtime/wasi/translator -# family it's a transitive dependency of. -exam-deltic: +# The one-version-everywhere gate: every `jsr:@polyengine/*` package +# resolved in BOTH deno.locks (js/polyengine and +# conformance/driver-ct/polyengine) must agree on the exact same +# resolved version, or the embedder module can load twice across the +# module boundary (see js/polyengine/deno.json's MODULE-IDENTITY +# comment). js/polyengine's manifest takes a caret range (required for +# publishing to JSR) so the *lock*, not the manifest, is the source of +# truth for the resolved version. @polyengine/protocol is excluded: it +# versions independently of the runtime/wasi/translator family it's a +# transitive dependency of. +exam-polyengine: #!/usr/bin/env bash set -euo pipefail - v=$(jq -r '.specifiers // {} | to_entries[] | select(.key | test("^jsr:@deltic/(?!protocol)")) | .value' \ - js/deltic/deno.lock conformance/driver-ct/deltic/deno.lock | sort -u) + v=$(jq -r '.specifiers // {} | to_entries[] | select(.key | test("^jsr:@polyengine/(?!protocol)")) | .value' \ + js/polyengine/deno.lock conformance/driver-ct/polyengine/deno.lock | sort -u) if [ "$(printf '%s\n' "$v" | wc -l)" != 1 ]; then - echo "deltic pin drift: $v" >&2 + echo "polyengine pin drift: $v" >&2 exit 1 fi - echo "deltic pin: $v" + echo "polyengine pin: $v" -# The JS runner core's one-version gate: the deltic-browser driver's +# The JS runner core's one-version gate: the polyengine-browser driver's # npm tree (@jsr/polymorph__test, JSR's npm-compat form of # jsr:@polymorph/test, routed through the tree's own .npmrc) and its # deno.lock (which locks the same package under its bare jsr: name for # the bundled worker import) must resolve the same version — a skewed # bump runs the JS harness against a Rust runner from a different -# polymorph-test release. Wired next to exam-deltic in CI. +# polymorph-test release. Wired next to exam-polyengine in CI. runner-js-pin-check: #!/usr/bin/env bash set -euo pipefail v=$({ grep -A1 "'@jsr/polymorph__test':" \ - conformance/driver-ct/deltic/pnpm-lock.yaml \ + conformance/driver-ct/polyengine/pnpm-lock.yaml \ | sed -n "s/.*specifier: *//p"; \ - jq -r '.jsr | keys[]' conformance/driver-ct/deltic/deno.lock \ + jq -r '.jsr | keys[]' conformance/driver-ct/polyengine/deno.lock \ | grep '^@polymorph/test@' | sed 's/.*@//'; } | sort -u) if [ -z "$v" ] || [ "$(printf '%s\n' "$v" | wc -l)" != 1 ]; then echo "runner-js pin drift: $v" >&2 diff --git a/justfile.shared.just b/justfile.shared.just index 1a723f1..e288caf 100644 --- a/justfile.shared.just +++ b/justfile.shared.just @@ -23,22 +23,23 @@ build-component crate: -o {{root}}/target/components/{{crate}}.wasm.tmp mv -f {{root}}/target/components/{{crate}}.wasm.tmp {{root}}/target/components/{{crate}}.wasm -# Extract the deltic translator wasm from the pinned `@deltic/translator` -# JSR package's lock-pinned module cache into `out_dir` — no network, no -# sha256 bookkeeping (the JSR package's integrity lives in -# conformance/driver-ct/deltic/deno.lock, enforced by --frozen). Every -# browser leg that used to fetch a sha-pinned release asset now runs this -# instead. Resolves against conformance/driver-ct/deltic's import map (the -# single deltic pin site); asserts every module in the translator's graph -# resolves to the one pinned version before copying. +# Extract the polyengine translator wasm from the pinned +# `@polyengine/translator` JSR package's lock-pinned module cache into +# `out_dir` — no network, no sha256 bookkeeping (the JSR package's +# integrity lives in conformance/driver-ct/polyengine/deno.lock, +# enforced by --frozen). Every browser leg that used to fetch a +# sha-pinned release asset now runs this instead. Resolves against +# conformance/driver-ct/polyengine's import map (the single polyengine +# pin site); asserts every module in the translator's graph resolves to +# the one pinned version before copying. [private] -extract-deltic-translator out_dir: +extract-polyengine-translator out_dir: #!/usr/bin/env bash set -euo pipefail mkdir -p {{out_dir}} info=$(mktemp) trap 'rm -f "$info"' EXIT - deno info --json --config {{root}}/conformance/driver-ct/deltic/deno.json --frozen \ - @deltic/translator > "$info" - pin=$(grep -o 'jsr:@deltic/runtime@[^/"]*' {{root}}/conformance/driver-ct/deltic/deno.json | head -1 | sed 's/.*@//') - python3 "{{root}}/scripts/extract-deltic-translator.py" "$info" {{out_dir}} "$pin" + deno info --json --config {{root}}/conformance/driver-ct/polyengine/deno.json --frozen \ + @polyengine/translator > "$info" + pin=$(grep -o 'jsr:@polyengine/runtime@[^/"]*' {{root}}/conformance/driver-ct/polyengine/deno.json | head -1 | sed 's/.*@//') + python3 "{{root}}/scripts/extract-polyengine-translator.py" "$info" {{out_dir}} "$pin" diff --git a/scripts/extract-deltic-translator.py b/scripts/extract-polyengine-translator.py similarity index 58% rename from scripts/extract-deltic-translator.py rename to scripts/extract-polyengine-translator.py index 110b519..2a2d8e3 100755 --- a/scripts/extract-deltic-translator.py +++ b/scripts/extract-polyengine-translator.py @@ -1,14 +1,14 @@ #!/usr/bin/env python3 -"""Extract the deltic translator wasm from a `deno info --json` graph. +"""Extract the polyengine translator wasm from a `deno info --json` graph. -Used by justfile.shared.just's extract-deltic-translator recipe: every -browser leg that used to fetch a sha256-pinned GitHub release asset now -copies the translator wasm straight out of the `@deltic/translator` JSR -package's lock-pinned module cache instead (no network, no sha -bookkeeping — the package's integrity lives in -conformance/driver-ct/deltic/deno.lock, enforced by --frozen). +Used by justfile.shared.just's extract-polyengine-translator recipe: +every browser leg that used to fetch a sha256-pinned GitHub release +asset now copies the translator wasm straight out of the +`@polyengine/translator` JSR package's lock-pinned module cache instead +(no network, no sha bookkeeping — the package's integrity lives in +conformance/driver-ct/polyengine/deno.lock, enforced by --frozen). -Usage: extract-deltic-translator.py +Usage: extract-polyengine-translator.py """ import json import sys @@ -17,7 +17,7 @@ def main() -> None: info_path, out_dir, pin = sys.argv[1], sys.argv[2], sys.argv[3] graph = json.load(open(info_path)) - mods = [m for m in graph["modules"] if "/@deltic/" in m.get("specifier", "")] + mods = [m for m in graph["modules"] if "/@polyengine/" in m.get("specifier", "")] bad = {m["specifier"] for m in mods if pin not in m["specifier"]} if bad: sys.exit(f"pin drift in translator graph (expected {pin}): {bad}") @@ -31,7 +31,7 @@ def main() -> None: # "unexpected section" near EOF). with open(asset["local"], "rb") as f: data = f.read(asset["size"]) - with open(out_dir + "/deltic-translator-shim.wasm", "wb") as f: + with open(out_dir + "/polyengine-translator-shim.wasm", "wb") as f: f.write(data) diff --git a/scripts/setup.sh b/scripts/setup.sh index dfc21ac..d9cebd5 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -9,7 +9,7 @@ # bootstrap script) # - pnpm (via npm, version pinned below) # - JS dependencies for the package trees (skipped with SKIP_NODE=1); -# the JS package trees carry no compiled toolchain (deltic arrives as +# the JS package trees carry no compiled toolchain (polyengine arrives as # pinned release assets, componentize-js as a verified binary), so # installs run no cargo build # @@ -131,7 +131,7 @@ if [ "${SKIP_NODE:-}" != "1" ]; then if ! have pnpm; then npm install -g "pnpm@${PNPM_VERSION}" fi - for dir in conformance/driver-ct/deltic js/componentize/wpt/parity; do + for dir in conformance/driver-ct/polyengine js/componentize/wpt/parity; do if [ -f "$REPO_ROOT/$dir/package.json" ]; then (cd "$REPO_ROOT/$dir" && pnpm install) fi