Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/jsr-publish.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -20,4 +20,4 @@ jobs:
with:
deno-version: "2.9.5"
- run: deno publish
working-directory: js/deltic
working-directory: js/polyengine
49 changes: 25 additions & 24 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,47 +28,48 @@ 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/<pkg>@0.1.0-pre.g<hash>`; 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/<pkg>@0.3.0-pre.g<hash>`; 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
ratchet in `wpt/parity/losses.js`).
- `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.

Expand All @@ -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)
Expand All @@ -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
Expand Down
26 changes: 13 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading
Loading