From d5519aebc25c83eba37608eccd616af44c42483e Mon Sep 17 00:00:00 2001 From: Kyle Mathews Date: Wed, 2 Dec 2026 09:38:41 -0700 Subject: [PATCH 1/6] fix(oracle-gaps): record no assertion outside a test, and a file-level hook that fails is a broken owner file (#188) The capture harness hashed every assertion into the running test's row, and a file-level `afterAll` asserts after the last row closed, so the harness threw `Digest already called` out of the hook and Vitest failed a file whose every test passed. The harness now records no assertion outside a test; the assertion itself still runs. Oracle first: the e2e gap oracle gains the `w_hooked` capture witness and a drawn `hookAsserts` field (an oracle file whose file-level hooks assert, each checking that its assertion threw as it does alone), which went RED on the unguarded harness and GREEN after the guard; a drawn `hookFails` field and the constructed history "a file-level hook that fails beside another owner", under which such a file is a broken owner file that judges nothing (law 14), with its two states; and law 3's prose and statement extended. Also adds AGENTS.md, which lived untracked in the maintainer's checkout, and repository pointer skills under .agents/skills and .claude/skills. Co-authored-by: Isaac --- .agents/skills/oracles-design/SKILL.md | 9 ++ .../skills/oracles-evaluate-review/SKILL.md | 9 ++ .agents/skills/oracles-explore/SKILL.md | 9 ++ .agents/skills/oracles-review/SKILL.md | 9 ++ .agents/skills/oracles-setup/SKILL.md | 9 ++ .../capture-file-level-hook-assertion.md | 5 + .claude/skills/oracles-design/SKILL.md | 9 ++ .../skills/oracles-evaluate-review/SKILL.md | 9 ++ .claude/skills/oracles-explore/SKILL.md | 9 ++ .claude/skills/oracles-review/SKILL.md | 9 ++ .claude/skills/oracles-setup/SKILL.md | 9 ++ AGENTS.md | 95 ++++++++++++++ .../oracles/oracle-gaps/capture-setup.mjs | 5 + .../oracle-gaps/gap-report-model-oracle.mjs | 123 ++++++++++++++++-- .../gap-report-oracle.property.test.mjs | 102 ++++++++++++++- .../oracle-gaps/history-fingerprint.json | 8 +- packages/oracles/scripts/e2e-shards.mjs | 3 + packages/oracles/scripts/pr-shards.mjs | 1 + 18 files changed, 416 insertions(+), 16 deletions(-) create mode 100644 .agents/skills/oracles-design/SKILL.md create mode 100644 .agents/skills/oracles-evaluate-review/SKILL.md create mode 100644 .agents/skills/oracles-explore/SKILL.md create mode 100644 .agents/skills/oracles-review/SKILL.md create mode 100644 .agents/skills/oracles-setup/SKILL.md create mode 100644 .changeset/capture-file-level-hook-assertion.md create mode 100644 .claude/skills/oracles-design/SKILL.md create mode 100644 .claude/skills/oracles-evaluate-review/SKILL.md create mode 100644 .claude/skills/oracles-explore/SKILL.md create mode 100644 .claude/skills/oracles-review/SKILL.md create mode 100644 .claude/skills/oracles-setup/SKILL.md create mode 100644 AGENTS.md diff --git a/.agents/skills/oracles-design/SKILL.md b/.agents/skills/oracles-design/SKILL.md new file mode 100644 index 00000000..213927db --- /dev/null +++ b/.agents/skills/oracles-design/SKILL.md @@ -0,0 +1,9 @@ +--- +name: oracles-design +description: Design, write, or change an oracle with @tanstack/oracles. Start from approved potential laws, write the oracle file with its law block and code, choose a model, and build histories that reach the states the law needs. Show the evidence the change needs, and close every gap. Use for a new oracle, an oracle repair, or a production change in owned code. Also use for any change to a model, history grammar, driver, or check. +--- + +Read `packages/oracles/skills/oracles-design/SKILL.md` in full, and follow it. This repository is +`@tanstack/oracles`, so that file is the skill's source, at the version of +this checkout. If it does not exist, you are not in the TanStack/oracles +repository: say so and stop. diff --git a/.agents/skills/oracles-evaluate-review/SKILL.md b/.agents/skills/oracles-evaluate-review/SKILL.md new file mode 100644 index 00000000..512be039 --- /dev/null +++ b/.agents/skills/oracles-evaluate-review/SKILL.md @@ -0,0 +1,9 @@ +--- +name: oracles-evaluate-review +description: Evaluate a review of oracle work done with @tanstack/oracles. Keep a lossless ledger of every finding, and check each claim against the code. Extend the oracle so it shows each confirmed bug on unchanged production, then fix production and close the bug class. Use when review findings arrive for a branch that touches an oracle or owned code. +--- + +Read `packages/oracles/skills/oracles-evaluate-review/SKILL.md` in full, and follow it. This repository is +`@tanstack/oracles`, so that file is the skill's source, at the version of +this checkout. If it does not exist, you are not in the TanStack/oracles +repository: say so and stop. diff --git a/.agents/skills/oracles-explore/SKILL.md b/.agents/skills/oracles-explore/SKILL.md new file mode 100644 index 00000000..b5abb219 --- /dev/null +++ b/.agents/skills/oracles-explore/SKILL.md @@ -0,0 +1,9 @@ +--- +name: oracles-explore +description: Explore an area of a codebase with @tanstack/oracles, or the whole repository. Probe the real API to prove each finding, propose a potential oracle and its potential laws, build it, fix confirmed bugs oracle first, and close gaps until bugs or design questions turn up. The first time in a repository, it also onboards the developer: what the session will do, new words explained as they come up, a walk-through, and the choice to finish setting up. Use when someone is trying @tanstack/oracles, asks where an oracle would help, or asks to explore an area ("explore the clearQueue API"). +--- + +Read `packages/oracles/skills/oracles-explore/SKILL.md` in full, and follow it. This repository is +`@tanstack/oracles`, so that file is the skill's source, at the version of +this checkout. If it does not exist, you are not in the TanStack/oracles +repository: say so and stop. diff --git a/.agents/skills/oracles-review/SKILL.md b/.agents/skills/oracles-review/SKILL.md new file mode 100644 index 00000000..1cd0de8a --- /dev/null +++ b/.agents/skills/oracles-review/SKILL.md @@ -0,0 +1,9 @@ +--- +name: oracles-review +description: Review oracle work done with @tanstack/oracles. Challenge whether an oracle enforces its law, whether it is the right law, and whether the work took a shortcut. Use for a new or changed oracle, or a production change in owned code. Also use for a proposed change to what an oracle promises. +--- + +Read `packages/oracles/skills/oracles-review/SKILL.md` in full, and follow it. This repository is +`@tanstack/oracles`, so that file is the skill's source, at the version of +this checkout. If it does not exist, you are not in the TanStack/oracles +repository: say so and stop. diff --git a/.agents/skills/oracles-setup/SKILL.md b/.agents/skills/oracles-setup/SKILL.md new file mode 100644 index 00000000..97625298 --- /dev/null +++ b/.agents/skills/oracles-setup/SKILL.md @@ -0,0 +1,9 @@ +--- +name: oracles-setup +description: Finish setting up a repository for oracles with @tanstack/oracles. Pin the packages, add the lint preset and the Vitest config, write the agent instructions, make the oracle skills findable by coding agents, and run the oracle through the gap check. Use when the developer wants to keep the work of a first session (a commit, or a pull request), when a repository adopts @tanstack/oracles, or when it upgrades its pinned commit. Its install and file-placement sections also cover the minimal setup that a first session needs. +--- + +Read `packages/oracles/skills/oracles-setup/SKILL.md` in full, and follow it. This repository is +`@tanstack/oracles`, so that file is the skill's source, at the version of +this checkout. If it does not exist, you are not in the TanStack/oracles +repository: say so and stop. diff --git a/.changeset/capture-file-level-hook-assertion.md b/.changeset/capture-file-level-hook-assertion.md new file mode 100644 index 00000000..51cead2c --- /dev/null +++ b/.changeset/capture-file-level-hook-assertion.md @@ -0,0 +1,5 @@ +--- +'@tanstack/oracles': patch +--- + +Fix `oracle-gaps` failing a file whose file-level `afterAll` asserts. The capture harness hashes each assertion into the running test's row, and the row closes when its test ends. An assertion in a file-level hook runs after the last test, outside any test, so the harness updated a closed hash and threw `Digest already called` out of the hook. Vitest then failed a file whose every test passed, and the gap report blocked every mutant the file owns. The harness now records no assertion outside a test. The assertion itself still runs, so a failing hook assertion still fails the file. Under the gap check such an assertion is no verdict: a file whose file-level hook fails judges nothing. diff --git a/.claude/skills/oracles-design/SKILL.md b/.claude/skills/oracles-design/SKILL.md new file mode 100644 index 00000000..213927db --- /dev/null +++ b/.claude/skills/oracles-design/SKILL.md @@ -0,0 +1,9 @@ +--- +name: oracles-design +description: Design, write, or change an oracle with @tanstack/oracles. Start from approved potential laws, write the oracle file with its law block and code, choose a model, and build histories that reach the states the law needs. Show the evidence the change needs, and close every gap. Use for a new oracle, an oracle repair, or a production change in owned code. Also use for any change to a model, history grammar, driver, or check. +--- + +Read `packages/oracles/skills/oracles-design/SKILL.md` in full, and follow it. This repository is +`@tanstack/oracles`, so that file is the skill's source, at the version of +this checkout. If it does not exist, you are not in the TanStack/oracles +repository: say so and stop. diff --git a/.claude/skills/oracles-evaluate-review/SKILL.md b/.claude/skills/oracles-evaluate-review/SKILL.md new file mode 100644 index 00000000..512be039 --- /dev/null +++ b/.claude/skills/oracles-evaluate-review/SKILL.md @@ -0,0 +1,9 @@ +--- +name: oracles-evaluate-review +description: Evaluate a review of oracle work done with @tanstack/oracles. Keep a lossless ledger of every finding, and check each claim against the code. Extend the oracle so it shows each confirmed bug on unchanged production, then fix production and close the bug class. Use when review findings arrive for a branch that touches an oracle or owned code. +--- + +Read `packages/oracles/skills/oracles-evaluate-review/SKILL.md` in full, and follow it. This repository is +`@tanstack/oracles`, so that file is the skill's source, at the version of +this checkout. If it does not exist, you are not in the TanStack/oracles +repository: say so and stop. diff --git a/.claude/skills/oracles-explore/SKILL.md b/.claude/skills/oracles-explore/SKILL.md new file mode 100644 index 00000000..b5abb219 --- /dev/null +++ b/.claude/skills/oracles-explore/SKILL.md @@ -0,0 +1,9 @@ +--- +name: oracles-explore +description: Explore an area of a codebase with @tanstack/oracles, or the whole repository. Probe the real API to prove each finding, propose a potential oracle and its potential laws, build it, fix confirmed bugs oracle first, and close gaps until bugs or design questions turn up. The first time in a repository, it also onboards the developer: what the session will do, new words explained as they come up, a walk-through, and the choice to finish setting up. Use when someone is trying @tanstack/oracles, asks where an oracle would help, or asks to explore an area ("explore the clearQueue API"). +--- + +Read `packages/oracles/skills/oracles-explore/SKILL.md` in full, and follow it. This repository is +`@tanstack/oracles`, so that file is the skill's source, at the version of +this checkout. If it does not exist, you are not in the TanStack/oracles +repository: say so and stop. diff --git a/.claude/skills/oracles-review/SKILL.md b/.claude/skills/oracles-review/SKILL.md new file mode 100644 index 00000000..1cd0de8a --- /dev/null +++ b/.claude/skills/oracles-review/SKILL.md @@ -0,0 +1,9 @@ +--- +name: oracles-review +description: Review oracle work done with @tanstack/oracles. Challenge whether an oracle enforces its law, whether it is the right law, and whether the work took a shortcut. Use for a new or changed oracle, or a production change in owned code. Also use for a proposed change to what an oracle promises. +--- + +Read `packages/oracles/skills/oracles-review/SKILL.md` in full, and follow it. This repository is +`@tanstack/oracles`, so that file is the skill's source, at the version of +this checkout. If it does not exist, you are not in the TanStack/oracles +repository: say so and stop. diff --git a/.claude/skills/oracles-setup/SKILL.md b/.claude/skills/oracles-setup/SKILL.md new file mode 100644 index 00000000..97625298 --- /dev/null +++ b/.claude/skills/oracles-setup/SKILL.md @@ -0,0 +1,9 @@ +--- +name: oracles-setup +description: Finish setting up a repository for oracles with @tanstack/oracles. Pin the packages, add the lint preset and the Vitest config, write the agent instructions, make the oracle skills findable by coding agents, and run the oracle through the gap check. Use when the developer wants to keep the work of a first session (a commit, or a pull request), when a repository adopts @tanstack/oracles, or when it upgrades its pinned commit. Its install and file-placement sections also cover the minimal setup that a first session needs. +--- + +Read `packages/oracles/skills/oracles-setup/SKILL.md` in full, and follow it. This repository is +`@tanstack/oracles`, so that file is the skill's source, at the version of +this checkout. If it does not exist, you are not in the TanStack/oracles +repository: say so and stop. diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 00000000..3d7163d9 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,95 @@ + + +## Oracle tests + +This repository is `@tanstack/oracles`, and it holds its own code to the +method it ships: each package's design is captured as laws, enforced by its +own oracles against an independent model. Work oracle first, production +second. + +**Who owns what.** The laws belong to the people who maintain this +repository: what the code promises, the authority for each promise, and its +limits. Propose a law, but do not adopt or change one without their +approval. The production code that the oracles own is yours. Whenever you +change it, do a good job, not a minimal or lazy one: the fast, small, +elegant version, as an optimizing compiler for the oracle would write it. +Anything that keeps every oracle passing is allowed, so a big refactor is +fine when it makes the code better; the oracle is the review. Keep it in +proportion to the task: improve the code the work touches, and when you see +a larger win elsewhere, offer it instead of turning the task into a long +optimization project. + +**How the work goes.** + +- **Probe first.** Before you propose anything, call the real code with + small scripts and show what they print. Every law and every finding comes + with a probe that can be rerun. +- **Propose the laws, then build only the approved ones.** Each law is a + "For every …" sentence with where its promise is written: the docs, a + test, or a maintainer's decision. A question nobody has decided is fine: + state it as a limit. +- **Red first, like TDD, but the oracle goes red.** A bug becomes a law and + a history that fail on the unchanged code. Then fix production at once, + and show the run going green. +- **Never weaken or quarantine an oracle:** no skip, no `test.fails`, no + loosened expectation, no switch that turns a check off. +- **Build the strongest model the laws need.** Compare every observable + result they speak about. The model states the rule a user relies on, + never the code's algorithm, even when the docs describe that algorithm. + Give each law a calibration: a wrong answer the check must reject. +- **Run the oracles only through the gap check, never Vitest alone.** It + prints each test file's result first, then each gap as it is judged, and + ends with one `oracle-gaps: done` line. A run + can take minutes: start it in the background with output to a log at a + path of its own (never a fixed path under `/tmp`), and read the new lines + every few seconds, acting on a failure first. Stop a + run only by the process ID you recorded, never by name. +- **Green is not done.** A gap is a change to the owned code that no law + notices. There are no equivalent mutants: never call one equivalent. + Widen the histories or the check until the oracle sees it, and keep going + until a bug or a design question turns up. +- **Report classes of bugs:** the rule broken, and the measured share of + generated inputs that break it. Never call one minor. + +**Skills.** + +- To explore an area of the code (or the whole repository), find where an + oracle would help, or propose a new one, read + `packages/oracles/skills/oracles-explore/SKILL.md` in full + and follow it. +- Before you create or change an oracle, or change production code that an + oracle owns, read `packages/oracles/skills/oracles-design/SKILL.md` + in full and follow it. +- Before you review oracle work, read + `packages/oracles/skills/oracles-review/SKILL.md` in full. +- Before you act on review findings, read + `packages/oracles/skills/oracles-evaluate-review/SKILL.md` in + full. +- Lint each oracle file and each changed production file after you edit it. + Fix every report. Do not disable a rule. +- Typecheck each oracle file after you edit it (Vitest strips types without + checking them). +- Oracle files: `packages/**/*oracle.property.test.{ts,js,mjs}`. Gap check: `node packages/oracles/oracle-gaps/index.mjs --package --source ` (run `pnpm --filter @tanstack/oracles build` first, so the package resolves from `dist/`). + + + +## This repository + +Agents working here have drifted from the block above in specific ways; each rule below closes one. + +- **A law is an `oracleProperty` that owns the code it judges.** A whole-program dry run, a ledger or log audit, or an + end-to-end "calibration" run is not a substitute: it is slow, and the gap check cannot see it. Move decision logic + into pure functions that the laws own, and keep one integration run for the wiring only. +- **Unowned production code is a gap.** Run the gap check over every source file you changed, not one. A function no + law owns is either given a law or deleted. Do not leave old code beside its replacement. +- **The design-grammar trigger is not optional.** When one boundary has more than five laws, a law predicts no new + case, or the model has more than one branch per law, read + `packages/oracles/docs/instruments/design-grammar.md` and do its parts list before you write the model, as + `oracles-design` step 1 says. +- **Every feedback loop has a stated time budget, enforced as a law.** An oracle file finishes in seconds. A loop that + runs slower than its budget is a defect in its design, not something to wait out. +- **Delegation carries these rules.** When you hand oracle work to another agent, tell it to read this file and the + skill that applies before it starts. Check its result against the laws yourself: an agent's "done" or "passing" + report is not evidence. +- **A decision you were not given is a law change.** A tie-break, a threshold, a fallback, or a "deviation" that + changes what production promises goes to the maintainers before it goes into code. diff --git a/packages/oracles/oracle-gaps/capture-setup.mjs b/packages/oracles/oracle-gaps/capture-setup.mjs index 72e61ff8..51d3c53f 100644 --- a/packages/oracles/oracle-gaps/capture-setup.mjs +++ b/packages/oracles/oracle-gaps/capture-setup.mjs @@ -811,6 +811,11 @@ function render(value, seen = new Set(), depth = 0) { // once per worker and call the hooks of the copy now running. globalThis.__oracleGapsHooks = { matcher(name, assertion) { + // Outside any test (a file-level hook, or async work that outlived its + // test) there is no row: the last one closed its hash (finishTest), and + // updating it throws out of the hook (#188). The assertion still runs, + // so a failing one still fails the file. + if (!inTest) return try { const rendered = `${name}(${render(chai.util.flag(assertion, `object`))})\n` digest.update(rendered) diff --git a/packages/oracles/oracle-gaps/gap-report-model-oracle.mjs b/packages/oracles/oracle-gaps/gap-report-model-oracle.mjs index bb306a69..571a6228 100644 --- a/packages/oracles/oracle-gaps/gap-report-model-oracle.mjs +++ b/packages/oracles/oracle-gaps/gap-report-model-oracle.mjs @@ -1193,6 +1193,19 @@ const drawn = fc.record({ // lines changed. Where no such push exists, the find stays one line. // Drawn last (the generator rule). authoredSpan: fc.boolean(), + // The oracle file whose file-level `beforeAll` and `afterAll` each assert, + // outside any test, as an oracle that checks its fixture before and after + // its laws does (issue #188): `a`, `b`, or none. The hooks call nothing of + // the source under test, so they change no outcome; a file that fails for + // another reason fails with or without them. Drawn last (the generator + // rule). + hookAsserts: fc.constantFrom(`none`, `none`, `a`, `b`), + // Whether that file's `afterAll` assertion is false: the file then fails + // outside its tests, after every test passed, and is a broken owner file + // that judges nothing ("A broken owner file judges nothing", 2026-11-19). + // Inert where no file asserts, as `failingLawCalls` is without a failing + // law. Drawn last (the generator rule). + hookFails: fc.constantFrom(false, false, false, true), }) // The edit sequence over the witness module, the one list of steps that a @@ -2013,6 +2026,17 @@ const witness = [ body: [push], tests: [judging(`a`, `fixed seed`, 1, { spies: true })], }, + // A file whose file-level `beforeAll` and `afterAll` each assert, as an + // oracle that checks its fixture before and after its laws does. The + // `afterAll` runs after the last test ends, outside any test. The capture + // must leave the file passing, as it does alone (issue #188). A drawn + // history's file asserts so too (`hookAsserts`); this witness pins one. + { + id: `w_hooked`, + owners: [`a`], + body: [push], + tests: [judging(`a`, `fixed seed`, 1, { hookAsserts: true })], + }, // Two tests that share state: the first, which calls another function, // sets it; the second calls this function only when it is set. A runner // that runs only the tests that reached a site must not change what the @@ -2343,6 +2367,7 @@ const captureWitness = new Set([ `w_soft`, `w_getter`, `w_spy`, + `w_hooked`, `w_shared`, `w_caught`, `w_late`, @@ -3599,6 +3624,9 @@ function resolveHistory(history) { failingLawCalls: history.failingLawCalls ?? `none`, failingLawHook: history.failingLawHook ?? `none`, failingLawSpins: history.failingLawSpins === true, + // The test file whose file-level hooks assert (`hookAsserts`), or none. + hookAsserts: history.hookAsserts ?? `none`, + hookFails: history.hookFails === true, ordinary: history.ordinary === true, // The batch whose run rejects (a test-only fault; 0 is none). rejectBatch: history.rejectBatch ?? 0, @@ -5039,6 +5067,13 @@ const FAILING_LAW = `a law that fails with no mutant active` const FAILING_ERROR = `Error: this law fails with no mutant active` const HOOKED_SUITE = `hooked` const HOOK_ERROR = `this hook fails with no mutant active` +// The error a file-level `afterAll` whose assertion is false (`hookFails`) +// rethrows in place of the assertion's own message, so the baseline's text is +// one the model knows. +const FILE_HOOK_ERROR = `this file-level hook fails with no mutant active` +/** Whether oracle file `file`'s file-level `afterAll` assertion fails (`hookFails`). */ +const brokenByHook = (plan, file) => + plan.hookAsserts === file && plan.hookFails === true // How often a heavy failing law calls production: past the call floor // (check.mjs CALL_FLOOR, 100,000 site evaluations) in its own test. const HEAVY_CALLS = 110_000 @@ -5050,6 +5085,10 @@ const SPIN_BOUND = 1_000_000 const holdsFailingLaw = (plan, file) => plan.failingLaw === file || (plan.failingLaw === `both` && (file === `a` || file === `b`)) +/** Whether test file `file`'s file-level hooks assert: the history names it (`hookAsserts`), or a witness test of it does. */ +const holdsHookAssertion = (plan, file) => + plan.hookAsserts === file || + plan.tests.some((t) => t.file === file && t.hookAsserts) /** The failing law's name, as its file's tests name it. */ const failingLawName = (plan) => plan.failingLawHook === `none` @@ -5089,7 +5128,10 @@ function blockingOf(plan) { return [`a`, `b`].flatMap((file) => { const owner = brokenOwner && file === `b` const law = holdsFailingLaw(plan, file) - if (!owner && !law) return [] + // A file whose file-level hook fails is a broken owner file: it fails as + // a whole, as a file that did not load does, and names no law. + const hookBroken = brokenByHook(plan, file) + if (!owner && !law && !hookBroken) return [] const broken = owner ? [`${BROKEN_SUITE} > fixed seed 999`] : [] const failing = law ? [failingLawName(plan)] : [] // File b's failing owner follows the plan's tests; the failing law is @@ -5107,10 +5149,16 @@ function blockingOf(plan) { return [ { file, - laws, + ...(hookBroken ? { broken: true } : { laws }), // How many of its tests fail, which the baseline counts. failed: broken.length + (lawFails ? 1 : 0), - hook: law && plan.failingLawHook !== `none` ? HOOK_ERROR : undefined, + // The error a file that fails outside its tests names: the module's + // (a file-level hook's) before a describe's hook's. + hook: hookBroken + ? FILE_HOOK_ERROR + : law && plan.failingLawHook !== `none` + ? HOOK_ERROR + : undefined, ...(first === undefined ? {} : first === failingLawName(plan) @@ -5175,7 +5223,8 @@ function frameworkTestsOf(plan) { * Each test file's baseline (law 14): its tests that ran and those skipped * (a file with no tests of the plan holds one skipped placeholder), how * many failed, and its failing test, or that it did not load, or that it - * failed outside its tests (a describe's hook). + * failed outside its tests (a describe's hook, or a file-level hook that + * fails after its tests passed: a broken owner file, which loads). */ function baselineOf(plan) { const failing = blockingOf(plan) @@ -5187,7 +5236,8 @@ function baselineOf(plan) { (plan.midrun && file === plan.midrunBy ? 1 : 0) + (file === `a` && plan.consoleOutput ? 1 : 0) const entry = failing.find((f) => f.file === file) - const loads = entry === undefined || entry.laws !== undefined + const loads = + entry === undefined || entry.laws !== undefined || entry.broken === true // The failing owner's suite holds two tests and a third of its name, and // the failing law is one test more; a `beforeAll` that throws skips it. const owner = plan.fault === `brokenOwner` && file === `b` @@ -5315,8 +5365,12 @@ function model(plan) { // console's, and the abort's), which judge no mutant, though each keeps // its file's mutants from blocking. A failing law is no test of the plan, // so the plan's tests judge as they would beside none. + // A broken owner file (a file-level hook that fails) loads and runs its + // tests, and judges nothing with them. + const judgesIn = (file) => + runsTests(file) && failing.find((f) => f.file === file)?.broken !== true const passingIn = (file) => - runsTests(file) ? entryOf(file).ran - entryOf(file).failed : 0 + judgesIn(file) ? entryOf(file).ran - entryOf(file).failed : 0 // Every test of an owner file, the plan's and the fixture's own // deterministic passing tests (`frameworkTestsOf`, #204). const census = [...plan.tests, ...frameworkTestsOf(plan)] @@ -5325,7 +5379,7 @@ function model(plan) { (t) => oracleFilesOf(plan).includes(t.file) && owners(id).has(t.file) && - runsTests(t.file), + judgesIn(t.file), ) // An authored mutant (its copy records no reach) with no passing owner // test, that a failing law or a failing file of its owners holds, and no @@ -5369,7 +5423,7 @@ function model(plan) { return new Map( spins ? [...owners(site.fnId)] - .filter((file) => holdsFailingLaw(plan, file) && runsTests(file)) + .filter((file) => holdsFailingLaw(plan, file) && judgesIn(file)) .map((file) => [file, plan.failingLawAt]) : [], ) @@ -5637,6 +5691,30 @@ function model(plan) { } } +/** + * The names a test file imports from Vitest, each once: the hook that a + * failing law's describe throws from, `afterEach` for a test whose cleanup + * throws, `afterAll` and `beforeAll` for a file whose hooks assert + * (`hookAsserts`), `describe`, `expect`, `test`, and `vi` for a test + * that spies. + */ +const vitestImports = (plan, file) => { + const tests = plan.tests.filter((t) => t.file === file) + return [ + ...new Set([ + ...(holdsFailingLaw(plan, file) && plan.failingLawHook !== `none` + ? [plan.failingLawHook] + : []), + ...(tests.some((t) => t.cleanupThrows) ? [`afterEach`] : []), + ...(holdsHookAssertion(plan, file) ? [`afterAll`, `beforeAll`] : []), + `describe`, + `expect`, + `test`, + ...(tests.some((t) => t.spies || t.timed === `spiedclock`) ? [`vi`] : []), + ]), + ] +} + const testName = (t, index) => t.name === `plain` ? `check ${index}` @@ -5744,7 +5822,7 @@ function oracleTestFile(plan, file) { const out = [ // A per-file environment, which Vitest reads from the file's text. ...(plan.pragma && file === `a` ? [`// @vitest-environment marked`] : []), - `import { ${holdsFailingLaw(plan, file) && plan.failingLawHook !== `none` ? `${plan.failingLawHook}, ` : ``}${plan.tests.some((t) => t.file === file && t.cleanupThrows) ? `afterEach, ` : ``}describe, expect, test${plan.tests.some((t) => t.file === file && (t.spies || t.timed === `spiedclock`)) ? `, vi` : ``} } from 'vitest'`, + `import { ${vitestImports(plan, file).join(`, `)} } from 'vitest'`, ...(plan.tests.some((t) => t.file === file && t.shrinks) ? [`import fc from 'fast-check'`] : []), @@ -5819,6 +5897,33 @@ function oracleTestFile(plan, file) { : file === `b` ? `strict` : `true` + // A file whose hooks assert (`hookAsserts`): a `beforeAll` and an `afterAll` + // at the file's level, each with an assertion outside any test; the + // `afterAll` runs after the file's last test has ended (issue #188). Each + // asserts something false and checks that the assertion threw, as it does + // alone: a capture that recorded it into a closed row throws another + // error, which the hook rethrows, and one that skipped the matcher outside + // a test throws nothing, which the hook reports. Neither hook calls the + // source under test. Where the history names the `afterAll` as failing + // (`hookFails`), it rethrows its assertion's failure as FILE_HOOK_ERROR, so + // the file fails outside its tests with a message the baseline names. + if (holdsHookAssertion(plan, file)) + out.push( + ...[`beforeAll`, `afterAll`].flatMap((hook) => [ + `${hook}(() => {`, + ` let threw = false`, + ` try {`, + ` expect(shared.value).toBe(-1)`, + ` } catch (error) {`, + ` if ((error as { name?: string }).name !== 'AssertionError') throw error`, + ...(hook === `afterAll` && brokenByHook(plan, file) + ? [` throw new Error('${FILE_HOOK_ERROR}')`] + : [` threw = true`]), + ` }`, + ` if (!threw) throw new Error('the assertion in ${hook} did not run')`, + `})`, + ]), + ) if (plan.failingLawAt === `start`) out.push(...failingLawLines(plan, file)) plan.tests.forEach((t, index) => { if (t.file !== file) return diff --git a/packages/oracles/oracle-gaps/gap-report-oracle.property.test.mjs b/packages/oracles/oracle-gaps/gap-report-oracle.property.test.mjs index 7f095f9c..fc9db9d2 100644 --- a/packages/oracles/oracle-gaps/gap-report-oracle.property.test.mjs +++ b/packages/oracles/oracle-gaps/gap-report-oracle.property.test.mjs @@ -92,9 +92,11 @@ * Vitest discovers and that includes no test (F12). The CLI's * capture must not change what a test observes: an owner that passes * alone passes under the CLI, even when it counts the reads of a getter - * on a value it asserts on, or spies on the builtins a value is scanned + * on a value it asserts on, spies on the builtins a value is scanned * with (`Object.keys`, `Object.getPrototypeOf`, - * `Object.getOwnPropertyDescriptor`) and counts their calls. A Vitest + * `Object.getOwnPropertyDescriptor`) and counts their calls, or asserts + * in a file-level `beforeAll` or `afterAll`, outside any test; an + * `afterAll` runs after its last test has ended (issue #188). A Vitest * config that defines `test.projects`, which the runner cannot honor, * refuses the run and names `test.projects` (maintainer decision of * 2026-11-08), rather than leave every mutant unreached. The run loads @@ -362,7 +364,10 @@ * load, which names the file, each with the step that unblocks it (G13); * then, when an oracle file failed, `Provisional:` with how many mutants * are blocked. A failing law, a failing owner file, or a setup file that - * throws and fails every file, refuses nothing. A test that fails with no + * throws and fails every file, refuses nothing. A file whose file-level + * hook fails, after its tests passed, fails as a whole and judges nothing, + * as a file that did not load does ("A broken owner file judges + * nothing", 2026-11-19). A test that fails with no * mutant active judges nothing: it is left out per test, as a * nondeterministic test is, and the passing tests of its file still * judge the mutants the file owns (the maintainer's decision "Block per @@ -4483,6 +4488,35 @@ async function driver(plan, observe) { ) ) states.add(`a failing describe hook made its laws fail`) + // A file whose file-level hook fails is a broken owner file ("A broken + // owner file judges nothing", 2026-11-19): a mutant that only it owns is + // blocked by it, and one that another owner judges is killed there. + const hookBroken = plan.hookFails && plan.hookAsserts !== `none` + if ( + cli.exit === 0 && + hookBroken && + cli.mutants.some((m) => { + const files = [...ownedBy(m.function)] + return ( + m.source === SOURCE && + m.outcome === `blocked` && + files.length > 0 && + files.every((file) => file === plan.hookAsserts) + ) + }) + ) + states.add(`blocked by a failing file-level hook`) + if ( + cli.exit === 0 && + hookBroken && + cli.mutants.some( + (m) => + m.source === SOURCE && + m.outcome === `killed` && + [...ownedBy(m.function)].includes(plan.hookAsserts), + ) + ) + states.add(`a broken owner file left its mutants to another owner`) // A failing law that spins under a mutant still runs, before the passing // law that would kill it, so the count cut it causes is a gap ("An // excluded test still runs", 2026-11-23): the mutant is blocked by that @@ -4676,6 +4710,17 @@ async function driver(plan, observe) { states.add(`an uncalled function in an owned function is a gap`) if (m.function === `w_spy` && m.outcome === `killed`) states.add(`a builtin spy the capture left uncalled`) + if (m.function === `w_hooked` && m.outcome === `killed`) + states.add(`an assertion outside any test the capture left passing`) + // A drawn test file whose hooks assert (`hookAsserts`) judged a mutant + // (the witness above pins one such file; this counts the drawn ones). + if ( + m.outcome === `killed` && + plan.hookAsserts !== `none` && + !plan.hookFails && + [...ownedBy(m.function)].includes(plan.hookAsserts) + ) + states.add(`a drawn file whose hooks assert judged`) if (m.function === `w_shared` && m.class === `branch-never-taken`) states.add(`a test that depends on an earlier test`) if (m.function === `w_late` && m.outcome === `killed`) @@ -7667,6 +7712,10 @@ const required = [ `a heavy failing law left its file's other laws judging`, `a mutant that only a failing law reached was blocked by it`, `a failing describe hook made its laws fail`, + // A file-level hook that fails: a broken owner file (its constructed + // history, "a file-level hook that fails beside another owner"). + `blocked by a failing file-level hook`, + `a broken owner file left its mutants to another owner`, // A failing law still runs ("An excluded test still runs", 2026-11-23). `a failing law that spins under a mutant cut its copy`, // #204's census under per-law blocking (#186). @@ -7752,6 +7801,7 @@ const required = [ `a source that imports a dependency's subpath ran`, `a package with an unbuilt devDependency ran`, `a builtin spy the capture left uncalled`, + `an assertion outside any test the capture left passing`, `an uncalled function in an owned function is a gap`, `the CLI ran from a path with a space and #`, `a setup error`, @@ -7897,6 +7947,8 @@ const separate = [ `a heavy failing law left its file's other laws judging`, `a mutant that only a failing law reached was blocked by it`, `a failing describe hook made its laws fail`, + `blocked by a failing file-level hook`, + `a broken owner file left its mutants to another owner`, `a failing law that spins under a mutant cut its copy`, `the failing owner's passing pair judged module data beside its failing law`, `a partial run of one function`, @@ -8066,6 +8118,7 @@ const withDeclaration = (constructed) => failingLawCalls: `none`, failingLawHook: `none`, failingLawSpins: false, + hookFails: false, declaration: index % 2 === 0 ? `wrapper` : `oracleProperty`, ownerless: false, owners: [`a`, ...generated.owners.slice(1)], @@ -8138,9 +8191,9 @@ const witnessEditSequence = (witness) => (generated) => ({ oracleProperty({ id: `oracle-gaps.report`, law: { - statement: `The gap report enumerates the promised operator mutants, leaves out exactly the probe-only code, discovers every oracle that owns a function's call tree and refuses broken ownership, judges each mutant only by its owners' tests on their registered routes and counts only law verdicts on reproducible routes as kills, which outrank a run that never ends, anchors each mutant by its function and normalized statement, lists every gap and unowned mutant once with consistent counts, keeps keys stable under unrelated edits, reports through one daemon per package what a cold run reports at every state of a sequence of edits, and bounds the runs that confirm a mutant's cut-off copies by one budget per mutant and names in each heartbeat a mutant that is running, in a file that runs it, leaves nothing in the package and writes nothing where Vitest's include could find it while it runs, leaves no process running once it is stopped, runs the package as Vitest does from any install path and any --source spelling: one instance of each workspace dependency, no refusal over an unbuildable devDependency, child processes for a native addon anywhere in the tree, a capture that a test's builtin spies cannot see, and a refusal of test.projects; leads its report with every test file's baseline, blocks only the mutants a failing oracle file owns and judges the rest, prints every line of its stream with the prefix oracle-gaps: and its kind, one decisive baseline line before any mutant, and a done line last, and every run that does not complete ends, cold or through the daemon, with a refusal that exits 2, prints a refused: block and one fix: directive with no stack trace, and writes the refusal to the run's output directory. A run with --diff-base runs every test file's baseline, judges only the mutants on lines changed since that commit, every line of a source git does not track included, each marked inDiff and judged as the run without it judges it, and says on its stream, in summary.md, and in results.json that the run is partial.`, + statement: `The gap report enumerates the promised operator mutants, leaves out exactly the probe-only code, discovers every oracle that owns a function's call tree and refuses broken ownership, judges each mutant only by its owners' tests on their registered routes and counts only law verdicts on reproducible routes as kills, which outrank a run that never ends, anchors each mutant by its function and normalized statement, lists every gap and unowned mutant once with consistent counts, keeps keys stable under unrelated edits, reports through one daemon per package what a cold run reports at every state of a sequence of edits, and bounds the runs that confirm a mutant's cut-off copies by one budget per mutant and names in each heartbeat a mutant that is running, in a file that runs it, leaves nothing in the package and writes nothing where Vitest's include could find it while it runs, leaves no process running once it is stopped, runs the package as Vitest does from any install path and any --source spelling: one instance of each workspace dependency, no refusal over an unbuildable devDependency, child processes for a native addon anywhere in the tree, a capture that a test's builtin spies cannot see and under which a file-level hook's assertion passes as it does alone, and a refusal of test.projects; leads its report with every test file's baseline, blocks only the mutants a failing oracle file owns and judges the rest, prints every line of its stream with the prefix oracle-gaps: and its kind, one decisive baseline line before any mutant, and a done line last, and every run that does not complete ends, cold or through the daemon, with a refusal that exits 2, prints a refused: block and one fix: directive with no stack trace, and writes the refusal to the run's output directory. A run with --diff-base runs every test file's baseline, judges only the mutants on lines changed since that commit, every line of a source git does not track included, each marked inDiff and judged as the run without it judges it, and says on its stream, in summary.md, and in results.json that the run is partial.`, authority: `The maintainer's decisions in design runs v11, v14, and v19 (2026-11-04 and 2026-11-05), not in this package's records, including that a kill by reach agreement alone is a gap and that an incremental run through the daemon equals a cold one (v19.3); the project's oracle guide on quiet exclusions; the oracle rubric's outcome kinds (ORC-006); the CLI's documented operator list in schemata.mjs; the maintainer's dispositions G1, G2, G4, G5, G6, and G13 of the framework papercut ledger (2026-11-11) and the v20 freeze's namespacing, one-loop, and provisional-report decisions (2026-11-10); the maintainer's request for a greppable stream (2026-11-12, relayed by the coordinator with its decisions of that day: the same prefixes on stdout and stderr, a done line for a stopped run, and no --max-gaps).`, - limits: `Law 12 judges refusals. Known limits of the ending's ask (#139): check.mjs writes its results.json and summary.md before the ask, so a completed run that gets a stopped answer keeps its completed report; on win32, the decide step reads a stop recorded before the child's exit at its close or after 2 s, not at the stop itself; and a child whose supervisor was killed mid-ask has no reader for its stderr, so the orphan history judges stdout and its liveness, not stderr. The one internal error a history reaches is the constructed rejected-batch history (rejectBatch, a test-only fault that rejects a batch's run after its copies are in Vitest's and Vite's state). Its run is judged in this order: the output namespace, process warnings, and config lines, as for any run; then bounded retention, which owes the rejected batch's own line with its state after retirement; then the stream law (law 15) on both streams, as for any run, so its error line and its done line carry the prefix, and no other line does not, which the state \`a run ended in an internal error\` declares; then exit 3 with an internal error's done line last on both streams, no stack frame on stderr, and an error.log in its output directory. What the error.log's stack says is not judged. An internal error that no fault constructs is a completion failure, reported before the stream law; an internal error through the daemon is reached by no history, and its ending is the same function's (endRun), by inspection. The internal error's lines follow the register's C entry "The internal-error line" (2026-11-16): the general law (endsBreach) owes every run that ends through endRun one error line on stderr naming the done line's log, the output directory's error.log, and none on stdout, and owes the supervisor's own exit 3 none. The message's escape is witnessed by the fault's message, which holds a line break and a forged done line after it; the log path's escape only on POSIX, where the rejected batch's output directory holds a line break (a name on win32 cannot). Paths in a completed run's lines (the results note, the done line's report, the test-output note) are escaped the same way, by inspection: no completed history names such a directory. P10's exempt lines (v21.2 P10 and I3) are read by their own shapes (exemptBlocks), never by indentation alone: a baseline failure's indented details, a refusal's block, Node's warning with its \`--trace-warnings\` frames and its hint, V8's fatal block, esbuild's message block, and Vite's own \`[vite]\` line. The V8, traced-warning, and esbuild blocks are calibrated beside our own line with no prefix (the stream calibrations put them before the rejected-batch run's done line, and the law must name our line alone); no generated history prints any of them or a Vite line, and a shape of those tools that exemptBlocks does not name is read as a stray. The stdout summary's exemption is unused and not exercised: the CLI prefixes every summary line (its summary, legend, and function kinds). \`--help\` prints its usage text with no prefix and no done line, exempt by the register's M entry "\`--help\` is exempt" (2026-11-16), and the static oracle's Help law owes exactly that text; \`--stop-daemon\` prints nothing and exits 0, read the same way as a command outside the run protocol (C, pending ratification), and this oracle runs it without observing its streams. A syntax error in a module that the config imports lets the esbuild that Vite bundles configs with print its block before the refusal (trace, Vite 7.3.7, esbuild 0.28.2: \`✘ [ERROR] Unexpected end of file\`, an empty line, \` helper.ts:2:0:\`, the code frame, then the refused block): its lines are exempt by the register's M entry "Other tools' output is exempt" (2026-11-16), the refusal and the done line around them keep the prefix, and no history generates it. Bounded retention reads the hook's lines (retention-hook.mjs). Its count of one line per batch (runner law L2) rests on the index the hook takes when a batch starts, so a CLI that skipped a batch's index and its line together, or that omitted only the line of a check's last batch, keeps the indices 0..n-1 and is not seen; a check that ended before its report (the rejected batch, a stopped run) and a daemon the driver killed are judged for at most one line per index, since the batches they were running at their end owe none. A line's process is told by check.pid, which the check writes, and the driver itself knows only the daemon it killed. The cold store's law (held) counts the entries given to the store's put that a full collection leaves reachable, so a store that kept only a part of an entry (its unit without the entry) is not seen; staleOpen reads Vitest's own close state (closingPromise, set when close starts), so a close that starts and never resolves is the runner oracle's (L8); and a context replaced after a check's last batch is observed only by a later check's first batch through the daemon. The run whose process aborts is declared on every platform. Its win32 witness (process.abort through ORACLE_GAPS_TEST_ABORT_AT, under the win32 supervisor) lands in #79; until then the Windows end-to-end job is non-blocking (C entry (c)). On win32 Node cannot deliver SIGTERM (its kill is TerminateProcess, which ends the process with no stopped line), so the stop states that name SIGTERM are required on POSIX only, and a stop there goes through the CLI's test stop hook and is observed as SIGINT, which owes its done line as any stop does (no history sends a win32 child.kill, the SIGKILL-equivalent that owes none); every SIGINT state stays required on win32. A stop as the CLI starts lands only in one of two holds: the driver's own preload before the CLI's first statement (outcome a, nothing written; POSIX only, since its witness is a signal's default action), or the CLI's hold after its started marker, which the stop the CLI keeps releases (outcome b, judged only when the supervisor started no child); a stop during Node's own start between the two is not generated, since its outcome follows timing. The drawn spawn delay is a wait inside a hold, so it cannot move a stop out of it. Stop runs that land while the config warms (ORACLE_GAPS_TEST_WARM_PROBE) are still drawn, and on win32 every drawn stop goes through ORACLE_GAPS_TEST_STOP: each is a test-only hook that a drawn field switches, main's pattern, which the review of #57 (A3) brought to the maintainer; only the stop after the completed line (ORACLE_GAPS_TEST_HOLD_UNTIL) was made constructed-only. A missing \`ps\` is generated only as a PATH that names no command, on POSIX, where the run is supervised. The unsupervised path (stopNow, every win32 stop) is reached on POSIX by one constructed history whose stop is held at the run's note, before the check starts a process: an unsupervised POSIX run has no group to end, so a stop while the witness's test spins leaves that test's own child (measured; C 2026-11-13, Windows (e)), which win32 ends with the job object libuv puts its children in. Argument refusals are the static oracle's; the check's rejection of a stack trace, a missing fix, and a wrong exit code is calibrated in the static oracle, through the same refusalBreach, and here only a refused run reported as complete is calibrated, because each calibration here runs real CLI histories. Law 15's stdout gap lines are judged against each completed run's own results.json, by id: the cold run, and each check through the daemon (every step's check and the check that a mid-run edit overlaps); a stopped run and a refusal list no gaps and are not judged so. A line's change is read loosely: its code on one line, whole or cut after a kept part and ended with \`...\`; where the printer cuts (60 code points, kept 57) is the classify oracle's law 8 (\`shortened\`), in-process. A line with any text after its change does not read and fails loudly: the \` (cause: )\` suffix that #99 adds to timeout lines is not read yet, so whichever of #99 and #115 lands second extends readGapLine. Hangs only as an owner test that awaits a promise that never settles, under a 1 s first budget and a 20 s full limit, and a slow run only as two witnesses whose tests wait where the output changed, 3 s in one that then judges and 10 s in two one-test owners of one that does not; busy loops only on instrumented code (cut by the call budget), no slow runs past the full limit that would end, hangs in ordinary or nondeterministic tests, setup errors other than a throw at module load, loops, multi-line conditions, two functions on one line, or await, new, and void statements; nested functions, object-literal methods, accessors, and class-field arrows only where no test calls them (their ownership is the static oracle's); two source files of one package, with no re-exports, namespace imports, or calls into another package; --only only in a stopped run and a partial run of one function's mutants, and no --sample or --diff-base; the baseline's failures only as one failing owner test that throws an error and a setup file that throws, so a baseline law violation's law and counterexample lines are the classify oracle's; a derived class's file is instrumented and its sites are judged as unowned, but no test imports or constructs the class, so its no-mutant and super-region behavior is the static oracle's (in-process), not this oracle's; package configs only as vite.config or vitest.config with one of the extensions .ts, .mts, .cts, .js, .mjs, and .cjs (not every pair), as config/gap-vitest with the same extension through --config, or none, as an object or a sync or async function, with no plugins of their own except one enforce: 'pre' transform that appends a comment to each module of the package (prePlugin) and a plugin whose load reads each test file with a sync read (loadPlugin), drawn for a config in ES module syntax and reached by its own constructed history too; a plugin whose output depends on anything but the module's text (a sidecar file it reads) and an environment variable that changes between checks are not generated, since the runner tracks neither yet and the daemon's environment is fixed when it starts (F-A1: the maintainer decided on 2026-11-13 that the daemon tracks both and restarts when they change, in the next pull request); and test.projects only as a refusal, and only under the package's own package.json; the supervisor-death state is required and entered only off win32: win32 has no supervisor until #79, so there the state is not reached and its history is not judged (platform-scoped reach; the win32 run is unsupervised, which register C entry (e) of #58 records as not guaranteeing that no process outlives the CLI); a config's test.root only in four shapes, drawn for an ES module config that Vitest discovers in the package (the randomness-wins decision, 2026-11-16) and each reached by its own constructed history of one owner and one context, where the test files' globs and the setup file are relative to the root (issue #101): the directory that holds the tests, the directory above the package, a directory of the package that holds no test file, and the package's tests as a symbolic link to the directory that holds them (required on every platform, since Windows creates the link as the driver's other links); not under --config (nor in a history whose config edit names a second config), a CommonJS config, a parent's config, test.projects, several contexts with different roots, or a root that is the filesystem's root; the runner serves each copy of a test file by its absolute path, through its pre plugin's load (which answers before the config's own plugins) and through its read of the copy's path for Vitest's pragma read (serveCopies), and histories run copies only in Vite's server environments (node and the pragma's ssr environment): jsdom and happy-dom, Vite's client environment, are not generated (the #103 merge-gate review ran jsdom by hand under all five root shapes, and the copies loaded in each); a top-level await only in an ES module config and require only in a CommonJS one, as Vitest itself loads no other; a --config outside the package is refused by design, through the rule for paths outside the package (args.mjs), and no history generates one; contexts only one, four, or eleven, and process warnings judged only as MaxListenersExceededWarning on the CLI's own stderr (a daemon's process warnings go to its log); a context that fails to open gives back its listener allowance, which no observation shows (a kept allowance only raises the limit, so no warning follows), so that accounting is fixed by inspection; no probe-bound states, so reach agreement's killing of probe mutants is not checked; no gap answers or gate; law 9 judges the witness module's outcome classes along one constructed edit sequence only (a test edit, a helper edit, and a revert), which runs as two constructed histories, one for each half of the module (captureA and captureB, whose union is the module and which share no function; a function stays with the functions its tests or statements read), since the whole module along it took one CI job (#106, #145; maintainer decision "A one-history job over budget is cut by cost", 2026-11-16), so an interaction between functions of different halves, beyond the ones the split keeps together, is not judged along the sequence (the whole module runs together in \`every outcome class\` and in generated histories, which take no steps); and the budget witness's outcome classes along one constructed second check with nothing changed, because a generated history with the witness module or the budget witness takes no steps (maintainer decision, 2026-11-11, and the runtime review's P1-a, 2026-11-12; this oracle owns the gap); the state "a timed-out run reused after an edit" counts only runs cut by their call budget (the spin, in the first half), a count the CLI records, by the maintainer's decision "#104 state narrowed, #99 restores" (2026-11-17), which narrows "#90 job stays blocking" for that state only: the reuse of a run cut by the clock (a hang) is judged by law 9 but not required, because on main a hang's timeout is stored only when the sampler saw the copy idle, which load decides, and otherwise its confirmation is cut short by its mutant's budget and not kept (#104); #99 makes a hang a state-based no-progress kill and restores the reach as "a run killed for no progress, reused after an edit" (#156); law 9's edits come between checks, except one, midrun, which lands during a check through the daemon: a test of file a, whose context has loaded file b's helper, rewrites the helper in the baseline's first run of file a, before file b's runs read it, in one context or several; or a test of file b rewrites its own helper, or the data file that its verdict read through a sync fs read, after file b's judged tests read them, in the run that judges with the old text (review of #55, F1); that check must report, for each mutant, what a cold run of the state before the edit or of the state after it reports, and exit as one of them does (third review of #55, F-C), compared per mutant result rather than per file; when file b's own test lands the edit, b's baseline reads the old text and b's mutant runs read the new one, so b's own mutants in that check are not judged, since their results legitimately mix the two texts (maintainer decision, 2026-11-13), while every other mutant there is judged against both cold runs, with the check's exit code, its mutants' keys, and its stream; the stronger follow-up compares each run's raw outcome with the cold outcome of the state that run read; and the next check, with nothing changed, must equal a cold run of the state after the edit, compared for equality of results only, not for what the daemon reused or computed (the runner's rule: a run whose input changed after the run read it is invalidated and not stored, settleIn); a check through the daemon of a state that nothing changed must compute no run that was not cut off, judged where no test reads the clock (F-A, F-A2), and a test's fs read of a file and the module that the context serves from it are two inputs, each under its own hash (F-A2); an edit during a mutant run is not generated, and a file is edited mid-run only by the run's own tests, not by another process at an arbitrary time; a file that a test reads through fs is edited only as one JSON file that file b's verdict reads by a sync, a promise, or a callback read, or by a sync read after it stats its own directory and tests that it exists (statDir: the directory is an input as a directory, not by its content, and is not itself edited), each read first checking that its fs function keeps its own name and length (the runner stores a run under the files in the package that its copy reads with readFileSync, readFile, existsSync, or statSync, or the fs/promises readFile or stat, each with its hash at the copy's first read; a read outside the package or under node_modules, from a worker thread or a child process that a test starts, or through any other fs API, which includes readdir, opendir, glob, globSync, createReadStream, realpath, lstat, access, open, a read through a file descriptor (read, readSync, readv, fstat, fstatSync, and readFileSync or readFile given a file descriptor), copyFile and copyFileSync, cp and cpSync, openAsBlob, statfs, readlink, the callback stat, exists, watch, watchFile, and the fs/promises access, open, and glob, is no input, and none is generated: the maintainer decided on 2026-11-13 that every fs read except watch and watchFile is an input, which a follow-up of #55 implements, and until then this oracle owns the gap); a run cut off by its clock writes no closing row, so it is stored under its file's known inputs only, while a run that spun ends and keeps the inputs it named (F-D), in a batch as alone; a spun copy that reads a file that its file's unmutated run never reads is generated (spinData: file b's verdict tests that read the data spin on the function they test while it is open), and the data's edit is judged by law 9 for copies that spin in a batch; a copy that spins alone (runAlone, after a batch with an error outside any test) is generated too (spinThrows: each spun copy schedules an error that fires after its test), and its data's edit is judged the same way; an error outside any test only from a copy that spins, so the alone path's other units (a slow copy's confirmation) stay unwitnessed; a test that rewrites a file it read with the same text makes the next check compute that run again (1 run in the self-edit histories), since the edit changes the file's modification time: the daemon is conservative there, nothing goes stale, and content keys (D10) remove it, with a selfWrite dimension in that pull request; the mid-run marker sits in the daemon's session directory, .oracle-gaps-, whose location predates #55; the runner's hash memo knows a file by its size and modification time, so an edit that keeps both is not seen, and no history makes one (D10, planned in phase 2, A5); law 9's edits leave out other environment variables, new files that change how an unchanged import resolves, Vite config and installed-package changes, and concurrent checks other than two that start the daemon; cut-off charging judged only under one budget; native addons only as a binding.gyp or a prebuilt .node file, not as optional platform packages; a scratch package lies in the CLI's directory (.scratch-*), in a directory beside it whose name extends the CLI directory's name (siblingDir, drawn), or in the OS temp directory, so the driver's inside-the-CLI label is judged against a prefix that is not a parent; a CLI path spelled with another drive-letter case or separator than the package's is win32-only and not generated; daemon races (two CLIs reading one error file, a CLI hearing closing from the failing daemon it started, a reset connection on macOS) fixed by inspection; a daemon that stops answering only at four holds, each released by a count, never by time: a fresh daemon's first check held before it runs until the daemon accepts the driver's next request (ORACLE_GAPS_TEST_HOLD_OVERLAP), which stands in for a session slower to open than the bound while the CLI carries the warm-up pause; and, after a warm check with the pause disarmed (ORACLE_GAPS_TEST_PAUSE_ARM), the daemon's own pauses (pauseAt): before a check runs (daemon-check), before a check that reuses every run warms its contexts (daemon-warm), and before a context warms in place of one that a cut stopped, after the test edit (daemon-replace), each released by the driver's file once the CLI has ended; the CLI's bound is the socket's idle timeout on a daemon that sends nothing (60 s; these histories shorten it to 3 s), a wall-clock bound that changes the run's path and never its outcome; its cold check must equal a cold run (law 9's cold fallback, R39), and it never holds, since only the daemon gives its session the pauses (G43: a hook changes no outcome); the daemon must still run after the fallback, must leave the run's --out as the CLI left it once released (every file's text, with a poison the driver writes into its results.json and error.log), and must serve the next check (its served mark); the daemon drops a check whose CLI has gone before it runs, at each phase's end, and after each context that warms in place of a cut one, which is the one stretch inside a phase with no running copy to beat, and a check ends only once every context's share of a phase has; not witnessed: a gone CLI found while two contexts are both warming in place of cut ones (the wait for every context's share is by inspection), and a copy that starts in the moment between the CLI's bound and the daemon's reading of the closed connection, which runs to its end and writes into the run's --out (the race is the bound's own, a wall clock's, and no history generates it); the held warm-up and the held re-warm rely on the warm daemon's check reaching its hold within the 3 s bound, as the shortWait history relies on its first copy starting within it, and the driver's wait for the hold fails loudly otherwise; the one beat left, a running copy's poll, is witnessed by a warm daemon's check under the 3 s bound while a copy waits 10 s (shortWait); a CLI whose daemon is closing and hung waits 60 s and fails with an internal error rather than checking cold, and --stop-daemon against a hung daemon has no bound (merge gate F3; owed: a constructed history that closes a held daemon, issue #135); a fallback whose cold check refuses is not generated (law 9's refusal-notes comparison would see the fallback note); the runner's copies of the test files exist only in memory, and its harness and Vitest configs sit in the package's .oracle-gaps-, which the next run removes once a killed run has left it (judged after two stopped runs, not after a SIGKILL); a default --out is judged here too: the default-directory histories (a stop, a daemon check, and the unsupervised daemon check) run without --out, and their directory is named in the trace; the namespace is checked after each run and, in a stopped run, while the run runs; a slow kill in a later owner, after earlier owners' confirmations spent the budget, becomes a timeout (owner order; not generated); the Vitest 5 path of the copies' pragma read and of the runner is verified from Vitest 5's source only, since the Vitest 5 CI job runs no gap oracle; a batch whose run reports an error outside any test reruns each copy alone (unitsBatch, runAlone) with its first budget, and a copy cut there is kept as a timeout with no confirmation, a defect older than this oracle's budget work that no history reaches (no history has an error outside any test beside a slow copy), recorded here with that trace for the maintainer; stale-session removal is scoped to this host's session directories (a host file), and is not judged across pid namespaces; a generated history stops only while the witness spins, or aborts, and on win32 not at all, since every other stop switches a test-only hook (the hold after the completed line, the warm probe, and on win32 the test stop file; randomness wins, 2026-11-16), so only the halves of every outcome class stop with one; the stop law covers SIGTERM and SIGINT sent to the CLI; a SIGKILL of a supervisor is witnessed on POSIX by the constructed history "a supervised child exits when its supervisor is killed" (its child exits within the watchdog tick), and a signal sent to the daemon is not witnessed here, and its witness is one test that spins synchronously and starts one child process; the mutant budget is witnessed as two slow owners whose confirmations pass the --mutant-limit floor, not through its multiple of the owners' unmutated time, and authored mutants have no confirmations to budget; the witness w_slowpair is a wall-clock window, since the CLI's budget has no controlled clock and a fixture cannot see the time the CLI measures for its file: with one-test owner files p and q of measured unmutated time t each (a file first in its context pays the instrumented transform too), a wait W of 10 s, a 20 s --hang-limit and a 15 s --mutant-limit, it tells a budget from none only while (a) its first attempt is cut, W > 1 s + 3t, (b) its two confirmations do not fit the budget, 2W > max(15 s, 10 x 2t), and (c) each would fit its own full limit, W < 20 s + 3t; (b) is the binding one, so it holds while the two files' time stays under about 2 s together (about 1 s each, some 20 times the authoring machine's idle and 5 to 10 times its loaded measurements), and under one budget a run's overhead must stay under 10 s + 3t; CI runners measure 1.5 to 2.3 times the idle machine; beyond that w_slowpair would read not-judged; heartbeats are checked for shape only (maintainer decision "Heartbeats are progress, not outcome", 2026-11-14): each names a mutant of the run, or the baseline, in a file that runs it, and a beat after its mutant's own gap line is a breach, while their set and count, which depend on timing, are not compared and no busy mutant's beat is owed; the shape law reads "was running" only against a mutant's own streamed gap line, so a beat that names a killed mutant (which streams no line) after it finished, or a mutant that has not started, is not a breach; the state "a heartbeat named a busy mutant" is required (maintainer decision "#90 job stays blocking", 2026-11-16) and is entered only through a deterministic hold (#84): the slow kill's test, where its output differs, holds until the run's stream log has one more heartbeat that names a mutant in its file, released by the CLI's own line and never by the clock, so a cold run that holds it has such a beat on any machine; the state is entered only by a cold run that has the slow kill and named its stream log to the hold (\`every outcome class\`, which pins its own --out, and drawn histories with the slow kill and an --out), and a beat anywhere else enters nothing: a check through the daemon (a daemon keeps the environment of the call that started it), a stop run, a run with the default output directory, and the first half of the witness sequence (no slow kill; its I/O wait spans the interval by timing) run unheld, and their beats are progress only; a held copy that no beat releases is cut by the CLI's budget and is judged \`timeout, owed killed\` (the bound of 2,400 polls on the hold is a backstop that the CLI's 15 s budget and 20 s limit always reach first); a config only in the package's parent directory is generated one level up, in a temporary directory with no package.json (so its .js or .ts name is CommonJS), as a plain config, one that throws, one with no default export, or one that defines test.projects; a config two or more levels up, or a parent config beside a package config, is not generated, and the order in one directory follows Vitest's configFiles list by inspection; a package with no config lives in a temporary directory, where no parent has a config; a counterexample shrinks through at most six histories, and within half the unit's timeout, so it can be larger than the smallest that fails; in CI's random units it does not shrink (GAP_E2E_SHRINKS=0, the maintainer's decision "Shrink briefly in CI", 2026-11-17), and its history is filed whole; module-level data only as four \`const\` declarations of the main source (an object literal, an array that holds a function, a boolean, and an object of two methods), read in place, with no data imported from another file, destructured, reassigned, or declared as an enum or a default export; the work law only through shortcut witnesses (an early return before a counting loop with a bound twin of ratio 2, and a push beside one that calls String with a bound twin of ratio 1), the early return in tests that reach the clock by each watched path and in tests that wait a turn, a generated test's bound of 1 derived from its plan; probe code is never work (maintainer decision, 2026-11-16), so the model and the capture count no probe-only site, and only a constructed history (a probe branch under a generated test's work bound) reaches a probe branch beside a bound: the fixed seeds' generated histories reach neither that state nor \`killed by a work bound in a generated function\`, which stays measured; work counts are observed only through a bound's ratio and a rise, never as numbers (v21.2 O1), so a counter that skips every site on a probe's line, which drops only the condition sites of an elseIf that run once on both sides, survives (mutant M6, equivalent under these observations), while one that skips every site of a function that holds probe code is killed (M7), and one warm-cache witness whose selection reproduces observations but not work; work is the capture's count of site evaluations per test, so code with no site (a plain assignment, a for...of pass, a builtin's own work) counts nothing and a test's histories are summed, and a test whose work varies between the unmutated runs while its observations agree is not generated. The skip law (law 4: a mutant is judged without a run only where no owner's unmutated run reached its site with a value that the mutant changes) is judged through the kills, crashes, and setup errors of mutants whose value changed, and through the survivors of those whose value did not: for \`?.\` on an \`undefined\` and a \`null\` object (the drawn \`absentObjects\`), on an absent object two or three links deep, and past a link whose object is absent, where JavaScript short-circuits the rest of the chain so a plain read there changes nothing (the drawn \`optionalChains\`), and for a returned value made \`undefined\`, in the constructed history \`a value change at a ?. read and at a return\`; for a \`?.\` whose object is absent only while the module loads (a booted first function), in \`a ?. read of an object absent only at load\`, whose mutant throws as the module loads and is a setup error; and for a comparison swap, a dropped \`!\`, a skipped call, a boolean flip, a forced \`if\`, a loop that never runs, a dropped field, a value-position call, and an arithmetic swap, by the witness module's kills under \`every outcome class\`. A logical operator's swap (\`&&\`, \`||\`, \`??\`) has no killable site in the grammar (its only sites are probe guards and the old probe form), so that its switch infects the site on every reach is fixed by inspection. The switch's extra infection (it infects on every reach, including a \`return-undefined\` of a value that is already \`undefined\`) costs a run and changes no outcome only because its active form computes exactly the mutated expression; the \`?.\` helper's active form throws wherever it infects, so it infects exactly where the link's own object is absent and no earlier link of the chain short-circuited, and the outer links' helpers are told of an earlier link's short-circuit. An optional element read (\`a?.[k]\`) is not generated: it goes through the same capture helper as \`a?.b\`, so under its mutant an absent object throws before the key expression runs, where the plain read \`a[k]\` evaluates the key first; a key with an observed effect or a throw of its own is judged by that order, which differs from the real mutant's, and no history reaches it. An optional call (\`f?.()\`) is no site; where it feeds a later \`?.\` link, it passes its short-circuit on to that link, so the link's mutant is skipped where the call's method is absent, and runs where the call ran; this is judged for a method that returns an object or nothing, absent itself or behind an absent object (the drawn \`call\` and \`returns\` of \`optionalChains\`), and for a plain read of \`v\` after the call. The generated calls take no arguments; the spread that marks a call as run comes before any argument, so a call's arguments run only where it does, as before. The pass-through keeps, per call site, a stack of the open evaluations' records, so a record pairs with its evaluation only where evaluations of the same expression nest and each one ends. Four cases break the pairing, and no history generates any of them: an evaluation of the same expression nested in the receiver, or in the method lookup, that throws and is caught there after its call ran leaves a run record open, so an outer evaluation whose method is absent reads it as run (a false infection, and a false throw under the next link's mutant, P3); one nested in the call's arguments or in the method's body that throws before its call runs leaves a not-run record open, so an outer evaluation whose call ran reads it as skipped (a false skip: the next link's mutant is judged without a run, the class of issue #109, P5); and two async evaluations of the same expression interleaved at an \`await\` close each other's records (a false skip or a false throw). Each is filed for an owner as issue #162. Open Limits, owned by the in-process runner oracle (L1, state \"torn tail at a cut-off read\"; RED: captureLines without the guard): (a) the batch's cut-off read (runBatch's rowsOf after the cut-off) drops a partial last row, and no witness reaches that drop yet, because a copy held half written across the cut-off did not observe its release in the harness; (b) a short fragment on the strict path, which the no-newline mutant does not reach. The strict read after a finished run (a fragment is an internal error) is witnessed by the no-newline mutant. Windows idle gap (recorded, not witnessed): the state \`a hang cut off for idleness\` is required on every platform, and win32 reaches it (run 43683794816, job 132719872988), so it is not platform-scoped. The sampler (capture-setup.mjs) counts a copy idle only after 500 ms with no late tick, no non-quiet handle, utilization at most 5%, and no timer due, so \`every outcome class\` reaches the state only when the sampler sees that window. On win32 the check missed it once (run 43683794816, job 132719872940); the cause is not confirmed (a late tick on a shared runner, or a stdio handle outside \`quiet\` for this file's console output, are the candidates). Its witness, a test-only hold at the hang until the window is seen, is owed, and that is a timing dependency the determinism-under-load rule forbids; the maintainer decides whether it lands before the Windows job becomes blocking. A run killed before it cleans up may leave its own directory: the CLI killed with SIGKILL (\`kill\`, constructed only), the unsupervised abort, and every abort on win32. The constructed history \`a run after a killed CLI\` kills the CLI and its check's group while the witness spins, and the run after it must remove the directory the killed CLI wrote, through the \`host\` file that CLI wrote. Every other stop run that opens a session also finds a killed run's directory that the driver wrote, under a pid that no process can have (above Linux's pid_max and macOS's 99999, and not a multiple of 4 as every win32 pid is). The abort's killed directory is never followed by a run. Whether a run is killed is read from the stop and the platform, not observed, so a win32 supervisor (#79) must narrow it to the unsupervised abort. A run stopped before its first statement can remove nothing, so a killed run followed by such a stop would keep the killed run's directory whatever the CLI does; no history has that order (a stop before the CLI starts is the last run of its history, and the killed runs are not followed by one). On POSIX a supervised run's directory is removed by its supervisor once the child ends, whatever ended it; an unsupervised run removes its own when its process exits, and that path is judged on win32 alone (its hookStops histories), since POSIX's one unsupervised history is stopped at its note, before a session opens. No history makes a removal fail or reuses a pid, so the catch and the live-pid guard of removeSession are not judged; their witnesses are owed (#168). Block per law (2026-11-18) and "A broken owner file judges nothing" (2026-11-19): a failing law is drawn as one test of file a or b, at the start or the end of its file, calling the first generated function not at all, once (and maybe repeating it until the unmutated output), or past the call floor, or as a describe's law whose beforeAll or afterAll throws. A failing law still runs in its file's copies ("An excluded test still runs", 2026-11-23), and a failing law that spins under a mutant is drawn only through its own call repeated until the unmutated output (failingLawSpins) or a call that spins; a failing law that changes state a later test reads is not generated, so a kill by a passing law that reads such state is not judged (review of #176, round 1 F3: a failing fast-check property's shrink state, or an abandoned async body after a per-test timeout, feeding a later passing law's kill, whose replay of that law alone does not reproduce). Its witness needs a drawn field where a failing law writes a module-level value that a later passing law reads; owner: issue #210. A file-level beforeEach or afterEach that throws fails every test, and its report names one failing law per test, not the hook; it is not generated. A describe's failing hook fails only that describe's laws; a hook that fails only under a mutant is not read. Load reach follows the maintainer's decision "Load reach goes to every owner file" (2026-11-23, #186): the model's census counts every test of an owner file that loads the module (#204), the failing owner's passing pair included under per-law blocking, so code run at load in a file with a failing law is judged by that file's passing tests. A file whose tests fail and that also errs outside its tests is left out whole, and is not generated. Platform scopes (R56): 'a run stopped by SIGTERM while a worker spun' is judged on POSIX only, because Node cannot be sent SIGTERM on win32 (C-26, ratified by M-29; the win32 stop is the SIGINT of the test stop file). 'a supervised check with no ps on its PATH' is judged on POSIX only, because ps is a POSIX tool and the win32 watchdog reads liveness with signal 0; the other supervision states, including the supervisor-death witness, are judged on every platform. 'a check after the daemon's evidence store was corrupted' is required on POSIX only, because win32 may keep the store's shared memory mapped and refuse another process's write to it; the step still runs on win32, overwrites what the OS allows, enters the state (counted, not required) when it overwrote every file, and its check is judged as any other.`, + limits: `Law 12 judges refusals. An assertion in a file-level hook is no verdict: a file whose file-level hook fails judges nothing (law 14), and a file-level \`beforeAll\` that fails, which skips every test, has no history here. Known limits of the ending's ask (#139): check.mjs writes its results.json and summary.md before the ask, so a completed run that gets a stopped answer keeps its completed report; on win32, the decide step reads a stop recorded before the child's exit at its close or after 2 s, not at the stop itself; and a child whose supervisor was killed mid-ask has no reader for its stderr, so the orphan history judges stdout and its liveness, not stderr. The one internal error a history reaches is the constructed rejected-batch history (rejectBatch, a test-only fault that rejects a batch's run after its copies are in Vitest's and Vite's state). Its run is judged in this order: the output namespace, process warnings, and config lines, as for any run; then bounded retention, which owes the rejected batch's own line with its state after retirement; then the stream law (law 15) on both streams, as for any run, so its error line and its done line carry the prefix, and no other line does not, which the state \`a run ended in an internal error\` declares; then exit 3 with an internal error's done line last on both streams, no stack frame on stderr, and an error.log in its output directory. What the error.log's stack says is not judged. An internal error that no fault constructs is a completion failure, reported before the stream law; an internal error through the daemon is reached by no history, and its ending is the same function's (endRun), by inspection. The internal error's lines follow the register's C entry "The internal-error line" (2026-11-16): the general law (endsBreach) owes every run that ends through endRun one error line on stderr naming the done line's log, the output directory's error.log, and none on stdout, and owes the supervisor's own exit 3 none. The message's escape is witnessed by the fault's message, which holds a line break and a forged done line after it; the log path's escape only on POSIX, where the rejected batch's output directory holds a line break (a name on win32 cannot). Paths in a completed run's lines (the results note, the done line's report, the test-output note) are escaped the same way, by inspection: no completed history names such a directory. P10's exempt lines (v21.2 P10 and I3) are read by their own shapes (exemptBlocks), never by indentation alone: a baseline failure's indented details, a refusal's block, Node's warning with its \`--trace-warnings\` frames and its hint, V8's fatal block, esbuild's message block, and Vite's own \`[vite]\` line. The V8, traced-warning, and esbuild blocks are calibrated beside our own line with no prefix (the stream calibrations put them before the rejected-batch run's done line, and the law must name our line alone); no generated history prints any of them or a Vite line, and a shape of those tools that exemptBlocks does not name is read as a stray. The stdout summary's exemption is unused and not exercised: the CLI prefixes every summary line (its summary, legend, and function kinds). \`--help\` prints its usage text with no prefix and no done line, exempt by the register's M entry "\`--help\` is exempt" (2026-11-16), and the static oracle's Help law owes exactly that text; \`--stop-daemon\` prints nothing and exits 0, read the same way as a command outside the run protocol (C, pending ratification), and this oracle runs it without observing its streams. A syntax error in a module that the config imports lets the esbuild that Vite bundles configs with print its block before the refusal (trace, Vite 7.3.7, esbuild 0.28.2: \`✘ [ERROR] Unexpected end of file\`, an empty line, \` helper.ts:2:0:\`, the code frame, then the refused block): its lines are exempt by the register's M entry "Other tools' output is exempt" (2026-11-16), the refusal and the done line around them keep the prefix, and no history generates it. Bounded retention reads the hook's lines (retention-hook.mjs). Its count of one line per batch (runner law L2) rests on the index the hook takes when a batch starts, so a CLI that skipped a batch's index and its line together, or that omitted only the line of a check's last batch, keeps the indices 0..n-1 and is not seen; a check that ended before its report (the rejected batch, a stopped run) and a daemon the driver killed are judged for at most one line per index, since the batches they were running at their end owe none. A line's process is told by check.pid, which the check writes, and the driver itself knows only the daemon it killed. The cold store's law (held) counts the entries given to the store's put that a full collection leaves reachable, so a store that kept only a part of an entry (its unit without the entry) is not seen; staleOpen reads Vitest's own close state (closingPromise, set when close starts), so a close that starts and never resolves is the runner oracle's (L8); and a context replaced after a check's last batch is observed only by a later check's first batch through the daemon. The run whose process aborts is declared on every platform. Its win32 witness (process.abort through ORACLE_GAPS_TEST_ABORT_AT, under the win32 supervisor) lands in #79; until then the Windows end-to-end job is non-blocking (C entry (c)). On win32 Node cannot deliver SIGTERM (its kill is TerminateProcess, which ends the process with no stopped line), so the stop states that name SIGTERM are required on POSIX only, and a stop there goes through the CLI's test stop hook and is observed as SIGINT, which owes its done line as any stop does (no history sends a win32 child.kill, the SIGKILL-equivalent that owes none); every SIGINT state stays required on win32. A stop as the CLI starts lands only in one of two holds: the driver's own preload before the CLI's first statement (outcome a, nothing written; POSIX only, since its witness is a signal's default action), or the CLI's hold after its started marker, which the stop the CLI keeps releases (outcome b, judged only when the supervisor started no child); a stop during Node's own start between the two is not generated, since its outcome follows timing. The drawn spawn delay is a wait inside a hold, so it cannot move a stop out of it. Stop runs that land while the config warms (ORACLE_GAPS_TEST_WARM_PROBE) are still drawn, and on win32 every drawn stop goes through ORACLE_GAPS_TEST_STOP: each is a test-only hook that a drawn field switches, main's pattern, which the review of #57 (A3) brought to the maintainer; only the stop after the completed line (ORACLE_GAPS_TEST_HOLD_UNTIL) was made constructed-only. A missing \`ps\` is generated only as a PATH that names no command, on POSIX, where the run is supervised. The unsupervised path (stopNow, every win32 stop) is reached on POSIX by one constructed history whose stop is held at the run's note, before the check starts a process: an unsupervised POSIX run has no group to end, so a stop while the witness's test spins leaves that test's own child (measured; C 2026-11-13, Windows (e)), which win32 ends with the job object libuv puts its children in. Argument refusals are the static oracle's; the check's rejection of a stack trace, a missing fix, and a wrong exit code is calibrated in the static oracle, through the same refusalBreach, and here only a refused run reported as complete is calibrated, because each calibration here runs real CLI histories. Law 15's stdout gap lines are judged against each completed run's own results.json, by id: the cold run, and each check through the daemon (every step's check and the check that a mid-run edit overlaps); a stopped run and a refusal list no gaps and are not judged so. A line's change is read loosely: its code on one line, whole or cut after a kept part and ended with \`...\`; where the printer cuts (60 code points, kept 57) is the classify oracle's law 8 (\`shortened\`), in-process. A line with any text after its change does not read and fails loudly: the \` (cause: )\` suffix that #99 adds to timeout lines is not read yet, so whichever of #99 and #115 lands second extends readGapLine. Hangs only as an owner test that awaits a promise that never settles, under a 1 s first budget and a 20 s full limit, and a slow run only as two witnesses whose tests wait where the output changed, 3 s in one that then judges and 10 s in two one-test owners of one that does not; busy loops only on instrumented code (cut by the call budget), no slow runs past the full limit that would end, hangs in ordinary or nondeterministic tests, setup errors other than a throw at module load, loops, multi-line conditions, two functions on one line, or await, new, and void statements; nested functions, object-literal methods, accessors, and class-field arrows only where no test calls them (their ownership is the static oracle's); two source files of one package, with no re-exports, namespace imports, or calls into another package; --only only in a stopped run and a partial run of one function's mutants, and no --sample or --diff-base; the baseline's failures only as one failing owner test that throws an error and a setup file that throws, so a baseline law violation's law and counterexample lines are the classify oracle's; a derived class's file is instrumented and its sites are judged as unowned, but no test imports or constructs the class, so its no-mutant and super-region behavior is the static oracle's (in-process), not this oracle's; package configs only as vite.config or vitest.config with one of the extensions .ts, .mts, .cts, .js, .mjs, and .cjs (not every pair), as config/gap-vitest with the same extension through --config, or none, as an object or a sync or async function, with no plugins of their own except one enforce: 'pre' transform that appends a comment to each module of the package (prePlugin) and a plugin whose load reads each test file with a sync read (loadPlugin), drawn for a config in ES module syntax and reached by its own constructed history too; a plugin whose output depends on anything but the module's text (a sidecar file it reads) and an environment variable that changes between checks are not generated, since the runner tracks neither yet and the daemon's environment is fixed when it starts (F-A1: the maintainer decided on 2026-11-13 that the daemon tracks both and restarts when they change, in the next pull request); and test.projects only as a refusal, and only under the package's own package.json; the supervisor-death state is required and entered only off win32: win32 has no supervisor until #79, so there the state is not reached and its history is not judged (platform-scoped reach; the win32 run is unsupervised, which register C entry (e) of #58 records as not guaranteeing that no process outlives the CLI); a config's test.root only in four shapes, drawn for an ES module config that Vitest discovers in the package (the randomness-wins decision, 2026-11-16) and each reached by its own constructed history of one owner and one context, where the test files' globs and the setup file are relative to the root (issue #101): the directory that holds the tests, the directory above the package, a directory of the package that holds no test file, and the package's tests as a symbolic link to the directory that holds them (required on every platform, since Windows creates the link as the driver's other links); not under --config (nor in a history whose config edit names a second config), a CommonJS config, a parent's config, test.projects, several contexts with different roots, or a root that is the filesystem's root; the runner serves each copy of a test file by its absolute path, through its pre plugin's load (which answers before the config's own plugins) and through its read of the copy's path for Vitest's pragma read (serveCopies), and histories run copies only in Vite's server environments (node and the pragma's ssr environment): jsdom and happy-dom, Vite's client environment, are not generated (the #103 merge-gate review ran jsdom by hand under all five root shapes, and the copies loaded in each); a top-level await only in an ES module config and require only in a CommonJS one, as Vitest itself loads no other; a --config outside the package is refused by design, through the rule for paths outside the package (args.mjs), and no history generates one; contexts only one, four, or eleven, and process warnings judged only as MaxListenersExceededWarning on the CLI's own stderr (a daemon's process warnings go to its log); a context that fails to open gives back its listener allowance, which no observation shows (a kept allowance only raises the limit, so no warning follows), so that accounting is fixed by inspection; no probe-bound states, so reach agreement's killing of probe mutants is not checked; no gap answers or gate; law 9 judges the witness module's outcome classes along one constructed edit sequence only (a test edit, a helper edit, and a revert), which runs as two constructed histories, one for each half of the module (captureA and captureB, whose union is the module and which share no function; a function stays with the functions its tests or statements read), since the whole module along it took one CI job (#106, #145; maintainer decision "A one-history job over budget is cut by cost", 2026-11-16), so an interaction between functions of different halves, beyond the ones the split keeps together, is not judged along the sequence (the whole module runs together in \`every outcome class\` and in generated histories, which take no steps); and the budget witness's outcome classes along one constructed second check with nothing changed, because a generated history with the witness module or the budget witness takes no steps (maintainer decision, 2026-11-11, and the runtime review's P1-a, 2026-11-12; this oracle owns the gap); the state "a timed-out run reused after an edit" counts only runs cut by their call budget (the spin, in the first half), a count the CLI records, by the maintainer's decision "#104 state narrowed, #99 restores" (2026-11-17), which narrows "#90 job stays blocking" for that state only: the reuse of a run cut by the clock (a hang) is judged by law 9 but not required, because on main a hang's timeout is stored only when the sampler saw the copy idle, which load decides, and otherwise its confirmation is cut short by its mutant's budget and not kept (#104); #99 makes a hang a state-based no-progress kill and restores the reach as "a run killed for no progress, reused after an edit" (#156); law 9's edits come between checks, except one, midrun, which lands during a check through the daemon: a test of file a, whose context has loaded file b's helper, rewrites the helper in the baseline's first run of file a, before file b's runs read it, in one context or several; or a test of file b rewrites its own helper, or the data file that its verdict read through a sync fs read, after file b's judged tests read them, in the run that judges with the old text (review of #55, F1); that check must report, for each mutant, what a cold run of the state before the edit or of the state after it reports, and exit as one of them does (third review of #55, F-C), compared per mutant result rather than per file; when file b's own test lands the edit, b's baseline reads the old text and b's mutant runs read the new one, so b's own mutants in that check are not judged, since their results legitimately mix the two texts (maintainer decision, 2026-11-13), while every other mutant there is judged against both cold runs, with the check's exit code, its mutants' keys, and its stream; the stronger follow-up compares each run's raw outcome with the cold outcome of the state that run read; and the next check, with nothing changed, must equal a cold run of the state after the edit, compared for equality of results only, not for what the daemon reused or computed (the runner's rule: a run whose input changed after the run read it is invalidated and not stored, settleIn); a check through the daemon of a state that nothing changed must compute no run that was not cut off, judged where no test reads the clock (F-A, F-A2), and a test's fs read of a file and the module that the context serves from it are two inputs, each under its own hash (F-A2); an edit during a mutant run is not generated, and a file is edited mid-run only by the run's own tests, not by another process at an arbitrary time; a file that a test reads through fs is edited only as one JSON file that file b's verdict reads by a sync, a promise, or a callback read, or by a sync read after it stats its own directory and tests that it exists (statDir: the directory is an input as a directory, not by its content, and is not itself edited), each read first checking that its fs function keeps its own name and length (the runner stores a run under the files in the package that its copy reads with readFileSync, readFile, existsSync, or statSync, or the fs/promises readFile or stat, each with its hash at the copy's first read; a read outside the package or under node_modules, from a worker thread or a child process that a test starts, or through any other fs API, which includes readdir, opendir, glob, globSync, createReadStream, realpath, lstat, access, open, a read through a file descriptor (read, readSync, readv, fstat, fstatSync, and readFileSync or readFile given a file descriptor), copyFile and copyFileSync, cp and cpSync, openAsBlob, statfs, readlink, the callback stat, exists, watch, watchFile, and the fs/promises access, open, and glob, is no input, and none is generated: the maintainer decided on 2026-11-13 that every fs read except watch and watchFile is an input, which a follow-up of #55 implements, and until then this oracle owns the gap); a run cut off by its clock writes no closing row, so it is stored under its file's known inputs only, while a run that spun ends and keeps the inputs it named (F-D), in a batch as alone; a spun copy that reads a file that its file's unmutated run never reads is generated (spinData: file b's verdict tests that read the data spin on the function they test while it is open), and the data's edit is judged by law 9 for copies that spin in a batch; a copy that spins alone (runAlone, after a batch with an error outside any test) is generated too (spinThrows: each spun copy schedules an error that fires after its test), and its data's edit is judged the same way; an error outside any test only from a copy that spins, so the alone path's other units (a slow copy's confirmation) stay unwitnessed; a test that rewrites a file it read with the same text makes the next check compute that run again (1 run in the self-edit histories), since the edit changes the file's modification time: the daemon is conservative there, nothing goes stale, and content keys (D10) remove it, with a selfWrite dimension in that pull request; the mid-run marker sits in the daemon's session directory, .oracle-gaps-, whose location predates #55; the runner's hash memo knows a file by its size and modification time, so an edit that keeps both is not seen, and no history makes one (D10, planned in phase 2, A5); law 9's edits leave out other environment variables, new files that change how an unchanged import resolves, Vite config and installed-package changes, and concurrent checks other than two that start the daemon; cut-off charging judged only under one budget; native addons only as a binding.gyp or a prebuilt .node file, not as optional platform packages; a scratch package lies in the CLI's directory (.scratch-*), in a directory beside it whose name extends the CLI directory's name (siblingDir, drawn), or in the OS temp directory, so the driver's inside-the-CLI label is judged against a prefix that is not a parent; a CLI path spelled with another drive-letter case or separator than the package's is win32-only and not generated; daemon races (two CLIs reading one error file, a CLI hearing closing from the failing daemon it started, a reset connection on macOS) fixed by inspection; a daemon that stops answering only at four holds, each released by a count, never by time: a fresh daemon's first check held before it runs until the daemon accepts the driver's next request (ORACLE_GAPS_TEST_HOLD_OVERLAP), which stands in for a session slower to open than the bound while the CLI carries the warm-up pause; and, after a warm check with the pause disarmed (ORACLE_GAPS_TEST_PAUSE_ARM), the daemon's own pauses (pauseAt): before a check runs (daemon-check), before a check that reuses every run warms its contexts (daemon-warm), and before a context warms in place of one that a cut stopped, after the test edit (daemon-replace), each released by the driver's file once the CLI has ended; the CLI's bound is the socket's idle timeout on a daemon that sends nothing (60 s; these histories shorten it to 3 s), a wall-clock bound that changes the run's path and never its outcome; its cold check must equal a cold run (law 9's cold fallback, R39), and it never holds, since only the daemon gives its session the pauses (G43: a hook changes no outcome); the daemon must still run after the fallback, must leave the run's --out as the CLI left it once released (every file's text, with a poison the driver writes into its results.json and error.log), and must serve the next check (its served mark); the daemon drops a check whose CLI has gone before it runs, at each phase's end, and after each context that warms in place of a cut one, which is the one stretch inside a phase with no running copy to beat, and a check ends only once every context's share of a phase has; not witnessed: a gone CLI found while two contexts are both warming in place of cut ones (the wait for every context's share is by inspection), and a copy that starts in the moment between the CLI's bound and the daemon's reading of the closed connection, which runs to its end and writes into the run's --out (the race is the bound's own, a wall clock's, and no history generates it); the held warm-up and the held re-warm rely on the warm daemon's check reaching its hold within the 3 s bound, as the shortWait history relies on its first copy starting within it, and the driver's wait for the hold fails loudly otherwise; the one beat left, a running copy's poll, is witnessed by a warm daemon's check under the 3 s bound while a copy waits 10 s (shortWait); a CLI whose daemon is closing and hung waits 60 s and fails with an internal error rather than checking cold, and --stop-daemon against a hung daemon has no bound (merge gate F3; owed: a constructed history that closes a held daemon, issue #135); a fallback whose cold check refuses is not generated (law 9's refusal-notes comparison would see the fallback note); the runner's copies of the test files exist only in memory, and its harness and Vitest configs sit in the package's .oracle-gaps-, which the next run removes once a killed run has left it (judged after two stopped runs, not after a SIGKILL); a default --out is judged here too: the default-directory histories (a stop, a daemon check, and the unsupervised daemon check) run without --out, and their directory is named in the trace; the namespace is checked after each run and, in a stopped run, while the run runs; a slow kill in a later owner, after earlier owners' confirmations spent the budget, becomes a timeout (owner order; not generated); the Vitest 5 path of the copies' pragma read and of the runner is verified from Vitest 5's source only, since the Vitest 5 CI job runs no gap oracle; a batch whose run reports an error outside any test reruns each copy alone (unitsBatch, runAlone) with its first budget, and a copy cut there is kept as a timeout with no confirmation, a defect older than this oracle's budget work that no history reaches (no history has an error outside any test beside a slow copy), recorded here with that trace for the maintainer; stale-session removal is scoped to this host's session directories (a host file), and is not judged across pid namespaces; a generated history stops only while the witness spins, or aborts, and on win32 not at all, since every other stop switches a test-only hook (the hold after the completed line, the warm probe, and on win32 the test stop file; randomness wins, 2026-11-16), so only the halves of every outcome class stop with one; the stop law covers SIGTERM and SIGINT sent to the CLI; a SIGKILL of a supervisor is witnessed on POSIX by the constructed history "a supervised child exits when its supervisor is killed" (its child exits within the watchdog tick), and a signal sent to the daemon is not witnessed here, and its witness is one test that spins synchronously and starts one child process; the mutant budget is witnessed as two slow owners whose confirmations pass the --mutant-limit floor, not through its multiple of the owners' unmutated time, and authored mutants have no confirmations to budget; the witness w_slowpair is a wall-clock window, since the CLI's budget has no controlled clock and a fixture cannot see the time the CLI measures for its file: with one-test owner files p and q of measured unmutated time t each (a file first in its context pays the instrumented transform too), a wait W of 10 s, a 20 s --hang-limit and a 15 s --mutant-limit, it tells a budget from none only while (a) its first attempt is cut, W > 1 s + 3t, (b) its two confirmations do not fit the budget, 2W > max(15 s, 10 x 2t), and (c) each would fit its own full limit, W < 20 s + 3t; (b) is the binding one, so it holds while the two files' time stays under about 2 s together (about 1 s each, some 20 times the authoring machine's idle and 5 to 10 times its loaded measurements), and under one budget a run's overhead must stay under 10 s + 3t; CI runners measure 1.5 to 2.3 times the idle machine; beyond that w_slowpair would read not-judged; heartbeats are checked for shape only (maintainer decision "Heartbeats are progress, not outcome", 2026-11-14): each names a mutant of the run, or the baseline, in a file that runs it, and a beat after its mutant's own gap line is a breach, while their set and count, which depend on timing, are not compared and no busy mutant's beat is owed; the shape law reads "was running" only against a mutant's own streamed gap line, so a beat that names a killed mutant (which streams no line) after it finished, or a mutant that has not started, is not a breach; the state "a heartbeat named a busy mutant" is required (maintainer decision "#90 job stays blocking", 2026-11-16) and is entered only through a deterministic hold (#84): the slow kill's test, where its output differs, holds until the run's stream log has one more heartbeat that names a mutant in its file, released by the CLI's own line and never by the clock, so a cold run that holds it has such a beat on any machine; the state is entered only by a cold run that has the slow kill and named its stream log to the hold (\`every outcome class\`, which pins its own --out, and drawn histories with the slow kill and an --out), and a beat anywhere else enters nothing: a check through the daemon (a daemon keeps the environment of the call that started it), a stop run, a run with the default output directory, and the first half of the witness sequence (no slow kill; its I/O wait spans the interval by timing) run unheld, and their beats are progress only; a held copy that no beat releases is cut by the CLI's budget and is judged \`timeout, owed killed\` (the bound of 2,400 polls on the hold is a backstop that the CLI's 15 s budget and 20 s limit always reach first); a config only in the package's parent directory is generated one level up, in a temporary directory with no package.json (so its .js or .ts name is CommonJS), as a plain config, one that throws, one with no default export, or one that defines test.projects; a config two or more levels up, or a parent config beside a package config, is not generated, and the order in one directory follows Vitest's configFiles list by inspection; a package with no config lives in a temporary directory, where no parent has a config; a counterexample shrinks through at most six histories, and within half the unit's timeout, so it can be larger than the smallest that fails; in CI's random units it does not shrink (GAP_E2E_SHRINKS=0, the maintainer's decision "Shrink briefly in CI", 2026-11-17), and its history is filed whole; module-level data only as four \`const\` declarations of the main source (an object literal, an array that holds a function, a boolean, and an object of two methods), read in place, with no data imported from another file, destructured, reassigned, or declared as an enum or a default export; the work law only through shortcut witnesses (an early return before a counting loop with a bound twin of ratio 2, and a push beside one that calls String with a bound twin of ratio 1), the early return in tests that reach the clock by each watched path and in tests that wait a turn, a generated test's bound of 1 derived from its plan; probe code is never work (maintainer decision, 2026-11-16), so the model and the capture count no probe-only site, and only a constructed history (a probe branch under a generated test's work bound) reaches a probe branch beside a bound: the fixed seeds' generated histories reach neither that state nor \`killed by a work bound in a generated function\`, which stays measured; work counts are observed only through a bound's ratio and a rise, never as numbers (v21.2 O1), so a counter that skips every site on a probe's line, which drops only the condition sites of an elseIf that run once on both sides, survives (mutant M6, equivalent under these observations), while one that skips every site of a function that holds probe code is killed (M7), and one warm-cache witness whose selection reproduces observations but not work; work is the capture's count of site evaluations per test, so code with no site (a plain assignment, a for...of pass, a builtin's own work) counts nothing and a test's histories are summed, and a test whose work varies between the unmutated runs while its observations agree is not generated. The skip law (law 4: a mutant is judged without a run only where no owner's unmutated run reached its site with a value that the mutant changes) is judged through the kills, crashes, and setup errors of mutants whose value changed, and through the survivors of those whose value did not: for \`?.\` on an \`undefined\` and a \`null\` object (the drawn \`absentObjects\`), on an absent object two or three links deep, and past a link whose object is absent, where JavaScript short-circuits the rest of the chain so a plain read there changes nothing (the drawn \`optionalChains\`), and for a returned value made \`undefined\`, in the constructed history \`a value change at a ?. read and at a return\`; for a \`?.\` whose object is absent only while the module loads (a booted first function), in \`a ?. read of an object absent only at load\`, whose mutant throws as the module loads and is a setup error; and for a comparison swap, a dropped \`!\`, a skipped call, a boolean flip, a forced \`if\`, a loop that never runs, a dropped field, a value-position call, and an arithmetic swap, by the witness module's kills under \`every outcome class\`. A logical operator's swap (\`&&\`, \`||\`, \`??\`) has no killable site in the grammar (its only sites are probe guards and the old probe form), so that its switch infects the site on every reach is fixed by inspection. The switch's extra infection (it infects on every reach, including a \`return-undefined\` of a value that is already \`undefined\`) costs a run and changes no outcome only because its active form computes exactly the mutated expression; the \`?.\` helper's active form throws wherever it infects, so it infects exactly where the link's own object is absent and no earlier link of the chain short-circuited, and the outer links' helpers are told of an earlier link's short-circuit. An optional element read (\`a?.[k]\`) is not generated: it goes through the same capture helper as \`a?.b\`, so under its mutant an absent object throws before the key expression runs, where the plain read \`a[k]\` evaluates the key first; a key with an observed effect or a throw of its own is judged by that order, which differs from the real mutant's, and no history reaches it. An optional call (\`f?.()\`) is no site; where it feeds a later \`?.\` link, it passes its short-circuit on to that link, so the link's mutant is skipped where the call's method is absent, and runs where the call ran; this is judged for a method that returns an object or nothing, absent itself or behind an absent object (the drawn \`call\` and \`returns\` of \`optionalChains\`), and for a plain read of \`v\` after the call. The generated calls take no arguments; the spread that marks a call as run comes before any argument, so a call's arguments run only where it does, as before. The pass-through keeps, per call site, a stack of the open evaluations' records, so a record pairs with its evaluation only where evaluations of the same expression nest and each one ends. Four cases break the pairing, and no history generates any of them: an evaluation of the same expression nested in the receiver, or in the method lookup, that throws and is caught there after its call ran leaves a run record open, so an outer evaluation whose method is absent reads it as run (a false infection, and a false throw under the next link's mutant, P3); one nested in the call's arguments or in the method's body that throws before its call runs leaves a not-run record open, so an outer evaluation whose call ran reads it as skipped (a false skip: the next link's mutant is judged without a run, the class of issue #109, P5); and two async evaluations of the same expression interleaved at an \`await\` close each other's records (a false skip or a false throw). Each is filed for an owner as issue #162. Open Limits, owned by the in-process runner oracle (L1, state \"torn tail at a cut-off read\"; RED: captureLines without the guard): (a) the batch's cut-off read (runBatch's rowsOf after the cut-off) drops a partial last row, and no witness reaches that drop yet, because a copy held half written across the cut-off did not observe its release in the harness; (b) a short fragment on the strict path, which the no-newline mutant does not reach. The strict read after a finished run (a fragment is an internal error) is witnessed by the no-newline mutant. Windows idle gap (recorded, not witnessed): the state \`a hang cut off for idleness\` is required on every platform, and win32 reaches it (run 43683794816, job 132719872988), so it is not platform-scoped. The sampler (capture-setup.mjs) counts a copy idle only after 500 ms with no late tick, no non-quiet handle, utilization at most 5%, and no timer due, so \`every outcome class\` reaches the state only when the sampler sees that window. On win32 the check missed it once (run 43683794816, job 132719872940); the cause is not confirmed (a late tick on a shared runner, or a stdio handle outside \`quiet\` for this file's console output, are the candidates). Its witness, a test-only hold at the hang until the window is seen, is owed, and that is a timing dependency the determinism-under-load rule forbids; the maintainer decides whether it lands before the Windows job becomes blocking. A run killed before it cleans up may leave its own directory: the CLI killed with SIGKILL (\`kill\`, constructed only), the unsupervised abort, and every abort on win32. The constructed history \`a run after a killed CLI\` kills the CLI and its check's group while the witness spins, and the run after it must remove the directory the killed CLI wrote, through the \`host\` file that CLI wrote. Every other stop run that opens a session also finds a killed run's directory that the driver wrote, under a pid that no process can have (above Linux's pid_max and macOS's 99999, and not a multiple of 4 as every win32 pid is). The abort's killed directory is never followed by a run. Whether a run is killed is read from the stop and the platform, not observed, so a win32 supervisor (#79) must narrow it to the unsupervised abort. A run stopped before its first statement can remove nothing, so a killed run followed by such a stop would keep the killed run's directory whatever the CLI does; no history has that order (a stop before the CLI starts is the last run of its history, and the killed runs are not followed by one). On POSIX a supervised run's directory is removed by its supervisor once the child ends, whatever ended it; an unsupervised run removes its own when its process exits, and that path is judged on win32 alone (its hookStops histories), since POSIX's one unsupervised history is stopped at its note, before a session opens. No history makes a removal fail or reuses a pid, so the catch and the live-pid guard of removeSession are not judged; their witnesses are owed (#168). Block per law (2026-11-18) and "A broken owner file judges nothing" (2026-11-19): a failing law is drawn as one test of file a or b, at the start or the end of its file, calling the first generated function not at all, once (and maybe repeating it until the unmutated output), or past the call floor, or as a describe's law whose beforeAll or afterAll throws. A failing law still runs in its file's copies ("An excluded test still runs", 2026-11-23), and a failing law that spins under a mutant is drawn only through its own call repeated until the unmutated output (failingLawSpins) or a call that spins; a failing law that changes state a later test reads is not generated, so a kill by a passing law that reads such state is not judged (review of #176, round 1 F3: a failing fast-check property's shrink state, or an abandoned async body after a per-test timeout, feeding a later passing law's kill, whose replay of that law alone does not reproduce). Its witness needs a drawn field where a failing law writes a module-level value that a later passing law reads; owner: issue #210. A file-level beforeEach or afterEach that throws fails every test, and its report names one failing law per test, not the hook; it is not generated. A describe's failing hook fails only that describe's laws; a hook that fails only under a mutant is not read. Load reach follows the maintainer's decision "Load reach goes to every owner file" (2026-11-23, #186): the model's census counts every test of an owner file that loads the module (#204), the failing owner's passing pair included under per-law blocking, so code run at load in a file with a failing law is judged by that file's passing tests. A file whose tests fail and that also errs outside its tests is left out whole, and is not generated. Platform scopes (R56): 'a run stopped by SIGTERM while a worker spun' is judged on POSIX only, because Node cannot be sent SIGTERM on win32 (C-26, ratified by M-29; the win32 stop is the SIGINT of the test stop file). 'a supervised check with no ps on its PATH' is judged on POSIX only, because ps is a POSIX tool and the win32 watchdog reads liveness with signal 0; the other supervision states, including the supervisor-death witness, are judged on every platform. 'a check after the daemon's evidence store was corrupted' is required on POSIX only, because win32 may keep the store's shared memory mapped and refuse another process's write to it; the step still runs on win32, overwrites what the OS allows, enters the state (counted, not required) when it overwrote every file, and its check is judged as any other.`, }, histories: { // A failing history shrinks through at most six smaller ones. Each runs @@ -8170,6 +8223,9 @@ oracleProperty({ `killed by a work bound in a generated function`, // A check whose runs have more than one batch: the retention law's multi-batch reach. `a check that ran more than one batch`, + // A drawn file whose file-level hooks assert (`hookAsserts`) judged a + // mutant: the `w_hooked` witness is the required reach. + `a drawn file whose hooks assert judged`, ], runs: 2, // One fixed base per constructed history and none drawn: the per-run @@ -8370,6 +8426,8 @@ oracleProperty({ failingLawSpins: false, diffBase: `none`, authoredSpan: false, + hookAsserts: `none`, + hookFails: false, stopRuns: NO_STOPS, laterSteps: NO_LATER_STEPS, }, @@ -8581,6 +8639,8 @@ oracleProperty({ failingLawSpins: false, diffBase: `none`, authoredSpan: false, + hookAsserts: `none`, + hookFails: false, }, }, { @@ -8748,6 +8808,8 @@ oracleProperty({ failingLawSpins: false, diffBase: `none`, authoredSpan: false, + hookAsserts: `none`, + hookFails: false, }, }, { @@ -8942,6 +9004,8 @@ oracleProperty({ failingLawSpins: false, diffBase: `none`, authoredSpan: false, + hookAsserts: `none`, + hookFails: false, }, }, ], @@ -11976,6 +12040,34 @@ oracleProperty({ authoredSpan: spanned, }), })), + { + // File a asserts in its file-level hooks and its `afterAll`'s + // assertion is false: the file fails outside its tests, after every + // test passed, so it is a broken owner file that judges nothing ("A + // broken owner file judges nothing", 2026-11-19). The first function, + // which only file a owns, is blocked by it; the second, which file b + // owns too, is killed by file b. File a also writes to the console, + // so the run captures a broken file's output. Appended at the end of + // the list. + name: `a file-level hook that fails beside another owner`, + enters: [ + `blocked by a failing file-level hook`, + `a broken owner file left its mutants to another owner`, + ], + build: (generated) => + oneOwnerHistory(generated, { + functions: [[kill], [kill]], + owners: [`a`, `both`], + tests: [ + { ...judging(`a`, `fixed seed`, 7), fn: 0 }, + { ...judging(`a`, `fixed seed`, 7), fn: 1 }, + { ...judging(`b`, `fixed seed`, 7), fn: 1 }, + ], + hookAsserts: `a`, + hookFails: true, + consoleOutput: true, + }), + }, ]), }, resolve: resolveHistory, diff --git a/packages/oracles/oracle-gaps/history-fingerprint.json b/packages/oracles/oracle-gaps/history-fingerprint.json index 335059df..6d2e8773 100644 --- a/packages/oracles/oracle-gaps/history-fingerprint.json +++ b/packages/oracles/oracle-gaps/history-fingerprint.json @@ -88,7 +88,9 @@ ["failingLawSpins", "a52fc926e1e1704b"], ["faults", "484207f844e32250"], ["diffBase", "12e714e66d263986"], - ["authoredSpan", "3259189ca6a54cd5"] + ["authoredSpan", "3259189ca6a54cd5"], + ["hookAsserts", "76328d84a4ad6336"], + ["hookFails", "6e084c1e8b33f13d"] ], "histories": [ ["functions", "66c0e9c56951c377"], @@ -179,6 +181,8 @@ ["failingLawSpins", "a52fc926e1e1704b"], ["faults", "484207f844e32250"], ["diffBase", "12e714e66d263986"], - ["authoredSpan", "3259189ca6a54cd5"] + ["authoredSpan", "3259189ca6a54cd5"], + ["hookAsserts", "76328d84a4ad6336"], + ["hookFails", "6e084c1e8b33f13d"] ] } diff --git a/packages/oracles/scripts/e2e-shards.mjs b/packages/oracles/scripts/e2e-shards.mjs index 329f8d67..6891c811 100644 --- a/packages/oracles/scripts/e2e-shards.mjs +++ b/packages/oracles/scripts/e2e-shards.mjs @@ -375,6 +375,9 @@ export const shards = { `fixed seed 20261105: module data that only the failing owner's passing pair judges`, `random seed: module data that only the failing owner's passing pair judges`, `determinism: constructed history: module data that only the failing owner's passing pair judges`, + `fixed seed 20261105: a file-level hook that fails beside another owner`, + `random seed: a file-level hook that fails beside another owner`, + `determinism: constructed history: a file-level hook that fails beside another owner`, `fixed seed 20261105: a stop that reaches the config's service before the run`, `random seed: a stop that reaches the config's service before the run`, `determinism: constructed history: a stop that reaches the config's service before the run`, diff --git a/packages/oracles/scripts/pr-shards.mjs b/packages/oracles/scripts/pr-shards.mjs index 917d08df..5c12a806 100644 --- a/packages/oracles/scripts/pr-shards.mjs +++ b/packages/oracles/scripts/pr-shards.mjs @@ -908,6 +908,7 @@ export const partitions = { 'a failing afterAll around a law that calls production', 'a failing law that spins under a mutant before a passing law', "module data that only the failing owner's passing pair judges", + 'a file-level hook that fails beside another owner', 'a check with --diff-base on changed and unchanged lines', 'a check with --diff-base and an untracked source', 'a check with --diff-base on changed and unchanged lines of one function', From d4c83fe6aca2ca577aaf71f0ad395f2d518680c6 Mon Sep 17 00:00:00 2001 From: Kyle Mathews Date: Wed, 2 Dec 2026 10:20:41 -0700 Subject: [PATCH 2/6] fix(oracle-gaps): a failing file-level hook in an all-skipped file breaks nothing Vitest runs no hook of a file whose every test is skipped, which the fixture's placeholder alone leaves, so a drawn history with `hookFails` on an oracle file that holds no test must predict a passing file, not a broken owner file (CodeRabbit's finding on #322). The model's `brokenByHook` now requires a test that runs. The constructed history "an all-skipped file whose failing hook does not run" and its state went RED on the old model and GREEN on this one. Co-authored-by: Isaac --- .../oracle-gaps/gap-report-model-oracle.mjs | 21 ++++++++++-- .../gap-report-oracle.property.test.mjs | 33 +++++++++++++++++++ packages/oracles/scripts/e2e-shards.mjs | 3 ++ packages/oracles/scripts/pr-shards.mjs | 1 + 4 files changed, 56 insertions(+), 2 deletions(-) diff --git a/packages/oracles/oracle-gaps/gap-report-model-oracle.mjs b/packages/oracles/oracle-gaps/gap-report-model-oracle.mjs index 571a6228..9128a9d7 100644 --- a/packages/oracles/oracle-gaps/gap-report-model-oracle.mjs +++ b/packages/oracles/oracle-gaps/gap-report-model-oracle.mjs @@ -5071,9 +5071,26 @@ const HOOK_ERROR = `this hook fails with no mutant active` // rethrows in place of the assertion's own message, so the baseline's text is // one the model knows. const FILE_HOOK_ERROR = `this file-level hook fails with no mutant active` -/** Whether oracle file `file`'s file-level `afterAll` assertion fails (`hookFails`). */ +/** + * Whether oracle file `file` runs a test, so that its file-level hooks run: + * Vitest runs no hook of a file whose every test is skipped, which the + * fixture's placeholder alone leaves (CodeRabbit's finding on #322). The + * tests that run: the plan's, the failing law's (a describe's hook may skip + * it, and the file's hooks still run), the failing owner's suite, the mid-run + * editor's, and the console test. + */ +const runsHooks = (plan, file) => + plan.tests.some((t) => t.file === file) || + holdsFailingLaw(plan, file) || + (file === `b` && plan.fault === `brokenOwner`) || + (plan.midrun && file === plan.midrunBy) || + (file === `a` && plan.consoleOutput) +/** + * Whether oracle file `file`'s file-level `afterAll` assertion fails + * (`hookFails`) and runs, so the file is a broken owner file. + */ const brokenByHook = (plan, file) => - plan.hookAsserts === file && plan.hookFails === true + plan.hookAsserts === file && plan.hookFails === true && runsHooks(plan, file) // How often a heavy failing law calls production: past the call floor // (check.mjs CALL_FLOOR, 100,000 site evaluations) in its own test. const HEAVY_CALLS = 110_000 diff --git a/packages/oracles/oracle-gaps/gap-report-oracle.property.test.mjs b/packages/oracles/oracle-gaps/gap-report-oracle.property.test.mjs index fc9db9d2..efc04bae 100644 --- a/packages/oracles/oracle-gaps/gap-report-oracle.property.test.mjs +++ b/packages/oracles/oracle-gaps/gap-report-oracle.property.test.mjs @@ -4517,6 +4517,19 @@ async function driver(plan, observe) { ) ) states.add(`a broken owner file left its mutants to another owner`) + // Vitest runs no hook of a file whose every test is skipped (the fixture's + // placeholder alone), so such a file's failing hook fails nothing, and the + // file passes (CodeRabbit's finding on #322). + if ( + cli.exit === 0 && + hookBroken && + cli.lead.some((line) => + line.startsWith( + `oracle-gaps: baseline pass tests/${plan.hookAsserts}.test.ts: `, + ), + ) + ) + states.add(`an all-skipped file's failing hook ran nothing`) // A failing law that spins under a mutant still runs, before the passing // law that would kill it, so the count cut it causes is a gap ("An // excluded test still runs", 2026-11-23): the mutant is blocked by that @@ -7716,6 +7729,7 @@ const required = [ // history, "a file-level hook that fails beside another owner"). `blocked by a failing file-level hook`, `a broken owner file left its mutants to another owner`, + `an all-skipped file's failing hook ran nothing`, // A failing law still runs ("An excluded test still runs", 2026-11-23). `a failing law that spins under a mutant cut its copy`, // #204's census under per-law blocking (#186). @@ -7949,6 +7963,7 @@ const separate = [ `a failing describe hook made its laws fail`, `blocked by a failing file-level hook`, `a broken owner file left its mutants to another owner`, + `an all-skipped file's failing hook ran nothing`, `a failing law that spins under a mutant cut its copy`, `the failing owner's passing pair judged module data beside its failing law`, `a partial run of one function`, @@ -12068,6 +12083,24 @@ oracleProperty({ consoleOutput: true, }), }, + { + // File b owns the second function and holds no test, so its only + // test is the fixture's skipped placeholder. Vitest runs no hook of + // such a file, so file b's failing `afterAll` fails nothing and the + // file passes (CodeRabbit's finding on #322). A model that predicted + // a broken owner file here would reject the baseline. Appended at + // the end of the list. + name: `an all-skipped file whose failing hook does not run`, + enters: [`an all-skipped file's failing hook ran nothing`], + build: (generated) => + oneOwnerHistory(generated, { + functions: [[kill], [kill]], + owners: [`a`, `b`], + tests: [{ ...judging(`a`, `fixed seed`, 7), fn: 0 }], + hookAsserts: `b`, + hookFails: true, + }), + }, ]), }, resolve: resolveHistory, diff --git a/packages/oracles/scripts/e2e-shards.mjs b/packages/oracles/scripts/e2e-shards.mjs index 6891c811..fddef2c0 100644 --- a/packages/oracles/scripts/e2e-shards.mjs +++ b/packages/oracles/scripts/e2e-shards.mjs @@ -378,6 +378,9 @@ export const shards = { `fixed seed 20261105: a file-level hook that fails beside another owner`, `random seed: a file-level hook that fails beside another owner`, `determinism: constructed history: a file-level hook that fails beside another owner`, + `fixed seed 20261105: an all-skipped file whose failing hook does not run`, + `random seed: an all-skipped file whose failing hook does not run`, + `determinism: constructed history: an all-skipped file whose failing hook does not run`, `fixed seed 20261105: a stop that reaches the config's service before the run`, `random seed: a stop that reaches the config's service before the run`, `determinism: constructed history: a stop that reaches the config's service before the run`, diff --git a/packages/oracles/scripts/pr-shards.mjs b/packages/oracles/scripts/pr-shards.mjs index 5c12a806..c2988178 100644 --- a/packages/oracles/scripts/pr-shards.mjs +++ b/packages/oracles/scripts/pr-shards.mjs @@ -909,6 +909,7 @@ export const partitions = { 'a failing law that spins under a mutant before a passing law', "module data that only the failing owner's passing pair judges", 'a file-level hook that fails beside another owner', + 'an all-skipped file whose failing hook does not run', 'a check with --diff-base on changed and unchanged lines', 'a check with --diff-base and an untracked source', 'a check with --diff-base on changed and unchanged lines of one function', From 4d78992d281fcbdaec6c9e2d998d4d9b89b187b3 Mon Sep 17 00:00:00 2001 From: Kyle Mathews Date: Wed, 2 Dec 2026 11:56:58 -0700 Subject: [PATCH 3/6] fix(oracle-gaps): the fixture's failing hook is written whether or not it runs The e2e fixture wrote a file-level `afterAll` that fails only where the model predicted that the hook runs, so a Vitest that ran the hooks of an all-skipped file could not have failed the baseline the model owes. The fixture now writes the failing hook from the history alone (`hookFailsIn`), and `brokenByHook`, the model's prediction, stays apart from it (CodeRabbit's finding on #322, second review). Co-authored-by: Isaac --- .../oracle-gaps/gap-report-model-oracle.mjs | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/packages/oracles/oracle-gaps/gap-report-model-oracle.mjs b/packages/oracles/oracle-gaps/gap-report-model-oracle.mjs index 9128a9d7..1c2f3f7d 100644 --- a/packages/oracles/oracle-gaps/gap-report-model-oracle.mjs +++ b/packages/oracles/oracle-gaps/gap-report-model-oracle.mjs @@ -5086,11 +5086,20 @@ const runsHooks = (plan, file) => (plan.midrun && file === plan.midrunBy) || (file === `a` && plan.consoleOutput) /** - * Whether oracle file `file`'s file-level `afterAll` assertion fails - * (`hookFails`) and runs, so the file is a broken owner file. + * Whether the history gives oracle file `file` a file-level `afterAll` whose + * assertion is false (`hookFails`): what the fixture writes, whether or not + * the hook runs. + */ +const hookFailsIn = (plan, file) => + plan.hookAsserts === file && plan.hookFails === true +/** + * Whether that failing hook runs, so the file is a broken owner file: the + * model's prediction, kept apart from what the fixture writes, so a Vitest + * that ran the hooks of an all-skipped file would fail the baseline the model + * owes (CodeRabbit's finding on #322). */ const brokenByHook = (plan, file) => - plan.hookAsserts === file && plan.hookFails === true && runsHooks(plan, file) + hookFailsIn(plan, file) && runsHooks(plan, file) // How often a heavy failing law calls production: past the call floor // (check.mjs CALL_FLOOR, 100,000 site evaluations) in its own test. const HEAVY_CALLS = 110_000 @@ -5923,7 +5932,9 @@ function oracleTestFile(plan, file) { // a test throws nothing, which the hook reports. Neither hook calls the // source under test. Where the history names the `afterAll` as failing // (`hookFails`), it rethrows its assertion's failure as FILE_HOOK_ERROR, so - // the file fails outside its tests with a message the baseline names. + // the file fails outside its tests with a message the baseline names. The + // fixture writes that hook whether or not it runs: whether it runs is the + // model's prediction (`brokenByHook`), kept apart from the fixture. if (holdsHookAssertion(plan, file)) out.push( ...[`beforeAll`, `afterAll`].flatMap((hook) => [ @@ -5933,7 +5944,7 @@ function oracleTestFile(plan, file) { ` expect(shared.value).toBe(-1)`, ` } catch (error) {`, ` if ((error as { name?: string }).name !== 'AssertionError') throw error`, - ...(hook === `afterAll` && brokenByHook(plan, file) + ...(hook === `afterAll` && hookFailsIn(plan, file) ? [` throw new Error('${FILE_HOOK_ERROR}')`] : [` threw = true`]), ` }`, From bdbd365f92b11c11f743ff449d9ec6d89ebc9a44 Mon Sep 17 00:00:00 2001 From: Kyle Mathews Date: Wed, 2 Dec 2026 12:33:24 -0700 Subject: [PATCH 4/6] ci: retrigger the PR workflow after the GitHub Actions outage No run was created for the pushes made during the outage, nor for a close and reopen of the pull request afterwards. Co-authored-by: Isaac From 058bee289d1e138d41ebc80b2e7548aa8f40bc72 Mon Sep 17 00:00:00 2001 From: Kyle Mathews Date: Wed, 2 Dec 2026 12:54:36 -0700 Subject: [PATCH 5/6] ci: retrigger the PR workflow once more after the GitHub Actions incident GitHub's incident notes say events during the outage cannot be replayed. The first retrigger at 19:32Z produced no run either. Co-authored-by: Isaac From 7b155e8769fc3e81cbce029378cf4d90ad816d7f Mon Sep 17 00:00:00 2001 From: Kyle Mathews Date: Wed, 2 Dec 2026 14:04:25 -0700 Subject: [PATCH 6/6] ci: retrigger the PR workflow now that GitHub processes push events again Co-authored-by: Isaac