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
2 changes: 1 addition & 1 deletion js/runner-deltic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ repo bundles one worker entry — the deltic engine surface, the message
loop, and its own host module, resolved through one import map — and
passes `workerMain({ deltic, suiteImports })` its inlined engine and an
import-record factory. One bundle means one embedder module instance,
which is what keeps `instanceof WitError` true across the host-module
which is what keeps `instanceof ComponentException` true across the host-module
boundary; workers resolve no import maps, so this is the only sound
shape. The stock `browser-worker.mjs` is `workerMain()` with the
bundleUrl-loading defaults.
Expand Down
10 changes: 5 additions & 5 deletions js/runner-deltic/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
// re-run `deno install --entrypoint runner.ts browser-bundle-entry.ts` in
// this directory, and commit the diff (see README.md "Pinning").
"imports": {
"@deltic/ct-runner": "jsr:@deltic/ct-runner@0.1.0-pre.ga67ee83",
"@deltic/runtime/embedder": "jsr:@deltic/runtime@0.1.0-pre.ga67ee83/embedder",
"@deltic/runtime/shim": "jsr:@deltic/runtime@0.1.0-pre.ga67ee83/shim",
"@deltic/translator": "jsr:@deltic/translator@0.1.0-pre.ga67ee83",
"@deltic/wasi-shims": "jsr:@deltic/wasi-shims@0.1.0-pre.ga67ee83"
"@deltic/ct-runner": "jsr:@deltic/ct-runner@0.1.0-pre.g078aa15",
"@deltic/runtime/embedder": "jsr:@deltic/runtime@0.1.0-pre.g078aa15/embedder",
"@deltic/runtime/shim": "jsr:@deltic/runtime@0.1.0-pre.g078aa15/shim",
"@deltic/translator": "jsr:@deltic/translator@0.1.0-pre.g078aa15",
"@deltic/wasi-shims": "jsr:@deltic/wasi-shims@0.1.0-pre.g078aa15"
},
// Deno's supply-chain minimum-dependency-age gate (24h default) applies
// even to exact prerelease pins; deltic publishes per commit, so the
Expand Down
48 changes: 28 additions & 20 deletions js/runner-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 js/runner-deltic/engine.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @param {object} [input.hostImports] SUT host-import record fragments
* (interface id -> implementation), merged over the engine's wasi +
* test-context imports. MUST be built against the same embedder module
* instance as `bundle` (one WitError class; see worker-main.mjs).
* instance as `bundle` (one ComponentException class; see worker-main.mjs).
* @returns {Promise<{newTests: () => Promise<object>, Context, tagsOf}>}
*/
export async function loadSuite(
Expand Down
5 changes: 3 additions & 2 deletions js/runner-deltic/worker-main.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
// (`polymorph:websocket/connections`, `polymorph:webcrypto/*`, …) that
// the stock worker cannot supply: workers resolve no import maps, so the
// host module and the deltic engine must arrive in ONE bundle or the
// embedder module loads twice and `instanceof WitError` stops holding
// across the boundary. The downstream pattern is a bundled worker entry:
// embedder module loads twice and `instanceof ComponentException` stops
// holding across the boundary. The downstream pattern is a bundled worker
// entry:
//
// // worker-entry.ts — deno bundle --platform browser
// import * as deltic from "./browser-bundle-entry.ts"; // jsr:@deltic/*
Expand Down
14 changes: 10 additions & 4 deletions js/viewer/harness.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,18 @@ export async function runCases({
}
} catch (e) {
const payload = e?.payload ?? e;
if (payload?.tag === "failed") {
// Shape-compatible read: the deltic runner lifts err-result values as
// A10 `{ kind, value }`; the jco-era node runner still emits the
// pre-A10 `{ tag, val }` — this harness is shared by both, so read
// either spelling rather than picking one.
const kind = payload?.kind ?? payload?.tag;
const value = payload && "value" in payload ? payload.value : payload?.val;
if (kind === "failed") {
failed++;
event = { case: name, status: "fail", provenance: "returned", detail: payload.val };
} else if (payload?.tag === "skipped") {
event = { case: name, status: "fail", provenance: "returned", detail: value };
} else if (kind === "skipped") {
skipped++;
event = { case: name, status: "skipped", provenance: "returned", detail: payload.val };
event = { case: name, status: "skipped", provenance: "returned", detail: value };
} else {
failed++;
event = {
Expand Down
20 changes: 17 additions & 3 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,15 @@ verify-cli: build
# specifier in every deno.json, and every @deltic package the lock
# resolves, must name the SAME prerelease — one version names one
# upstream commit, and the browser assets are built from that same graph.
#
# CONTRACT: as of deltic pre-b297834 (A10), @deltic/protocol ships as a
# stable, independently-versioned package (0.1.0, no per-commit prerelease
# hash) that @deltic/runtime/wasi-shims depend on transitively — it is not
# named by any jsr:@deltic/*@<hash> specifier in deno.json and isn't part
# of the "one version names one commit" pin this gate polices. Excluded by
# name rather than by pattern, so drift in any *other* @deltic package
# still trips the gate. See contracts/embedder-api.md "Migration notes"
# (upstream, pre-b297834) and js/runner-deltic/deno.lock.
deltic-pin-gate:
#!/usr/bin/env bash
set -euo pipefail
Expand All @@ -149,14 +158,19 @@ deltic-pin-gate:
python3 - "$v" js/runner-deltic/deno.lock <<'PY'
import json, sys
want, lock = sys.argv[1], json.load(open(sys.argv[2]))
stable = {"@deltic/protocol"} # see CONTRACT note above deltic-pin-gate
def pkg_name(k):
# k looks like "jsr:@deltic/foo@1.2.3" or "@deltic/foo@1.2.3"
rest = k[len("jsr:"):] if k.startswith("jsr:") else k
return rest.rsplit("@", 1)[0]
bad = {k: r for k, r in lock.get("specifiers", {}).items()
if "@deltic/" in k and r != want}
if "@deltic/" in k and r != want and pkg_name(k) not in stable}
bad.update({k: k for k in lock.get("jsr", {}) if k.startswith("@deltic/")
and not k.endswith("@" + want)})
and not k.endswith("@" + want) and pkg_name(k) not in stable})
if bad:
sys.exit(f"deltic lock drift (want {want}): {sorted(bad)}")
PY
echo "deltic pin gate: all @deltic packages pinned to $v"
echo "deltic pin gate: all @deltic packages pinned to $v (protocol excluded, stable)"

# The deltic browser-leg assets, built from the pinned JSR graph (no
# network fetch, no sha bookkeeping — deno.lock carries JSR package
Expand Down
Loading