The contract suite

Every bridge passes this suite: the web fallback, and each native shell. It is the evidence behind "swapping a shell is a config change".

It has no test-runner dependency. Each case is a name and an async function that throws on failure, so the same cases run under bun test against the web fallback and inside a Swift or Tauri shell's own web view, where there is no bun:test. runContract() runs them all and returns a report; src/contract.test.ts adapts them to bun test one case per test.

The harness

A shell under test supplies a harness:

The suite's own files are all named contract-…, and a shell's fresh state removes only those, so running it never touches a file the player made.

A case that needs something the harness lacks is skipped and reported as skipped, never passed.

runContract

Runs every case and reports each as passed, failed or skipped. For a shell's web view, where a report is all there is to send back.