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
1 change: 1 addition & 0 deletions .github/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}`).
Expand Down
21 changes: 10 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <rev> --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 <rev> --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"
Expand Down
10 changes: 5 additions & 5 deletions conformance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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#<rev>` 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).
1 change: 1 addition & 0 deletions conformance/driver-ct/deltic/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@jsr:registry=https://npm.jsr.io
4 changes: 2 additions & 2 deletions conformance/driver-ct/deltic/browser/worker-entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
// 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
// `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/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
Expand Down
4 changes: 2 additions & 2 deletions conformance/driver-ct/deltic/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
15 changes: 7 additions & 8 deletions conformance/driver-ct/deltic/deno.lock

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

2 changes: 1 addition & 1 deletion conformance/driver-ct/deltic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
13 changes: 6 additions & 7 deletions conformance/driver-ct/deltic/pnpm-lock.yaml

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

4 changes: 2 additions & 2 deletions conformance/driver-ct/deltic/run-browser.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
11 changes: 5 additions & 6 deletions conformance/driver-ct/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
21 changes: 21 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Loading