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
34 changes: 22 additions & 12 deletions conformance/driver-ct/polyengine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,33 @@ module graph — no fetch step, no network.
polyengine ships as exact-pinned JSR prereleases (one per green upstream
commit; the hash in the version names the commit — see the [polyengine
README's "Consuming the unstable
prereleases"](https://github.com/polymorph-components/polyengine#readme)). The version is
pinned in **three** places, cross-checked by `just polyengine-check`'s pin
gate (`../../../scripts/check-polyengine-pin.sh`):
prereleases"](https://github.com/polymorph-components/polyengine#readme)). As
of A22, the `@polyengine/protocol` line versions independently of the
`@polyengine/{runtime,translator,wasi,ct-runner}` lockstep line: `just
polyengine-check`'s pin gate (`../../../scripts/check-polyengine-pin.sh`)
asserts one resolved `@polyengine/runtime` version across the two configs
that load the embedder, one resolved `@polyengine/protocol` version across
all three configs, and that `polyengine-impl` names no `@polyengine/runtime`
specifier at all (published host modules must not import
`@polyengine/runtime` — see `../../../polyengine-impl/README.md`).

- `deno.json` (this directory) — import-map versions
(`jsr:@polyengine/<pkg>@<version>`) for `@polyengine/ct-runner`,
`@polyengine/runtime/embedder`, `@polyengine/runtime/shim`,
`@polyengine/wasi-shims`, `@polyengine/translator`. `deno.lock` carries
integrity hashes for that module graph, enforced with `--frozen`.
`@polyengine/wasi`, `@polyengine/translator`, `@polyengine/protocol`.
`deno.lock` carries integrity hashes for that module graph, enforced
with `--frozen`.
- [`browser/deno.json`](browser/deno.json) — the SAME `@polyengine/runtime`
and `@polyengine/protocol` pins again (the module-identity constraint:
stateful handles minted by one embedder copy are refused by another, so
every config that loads the embedder must agree), with the npm WebRTC
backends stubbed out (never executed in a page).
- [`../../../polyengine-impl/deno.json`](../../../polyengine-impl/deno.json) —
the SAME `@polyengine/runtime/embedder` version (the module-identity
constraint: polyengine'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 ComponentException` stops holding across
the boundary).
- [`browser/deno.json`](browser/deno.json) — the SAME pins again, with
the npm WebRTC backends stubbed out (never executed in a page).
the SAME `@polyengine/protocol` version only. As of A22 this package (a
published host module) does not map `@polyengine/runtime` at all: its
copies of `@polyengine/protocol` are harmless by construction, so it no
longer participates in the runtime module-identity constraint above.


Each `deno.json` also carries a
`"minimumDependencyAge": { "age": "P1D", "exclude": ["jsr:@polyengine/*"] }`
Expand Down
11 changes: 6 additions & 5 deletions conformance/driver-ct/polyengine/browser/deno.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"//": "The browser-bundle import map: identical polyengine pins to ../deno.json, with the npm WebRTC backends mapped to ./stub.ts (never executed in a page; see stub.ts). polyengine ships as exact-pinned JSR prereleases; the pin gate (`just polyengine-check`) asserts one version repo-wide.",
"//": "The browser-bundle import map: identical polyengine pins to ../deno.json, with the npm WebRTC backends mapped to ./stub.ts (never executed in a page; see stub.ts). polyengine ships as exact-pinned JSR prereleases; the pin gate (`just polyengine-check`) asserts one @polyengine/runtime version across this file and ../deno.json (the two configs that load the embedder — polyengine-impl no longer does, as of A22) and one @polyengine/protocol version repo-wide.",
"minimumDependencyAge": { "age": "P1D", "exclude": ["jsr:@polyengine/*"] },
"imports": {
"@polyengine/ct-runner": "jsr:@polyengine/ct-runner@0.4.0",
"@polyengine/runtime/embedder": "jsr:@polyengine/runtime@0.4.0/embedder",
"@polyengine/runtime/shim": "jsr:@polyengine/runtime@0.4.0/shim",
"@polyengine/wasi": "jsr:@polyengine/wasi@0.4.0",
"@polyengine/ct-runner": "jsr:@polyengine/ct-runner@0.5.0",
"@polyengine/runtime/embedder": "jsr:@polyengine/runtime@0.5.0/embedder",
"@polyengine/runtime/shim": "jsr:@polyengine/runtime@0.5.0/shim",
"@polyengine/wasi": "jsr:@polyengine/wasi@0.5.0",
"@polyengine/protocol": "jsr:@polyengine/protocol@0.2.2",
"node-datachannel": "./stub.ts",
"node-datachannel/polyfill": "./stub.ts",
"werift": "./stub.ts"
Expand Down
42 changes: 22 additions & 20 deletions conformance/driver-ct/polyengine/browser/deno.lock

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

13 changes: 7 additions & 6 deletions conformance/driver-ct/polyengine/deno.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"//": "MODULE-IDENTITY CONSTRAINT: polyengine's wasi module imports @polyengine/runtime/embedder by bare specifier internally. Every config in this repo (this file AND polyengine-impl/deno.json AND browser/deno.json) must map that specifier to the IDENTICAL exact-pinned JSR version, or the embedder module loads twice and `instanceof ComponentException` stops holding across the module boundary. polyengine ships as exact-pinned JSR releases (caret-honest upstream; per-commit `<next>-pre.g<hash>` prereleases exist between releases — pin exactly); the lock carries integrity and --frozen enforces it; the pin gate (`just polyengine-check`) asserts one version repo-wide. The npm mappings mirror polyengine-impl/deno.json: the host module's bare `node-datachannel/polyfill` / `werift` specifiers resolve against THIS config when run.ts is the entry module.",
"//": "MODULE-IDENTITY CONSTRAINT (A22): this file AND browser/deno.json still load the embedder (@polyengine/runtime/embedder) and must map it to the IDENTICAL exact-pinned JSR version, or stateful handles minted by one copy are refused by another. polyengine-impl/deno.json no longer participates in this constraint: as of A22, published host modules (like polyengine-impl) depend only on @polyengine/protocol, whose copies are harmless by construction. @polyengine/protocol itself must resolve to one version across ALL THREE configs in this repo (this file, browser/deno.json, and polyengine-impl/deno.json), since it carries the vocabulary (ComponentException, Stream, brand predicates, ...) that crosses those module boundaries. polyengine ships as exact-pinned JSR releases (caret-honest upstream; per-commit `<next>-pre.g<hash>` prereleases exist between releases — pin exactly); the lock carries integrity and --frozen enforces it; the pin gate (`just polyengine-check`) asserts this repo-wide. The npm mappings mirror polyengine-impl/deno.json: the host module's bare `node-datachannel/polyfill` / `werift` specifiers resolve against THIS config when run.ts is the entry module.",
"nodeModulesDir": "auto",
"minimumDependencyAge": { "age": "P1D", "exclude": ["jsr:@polyengine/*", "npm:@jsr/*"] },
"imports": {
"@polyengine/ct-runner": "jsr:@polyengine/ct-runner@0.4.0",
"@polyengine/runtime/embedder": "jsr:@polyengine/runtime@0.4.0/embedder",
"@polyengine/runtime/shim": "jsr:@polyengine/runtime@0.4.0/shim",
"@polyengine/wasi": "jsr:@polyengine/wasi@0.4.0",
"@polyengine/translator": "jsr:@polyengine/translator@0.4.0",
"@polyengine/ct-runner": "jsr:@polyengine/ct-runner@0.5.0",
"@polyengine/runtime/embedder": "jsr:@polyengine/runtime@0.5.0/embedder",
"@polyengine/runtime/shim": "jsr:@polyengine/runtime@0.5.0/shim",
"@polyengine/wasi": "jsr:@polyengine/wasi@0.5.0",
"@polyengine/translator": "jsr:@polyengine/translator@0.5.0",
"@polyengine/protocol": "jsr:@polyengine/protocol@0.2.2",
"node-datachannel": "npm:node-datachannel@0.32.3",
"node-datachannel/polyfill": "npm:node-datachannel@0.32.3/polyfill",
"werift": "npm:werift@0.22.2"
Expand Down
52 changes: 27 additions & 25 deletions conformance/driver-ct/polyengine/deno.lock

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

13 changes: 7 additions & 6 deletions conformance/driver-ct/polyengine/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@
// <path>` remains as an optional override (a documented interface for
// swapping in a locally built shim), but is no longer required to run.
//
// MODULE-IDENTITY CONSTRAINT: polyengine's wasi module imports
// `@polyengine/runtime/embedder` by bare specifier internally; this leg's
// `deno.json` AND `polyengine-impl/deno.json` (AND `browser/deno.json`) must
// map that specifier to the IDENTICAL pinned JSR version, or the embedder
// module loads twice and `instanceof ComponentException` stops holding across the
// module boundary.
// MODULE-IDENTITY CONSTRAINT (A22): this leg's `deno.json` AND
// `browser/deno.json` still load the embedder (`@polyengine/runtime/embedder`)
// and must map it to the IDENTICAL pinned JSR version, or stateful handles
// minted by one copy are refused by another. `polyengine-impl/deno.json` no
// longer maps `@polyengine/runtime` at all — as of A22 it depends only on
// `@polyengine/protocol`, whose copies are harmless by construction, so it
// no longer participates in this constraint.

import { Translator } from "@polyengine/runtime/shim";
import { defaultTranslator } from "@polyengine/translator";
Expand Down
2 changes: 1 addition & 1 deletion conformance/driver-ct/polyengine/signaling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// Failures are thrown as the WIT `error` variant's `other` case, which the
// runtime lifts into the `result<_, error>` the mailbox interface declares.

import { ComponentException } from "@polyengine/runtime/embedder";
import { ComponentException } from "@polyengine/protocol";

/** The mailbox interface's WIT id (conformance/wit/deps/conformance-signaling). */
export const MAILBOX_INTERFACE = "conformance:signaling/mailbox@0.1.0";
Expand Down
21 changes: 12 additions & 9 deletions polyengine-impl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,17 @@ a subset of the protocol surface; the conformance suite

## Module identity

`deno.json` pins `@polyengine/runtime/embedder` to an exact-pinned
`jsr:@polyengine/runtime@<version>/embedder` specifier that MUST stay
byte-identical with the one in
As of A22 (`@polyengine/runtime@0.5.0` / `@polyengine/protocol@0.2.2`), this
package depends on `@polyengine/protocol` only — host modules must not import
`@polyengine/runtime` (protocol copies are harmless by construction, so no
module-identity constraint applies to this package's pin). `deno.json` maps
`@polyengine/protocol` to a caret range (published dependency constraints
must be ranges). The runtime-module-identity constraint still applies between
the two driver configs that load the embedder,
[`conformance/driver-ct/polyengine/deno.json`](../conformance/driver-ct/polyengine/deno.json)
(and its `browser/deno.json`): polyengine's `wasi-shims` imports that
specifier by bare name internally, so two divergent mappings load the
embedder module twice and `instanceof ComponentException` stops holding across
the module boundary. The bump procedure lives in
[`conformance/driver-ct/polyengine/README.md`](../conformance/driver-ct/polyengine/README.md);
`just polyengine-check` asserts all three configs agree on one version
and its `browser/deno.json` sibling: see
[`conformance/driver-ct/polyengine/README.md`](../conformance/driver-ct/polyengine/README.md).
`just polyengine-check` asserts one resolved `@polyengine/runtime` version
across those two configs, one resolved `@polyengine/protocol` version across
all three, and that this package names no `@polyengine/runtime` specifier
(the pin gate, `scripts/check-polyengine-pin.sh`).
6 changes: 3 additions & 3 deletions polyengine-impl/deno.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@polymorph/webrtc-datachannels",
"version": "0.4.0",
"version": "0.5.0",
"license": "Apache-2.0",
"exports": "./src/webrtc.ts",
"//": "MODULE-IDENTITY CONSTRAINT: polyengine's wasi module imports @polyengine/runtime/embedder by bare specifier internally. Every config in this repo (this file AND conformance/driver-ct/polyengine/deno.json AND conformance/driver-ct/polyengine/browser/deno.json) must map that specifier to the IDENTICAL exact-pinned JSR version, or the embedder module loads twice and `instanceof ComponentException` stops holding across the module boundary. polyengine ships as exact-pinned JSR releases (caret-honest upstream; per-commit `<next>-pre.g<hash>` prereleases exist between releases — the OTHER two configs still pin exactly, since they load the same on-disk polyengine module and must resolve identically; this JSR-published package instead depends on a caret range, since published dependency constraints must be rangesthe pin gate (`just polyengine-check`) asserts one RESOLVED version across all three repo deno.locks). The lock carries integrity and --frozen enforces it.",
"//": "MODULE-IDENTITY CONSTRAINT (A22): this package is a host module and MUST NOT import @polyengine/runtime (published host modules couple only to @polyengine/protocol, whose copies are harmless by construction — the module-identity story that used to require matching this package's runtime pin against conformance/driver-ct/polyengine/deno.json and its browser/ sibling no longer applies here). This config depends on @polyengine/protocol via a caret range (published dependency constraints must be ranges); the pin gate (`just polyengine-check`) asserts one RESOLVED @polyengine/protocol version across all three repo deno.locks, one RESOLVED @polyengine/runtime version across the two driver configs that still load the embedder, and that this package's deno.json/deno.lock name no @polyengine/runtime specifier at all. The lock carries integrity and --frozen enforces it.",
"nodeModulesDir": "auto",
"minimumDependencyAge": { "age": "P1D", "exclude": ["jsr:@polyengine/*"] },
"imports": {
"@polyengine/runtime/embedder": "jsr:@polyengine/runtime@^0.4.0/embedder",
"@polyengine/protocol": "jsr:@polyengine/protocol@^0.2.2",
"node-datachannel": "npm:node-datachannel@0.32.3",
"node-datachannel/polyfill": "npm:node-datachannel@0.32.3/polyfill",
"werift": "npm:werift@0.22.2"
Expand Down
15 changes: 4 additions & 11 deletions polyengine-impl/deno.lock

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

Loading
Loading