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
22 changes: 11 additions & 11 deletions .github/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ rust-checks:

# Everything the conformance CI job runs: the cross-implementation
# conformance targets that share its runner (wasmtime-rustcrypto,
# composed, jco-node, jco-browser, deltic-deno), their aggregates, and
# the deltic host module's own unit gate (same module, fast local
# composed, jco-node, jco-browser, polyengine-deno), their aggregates, and
# the polyengine host module's own unit gate (same module, fast local
# check). The jco-firefox and jco-webkit legs run as their own CI jobs,
# and the committed-matrix and compat gates run in the
# conformance-aggregate job, where every target's results have joined.
conformance-checks:
@just gha::_step conformance-ct::deltic-pin-check
@just gha::_step conformance-ct::polyengine-pin-check
@just gha::_step conformance-ct::runner-js-pin-check
@just gha::_step conformance-ct::all
@just gha::_step deltic-module-check
@just gha::_step polyengine-module-check

# Everything the conformance-suites CI job runs: transpile the suite
# components into conformance/driver-ct/jco/generated for the engine-leg
Expand Down Expand Up @@ -126,11 +126,11 @@ timing-lab-scheduled:
# the suite component wasms (prebuilt when the pages workflow restores
# the CI run's conformance-artifacts cache — CONFORMANCE_PREBUILT — and
# rebuilt by the recipe's cargo fallback otherwise) and the
# deltic-browser worker bundle + repo-pinned translator shim the staged
# polyengine-browser worker bundle + repo-pinned translator shim the staged
# viewer's live pane loads.
pages-live-assets:
just conformance-ct::build
just conformance-ct::_deltic-browser-bundle
just conformance-ct::_polyengine-browser-bundle

# Assemble the Pages site in target/conformance-site: the browser WPT
# parity page, the conformance results viewer + live run, the public
Expand All @@ -157,7 +157,7 @@ pages-site:
cp -r js/componentize/wpt/parity/generated-web \
target/conformance-site/js/componentize/wpt/parity/
# The conformance results viewer: the staged component-test page
# (self-contained: the deltic release assets and the raw
# (self-contained: the polyengine release assets and the raw
# viewer-aggregate component ride inside viewer/), the committed
# lockfiles/manifests, and — when the pages workflow could fetch the
# latest main CI run's conformance-results artifact — the
Expand All @@ -181,11 +181,11 @@ pages-site:
# resolve to locally: the worker bundle + its pin-matched translator
# shim, and both suite component wasms. Weight: the suites are
# multi-MB but fetched only when a visitor starts a run.
mkdir -p target/conformance-site/target/deltic-browser \
mkdir -p target/conformance-site/target/polyengine-browser \
target/conformance-site/target/wasm32-wasip2/release
cp target/deltic-browser/webcrypto-worker.mjs \
target/deltic-browser/deltic-translator-shim.wasm \
target/conformance-site/target/deltic-browser/
cp target/polyengine-browser/webcrypto-worker.mjs \
target/polyengine-browser/polyengine-translator-shim.wasm \
target/conformance-site/target/polyengine-browser/
cp target/wasm32-wasip2/release/conformance_guest_ct.wasm \
target/wasm32-wasip2/release/conformance_signing_guest_ct.wasm \
target/conformance-site/target/wasm32-wasip2/release/
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ jobs:
# The cross-implementation conformance targets that run in this job
# (component-test stack): both suites across wasmtime-rustcrypto,
# composed, jco-node, jco-browser (headless Chromium via jco),
# deltic-browser (headless Chromium via deltic), and deltic-deno
# polyengine-browser (headless Chromium via polyengine), and polyengine-deno
# (runtime-linked under stock Deno) — plus the aggregates over those
# targets and the deltic host module's unit gate. The jco-firefox and
# targets and the polyengine host module's unit gate. The jco-firefox and
# jco-webkit legs run as their own jobs below (Firefox needs a runner
# to itself; WebKit needs macOS); the committed-matrix and compat
# gates run in conformance-aggregate once every target's results
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
# Owns the rev derivation, the rev-keyed tools cache, the
# install, and the pins gate; conformance-ct::_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

- name: Install Node 24
# Exact-pinned, like every engine here (Deno, the Playwright
Expand All @@ -127,10 +127,10 @@ jobs:
node-version: "24.19.0"

- name: Install Deno
# For the deltic-deno conformance target and js/deltic's own unit
# gate: deltic runs the suites RUNTIME-LINKED under stock Deno,
# its runtime graph pinned by the conformance/driver-ct/deltic and
# js/deltic import maps + frozen deno.lock files (no npm tree, no
# For the polyengine-deno conformance target and js/polyengine's own unit
# gate: polyengine runs the suites RUNTIME-LINKED under stock Deno,
# its runtime graph pinned by the conformance/driver-ct/polyengine and
# js/polyengine import maps + frozen deno.lock files (no npm tree, no
# transpile). Version-pinned like every other toolchain here.
uses: denoland/setup-deno@v2
with:
Expand Down Expand Up @@ -487,7 +487,7 @@ jobs:
save-if: false

- name: Install the component-test tools at the pinned revision
uses: polymorph-components/polymorph-test/actions/setup@b4444a25a22106ad4128549bdc9e579552e62210
uses: polymorph-components/polymorph-test/actions/setup@38bfedf2b989522b82ddce5320fc1557a2f61461

- name: Download the ubuntu conformance results
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -520,7 +520,7 @@ jobs:
# input polices the `uses:` refs 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
Expand All @@ -529,28 +529,28 @@ jobs:
composed=conformance/driver-ct/results/composed.jsonl
jco-node=conformance/driver-ct/results/jco-node.jsonl
jco-browser=conformance/driver-ct/results/jco-browser.jsonl
deltic-browser=conformance/driver-ct/results/deltic-browser.jsonl
polyengine-browser=conformance/driver-ct/results/polyengine-browser.jsonl
jco-firefox=conformance/driver-ct/results/jco-firefox.jsonl
jco-webkit=conformance/driver-ct/results/jco-webkit.jsonl
deltic-deno=conformance/driver-ct/results/deltic-deno.jsonl
polyengine-deno=conformance/driver-ct/results/polyengine-deno.jsonl
summary-title: Conformance matrix
cli: target/ct-tools/bin/component-test
cargo-lock: Cargo.lock

- name: Publish the signing 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/signing-guest-ct/tests.lock
manifest: conformance/driver-ct/targets-signing.toml
results: |
wasmtime-rustcrypto=conformance/driver-ct/results/wasmtime-signing.jsonl
jco-node=conformance/driver-ct/results/jco-node-signing.jsonl
jco-browser=conformance/driver-ct/results/jco-browser-signing.jsonl
deltic-browser=conformance/driver-ct/results/deltic-browser-signing.jsonl
polyengine-browser=conformance/driver-ct/results/polyengine-browser-signing.jsonl
jco-firefox=conformance/driver-ct/results/jco-firefox-signing.jsonl
jco-webkit=conformance/driver-ct/results/jco-webkit-signing.jsonl
deltic-deno=conformance/driver-ct/results/deltic-deno-signing.jsonl
polyengine-deno=conformance/driver-ct/results/polyengine-deno-signing.jsonl
summary-title: Signing 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/webcrypto (js/deltic) to JSR.
# Publish @polymorph/webcrypto (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
12 changes: 6 additions & 6 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ jobs:
node-version: "24.19.0"

- name: Install Deno
# For the viewer staging's deltic release assets
# (conformance-ct::_viewer-prepared runs the checkout's
# fetch-deltic.ts). Version-pinned as in ci.yml.
# For the viewer staging's polyengine release assets
# (conformance-ct::_viewer-prepared runs `just polyengine-assets`
# inside the polymorph-test checkout). Version-pinned as in ci.yml.
uses: denoland/setup-deno@v2
with:
deno-version: "2.9.5"
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:

- name: Build the live pane's assets
# The suite wasms (prebuilt on a cache hit) and the
# deltic-browser worker bundle + translator shim the staged
# polyengine-browser worker bundle + translator shim the staged
# viewer's live pane loads.
run: just gha::pages-live-assets
env:
Expand All @@ -106,8 +106,8 @@ jobs:

- name: Build the conformance viewer artifacts
# component-test's results viewer staged at the pin: the page
# files, the raw viewer-aggregate component (deltic translates
# it in-page — no transpile), and the pinned deltic release
# files, the raw viewer-aggregate component (polyengine translates
# it in-page — no transpile), and the pinned polyengine release
# assets.
run: just conformance-ct::_viewer-prepared

Expand Down
18 changes: 9 additions & 9 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Guidance for automated agents (and humans) working in this repository.

`polymorph:webcrypto`: a WIT interface plus multiple implementations that run the
*same* guest component against real cryptography: a Wasmtime host (RustCrypto)
and two JS hosts over the platform Web Crypto API — deltic (runtime-linked;
and two JS hosts over the platform Web Crypto API — polyengine (runtime-linked;
the primary JS path) and jco (transpile-based). It is a sibling of
`polymorph:webrtc-datachannels` and deliberately mirrors its architecture — prefer
clarity and correctness over features, and keep the implementations
Expand Down Expand Up @@ -66,12 +66,12 @@ rust/ # the Rust library surface (directory = crate name
# export policy
js/ # the JS library surface (directory = npm name minus
# the `@polymorph/webcrypto-` family root)
deltic/ # deltic host MODULE (src/mod.ts): the same
# reference host over deltic's embedder API,
polyengine/ # polyengine host MODULE (src/mod.ts): the same
# reference host over polyengine's embedder API,
# runtime-linked — no transpile step; the
# canonical module deltic-family consumers pin
# canonical module polyengine-family consumers pin
# by URL (deno.lock frozen, release-pinned
# import maps). Gate: `just deltic-module-check`
# import maps). Gate: `just polyengine-module-check`
jco/ # @polymorph/webcrypto-jco: jco host LIBRARY.
# webcrypto.js implements the imports over the
# browser-compatible Web Crypto API ONLY; no
Expand Down Expand Up @@ -133,12 +133,12 @@ conformance/ # cross-implementation conformance tests, on the
signing-guest-ct/ # the host-only suite for surfaces the in-guest
# provider does not export (ecdsa-sign)
driver-ct/ # the wasmtime host driver (ct-driver), the
# deltic children (deltic/) serving the
# deltic-deno and deltic-browser targets, the
# polyengine children (polyengine/) serving the
# polyengine-deno and polyengine-browser targets, the
# jco runner (jco/) serving jco-node plus the
# browser-engine targets jco-browser
# (Chromium), jco-firefox, and jco-webkit
# (macOS CI only; jco-browser/deltic-browser
# (macOS CI only; jco-browser/polyengine-browser
# gate in CI and are locally opt-in via
# CONFORMANCE_BROWSER=1, jco-firefox via
# CONFORMANCE_FIREFOX=1), targets.toml +
Expand Down Expand Up @@ -431,7 +431,7 @@ and the cross-target conformance-aggregate job.)
| `just componentize::typecheck` | the `webcrypto-componentize` library, or `wit/extension-conditions.json`. Asserts its exported surface against the Web Cryptography API definitions TypeScript ships, and its extension-condition table against the wit/ registry; no component build, nothing generated. |
| `just componentize::test` | the `webcrypto-componentize` library, the componentize-demo guest, the in-guest provider, or any WIT. Gates in CI. Componentizes the JS demo guest from your tree (with the downloaded, digest-verified componentize-js — see the WPT row for the pin mechanics), composes it with the in-guest provider and driver, and runs it under `wasmtime`. The behavioral gate on the shim's checks the WPT census cannot observe (the SHA-1 collision postures, the extension-error transport). |
| `just wpt::test` | the `webcrypto-componentize` library, its `wpt/` harness or vendored files, the in-guest provider, or any WIT. Gates in CI. The runner is componentized from your tree in seconds; the componentize-js build it needs is downloaded and digest-verified (`js/componentize/wpt/component.sh`), never compiled here. Changing `js/componentize/componentize-js.rev` triggers the `componentize-js-toolchain` workflow; this check then fails until that publishes *and* `just componentize::update-toolchain-digest` records the new digests. Intentional changes to the test census also need `just wpt::update-expectations`. |
| `just conformance-ct::all` | any host/guest behavior the tests assert — the WIT surface, an implementation, the conformance suites/vectors/translation policy, or driver-ct/targets.toml. Runs the wasmtime-rustcrypto, composed, jco-node, and deltic-deno targets always (Node 24+, Deno), the jco-browser and deltic-browser legs under CI or CONFORMANCE_BROWSER=1, and the jco-firefox leg under CONFORMANCE_FIREFOX=1 (in CI it is the dedicated conformance-firefox job — Firefox needs a runner to itself), aggregating against the committed lockfiles and target manifests and building the compat matrix (results/compat.json); the jco-webkit leg runs only as the macOS CI job, and CI's conformance-aggregate job re-aggregates all eight targets, diffs the committed matrices (`matrix-check`), and gates the compat registry (`compat-check --require-all`). Intentional case changes also need `just conformance-ct::lock-update` and `just conformance-ct::matrix-update` — the latter from a full run, which only CI can produce (the WebKit leg needs macOS), so in practice `just gha::update-matrices-from-ci` (copies the matrices from the branch's CI `conformance-results` artifact). |
| `just conformance-ct::all` | any host/guest behavior the tests assert — the WIT surface, an implementation, the conformance suites/vectors/translation policy, or driver-ct/targets.toml. Runs the wasmtime-rustcrypto, composed, jco-node, and polyengine-deno targets always (Node 24+, Deno), the jco-browser and polyengine-browser legs under CI or CONFORMANCE_BROWSER=1, and the jco-firefox leg under CONFORMANCE_FIREFOX=1 (in CI it is the dedicated conformance-firefox job — Firefox needs a runner to itself), aggregating against the committed lockfiles and target manifests and building the compat matrix (results/compat.json); the jco-webkit leg runs only as the macOS CI job, and CI's conformance-aggregate job re-aggregates all eight targets, diffs the committed matrices (`matrix-check`), and gates the compat registry (`compat-check --require-all`). Intentional case changes also need `just conformance-ct::lock-update` and `just conformance-ct::matrix-update` — the latter from a full run, which only CI can produce (the WebKit leg needs macOS), so in practice `just gha::update-matrices-from-ci` (copies the matrices from the branch's CI `conformance-results` artifact). |
| `just demo::transpile` | anything affecting the component's interfaces, or the transpile flags in `examples/jco-demo/package.json`. |
| `just jco::test-host` | the jco host's input-buffering admission subsystem (`configure`, the admission queue). Runs `webcrypto.js` directly under `node --test`; the conformance suite cannot reach this code, since its workers each run their cases sequentially against their own host instance. |
| `just jco::typecheck` | the jco host (`webcrypto.js`), its world, or any WIT. Regenerates the interface definitions and type-checks the host against them; no component build. |
Expand Down
Loading
Loading