Skip to content

jco legs: consume the upstream JS runner core (@lann/component-test-js) - #24

Merged
lann merged 1 commit into
component-test-git-depsfrom
consume-ct-js
Aug 5, 2026
Merged

lann merged 1 commit into
component-test-git-depsfrom
consume-ct-js

Conversation

@lann

@lann lann commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #23 (git-sourced cargo deps); completes the dependency policy for JS. Depends on polymorph-components/polymorph-test#52 (the runCases gating options), currently pinned at its head rev 135a395 — if that PR rebase-merges, the three pins here bump to the post-merge SHA (root Cargo.toml comment is the checklist).

The local pre-facade harness (~160 lines of component-test protocol: results envelope, case loop, verdict mapping, test-context provider) is deleted in favor of @lann/component-test-js as a github:lann/component-test#<rev> npm git dep — one harness for every runner, per polymorph-components/polymorph-test#5. harness.mjs is now thin glue: bindImports + a runSuite that feeds the upstream loop with freshCases (instance-per-case, matching the wasmtime leg) and caseTimeoutMs (60s, matching --case-timeout).

New capability, free with the facade: the jco legs now run the same tag-inventory drift check the wasmtime runner applies, read from the transpiled core wasm custom sections (verified the section survives jco's instantiation-mode transpile). Untagged suite + no declared features = every case runs, exactly as before.

The browser leg maps the bare specifiers through a page import map onto served facade files — same source runs in Node and Chromium unchanged.

Event-shape deltas (uncommitted jsonl only; matrix byte-identical): diagnostics attach only when non-empty, diagnostics-complete only where incompleteness is possible, envelope drops "scheduling":"none" since the loop now schedules — all three aligning jco output with the Rust runner's.

Verification: full just ci green — 3 targets x 52 cases, 0 failing, committed matrix byte-identical, headless-Chromium leg included.

The local pre-facade harness carried ~160 lines of component-test
protocol implementation — the results envelope, the case loop, the
thrown-payload verdict mapping, the test-context provider — that any
other consumer would have to copy and keep in sync with the results
schema by hand. Upstream promoted that machinery into the
@lann/component-test-js facade (lann/component-test 0c8cfd5) and, for
the two gaps these legs need, grew runCases per-case fresh instances
and a per-case wall bound (polymorph-components/polymorph-test#50, merged as the
pinned rev). The local copy is deleted; harness.mjs is now thin glue:
bindImports (SUT wiring, config environment, the dual key spellings)
and a runSuite that feeds the upstream loop.

What the legs gain beyond deduplication: the upstream loop
mark-schedules against the tag inventory read from the transpiled
core wasm, so the jco legs now carry the same inventory-drift check
the wasmtime runner applies (a case the tags section does not cover
fails the run as unsound). The suite is untagged and targets.toml
declares no features, so `missing` is always empty and every case
runs, exactly as before.

Leg specifics:

- run-node keeps the compiled-module map but retains the raw bytes for
  the inventory scan.
- run-browser resolves the bare @lann/component-test-js specifiers
  through a page import map onto /ct/-served facade files (resolved
  from the installed package via import.meta.resolve), and compiles
  from fetched bytes instead of compileStreaming so the same bytes
  feed the inventory.
- Event-shape deltas against the deleted local loop, both aligning the
  jco legs with the Rust runner: diagnostics attach only when
  non-empty, diagnostics-complete appears only where incompleteness is
  possible, and the envelope drops "scheduling":"none" because the
  loop now schedules. Neither jsonl stream is committed; the matrix is
  byte-identical.

One rev everywhere: the npm pin, both cargo entries, and the CLI
install all move to polymorph-components/polymorph-test@135a395 together (the root
Cargo.toml comment is the bump checklist).

Verification: full just ci green (3 targets x 52 cases, 0 failing,
committed matrix byte-identical), including the real headless-Chromium
leg through the import map.
@lann
lann merged commit d119396 into component-test-git-deps Aug 5, 2026
2 checks passed
@lann
lann deleted the consume-ct-js branch August 5, 2026 12:39
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.

2 participants