Skip to content

Harness core: per-case fresh instances and case timeout - #52

Merged
lann merged 1 commit into
mainfrom
js-harness-gating
Aug 5, 2026
Merged

Harness core: per-case fresh instances and case timeout#52
lann merged 1 commit into
mainfrom
js-harness-gating

Conversation

@lann

@lann lann commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Closes #50. Two opt-in runCases options for the gating jco adapters, keeping the loop single-owner per the one-harness rule (#5); default behavior unchanged.

  • freshCases — instance-per-case granularity (Runner execution-policy guidance #22's wasmtime default) for instantiation-mode transpiles: census/striping from cases, each execution re-enumerates through the factory. Vanished case = throw (drift, unsound), mirroring the inventory-drift posture.
  • caseTimeoutMs — the JS analog of the runner's --case-timeout (Runner: per-case execution budget and timeout (limit-exceeded provenance) #45): expiry fails the case with the schema's {"limit-exceeded":"case-timeout"} provenance and the Rust runner's detail wording, and the loop continues. Doc comment requires pairing with freshCases: JSPI attempts cannot be cancelled, and a timed-out shared instance may be wedged mid-suspension.

Selftest grows a synthetic-case section covering both (hang → limit-exceeded row without stalling; payload mapping intact under the race; per-case enumeration counted; vanished case throws). Facade version 0.2.0.

First consumer: component-websocket's driver-ct jco legs (conversion PR to follow), deleting its local pre-facade harness copy.

Verified: just verify-viewer green end-to-end.

The gating jco adapters need two things the viewer's live page did
not: a per-case wall bound (the runner grew one in #45; without it a
wedged case burns the leg's whole outer timeout with no per-case
attribution) and instance-per-case granularity (#22's wasmtime
default; instantiation-mode transpiles can re-instantiate where
module-mode singletons cannot). Both land as opt-in runCases options
so the loop stays single-owner (#5): default behavior is unchanged.

- freshCases: census and striping still come from `cases`; each
  execution re-enumerates through the factory and runs the matching
  case. A vanished case throws — drift is unsound, not a failing case.
- caseTimeoutMs: on expiry the case fails with
  {"limit-exceeded":"case-timeout"} provenance (the schema's existing
  vocabulary) and the Rust runner's detail wording, and the loop moves
  on. JSPI attempts cannot be cancelled, so the doc comment requires
  pairing with freshCases: a timed-out shared instance may be wedged
  mid-suspension, poisoning every later case.

Selftest grows a synthetic-case section (the loop only needs
name()/run()): the hanging case produces the limit-exceeded row
without stalling the loop, thrown payloads still map correctly under
the race, enumeration is counted per case, and a vanished case throws.
Facade version to 0.2.0.

First consumer: component-websocket's driver-ct jco legs, replacing
its local pre-facade harness copy.

Verification: just verify-viewer (aggregate parity, sample 1/1/1,
fixture 6/1/0/1na, striping partition equality, the new section).
@lann
lann merged commit 1917446 into main Aug 5, 2026
2 checks passed
lann added a commit to polymorph-components/polymorph-websocket that referenced this pull request Aug 5, 2026
135a395 was polymorph-components/polymorph-test#52's head; the merge landed as a merge
commit, so bump the three pins (both cargo entries, the npm dep) to
1917446 on main history — which also picks up the execution-budget
rework (upstream #45) that landed ahead of the merge.

Verification: conformance-ct::all green at the new rev (3 targets x 52
cases, 0 failing, matrix byte-identical); cargo test green.
@lann
lann deleted the js-harness-gating 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.

JS harness core: per-case fresh instances and case timeout (gating jco adapters)

1 participant