Verification
Yomorai’s claims are backed by four kinds of evidence, reported separately because they say different things. Tests are evidence, not proof, and bounded model checking is not proof of the code either. This page says what each kind establishes, what it does not, and how to run it.
Formal models (TLC)
Section titled “Formal models (TLC)”formal/ holds TLA+ models of the five critical protocols: approval,
execution, budget, isolation and classification
(formal/README.md). Each is checked by TLC with
MC.cfg, which must pass, and MC_bug.cfg, which removes the protocol’s
safeguard and must produce a counterexample — evidence that the invariants can
fail at all.
| Model | Distinct states (2026-11-30) | Planted bug caught by |
|---|---|---|
| approval | 65 | ApprovalsOnlyForHead |
| execution | 160,041 | AtMostOneLive |
| budget | 23,900 | WithinBudget |
| isolation | 868,608 | ContextDestroyedOnEnd |
| classification | 1,056 | IncomparableNoPerfVerdict |
What they establish: the protocol designs keep their invariants in every
reachable state within the stated bounds (for example three commits and three
users for approval). What they do not: anything about the TypeScript by
themselves; behaviour beyond the bounds; real time; things the models abstract
away (permissions changing after an approval, the 12 real stages represented
by 2, one budget scope instead of three, page scripts inside a browser
context, the CLASS-005 severity thresholds). Each model’s assumptions and
limits are listed in formal/README.md.
pnpm tlc # downloads tla2tools 1.7.4 (checksum-pinned); needs Java 11+Conformance testing
Section titled “Conformance testing”verification/model-based/ transcribes each model’s Next relation as a pure
function and uses fast-check to generate event sequences — duplicates,
reordering, retries, cancellations — that run against both the real
implementation (Coordinator, BudgetLedger, the gate, the browser executor)
and the transcription, comparing abstract state and invariants after every
step. The approval property runs 10,000 sequences; the isolation tests drive
a real browser and run few sequences. A planted bug must be caught with a
shrunk counterexample.
What it establishes: on the generated sequences, the code behaves like the model. What it does not: that the transcription is faithful to the TLA+ (it is written by hand), or that untried sequences behave.
Mutation testing
Section titled “Mutation testing”- Named critical mutations (
verification/mutations/catalogue.ts, 11 entries, such as removing approval validation, allowing a stale publish, skipping the budget reservation, removing the production guard, removing prompt redaction, skipping the webhook signature check). Each is applied alone and the test suite must fail. The last recorded run killed all 14. - Stryker mutation score for
core(coordinator, budget, classification, lifecycle, triggers, stage runner),securityand the production guard, with a break threshold of 70 percent; on CI it runs nightly (nightly.yml), incrementally: only mutants in changed code, or whose tests changed, run again.
pnpm mutation:critical # named mutationspnpm mutation # Stryker (slow; CI runs it nightly)What it establishes: these specific defects would be detected. What it does not: that every defect would.
| Project | Location | What |
|---|---|---|
unit |
packages/*/src/**/*.test.ts, apps/*/src/**/*.test.ts |
Pure logic |
acceptance |
verification/acceptance/, verification/traceability/ |
Requirement-level behaviour, including these docs and the GitHub Action |
contract |
verification/contracts/ |
Adapters against recorded GitHub, Cloudflare, model-provider and storage shapes; the API contract |
property |
verification/model-based/ |
Conformance against the models |
integration |
verification/conformance/ |
The Worker’s logic over look-alike bindings in Node |
security |
verification/adversarial/ |
Secrets never reaching prompts, logs or outputs |
e2e |
verification/e2e/ |
Real Chromium against the sample application: browser, CLI, MCP, authentication, performance, and a golden evaluation of every fixture variant |
pnpm test # every suite but e2e (bun test, scripts/test.ts)pnpm test e2e # browser end-to-end only (needs Chromium)None of these run inside the Cloudflare Workers runtime or call a live model provider; see Status.
Requirements registry and status
Section titled “Requirements registry and status”Every requirement in openspec/changes/yomorai-v0-0-1/specs/ has a stable id
(146 requirements, 57 critical). verification/traceability/requirements.yaml
is generated from the specs and lists, per requirement, which kinds of
evidence it needs (acceptance, integration, e2e, model,
property, mutation, adversarial; plan in
verification/traceability/plan.ts). Tests claim a requirement by carrying
its id in the title, for example [LIFE-004].
Status is never written by hand. verification/traceability/status.ts
computes it from CI output — JUnit XML, tlc.json, mutations.json:
- a test method is satisfied when at least one test of that kind tagged with the id passed and none failed or was skipped;
- the
modelmethod needs every passing configuration of the model (MC.cfg, andMC_<name>.cfgwhere some properties are checked on another instance) to pass, together checking the listed properties, and every planted-bug configuration to produce a counterexample; - the
mutationmethod needs the named mutation killed; - verified = every needed method satisfied; partially_verified = some; unverified = none; failing = any failed.
A missing input counts as no evidence, never as a pass. The release gate
passes only when every critical requirement is verified, nothing is failing
and no critical mutation survived. The last committed report
(verification/reports/verification.md) shows the gate BLOCKED: many
critical requirements are still partially verified or unverified.
pnpm traceability # specs, registry and test tags agreepnpm verify:report # writes verification/reports/verification.{md,json}pnpm verify:report --gate # also exits 1 unless the release gate passesRunning everything: pnpm verify
Section titled “Running everything: pnpm verify”pnpm verify (scripts/verify.ts) produces, on one machine, the evidence the
CI jobs produce, then the release report and the release gate:
pnpm verify # every stage, then the report and the gatepnpm verify --list # the stages, their slots and what they checkpnpm verify --only e2e,tlc # some stages (and what they need)pnpm verify --skip mutations # all but somepnpm verify --slots 6 # a smaller budget (default: the core count)The stages (typecheck, lint, boundaries, traceability, the non-e2e test
projects, the e2e project, the three Playwright suites, TLC and the named
mutations) are independent and run at the same time within a budget of
slots, about one busy core each. A stage sizes its own parallelism to the
slots it is given (bun test and Playwright workers, TLC processes, concurrent
mutants), so stages do not starve each other; the longest start first. The
landing page’s timing measurements (frame rate, scroll, Lighthouse) run last,
when nothing else is running. Each stage writes its whole output to
verification/reports/logs/<stage>.log; the console shows one line per stage
start and end, a line a minute about what is still running, and the end of the
log of a stage that fails. Old reports are removed first, so the release report
reads only this run’s evidence. The run ends with the release report
(verification.{md,json}), the release gate, and a table of stage timings. It
exits non-zero when any stage or the gate fails.
Browsers never outlive a run. A run (pnpm verify, a pnpm test run, a
Playwright suite, the mutation runner) gets a temporary directory of its own as
TMPDIR; every Chromium it starts keeps its profile there, so it carries that
directory on its command line (verification/browser-scope.ts). When the run
ends, any such browser still alive, and every process below it, is killed and
the run fails, naming them (pnpm verify reports it as the browsers stage).
Lighthouse’s Chrome, which chrome-launcher starts detached, is also stopped
when the process that launched it exits for any reason, and a Chrome still
starting when its run is stopped is stopped as soon as it is up.
What runs in parallel, and why it is safe
Section titled “What runs in parallel, and why it is safe”- Sample-application variants are built once, before any test starts
(
scripts/test.ts), into a cache addressed by the content of every build input (verification/e2e/variant-cache.ts). Built files are read-only; tests only serve them, on port 0. A test run that finds a variant missing fails rather than building it. - e2e files run in parallel workers. Each file has its own servers
(port 0), temporary directories, in-memory databases and browser. The golden
reviews run four at a time within their file; each review has its own engine,
store and servers.
YOMORAI_E2E_WORKERSoverrides the worker count. - The dashboard suite starts one set of backends per Playwright worker
(
apps/web/tests/global-setup.ts); a test reads the backends of its own worker, so what a test changes (memory entries, a corrupted blob, a tampered ledger, a started review) is seen only by later tests of that worker, as when one worker ran the whole file.YOMORAI_WEB_WORKERSoverrides the count. - The landing suite is a static site on one server, at a free port: its
tests run fully parallel, except those tagged
@timing, which run afterwards in a project of their own, one at a time. - TLC runs several configurations at once, largest first (by the state
counts of the previous report);
tlc.jsonlists them in the same order as before.TLC_JOBSandTLC_WORKERSset processes and threads per process. - Mutants run concurrently, each in its own copy of the repository, and a
mutant starts as soon as its own tests have passed unmutated;
mutations.jsonlists them in catalogue order.
Measured on a 10-core Mac (2026-12-01, on a shared, often heavily loaded
machine, so treat these as indicative): e2e 608 s one file at a time, 227 s
with 2 workers, 194 s with 4, 185 s with 6 and 193 s with 8, where 6 and 8
also starved timed assertions; four workers is the default, and five
consecutive runs at four passed in 135–179 s. Dashboard suite 110 s on one
worker, 70–75 s on three. Landing suite 77 s, 59–71 s (its 16 untimed tests
take 11 s on four workers; the timing tests take about 48 s alone). TLC took
493 s one run at a time and 338 s with three processes, almost all of it
isolation’s MC.cfg (502 s alone): checking the liveness property
RunningEventuallyEnds on the full-size model (868,608 states, four contexts)
made TLC build and then search a behaviour graph of every state. The
invariants are now checked at that size in MC.cfg (9 s) and the liveness
property in MC_live.cfg on the instance the design specified (two contexts
for eight executions, 18,688 states, 4 s), which still catches a missing
fairness condition. The whole TLC stage takes about 55 s. -lncheck final
saved a quarter of isolation’s time and nothing on the other models. Named mutations
213 s one at a time, 98 s at three, 65 s at five with the shared variant
cache; every run gave the same results in the same order.
The whole of pnpm verify took about 28 minutes with every stage run one after
another, and 12m22s in parallel with the release gate passing (2026-12-01, load
about 20 at the start). TLC starts once the unit and e2e stages are done and
holds six slots: run beside them, even at the lowest priority, its threads
starved timed tests and hooks, and a run took 14m43s and failed.
.github/workflows/ci.yml runs typecheck, lint and boundary checks,
traceability, OpenSpec validation, every test project, the browser end-to-end
tests, TLC, the named mutations, a build, and finally
the verification report from the collected artifacts.
On a pull request it runs only what the change can reach
(scripts/affected.ts, also pnpm test --affected <base> locally): the test
files whose imports, transitively, or named entry points reach a changed file,
and the Playwright suites, TLC and the mutations only when their paths changed.
Documentation alone runs no tests. A changed file that no test reaches, and any
change to the toolchain (package manifests, the lockfile, TypeScript or test
configuration, the workflows), runs everything. A push to main is compared
with the commit before it the same way: a merged pull request already passed
on exactly that code, since branch protection requires it to be up to date.
CI runs everything every night (the safety net under the selection), and a
release runs every gate again from scratch; releases alone produce release
evidence. The non-e2e suites run as two parallel jobs and the e2e suite as
three, cut by recorded file durations; the landing page’s content and its
timing measurements run as two jobs side by side. The e2e shards
are cut by recorded file durations (verification/test-timings.json,
refreshed by pnpm test:timings).