diff --git a/.github/justfile b/.github/justfile index 21cf6bb..7b0d3db 100644 --- a/.github/justfile +++ b/.github/justfile @@ -32,6 +32,7 @@ rust-checks: conformance-checks: @just gha::_step exam-deltic + @just gha::_step runner-js-pin-check @just gha::_step conformance-ct::all @just gha::_step deltic-module-check @just gha::_step wpt::parity diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6881e84..36ddf29 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,8 +54,6 @@ jobs: uses: polymorph-components/polymorph-test/actions/setup@b4444a25a22106ad4128549bdc9e579552e62210 with: tools: component-test-cli - js-locks: | - conformance/driver-ct/deltic/pnpm-lock.yaml - uses: pnpm/action-setup@v4 with: version: 10.34.5 diff --git a/AGENTS.md b/AGENTS.md index aff47ac..a8abf26 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -59,11 +59,12 @@ Layout (each directory's justfile module in parentheses): `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 as a git dep - (`@polymorph/component-test-js` in `driver-ct/deltic/package.json`), and + deltic-browser driver consumes its JS runner core from JSR + (`@jsr/polymorph__test` in `driver-ct/deltic/package.json`), and the `component-test` CLI is cargo-installed at the rev Cargo.lock - records (`conformance-ct::_ct-tools`). One rev everywhere; the root - `Cargo.toml` comment is the bump checklist. There is no transpiler + 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, deno.lock}`). diff --git a/Cargo.toml b/Cargo.toml index 2ef102b..aea718e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,17 +21,16 @@ default-members = [ ] [workspace.dependencies] -# The component-test harness, rev-pinned (no registry release yet). -# One rev everywhere: these two entries, the CLI install -# (conformance/driver-ct/justfile reads the rev back out of Cargo.lock), -# the @polymorph/component-test-js pin in -# conformance/driver-ct/deltic/package.json, and the actions/aggregate -# ref in .github/workflows/ci.yml. Bump all together with -# `component-test pins bump --cargo-toml Cargo.toml --package-json -# conformance/driver-ct/deltic/package.json --workflow -# .github/workflows/ci.yml`, then `cargo update component-test-sdk -# component-test-runner` and `pnpm --dir conformance/driver-ct/deltic -# install`; the _ct-tools pins gate and the CI ref guard fail on skew. +# The component-test harness: the crates pinned by git rev, the JS +# runner core from JSR (@jsr/polymorph__test, npm.jsr.io per-tree +# .npmrc). Both sides of a bump name ONE polymorph-test release: +# `component-test pins bump --cargo-toml Cargo.toml --workflow +# .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 +# 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" } anyhow = "1" diff --git a/conformance/README.md b/conformance/README.md index 79ab2c7..ea5f2d7 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 `@polymorph/component-test-js`'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); `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. | | [`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 @@ -107,7 +107,7 @@ 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 -consumes the JS runner core the same way: -`@polymorph/component-test-js` in `driver-ct/deltic/package.json`, a `github:polymorph-components/polymorph-test#` git -dep pinned to the same rev as the cargo entries (one rev everywhere — -the root `Cargo.toml` comment is the bump checklist). +consumes the JS runner core from JSR: `@jsr/polymorph__test` in +`driver-ct/deltic/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/.npmrc b/conformance/driver-ct/deltic/.npmrc new file mode 100644 index 0000000..41583e3 --- /dev/null +++ b/conformance/driver-ct/deltic/.npmrc @@ -0,0 +1 @@ +@jsr:registry=https://npm.jsr.io diff --git a/conformance/driver-ct/deltic/browser/worker-entry.ts b/conformance/driver-ct/deltic/browser/worker-entry.ts index 97f7aa2..434cea2 100644 --- a/conformance/driver-ct/deltic/browser/worker-entry.ts +++ b/conformance/driver-ct/deltic/browser/worker-entry.ts @@ -5,7 +5,7 @@ // emitted bundle carries exactly one embedder module instance — which is // what keeps `instanceof ComponentException` true when the host module throws // across the component boundary (workers resolve no import maps, so -// bundling is the only sound shape; see @polymorph/component-test-js's +// bundling is the only sound shape; see @jsr/polymorph__test's // runner-deltic README). // // Built by `just conformance-ct::run-deltic-browser` with @@ -13,7 +13,7 @@ // served to the page from there as runSuitesInPage's workerUrl. import * as deltic from "../browser-bundle-entry.ts"; -import { workerMain } from "@polymorph/component-test-js/deltic-worker-main"; +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 diff --git a/conformance/driver-ct/deltic/deno.json b/conformance/driver-ct/deltic/deno.json index 4299795..238eaf5 100644 --- a/conformance/driver-ct/deltic/deno.json +++ b/conformance/driver-ct/deltic/deno.json @@ -6,9 +6,9 @@ "@deltic/runtime/shim": "jsr:@deltic/runtime@0.1.0/shim", "@deltic/wasi": "jsr:@deltic/wasi@0.1.0", "@deltic/translator": "jsr:@deltic/translator@0.1.0", - "@polymorph/component-test-js/deltic-worker-main": "./node_modules/@polymorph/component-test-js/js/runner-deltic/worker-main.mjs" + "@polymorph/test/deltic-worker-main": "jsr:@polymorph/test@0.1.1/deltic-worker-main" }, - "minimumDependencyAge": { "age": "P1D", "exclude": ["jsr:@deltic/*"] }, + "minimumDependencyAge": { "age": "P1D", "exclude": ["jsr:@deltic/*", "jsr:@polymorph/*"] }, "tasks": { "check": "deno check run.ts browser/worker-entry.ts browser-bundle-entry.ts" } diff --git a/conformance/driver-ct/deltic/deno.lock b/conformance/driver-ct/deltic/deno.lock index 6bc38aa..8a69d96 100644 --- a/conformance/driver-ct/deltic/deno.lock +++ b/conformance/driver-ct/deltic/deno.lock @@ -7,7 +7,7 @@ "jsr:@deltic/runtime@0.1.0": "0.1.0", "jsr:@deltic/translator@0.1.0": "0.1.0", "jsr:@deltic/wasi@0.1.0": "0.1.0", - "npm:playwright-core@^1.61.1": "1.62.1" + "jsr:@polymorph/test@0.1.1": "0.1.1" }, "jsr": { "@deltic/ct-runner@0.1.0": { @@ -37,12 +37,9 @@ "jsr:@deltic/protocol", "jsr:@deltic/runtime@0.1" ] - } - }, - "npm": { - "playwright-core@1.62.1": { - "integrity": "sha512-wPYSwEBJY9GHraISXqyqtx0na0LpO3XEX7jNDhntbex7tzUS7kLnZsOlFruFJB4Hi/rhDMjXGqHewDZ68nYZVw==", - "bin": true + }, + "@polymorph/test@0.1.1": { + "integrity": "50ce81310c97591c523bbfdbe74e18a806e709ae1c09f47297da98267b5be8b3" } }, "workspace": { @@ -50,10 +47,12 @@ "jsr:@deltic/ct-runner@0.1.0", "jsr:@deltic/runtime@0.1.0", "jsr:@deltic/translator@0.1.0", - "jsr:@deltic/wasi@0.1.0" + "jsr:@deltic/wasi@0.1.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 index 3289abc..c63662d 100644 --- a/conformance/driver-ct/deltic/package.json +++ b/conformance/driver-ct/deltic/package.json @@ -4,7 +4,7 @@ "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": { - "@polymorph/component-test-js": "github:polymorph-components/polymorph-test#b4444a25a22106ad4128549bdc9e579552e62210", + "@jsr/polymorph__test": "0.1.1", "playwright-core": "^1.61.1" } } diff --git a/conformance/driver-ct/deltic/pnpm-lock.yaml b/conformance/driver-ct/deltic/pnpm-lock.yaml index 379b80f..8305485 100644 --- a/conformance/driver-ct/deltic/pnpm-lock.yaml +++ b/conformance/driver-ct/deltic/pnpm-lock.yaml @@ -8,18 +8,17 @@ importers: .: dependencies: - '@polymorph/component-test-js': - specifier: github:polymorph-components/polymorph-test#b4444a25a22106ad4128549bdc9e579552e62210 - version: https://codeload.github.com/polymorph-components/polymorph-test/tar.gz/b4444a25a22106ad4128549bdc9e579552e62210 + '@jsr/polymorph__test': + specifier: 0.1.1 + version: 0.1.1 playwright-core: specifier: ^1.61.1 version: 1.62.1 packages: - '@polymorph/component-test-js@https://codeload.github.com/polymorph-components/polymorph-test/tar.gz/b4444a25a22106ad4128549bdc9e579552e62210': - resolution: {gitHosted: true, integrity: sha512-Dy/z2SUF809cxGKpNl0/4Po1hDmv8RrwjyJpAASdBIYExDBjKjAuP3wuuHYlN81/3+5q+iqwyoDjpqNAxMVM/g==, tarball: https://codeload.github.com/polymorph-components/polymorph-test/tar.gz/b4444a25a22106ad4128549bdc9e579552e62210} - version: 0.1.0 + '@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} playwright-core@1.62.1: resolution: {integrity: sha512-wPYSwEBJY9GHraISXqyqtx0na0LpO3XEX7jNDhntbex7tzUS7kLnZsOlFruFJB4Hi/rhDMjXGqHewDZ68nYZVw==} @@ -28,6 +27,6 @@ packages: snapshots: - '@polymorph/component-test-js@https://codeload.github.com/polymorph-components/polymorph-test/tar.gz/b4444a25a22106ad4128549bdc9e579552e62210': {} + '@jsr/polymorph__test@0.1.1': {} playwright-core@1.62.1: {} diff --git a/conformance/driver-ct/deltic/run-browser.mjs b/conformance/driver-ct/deltic/run-browser.mjs index 474c888..bfef5be 100644 --- a/conformance/driver-ct/deltic/run-browser.mjs +++ b/conformance/driver-ct/deltic/run-browser.mjs @@ -23,8 +23,8 @@ import { buildHarnessPage, findChrome, runPageHarness, -} from "@polymorph/component-test-js/browser-driver"; -import { writeResultsFile } from "@polymorph/component-test-js/node-runner"; +} from "@jsr/polymorph__test/browser-driver"; +import { writeResultsFile } from "@jsr/polymorph__test/node-runner"; import { spawnEchod, unreachableUrl } from "../../server/echod.mjs"; diff --git a/conformance/driver-ct/justfile b/conformance/driver-ct/justfile index d6e004f..4cce623 100644 --- a/conformance/driver-ct/justfile +++ b/conformance/driver-ct/justfile @@ -33,11 +33,11 @@ build-driver: # of truth; same-rev reruns are a no-op "already installed"). The # bootstrap extraction anchors on the crate name, not the repository # URL (URLs change on renames): the sdk's [[package]] block in -# Cargo.lock carries the git source to install from. The pins gate then -# asserts one rev everywhere — a skewed bump runs the JS harness -# against a Rust runner from a different rev. The deltic browser driver's -# lockfile is the only JS pin site left: the WPT parity tree stopped -# consuming the runner core when its jco carrier retired. +# Cargo.lock carries the git source to install from. The JS runner +# core arrives from JSR (@jsr/polymorph__test npm alias); its +# one-version gate is the root justfile's runner-js-pin-check, and the +# version<->rev pairing is the bump procedure's job (see the root +# Cargo.toml's bump comment). _ct-tools: #!/usr/bin/env bash set -euo pipefail @@ -50,7 +50,6 @@ _ct-tools: printf '%s' "$rev" > target/ct-tools/.rev fi target/ct-tools/bin/component-test pins --cargo-lock Cargo.lock \ - --js-lock conformance/driver-ct/deltic/pnpm-lock.yaml \ --expect "$rev" > /dev/null build-echod: diff --git a/justfile b/justfile index b3ab912..5828521 100644 --- a/justfile +++ b/justfile @@ -88,3 +88,24 @@ exam-deltic: exit 1 fi echo "deltic pin: $v" + +# The JS runner core's one-version gate: the deltic-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. +runner-js-pin-check: + #!/usr/bin/env bash + set -euo pipefail + v=$({ grep -A1 "'@jsr/polymorph__test':" \ + conformance/driver-ct/deltic/pnpm-lock.yaml \ + | sed -n "s/.*specifier: *//p"; \ + jq -r '.jsr | keys[]' conformance/driver-ct/deltic/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 + exit 1 + fi + echo "runner-js pin OK: @jsr/polymorph__test $v"