Skip to content

js: upstream the node suite-runner loop (#59's node half) - #70

Merged
lann merged 1 commit into
mainfrom
node-runner-glue
Aug 7, 2026
Merged

js: upstream the node suite-runner loop (#59's node half)#70
lann merged 1 commit into
mainfrom
node-runner-glue

Conversation

@lann

@lann lann commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Partial for #59 (its node half; the browser page driver is the remaining half). The fourth consumer (polymorph-tls's jco leg) confirmed the seam: its driver re-wrote the same ~40-line skeleton websocket, webrtc, and webcrypto already carry. The loop moves upstream as composable functions, not a frame:

  • runSuiteJsonl (in ./harness, browser-safe): census → tag-scheduled case loop → envelope/events/terminator through the caller's emit. Fresh instance per case by default (JSPI attempts cannot be cancelled; also contains trap poisoning), Context override for drivers with their own diagnostic transport (webcrypto), shard/only passthrough. Pool topologies (webcrypto's workers) keep composing runCases + mergeCounts directly — the helper is the sequential-driver shape, deliberately.
  • ./node-runner (node-only export): loadCoreModules(dir, prefix?) (several suites can share one generated tree; returns bytes for inventoryLookup + compiled modules for instantiate), resolveTestsExport (the three export spellings, error names the keys), writeResultsFile.
  • Deliberately per-consumer: argv, SUT/env wiring, concurrency topology, webrtc's child-process contract (Design: two-party/multi-instance orchestration contract (roles, rendezvous, signaling seam) #62's territory).
  • actions/README.md: the transpile-stamp convention documented next to the canonical recipes (stamp must cover the jco package.json — the flag-change staleness webcrypto hit is the motivating incident).

Verification: stub-driven unit tests (js/node-runner.test.mjs, in verify-imports) covering prefix filtering/ordering/empty-error, export spellings, envelope normalization + scheduling + fresh-instance counting + zero-case error, results-file shape; verify-node byte-for-byte goldens and the viewer selftest pin the harness change as additive. Adoption PRs on the four consumers follow (they are the integration gate, re-running full matrices on the slimmed drivers).

Four consumers carry near-identical copies of the same driver
skeleton: load a transpiled suite's cores, read the tag inventory,
instantiate, resolve the tests export across its spellings, run the
case loop with fresh instances and a case timeout, and emit
envelope/events/terminator as results JSONL. The loop moves upstream:

- harness.mjs gains runSuiteJsonl — the sequential-driver shape,
  browser-safe, with the JSPI fresh-instance-per-case default and a
  Context override for drivers with their own diagnostic transport;
  pool topologies keep composing runCases + mergeCounts directly.
- ./node-runner (node-only): loadCoreModules (prefix-filtered, name
  order, bytes + compiled modules), resolveTestsExport, and
  writeResultsFile.

What stays per-consumer is the frame: argv, SUT and environment
wiring, concurrency topology.

Also documents the transpile-stamp convention next to the canonical
recipes: the stamp must cover the jco package.json, where the flags
and the pinned transpiler live — a wasm-only stamp has demonstrably
shipped stale output across a flag change.

Stub-driven unit tests join verify-imports; verify-node's goldens and
the viewer selftest pin that the harness change is additive.
@lann
lann merged commit eabd159 into main Aug 7, 2026
3 checks passed
@lann
lann deleted the node-runner-glue branch August 7, 2026 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant