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 @@ -31,6 +31,7 @@ rust-checks:
@just gha::_step test

conformance-checks:
@just gha::_step exam-deltic
@just gha::_step conformance-ct::all
@just gha::_step deltic-module-check
@just gha::_step wpt::parity
Expand Down
21 changes: 11 additions & 10 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@ Layout (each directory's justfile module in parentheses):
Its knobs are exported functions (`configure`,
`setMaxInboundBufferBytes`, `setConnectTimeoutMs`, `setCloseTimeoutMs`);
the module reads no ambient configuration. The
deltic release is pinned in `conformance/driver-ct/deltic/fetch-translator.ts`
(TAG + translator-shim sha256) and in TWO import maps —
`js/deltic/deno.json` and `conformance/driver-ct/deltic/deno.json` —
which must agree byte-for-byte on the `@deltic/runtime/embedder` URL
(deltic's `wasi-shims` imports it by bare specifier internally, so a
drift would load the embedder module twice and break `instanceof
WitError` across the boundary). Bump procedure:
`conformance/driver-ct/deltic/README.md`.
deltic release is pinned in TWO import maps — `js/deltic/deno.json` and
`conformance/driver-ct/deltic/deno.json` — as exact-pinned JSR
prereleases (`jsr:@deltic/<pkg>@0.1.0-pre.g<hash>`; a version names one
upstream commit) which must agree on the `@deltic/runtime` version
(deltic's `wasi-shims` imports `@deltic/runtime/embedder` by bare
specifier internally, so a drift would load the embedder module twice
and break `instanceof WitError` across the boundary); the root
justfile's `exam-deltic` recipe (CI-wired) asserts one version
repo-wide. Bump procedure: `conformance/driver-ct/deltic/README.md`.
- `js/componentize/` (`just wpt::…`) — `websocket.js`, the WHATWG-API
shim for componentize-js guests (deviations registry in its header), and
the WPT parity gate (`wpt/README.md` is the vendoring policy; losses
Expand All @@ -64,8 +65,8 @@ Layout (each directory's justfile module in parentheses):
records (`conformance-ct::_ct-tools`). One rev everywhere; 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 release assets (single pin site:
`driver-ct/deltic/{deno.json,deno.lock,fetch-translator.ts}`).
deltic JSR prereleases (single pin site: `driver-ct/deltic/{deno.json,
deno.lock}`).
- `examples/` (`just demo::…`) — the echo-demo guest and its host runners.

Checks to run before committing, by what changed: WIT or `wit/README.md` →
Expand Down
66 changes: 39 additions & 27 deletions conformance/driver-ct/deltic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,46 @@ exact mirror.
just conformance-ct::run-deltic
```

which builds the suite + echod, fetches (and caches) the pinned
translator-shim release asset, and runs the suite through `ct-runner`,
writing `conformance/driver-ct/results/deltic-deno.jsonl`.
which builds the suite + echod and runs the suite through `ct-runner`,
writing `conformance/driver-ct/results/deltic-deno.jsonl`. The translator
comes from the packaged `@deltic/translator` JSR prerelease through the
module graph — no fetch step, no net grant.

## The pin

deltic is pinned to a release tag in **three** places, cross-checked at
run time by `fetch-translator.ts`:

- `deno.json` (this directory) — import-map URLs
(`raw.githubusercontent.com/lann/deltic/<tag>/…`) for `@deltic/ct-runner`,
`@deltic/runtime/embedder`, `@deltic/runtime/shim`, `@deltic/wasi-shims`.
`deno.lock` carries integrity hashes for that module graph, enforced
with `--frozen`.
deltic publishes `@deltic/{runtime,translator,wasi-shims,ct-runner}` to
JSR as exact-pinned prereleases (`0.1.0-pre.g<shorthash>`, the same short
hash as the corresponding GitHub release — a version names one exact
upstream commit; see deltic's README "Consuming the unstable
prereleases"). It is pinned in **two** places, both required to agree:

- `deno.json` (this directory) — import-map versions
(`jsr:@deltic/<pkg>@0.1.0-pre.g<hash>`) for `@deltic/ct-runner`,
`@deltic/runtime/embedder`, `@deltic/runtime/shim`, `@deltic/wasi-shims`,
`@deltic/translator`. `deno.lock` carries integrity hashes for that
module graph, enforced with `--frozen`.
- [`../../../js/deltic/deno.json`](../../../js/deltic/deno.json) — the
SAME `@deltic/runtime/embedder` URL (the module-identity constraint:
deltic's `wasi-shims` imports that specifier by bare name internally,
so every config resolving it must agree, or the embedder module loads
twice and `instanceof WitError` stops holding across the boundary).
- `fetch-translator.ts` — `TAG` + `TRANSLATOR_SHA256` for the
`deltic-translator-shim.wasm` release asset (cached under
`target/deltic/<tag>/`).

To bump: update the tag in all three files (this `deno.json`,
`js/deltic/deno.json`, and `fetch-translator.ts`) and the sha256 from the
release's `SHA256SUMS`, delete BOTH `deno.lock` files (this directory and
`js/deltic/`), re-run `deno cache run.ts fetch-translator.ts` here and
`deno cache websocket.ts tests/websocket_test.ts` in `js/deltic/` to
regenerate them, then re-run `just conformance-ct::run-deltic` and commit
the diff (including the regenerated `matrix.md`, via
`just conformance-ct::matrix-update`).
SAME `@deltic/runtime` version (the module-identity constraint: deltic's
`wasi-shims` imports `@deltic/runtime/embedder` by bare specifier
internally, so every config resolving it must agree, or the embedder
module loads twice and `instanceof WitError` stops holding across the
boundary).

`@deltic/translator` ships the translator wasm asset **for the same
commit** as `@deltic/runtime`, so the plan-format coupling is
self-consistent per graph by construction — there is no separate sha256
to track. The root justfile's `exam-deltic` recipe (wired into CI) is the
one-version-everywhere gate: it asserts every `jsr:@deltic/*` import
across both `deno.json` files names the identical version.

Both `deno.json`s carry
`"minimumDependencyAge": { "age": "P1D", "exclude": ["jsr:@deltic/*"] }`
(verbatim from deltic's README): Deno's 24-hour supply-chain gate would
otherwise block resolving a same-day publish.

To bump: update the version in both `deno.json` import maps, delete
**both** `deno.lock` files (this directory and `js/deltic/`), regenerate
with `deno install` (or `deno check`) in each directory, then re-run
`just conformance-ct::run-deltic` and commit the diff (including the
regenerated `matrix.md`, via `just conformance-ct::matrix-update`).
`exam-deltic` fails loud on any drift between the two configs.
18 changes: 18 additions & 0 deletions conformance/driver-ct/deltic/browser-bundle-entry.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// The deltic-browser worker's bundle entry for the engine surface:
// upstream's tools/release-bundle/entry.ts public surface, reproduced
// locally now that deltic publishes JSR prereleases instead of a
// pinned raw-URL release bundle (see ../../../README.md's deltic pin
// story and js/deltic/deno.json's MODULE-IDENTITY comment).
//
// Bundled with `deno bundle --platform browser` from THIS directory (so
// every re-export resolves through this directory's deno.json import
// map — the single deltic pin site), the emitted module is what
// browser/worker-entry.ts imports as `@deltic/release-bundle-entry`
// used to. Same export surface: instantiate/Translator/runSuite/
// wasiShims/WitError/artifactsFromEnvelope and friends (49 exports
// verified against the retired upstream entry).
export * from "@deltic/runtime/embedder";
export { Translator } from "@deltic/runtime/shim";
export * from "@deltic/ct-runner";
export { wasiShims } from "@deltic/wasi-shims";
export type { WasiShims, WasiShimsOptions } from "@deltic/wasi-shims";
17 changes: 9 additions & 8 deletions conformance/driver-ct/deltic/browser/worker-entry.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
// The deltic-browser shard worker's bundle entry: the deltic engine
// surface (the release-bundle entry at the pinned tag), the upstream
// worker message loop, and this repo's deltic host module, resolved
// through ONE import map so the emitted bundle carries exactly one
// embedder module instance — which is what keeps `instanceof WitError`
// 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 runner-deltic README).
// surface (the local browser-bundle-entry.ts, re-exporting the pinned
// JSR packages' public surface), the upstream worker message loop, and
// this repo's deltic host module, resolved through ONE import map so the
// emitted bundle carries exactly one embedder module instance — which is
// what keeps `instanceof WitError` 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
// 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 "@deltic/release-bundle-entry";
import * as deltic from "../browser-bundle-entry.ts";
import { workerMain } from "@polymorph/component-test-js/deltic-worker-main";
import { configure, websocketImports } from "../../../../js/deltic/websocket.ts";

Expand Down
15 changes: 8 additions & 7 deletions conformance/driver-ct/deltic/deno.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"//": "MODULE-IDENTITY CONSTRAINT: deltic's wasi-shims module imports @deltic/runtime/embedder by bare specifier internally. The @deltic/runtime/embedder entry here must map to the IDENTICAL URL as ../../../js/deltic/deno.json's entry, or the embedder module loads twice and `instanceof WitError` stops holding across the module boundary.",
"//": "MODULE-IDENTITY CONSTRAINT: deltic's wasi-shims module imports @deltic/runtime/embedder by bare specifier internally. The @deltic/runtime/embedder entry here must map to the IDENTICAL exact-pinned JSR version as ../../../js/deltic/deno.json's entry, or the embedder module loads twice and `instanceof WitError` stops holding across the module boundary. Pin story: 0.1.0-pre.ga67ee83 names one upstream deltic commit; @deltic/translator ships the translator wasm for that SAME commit; deno.lock carries integrity, --frozen enforced everywhere; one version repo-wide is asserted by the pin gate (justfile: exam-deltic).",
"imports": {
"@deltic/ct-runner": "https://raw.githubusercontent.com/lann/deltic/pre-58b2404/ct-runner/src/mod.ts",
"@deltic/runtime/embedder": "https://raw.githubusercontent.com/lann/deltic/pre-58b2404/runtime/src/embedder/mod.ts",
"@deltic/runtime/shim": "https://raw.githubusercontent.com/lann/deltic/pre-58b2404/runtime/src/shim/mod.ts",
"@deltic/wasi-shims": "https://raw.githubusercontent.com/lann/deltic/pre-58b2404/wasi-shims/src/mod.ts",
"@deltic/release-bundle-entry": "https://raw.githubusercontent.com/lann/deltic/pre-58b2404/tools/release-bundle/entry.ts",
"@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/wasi-shims": "jsr:@deltic/wasi-shims@0.1.0-pre.ga67ee83",
"@deltic/translator": "jsr:@deltic/translator@0.1.0-pre.ga67ee83",
"@polymorph/component-test-js/deltic-worker-main": "./node_modules/@polymorph/component-test-js/js/runner-deltic/worker-main.mjs"
},
"minimumDependencyAge": { "age": "P1D", "exclude": ["jsr:@deltic/*"] },
"tasks": {
"check": "deno check run.ts fetch-translator.ts browser/worker-entry.ts"
"check": "deno check run.ts browser/worker-entry.ts browser-bundle-entry.ts"
}
}
Loading
Loading