diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b83d515..dac8d73 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,7 +95,7 @@ jobs: # Owns the rev derivation, the rev-keyed tools cache, the # install, and the pins gate; `just conformance`'s _ct-tools # recognizes the stamped install and does not repeat it. - uses: polymorph-components/polymorph-test/actions/setup@2436bb9fd233ec514f10de613556a7a61bbb8476 + uses: polymorph-components/polymorph-test/actions/setup@b4026866e481ead0738742e3b380601b605e5350 with: js-locks: | conformance/driver-ct/jco/package-lock.json @@ -122,7 +122,7 @@ jobs: - run: just gha::conformance-checks - name: Publish the conformance matrix if: always() && hashFiles('conformance/driver-ct/results/*.jsonl') != '' - uses: polymorph-components/polymorph-test/actions/aggregate@2436bb9fd233ec514f10de613556a7a61bbb8476 + uses: polymorph-components/polymorph-test/actions/aggregate@b4026866e481ead0738742e3b380601b605e5350 with: lock: conformance/guest-ct/tests.lock manifest: conformance/driver-ct/targets.toml diff --git a/.gitignore b/.gitignore index 09a3f90..d79ed17 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /conformance/driver-ct/results/ /conformance/driver-ct/jco/node_modules/ /conformance/driver-ct/jco/generated/ +conformance/driver-ct/deltic/node_modules/ diff --git a/Cargo.lock b/Cargo.lock index fa20a0a..b8b0458 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -313,7 +313,7 @@ dependencies = [ [[package]] name = "component-test-core" version = "0.1.0" -source = "git+https://github.com/polymorph-components/polymorph-test?rev=2436bb9fd233ec514f10de613556a7a61bbb8476#2436bb9fd233ec514f10de613556a7a61bbb8476" +source = "git+https://github.com/polymorph-components/polymorph-test?rev=b4026866e481ead0738742e3b380601b605e5350#b4026866e481ead0738742e3b380601b605e5350" dependencies = [ "arcstr", "serde", @@ -322,7 +322,7 @@ dependencies = [ [[package]] name = "component-test-sdk" version = "0.1.0" -source = "git+https://github.com/polymorph-components/polymorph-test?rev=2436bb9fd233ec514f10de613556a7a61bbb8476#2436bb9fd233ec514f10de613556a7a61bbb8476" +source = "git+https://github.com/polymorph-components/polymorph-test?rev=b4026866e481ead0738742e3b380601b605e5350#b4026866e481ead0738742e3b380601b605e5350" dependencies = [ "component-test-core", "component-test-sdk-macro", @@ -334,7 +334,7 @@ dependencies = [ [[package]] name = "component-test-sdk-macro" version = "0.1.0" -source = "git+https://github.com/polymorph-components/polymorph-test?rev=2436bb9fd233ec514f10de613556a7a61bbb8476#2436bb9fd233ec514f10de613556a7a61bbb8476" +source = "git+https://github.com/polymorph-components/polymorph-test?rev=b4026866e481ead0738742e3b380601b605e5350#b4026866e481ead0738742e3b380601b605e5350" dependencies = [ "component-test-core", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index bdc737c..d0cde70 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -55,7 +55,7 @@ futures = { version = "0.3", default-features = false, features = ["std", "async # --cargo-toml Cargo.toml --package-json # conformance/driver-ct/jco/package.json --workflow # .github/workflows/ci.yml`, then the follow-ups it prints. -component-test-sdk = { git = "https://github.com/polymorph-components/polymorph-test", rev = "2436bb9fd233ec514f10de613556a7a61bbb8476" } +component-test-sdk = { git = "https://github.com/polymorph-components/polymorph-test", rev = "b4026866e481ead0738742e3b380601b605e5350" } aead = { version = "0.6", default-features = false, features = ["alloc"] } aes = { version = "0.9", features = ["zeroize"] } diff --git a/conformance/driver-ct/deltic/deno.lock b/conformance/driver-ct/deltic/deno.lock index 281c48d..0427d07 100644 --- a/conformance/driver-ct/deltic/deno.lock +++ b/conformance/driver-ct/deltic/deno.lock @@ -62,5 +62,12 @@ "https://raw.githubusercontent.com/lann/deltic/pre-83fff30/wasi-shims/src/io.ts": "dfe270e5ad3388c02696e27a5c69c58a411759fe8c99416361b0ac10177366da", "https://raw.githubusercontent.com/lann/deltic/pre-83fff30/wasi-shims/src/mod.ts": "1748985cf851252e1755aafd9ebb9c7ae96003ec41322d9524a952062d2b8570", "https://raw.githubusercontent.com/lann/deltic/pre-83fff30/wasi-shims/src/random.ts": "dc04d20de5399cc7fa8685a04ec954618e3994a374ef94535fff408a745425e2" + }, + "workspace": { + "packageJson": { + "dependencies": [ + "npm:playwright-core@1.62.1" + ] + } } } diff --git a/conformance/driver-ct/deltic/fetch-translator.ts b/conformance/driver-ct/deltic/fetch-translator.ts index 16f64d3..4abec1a 100644 --- a/conformance/driver-ct/deltic/fetch-translator.ts +++ b/conformance/driver-ct/deltic/fetch-translator.ts @@ -1,29 +1,38 @@ -// Fetch (and cache) the deltic translator-shim wasm for the pinned release. +// Fetch (and cache) pinned deltic release assets. // // deltic is a runtime linker: components are translated by a wasm build of // its translator, shipped as a release asset so consumers need no Rust -// toolchain. This script downloads that asset once into target/deltic/, -// verifies it against the pinned sha256, and prints the cached path on -// stdout (the `conformance-ct::run-deltic*` recipes capture it). +// toolchain; the browser leg additionally loads `deltic-embedder.mjs` (one +// platform-neutral ES module: embedder API + Translator + runner glue + +// wasi shims). This script downloads the selected asset once into +// target/deltic/, verifies it against the pinned sha256, and prints the +// cached path on stdout (the `conformance-ct::run-deltic*` recipes capture +// it). // -// THE PIN lives here (TAG + TRANSLATOR_SHA256) and in the sibling +// fetch-translator.ts [--asset translator|embedder] (default: translator) +// +// THE PIN lives here (TAG + per-asset sha256) and in the sibling // deno.json's import-map URLs. `assertPinConsistency` fails loud if the -// two drift. Bumping: update TAG here and in deno.json, update -// TRANSLATOR_SHA256 from the release's SHA256SUMS, delete deno.lock, and -// re-run `deno cache run.ts fetch-translator.ts` in this directory to +// two drift. Bumping: update TAG here and in deno.json, update the shas +// from the release's SHA256SUMS, delete deno.lock, and re-run +// `deno cache run.ts fetch-translator.ts` in this directory to // regenerate it (commit the diff). const TAG = "pre-83fff30"; -const TRANSLATOR_SHA256 = - "6d02b363785593595a789d083cda0aebb1de790726718ccf543198354fa3870c"; -const ASSET = "deltic-translator-shim.wasm"; +const ASSETS: Record = { + translator: { + file: "deltic-translator-shim.wasm", + sha256: "6d02b363785593595a789d083cda0aebb1de790726718ccf543198354fa3870c", + }, + embedder: { + file: "deltic-embedder.mjs", + sha256: "b9ceb33c78abdaa4311f681c1388b14a3471f8a17ebd2dbf2dddd4a596df72c3", + }, +}; const HERE = new URL(".", import.meta.url); const REPO_ROOT = new URL("../../../", HERE); const CACHE_DIR = new URL(`target/deltic/${TAG}/`, REPO_ROOT); -const CACHED = new URL(ASSET, CACHE_DIR); -const RELEASE_URL = - `https://github.com/lann/deltic/releases/download/${TAG}/${ASSET}`; async function sha256Hex(bytes: Uint8Array): Promise { const digest = await crypto.subtle.digest( @@ -55,32 +64,46 @@ async function assertPinConsistency(): Promise { async function main() { await assertPinConsistency(); + const flag = Deno.args.indexOf("--asset"); + const name = flag === -1 ? "translator" : Deno.args[flag + 1]; + const asset = ASSETS[name]; + if (!asset) { + throw new Error( + `unknown asset ${JSON.stringify(name)}; expected one of: ${ + Object.keys(ASSETS).join(", ") + }`, + ); + } + const cached = new URL(asset.file, CACHE_DIR); + try { - const bytes = await Deno.readFile(CACHED); - if (await sha256Hex(bytes) === TRANSLATOR_SHA256) { - console.log(CACHED.pathname); + const bytes = await Deno.readFile(cached); + if (await sha256Hex(bytes) === asset.sha256) { + console.log(cached.pathname); return; } - console.error(`cached ${ASSET} has a stale digest; re-fetching`); + console.error(`cached ${asset.file} has a stale digest; re-fetching`); } catch { // not cached yet } - console.error(`fetching ${RELEASE_URL} …`); - const resp = await fetch(RELEASE_URL); + const releaseUrl = + `https://github.com/lann/deltic/releases/download/${TAG}/${asset.file}`; + console.error(`fetching ${releaseUrl} …`); + const resp = await fetch(releaseUrl); if (!resp.ok) { - throw new Error(`GET ${RELEASE_URL}: ${resp.status} ${resp.statusText}`); + throw new Error(`GET ${releaseUrl}: ${resp.status} ${resp.statusText}`); } const bytes = new Uint8Array(await resp.arrayBuffer()); const got = await sha256Hex(bytes); - if (got !== TRANSLATOR_SHA256) { + if (got !== asset.sha256) { throw new Error( - `sha256 mismatch for ${ASSET}@${TAG}:\n want ${TRANSLATOR_SHA256}\n got ${got}`, + `sha256 mismatch for ${asset.file}@${TAG}:\n want ${asset.sha256}\n got ${got}`, ); } await Deno.mkdir(CACHE_DIR, { recursive: true }); - await Deno.writeFile(CACHED, bytes); - console.log(CACHED.pathname); + await Deno.writeFile(cached, bytes); + console.log(cached.pathname); } await main(); diff --git a/conformance/driver-ct/deltic/package-lock.json b/conformance/driver-ct/deltic/package-lock.json new file mode 100644 index 0000000..f528859 --- /dev/null +++ b/conformance/driver-ct/deltic/package-lock.json @@ -0,0 +1,32 @@ +{ + "name": "@polymorph/tls-conformance-deltic-browser", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@polymorph/tls-conformance-deltic-browser", + "dependencies": { + "@polymorph/component-test-js": "github:polymorph-components/polymorph-test#b4026866e481ead0738742e3b380601b605e5350", + "playwright-core": "1.62.1" + } + }, + "node_modules/@polymorph/component-test-js": { + "version": "0.2.0", + "resolved": "git+ssh://git@github.com/polymorph-components/polymorph-test.git#b4026866e481ead0738742e3b380601b605e5350", + "integrity": "sha512-yjekMTYYvlXG1ZI6LGw+ySuCZqhBHz7WXkyjpPsCZQkz+hxIRNF/kiemakwfCGiD7f4xf64Hb6sKV18K7d7MjQ==", + "license": "Apache-2.0 WITH LLVM-exception" + }, + "node_modules/playwright-core": { + "version": "1.62.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.62.1.tgz", + "integrity": "sha512-wPYSwEBJY9GHraISXqyqtx0na0LpO3XEX7jNDhntbex7tzUS7kLnZsOlFruFJB4Hi/rhDMjXGqHewDZ68nYZVw==", + "license": "Apache-2.0", + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=20" + } + } + } +} diff --git a/conformance/driver-ct/deltic/package.json b/conformance/driver-ct/deltic/package.json new file mode 100644 index 0000000..13d1136 --- /dev/null +++ b/conformance/driver-ct/deltic/package.json @@ -0,0 +1,10 @@ +{ + "name": "@polymorph/tls-conformance-deltic-browser", + "private": true, + "type": "module", + "description": "Node driver for the deltic-browser conformance rows: the composed artifacts runtime-linked inside headless Chromium through the upstream page driver and deltic worker.", + "dependencies": { + "@polymorph/component-test-js": "github:polymorph-components/polymorph-test#b4026866e481ead0738742e3b380601b605e5350", + "playwright-core": "1.62.1" + } +} diff --git a/conformance/driver-ct/deltic/run-browser.mjs b/conformance/driver-ct/deltic/run-browser.mjs new file mode 100644 index 0000000..57b8ed6 --- /dev/null +++ b/conformance/driver-ct/deltic/run-browser.mjs @@ -0,0 +1,98 @@ +// The deltic-browser leg: both composed artifacts run runtime-linked +// inside headless Chromium — the page, worker pool, stall watchdog, and +// Chrome ladder all live in @polymorph/component-test-js, and the +// upstream DELTIC worker (js/runner-deltic/browser-worker.mjs) loads the +// pinned deltic-embedder.mjs release asset and links the suite in the +// browser: no transpile step, no generated tree. This file is the frame: +// asset URL wiring, target configuration, and results-file writing — +// the browser sibling of ../deltic/run.ts exactly as ../jco/run-browser.mjs +// is the browser sibling of ../jco/run-node.mjs. +// +// The artifacts import only wasi 0.2 and test-context, so there is no +// SUT host module on this leg and the stock upstream worker serves it +// unmodified (wasiShims + test-context are inside the bundle). +// +// Gates in CI (the Actions runner image ships Chrome); locally it runs +// under CONFORMANCE_BROWSER=1 (`just conformance-ct::all`) or directly +// via `just conformance-ct::run-deltic-browser`. The justfile recipe +// fetches the sha256-pinned release assets first (fetch-translator.ts +// --asset translator|embedder), cached under target/deltic// and +// served to the page from the repository-root server. +import { dirname, join } from "node:path"; +import { fileURLToPath } from "node:url"; +import { parseArgs } from "node:util"; + +import { + buildHarnessPage, + findChrome, + MOUNT, + runPageHarness, +} from "@polymorph/component-test-js/browser-driver"; +import { writeResultsFile } from "@polymorph/component-test-js/node-runner"; + +const DELTIC_DIR = dirname(fileURLToPath(import.meta.url)); +const REPO_ROOT = join(DELTIC_DIR, "..", "..", ".."); +// Must agree with fetch-translator.ts's TAG (assets are served from its +// cache directory). +const TAG = "pre-83fff30"; +const ASSETS = `/target/deltic/${TAG}`; +const CASE_TIMEOUT_MS = 60_000; +const STALL_TIMEOUT_MS = 90_000; + +const { values } = parseArgs({ + options: { + out: { type: "string", default: join(DELTIC_DIR, "..", "results") }, + }, +}); + +const common = { + suite: "conformance-guest-ct", + bundleUrl: `${ASSETS}/deltic-embedder.mjs`, + translatorUrl: `${ASSETS}/deltic-translator-shim.wasm`, + caseTimeoutMs: CASE_TIMEOUT_MS, +}; +const SUITES = [ + { + ...common, + target: "deltic-browser", + suiteUrl: "/target/conformance/suite-plain.wasm", + missing: ["delegated-signer"], + }, + { + ...common, + target: "deltic-browser-delegated", + suiteUrl: "/target/conformance/suite-delegated.wasm", + missing: [], + }, +]; + +const playwright = await import("playwright-core"); +const outcome = await runPageHarness({ + playwright, + engine: "chromium", + executablePath: await findChrome(), + repoRoot: REPO_ROOT, + html: buildHarnessPage({ + title: "polymorph:tls conformance (deltic-browser)", + config: { + jobs: 1, + workerUrl: `${MOUNT}/js/runner-deltic/browser-worker.mjs`, + suites: SUITES, + }, + }), + stallTimeoutMs: STALL_TIMEOUT_MS, +}); + +let failed = 0; +for (const { target } of SUITES) { + const run = outcome[target]; + if (!run) throw new Error(`the page reported no run for target ${target}`); + const outPath = await writeResultsFile({ dir: values.out, target, lines: run.lines }); + const c = run.counts; + process.stderr.write( + `${target}: ${c.passed} passed, ${c.failed} failed, ${c.skipped} skipped, ` + + `${c.na} not applicable, ${c.total} total (wrote ${outPath})\n`, + ); + failed += c.failed; +} +process.exit(failed === 0 ? 0 : 1); diff --git a/conformance/driver-ct/jco/jco-transpile.mjs b/conformance/driver-ct/jco/jco-transpile.mjs new file mode 100644 index 0000000..ee27fa7 --- /dev/null +++ b/conformance/driver-ct/jco/jco-transpile.mjs @@ -0,0 +1,87 @@ +#!/usr/bin/env node +// Vendored from polymorph-test (js/jco-transpile.mjs at 2436bb9, deleted +// there when that repo went jco-free): a thin CLI over +// @bytecodealliance/jco-transpile, covering the two jco +// commands the conformance consumers use: `transpile` (component to ES +// module) and `types` (host-side type definitions for a WIT world). +// jco-transpile is the transpilation half of jco, published without +// the componentization toolchain (componentize-js, weval) that the +// full jco CLI drags in and nothing here runs. +// +// The library is resolved from the invoking package's node_modules — +// each consumer pins its own toolchain version — so this bin must run +// with the consumer's package directory as the working directory, +// which is how package.json scripts invoke it. +// +// The option spellings match the jco CLI's, and the library applies +// the same defaults the CLI did (name derivation, the wasi-shim map +// entries, output-path prefixing), so the generated trees are +// bit-identical to `jco transpile` / `jco types` output for these +// invocations. + +import { createRequire } from "node:module"; +import { join } from "node:path"; +import { pathToFileURL } from "node:url"; +import { parseArgs } from "node:util"; + +const require = createRequire(join(process.cwd(), "package.json")); +const { transpile, generateHostTypes, writeFiles } = await import( + pathToFileURL(require.resolve("@bytecodealliance/jco-transpile")).href +); + +const [command, path, ...rest] = process.argv.slice(2); +const { values } = parseArgs({ + args: rest, + options: { + name: { type: "string" }, + "async-mode": { type: "string" }, + instantiation: { type: "string", short: "I" }, + map: { type: "string", multiple: true }, + "world-name": { type: "string" }, + "out-dir": { type: "string", short: "o" }, + // Never answer an async-lowered import with a bare RETURNED status; + // required for componentize-js guests, whose lowering does not + // implement the returned-immediately case (see the option's doc in + // jco-transpile). + "no-eager-subtask-return": { type: "boolean" }, + // `types` only: WIT `@unstable` gates to enable, like `jco types + // --feature` (repeatable). + feature: { type: "string", multiple: true }, + }, +}); + +switch (command) { + case "transpile": { + const map = Object.fromEntries( + (values.map ?? []).map((entry) => { + const eq = entry.indexOf("="); + if (eq === -1) { + throw new Error(`--map entry has no '=': ${entry}`); + } + return [entry.slice(0, eq), entry.slice(eq + 1)]; + }), + ); + const { files } = await transpile(path, { + name: values.name, + asyncMode: values["async-mode"], + instantiation: values.instantiation, + map, + outDir: values["out-dir"], + noEagerSubtaskReturn: values["no-eager-subtask-return"], + }); + await writeFiles(files); + break; + } + case "types": { + const files = await generateHostTypes(path, { + worldName: values["world-name"], + asyncMode: values["async-mode"], + outDir: values["out-dir"], + features: values.feature, + }); + await writeFiles(files); + break; + } + default: + throw new Error(`unknown command: ${command} (expected transpile or types)`); +} diff --git a/conformance/driver-ct/jco/package-lock.json b/conformance/driver-ct/jco/package-lock.json index d7422ae..42950aa 100644 --- a/conformance/driver-ct/jco/package-lock.json +++ b/conformance/driver-ct/jco/package-lock.json @@ -10,7 +10,7 @@ "devDependencies": { "@bytecodealliance/jco-transpile": "https://github.com/lann/jco/releases/download/all-fixes-dbad4d7/bytecodealliance-jco-transpile-0.6.3-gdbad4d7.tgz", "@bytecodealliance/preview2-shim": "https://github.com/lann/jco/releases/download/all-fixes-dbad4d7/bytecodealliance-preview2-shim-0.20.1-gdbad4d7.tgz", - "@polymorph/component-test-js": "github:polymorph-components/polymorph-test#2436bb9fd233ec514f10de613556a7a61bbb8476", + "@polymorph/component-test-js": "github:polymorph-components/polymorph-test#b4026866e481ead0738742e3b380601b605e5350", "playwright-core": "1.62.1" }, "engines": { @@ -485,13 +485,10 @@ }, "node_modules/@polymorph/component-test-js": { "version": "0.2.0", - "resolved": "git+ssh://git@github.com/polymorph-components/polymorph-test.git#2436bb9fd233ec514f10de613556a7a61bbb8476", - "integrity": "sha512-QMD+V9RMpyAEI6oRd+q76qvkjrUi7UrYFrRO27/Hn6bYrj1UqDnBwUqtbqpVvuszkVXnYjGoXOWJezbunn7VTQ==", + "resolved": "git+ssh://git@github.com/polymorph-components/polymorph-test.git#b4026866e481ead0738742e3b380601b605e5350", + "integrity": "sha512-yjekMTYYvlXG1ZI6LGw+ySuCZqhBHz7WXkyjpPsCZQkz+hxIRNF/kiemakwfCGiD7f4xf64Hb6sKV18K7d7MjQ==", "dev": true, - "license": "Apache-2.0 WITH LLVM-exception", - "bin": { - "component-test-jco-transpile": "js/jco-transpile.mjs" - } + "license": "Apache-2.0 WITH LLVM-exception" }, "node_modules/@tybys/wasm-util": { "version": "0.10.3", diff --git a/conformance/driver-ct/jco/package.json b/conformance/driver-ct/jco/package.json index 97fd361..6c7188f 100644 --- a/conformance/driver-ct/jco/package.json +++ b/conformance/driver-ct/jco/package.json @@ -5,18 +5,18 @@ "type": "module", "description": "jco-node legs for the component-test conformance suite: transpile the composed artifacts (suite + TLS delivery, fused by wac) and run them under Node 24 JSPI against the upstream harness core; the artifacts import only wasi 0.2 and test-context, so there is no SUT host module.", "scripts": { - "transpile": "component-test-jco-transpile transpile ../../../target/conformance/suite-plain.wasm --name suite-plain -I async -o generated", - "transpile:delegated": "component-test-jco-transpile transpile ../../../target/conformance/suite-delegated.wasm --name suite-delegated -I async -o generated", + "transpile": "node ./jco-transpile.mjs transpile ../../../target/conformance/suite-plain.wasm --name suite-plain -I async -o generated", + "transpile:delegated": "node ./jco-transpile.mjs transpile ../../../target/conformance/suite-delegated.wasm --name suite-delegated -I async -o generated", "run:node": "node --experimental-wasm-jspi run-node.mjs", "run:browser": "node run-browser.mjs" }, "devDependencies": { "@bytecodealliance/jco-transpile": "https://github.com/lann/jco/releases/download/all-fixes-dbad4d7/bytecodealliance-jco-transpile-0.6.3-gdbad4d7.tgz", "@bytecodealliance/preview2-shim": "https://github.com/lann/jco/releases/download/all-fixes-dbad4d7/bytecodealliance-preview2-shim-0.20.1-gdbad4d7.tgz", - "@polymorph/component-test-js": "github:polymorph-components/polymorph-test#2436bb9fd233ec514f10de613556a7a61bbb8476", + "@polymorph/component-test-js": "github:polymorph-components/polymorph-test#b4026866e481ead0738742e3b380601b605e5350", "playwright-core": "1.62.1" }, "engines": { "node": ">=24" } -} +} \ No newline at end of file diff --git a/conformance/driver-ct/justfile b/conformance/driver-ct/justfile index d1c25a1..1f3d389 100644 --- a/conformance/driver-ct/justfile +++ b/conformance/driver-ct/justfile @@ -49,6 +49,7 @@ _ct-tools: fi {{ct}} pins --cargo-lock Cargo.lock \ --js-lock conformance/driver-ct/jco/package-lock.json \ + --js-lock conformance/driver-ct/deltic/package-lock.json \ --expect "$rev" > /dev/null # Check the committed case inventory against the built suite. @@ -151,6 +152,43 @@ run-deltic-delegated: build --suite suite-delegated \ --target deltic-deno-delegated --translator "$translator" +# The deltic browser driver's npm tree (the upstream page driver + +# playwright-core; no transpiler). +_deltic-browser-prepared: build + #!/usr/bin/env bash + set -euo pipefail + cd {{root}}/conformance/driver-ct/deltic + if [ package-lock.json -nt node_modules/.package-lock.json ]; then + npm ci --no-audit --no-fund + fi + +# Both composed artifacts runtime-linked inside headless Chromium: the +# upstream deltic worker loads the pinned embedder bundle and links the +# suite in the browser — no transpile step, no generated tree. +run-deltic-browser: _deltic-browser-prepared + #!/usr/bin/env bash + set -euo pipefail + cd {{root}}/conformance/driver-ct/deltic + deno run --allow-read=. --allow-write=../../../target/deltic \ + --allow-net=github.com,objects.githubusercontent.com,release-assets.githubusercontent.com \ + fetch-translator.ts --asset translator >/dev/null + deno run --allow-read=. --allow-write=../../../target/deltic \ + --allow-net=github.com,objects.githubusercontent.com,release-assets.githubusercontent.com \ + fetch-translator.ts --asset embedder >/dev/null + node run-browser.mjs + +# Runs the deltic browser leg under CI or CONFORMANCE_BROWSER=1; +# otherwise clears stale results so the standing run is deterministic. +_run-deltic-browser-if-enabled: + #!/usr/bin/env bash + set -euo pipefail + if [ "${GITHUB_ACTIONS:-}" = "true" ] || [ "${CONFORMANCE_BROWSER:-}" = "1" ]; then + cd {{root}} && just conformance-ct::run-deltic-browser + else + cd {{root}} + rm -f {{results}}/deltic-browser.jsonl {{results}}/deltic-browser-delegated.jsonl + fi + # The on-demand third target: the `tls-delegated` world over the # webcrypto-signer shim and a real polymorph:webcrypto provider, cloned # and built at the rev pinned alongside the shim's vendored WIT. @@ -191,6 +229,8 @@ aggregate: _ct-tools [ -f {{results}}/composed-delegated-webcrypto.jsonl ] && extra+=(--results composed-delegated-webcrypto={{results}}/composed-delegated-webcrypto.jsonl) [ -f {{results}}/jco-browser.jsonl ] && extra+=(--results jco-browser={{results}}/jco-browser.jsonl) [ -f {{results}}/jco-browser-delegated.jsonl ] && extra+=(--results jco-browser-delegated={{results}}/jco-browser-delegated.jsonl) + [ -f {{results}}/deltic-browser.jsonl ] && extra+=(--results deltic-browser={{results}}/deltic-browser.jsonl) + [ -f {{results}}/deltic-browser-delegated.jsonl ] && extra+=(--results deltic-browser-delegated={{results}}/deltic-browser-delegated.jsonl) {{ct}} aggregate \ --lock conformance/guest-ct/tests.lock \ --manifest conformance/driver-ct/targets.toml \ @@ -227,7 +267,7 @@ _run-browser-if-enabled: # The standing matrix: inventory check, all standing targets, # aggregate. Stale on-demand webcrypto results are cleared first so the # standing run is deterministic. -all: lock-check run-composed run-delegated run-jco-node run-jco-node-delegated run-deltic run-deltic-delegated _run-browser-if-enabled _clear-webcrypto aggregate +all: lock-check run-composed run-delegated run-jco-node run-jco-node-delegated run-deltic run-deltic-delegated _run-browser-if-enabled _run-deltic-browser-if-enabled _clear-webcrypto aggregate _clear-webcrypto: rm -f results/composed-delegated-webcrypto.jsonl diff --git a/conformance/driver-ct/matrix.md b/conformance/driver-ct/matrix.md index f67be1e..02cd69c 100644 --- a/conformance/driver-ct/matrix.md +++ b/conformance/driver-ct/matrix.md @@ -4,13 +4,13 @@ - target `composed-delegated-webcrypto`: no results (declared optional) -| Case | composed | composed-delegated | composed-delegated-webcrypto | deltic-deno | deltic-deno-delegated | jco-browser | jco-browser-delegated | jco-node | jco-node-delegated | -| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| data (1 cases) | pass | pass | — | pass | pass | pass | pass | pass | pass | -| delegated (3 cases) | 2 N/A, 1 pass | 1 N/A, 2 pass | — | 2 N/A, 1 pass | 1 N/A, 2 pass | 2 N/A, 1 pass | 1 N/A, 2 pass | 2 N/A, 1 pass | 1 N/A, 2 pass | -| handshake (1 cases) | pass | pass | — | pass | pass | pass | pass | pass | pass | -| identity (1 cases) | pass | pass | — | pass | pass | pass | pass | pass | pass | -| shutdown (1 cases) | pass | pass | — | pass | pass | pass | pass | pass | pass | +| Case | composed | composed-delegated | composed-delegated-webcrypto | deltic-browser | deltic-browser-delegated | deltic-deno | deltic-deno-delegated | jco-browser | jco-browser-delegated | jco-node | jco-node-delegated | +| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | +| data (1 cases) | pass | pass | — | pass | pass | pass | pass | pass | pass | pass | pass | +| delegated (3 cases) | 2 N/A, 1 pass | 1 N/A, 2 pass | — | 2 N/A, 1 pass | 1 N/A, 2 pass | 2 N/A, 1 pass | 1 N/A, 2 pass | 2 N/A, 1 pass | 1 N/A, 2 pass | 2 N/A, 1 pass | 1 N/A, 2 pass | +| handshake (1 cases) | pass | pass | — | pass | pass | pass | pass | pass | pass | pass | pass | +| identity (1 cases) | pass | pass | — | pass | pass | pass | pass | pass | pass | pass | pass | +| shutdown (1 cases) | pass | pass | — | pass | pass | pass | pass | pass | pass | pass | pass | ## Failures @@ -21,6 +21,8 @@ None. - `composed`: 2 N/A, 5 pass (7 total) - `composed-delegated`: 1 N/A, 6 pass (7 total) - `composed-delegated-webcrypto`: no results +- `deltic-browser`: 2 N/A, 5 pass (7 total) +- `deltic-browser-delegated`: 1 N/A, 6 pass (7 total) - `deltic-deno`: 2 N/A, 5 pass (7 total) - `deltic-deno-delegated`: 1 N/A, 6 pass (7 total) - `jco-browser`: 2 N/A, 5 pass (7 total) diff --git a/conformance/driver-ct/targets.toml b/conformance/driver-ct/targets.toml index 38da8fa..e54bfb2 100644 --- a/conformance/driver-ct/targets.toml +++ b/conformance/driver-ct/targets.toml @@ -67,3 +67,15 @@ optional = true [targets.jco-browser-delegated] missing-features = [] optional = true + +# The composed artifact runtime-linked inside headless Chromium (the +# upstream deltic worker; no transpile step). +[targets.deltic-browser] +missing-features = ["delegated-signer"] +optional = true + +# The composed-delegated artifact runtime-linked inside headless +# Chromium. +[targets.deltic-browser-delegated] +missing-features = [] +optional = true