Skip to content

Commit fe532f4

Browse files
KyleAMathewsIsaac
andauthored
fix(oracles): never instrument a super() call as a mutation site (#3)
* fix(oracles): never instrument a super() call as a mutation site The statement-deletion mutant wrapped an expression statement that calls `super(...)` (`G.m(id) || super(...)`). A derived constructor then ran with `super` conditional or moved, and with TypeScript's parameter properties or field initializers it read `this` before `super` and threw ("Must call super constructor..."), so every construction failed with no mutant active. Expression-position super calls were already excluded; statement-position ones were not. The fix excludes a `super(...)` call from `delete-call` in schemata.mjs. The static oracle gains a derived-class grammar (DERIVED file: a base class and a derived class whose constructor runs statements before and after `super('a')`, with and without parameter properties and a field initializer). Its laws: the source runs as the model says; the instrumented class with no mutant active runs as its source does; under every mutant the constructor completes with the base tag; and the model's expected sites contain no site for the super call. Law: The static half of the gap report keeps each derived class's super call unconditional (no mutant removes or moves it; with no mutant active the instrumented class behaves as its source). Authority: the gap report's contract that instrumentation with no mutant active does not change behavior and that a mutant is a legal program variant (the operator contract in schemata.mjs), and ECMAScript's rule that a derived constructor calls super before it reads this and before it returns. Maintainer report G11 (TanStack DB subscription.ts, 2026-11-09). Reach: 21 generated histories (fixed seed 20261105) and 25 (random seed) entered `a derived class constructed`, and every derived state (`a derived class with a parameter property`, `... with a plain parameter`, `... with a field initializer`, `... with statements before super`, `... with no statement before super`, `... with a conditional before super`, `... with a statement after super`, `... reading this after super`) is reached under both seeds, with two constructed histories naming them so each is reached on every campaign. RED: on the parent code (schemata.mjs unchanged, new grammar), the static oracle fails law `no-mutant behavior` at checkpoint `derived`, fixed seed 20261105 (the shrunk history has `derived: {before: [], after: []}`): the instrumented class with no mutant active throws "Must call super constructor in derived class before accessing 'this' or returning from derived constructor", the source returns labels [] and tag "a". Both calibrations of the new laws are then also red, because their clean trace fails. GREEN: `vitest --run --config oracle-gaps/vitest.config.mjs` (all four files, 34 tests, exit 0) on the final tree, including the static oracle with its two new calibrations (`super unconditional`, `no-mutant behavior`) detected. Mutant: a hostile "fix" that exempts only a leading `super(...)` statement (the first statement of the constructor body) leaves a later super call wrapped. The static oracle rejects it with `no-mutant behavior` (fixed and random seeds). With no mutant active, the wrapped super call throws in the TypeScript-emitted class, so the no-mutant law catches it before the per-mutant law does. Harness fix found by the end-to-end run: the determinism law compared the CLI's raw stderr, and a refusal's stack names the CLI copy's directory (`oracle-gaps-mutant cli #<random>`), which differs per run for a spaced-path history. The daemon branch already names those directories; the `cli` observation now names them the same way, in raw and file-URL form. The law still compares everything else the CLI reports. Mutant check: the failing determinism run (before the normalization) is the RED for this harness change; the GREEN is the full run above. Limits: derived classes are judged only in the static oracle's in-process run. No test imports the derived file, so the end-to-end oracle does not run it, and the run transpiles it to CommonJS at ES2022 (other downlevel targets and Vitest's transform are not run). The mutant switch restates the contract in schemata.mjs. The grammar has no `super.method()` call, no super in a value position, and no class of a container other than `Derived`. Verifying the TanStack DB subscription.ts case itself (~80 oracle files) is not in this change: it needs a run against that checkout. `createOracleReach` is TanStack DB's; this package declares reach with `states` and `constructed` histories (oracle-property.ts). Co-authored-by: Isaac <[email protected]> * fix(oracles): no super-region mutation sites in derived constructors Review follow-up to 77a06fd. That commit excluded a `super(...)` statement from `delete-call`, which left shapes where a mutant still prevents or delays the call: a `super` in an arrow argument, a `super` as a logical operand, and a statement before `super` that returns early. Maintainer decision (2026-11-09): one rule for every shape. A derived constructor gets no mutation site in its super region, which is its parameters, the statements before its first statement that calls `super`, and that statement. An arrow inherits `super`, so its body counts; a function, method, accessor, or class does not. Statements after the call keep their sites. `superGuarded` in schemata.mjs implements it. Law: no mutant, when active, prevents or delays a derived constructor's super call; with no mutant active the instrumented class behaves as its source; under every mutant the constructor completes with its base tag, unless an early return ends it first; statements after super keep their sites. Authority: the gap report's behavior-preservation and legal-variant contract (schemata.mjs operator contract), ECMAScript's rule that a derived constructor calls super before it reads this and before it returns, and the maintainer decision above. Grammar (gap-report-model-oracle.mjs): a derived class's before statements (push, conditional push, early `return {}`), one of four super forms (a statement; `[0].forEach(() => super('a'))`; `out && super('a')`; `nothing(n) || super('a')`), and after statements (push, `this.tag` read, conditional push). The model gives sites only to after statements. The form filter keeps sources legal TypeScript: a non-statement super needs plain parameters and no field, since TypeScript emits parameter-property assignments before the body and requires a root-level super beside a field. Reach: derive-from-observation (static oracle). Counts from the static run, fixed seed 20261105 / random seed: constructed 30 / 24; plain parameter 25 / 14; parameter property 5 / 7; field 9 / 7; early return 7 / 6; push before 9 / 6; conditional push before 7 / 5; push after 19 / 13; conditional push after 5 / 4; this read after 7 / 6; super as statement 10 / 15; super in an arrow 6 / 3; super after && 6 / 1; super after || 8 / 5. Plus constructed histories for each form and for the early return. RED: static oracle, on the 77a06fd schemata.mjs with the new grammar, fixed seed 20261105: law `super unconditional` at checkpoint `derived`, "under mutant 21 the class for 0 has tag undefined" (and mutant 30). The arrow, `&&`, and `||` forms let a mutant skip super; the `&&` and `||` forms return the `out` array with no error, so only the tag check sees it. The before-super sites that the rule removes are not separately shown red: the derived law fails first for them. Two harness defects were also red before the fix: the grammar's list cap (3 statements) and the form builds, which the oracle correctly rejected as outside the language. GREEN: static oracle 11/11 on the final tree (fixed and random seed, with the calibrations `super unconditional` and `no-mutant behavior` detected). Full suite (`vitest --run --config oracle-gaps/vitest.config.mjs`): 4 files, 34 tests, exit 0, on this commit's tree. Mutant: a hostile rule that covers only the super statement, not the statements before it, is rejected by `super unconditional` (mutant 21 and 23: a forced early return ends the constructor with no tag). The fix is restored byte-for-byte after the check. Harness hygiene (e2e, gap-report-oracle.property.test.mjs), no RED of its own: stderr is named (CLI directory and scratch package) before it is cut to its last 1500 characters (`readRun`); the daemon's first line reads that already named text; the scratch directory is resolved with realpathSync, as the static driver does. Comparison change: the `cli` observation now names the CLI copy by how.cli and the package directory before the cut, and the daemon path no longer calls replaceAll on a possibly undefined copy. No law is relaxed; the normalization is the determinism law's existing rule for scratch paths. Simplifications: one `derivedStates` table shared by the reach derivation and `required`; reach states come from the observed runs and the instrumented copy's super form, not the plan; `isSuperCall` and `holdsSuper` are shared; the `no-mutant behavior` calibration uses `corrupt`; `DERIVED_FN` is no longer exported; the plan carries one `derived` object (`spec`, `source`, `statements`). Limits: - The in-process run transpiles to CommonJS at ES2022; Vitest's transform (CR-6) and other downlevel targets are not exercised. - The mutant switch (`switchFor`) is a hand copy of the switch's contract, not the capture setup's runtime (CR-5): the capture setup imports Vitest and installs timers and globals on load, so it cannot run in-process. - The end-to-end oracle instruments the derived file and judges its sites as unowned, but no test imports or constructs the class; its no-mutant and super-region behavior is judged only in-process. - The model special case (CR-8) is kept as written. - Not generated: super in a method, a nested class, a `super.method()` call, a constructor default parameter, or a before-super `return` other than the early-object form. Co-authored-by: Isaac <[email protected]> --------- Co-authored-by: Isaac <[email protected]>
1 parent 98a9610 commit fe532f4

5 files changed

Lines changed: 561 additions & 24 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/oracles': patch
3+
---
4+
5+
Fix `oracle-gaps` instrumenting `super(...)` calls. Its statement-deletion mutant wrapped a `super(...)` call, so a derived class's constructor could skip the call, or read `this` before it, and every construction failed with no mutant active. A derived constructor now gets no mutation site in its super region: the statements before its first statement that calls `super(...)`, and that statement. So no mutant can prevent or delay the call. Statements after the call keep their sites. The check covers the call as a statement, as an arrow argument, and as a logical operand, and an early `return` before it. Limit: the check runs the derived class under TypeScript's ES2022 CommonJS transpile with a copy of the mutant switch, not under Vitest's transform.

‎packages/oracles/oracle-gaps/gap-report-model-oracle.mjs‎

Lines changed: 170 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ const SOURCE = `src/sut.ts`
3333
const LIB = `src/lib.ts`
3434
// A Svelte module, which only the static half reads: no test loads it.
3535
const RUNES = `src/state.svelte.ts`
36+
// A module with a base class and a derived class, which only the static half
37+
// reads: no test loads it. See `derivedFile`.
38+
const DERIVED = `src/derived.ts`
39+
// The derived class's constructor, as the model names it: no oracle owns it.
40+
const DERIVED_FN = `Derived.constructor`
41+
// The inputs a derived class is run with, each judged against the model.
42+
export const DERIVED_INPUTS = [0, 4, 9]
3643
// Where this package's own dependencies are installed.
3744
const OWN_MODULES = join(
3845
dirname(fileURLToPath(import.meta.url)),
@@ -182,6 +189,37 @@ const runeStatement = fc.oneof(
182189
rune: fc.constantFrom(`$effect`, `$effect.pre`),
183190
}),
184191
)
192+
// A derived class (DERIVED's `Derived`, which extends `DerivedBase`). Its
193+
// constructor runs `before` statements, then one `super('a')` call in one of
194+
// four forms, then `after` statements. A before statement may return early
195+
// (an object, with no `super` call). The class's parameters may be parameter
196+
// properties, and it may have a field initializer.
197+
const derivedBefore = fc.oneof(
198+
fc.record({ kind: fc.constant(`push`) }),
199+
fc.record({ kind: fc.constant(`if`), op: comparison, k: constant }),
200+
fc.record({ kind: fc.constant(`early`), op: comparison, k: constant }),
201+
)
202+
const derivedAfter = fc.oneof(
203+
fc.record({ kind: fc.constant(`push`) }),
204+
fc.record({ kind: fc.constant(`tag`) }),
205+
fc.record({ kind: fc.constant(`if`), op: comparison, k: constant }),
206+
)
207+
const derivedClass = fc
208+
.record({
209+
params: fc.constantFrom(`plain`, `property`),
210+
field: fc.boolean(),
211+
before: fc.array(derivedBefore, { maxLength: 3 }),
212+
// `plain`: a statement `super('a')`; `arrow`: called in an arrow passed to
213+
// a call; `and` and `or`: its right operand of `&&` or `||`.
214+
form: fc.constantFrom(`plain`, `arrow`, `and`, `or`),
215+
after: fc.array(derivedAfter, { maxLength: 3 }),
216+
})
217+
// Only a statement `super` is legal TypeScript beside parameter properties
218+
// or a field initializer: TypeScript emits the former before the body, and
219+
// requires a root-level `super` for the latter.
220+
.filter(
221+
(spec) => spec.form === `plain` || (spec.params === `plain` && !spec.field),
222+
)
185223
// The framework's route vocabulary (oracle-route.ts), and three names it
186224
// retired, which a registration may still carry and which are unknown
187225
// routes now.
@@ -315,6 +353,8 @@ const histories = fc.record({
315353
runes: fc.array(fc.array(runeStatement, { minLength: 1, maxLength: 4 }), {
316354
maxLength: 2,
317355
}),
356+
// The derived class of DERIVED's file, when there is one.
357+
derived: fc.option(derivedClass, { nil: null, freq: 4 }),
318358
// How `--source` spells each path: as the package names it, with a
319359
// leading `./`, or through a redundant segment. Each names the same file,
320360
// and the report names it by its path in the package.
@@ -1454,6 +1494,108 @@ function renderStatement(stmt, callText) {
14541494
throw new Error(`unknown statement kind ${stmt.kind}`)
14551495
}
14561496

1497+
// ## The derived class's file
1498+
//
1499+
// `Derived` extends `DerivedBase`. Its constructor runs the spec's `before`
1500+
// statements, the `super('a')` call in the spec's form, then its `after`
1501+
// statements. Each statement is one line, so a site's line is its statement's
1502+
// line. Before `super`, a push labels `b<i>`, an `if` labels `c<i>` when its
1503+
// condition holds, and an `early` returns an object when it holds. After
1504+
// `super`, a push labels `a<i>`, `tag` pushes `this.tag` (`a`), and an `if`
1505+
// labels `d<i>` when its condition holds. `nothing` returns 0, so the `or`
1506+
// form calls `super` as its right operand. `derivedMake` returns a new
1507+
// `Derived`. `statements` records each statement with its phase, its line,
1508+
// its text, and its call, which is what a site of the statement is.
1509+
const superCall = {
1510+
plain: `super('a');`,
1511+
arrow: `[0].forEach(() => super('a'));`,
1512+
and: `out && super('a');`,
1513+
or: `nothing(n) || super('a');`,
1514+
}
1515+
function derivedFile(spec) {
1516+
const lines = [
1517+
`export class DerivedBase {`,
1518+
` tag: string`,
1519+
` constructor(tag: string) {`,
1520+
` this.tag = tag`,
1521+
` }`,
1522+
`}`,
1523+
`export class Derived extends DerivedBase {`,
1524+
]
1525+
if (spec.field) lines.push(` count = 0`)
1526+
lines.push(
1527+
` constructor(${spec.params === `property` ? `public ` : ``}n: number, out: Array<string>) {`,
1528+
)
1529+
const statements = []
1530+
const statement = (phase, kind, text, call) => {
1531+
lines.push(` ${text}`)
1532+
statements.push({ phase, kind, text, call, line: lines.length })
1533+
}
1534+
for (const [i, s] of spec.before.entries()) {
1535+
if (s.kind === `push`)
1536+
statement(`before`, `push`, `out.push('b${i}');`, `out.push('b${i}');`)
1537+
else if (s.kind === `if`)
1538+
statement(
1539+
`before`,
1540+
`if`,
1541+
`if (n ${s.op} ${s.k}) out.push('c${i}');`,
1542+
`out.push('c${i}');`,
1543+
)
1544+
else statement(`before`, `early`, `if (n ${s.op} ${s.k}) return {};`)
1545+
}
1546+
statement(`super`, `super`, superCall[spec.form], undefined)
1547+
for (const [i, s] of spec.after.entries()) {
1548+
if (s.kind === `push`)
1549+
statement(`after`, `push`, `out.push('a${i}');`, `out.push('a${i}');`)
1550+
else if (s.kind === `tag`)
1551+
statement(`after`, `tag`, `out.push(this.tag);`, `out.push(this.tag);`)
1552+
else
1553+
statement(
1554+
`after`,
1555+
`if`,
1556+
`if (n ${s.op} ${s.k}) out.push('d${i}');`,
1557+
`out.push('d${i}');`,
1558+
)
1559+
}
1560+
lines.push(` }`, `}`)
1561+
lines.push(
1562+
`function nothing(x: number): number {`,
1563+
` return x - x;`,
1564+
`}`,
1565+
`export function derivedMake(x: number, out: Array<string>): Derived {`,
1566+
` return new Derived(x, out);`,
1567+
`}`,
1568+
)
1569+
return { source: `${lines.join(`\n`)}\n`, statements }
1570+
}
1571+
1572+
// What a derived class's constructor pushes for `x`, and the fields it sets:
1573+
// the labels in order (each `if` pushes its label when its comparison holds
1574+
// for `x`), and, unless an early `return` left the constructor first, the tag
1575+
// the base class sets, `n` for a parameter property, and `count` for a field
1576+
// initializer. An early return yields the object it returns, with no fields.
1577+
// The source's and the instrumented copy's runs must both agree with it.
1578+
export function derivedExpected(spec, x) {
1579+
const labels = []
1580+
for (const [i, s] of spec.before.entries()) {
1581+
if (s.kind === `push`) labels.push(`b${i}`)
1582+
else if (s.kind === `if`) {
1583+
if (holds(x, s.op, s.k)) labels.push(`c${i}`)
1584+
} else if (holds(x, s.op, s.k)) return { labels }
1585+
}
1586+
spec.after.forEach((s, i) => {
1587+
if (s.kind === `push`) labels.push(`a${i}`)
1588+
else if (s.kind === `tag`) labels.push(`a`)
1589+
else if (holds(x, s.op, s.k)) labels.push(`d${i}`)
1590+
})
1591+
return {
1592+
labels,
1593+
tag: `a`,
1594+
...(spec.params === `property` ? { n: x } : {}),
1595+
...(spec.field ? { count: 0 } : {}),
1596+
}
1597+
}
1598+
14571599
function resolveHistory(history) {
14581600
let label = 0
14591601
const containerOf = (index) => history.containers[index] ?? `free`
@@ -1584,6 +1726,9 @@ function resolveHistory(history) {
15841726
body,
15851727
tests: [],
15861728
}))
1729+
// The derived class's file, which is no function of the model's (see
1730+
// `derivedFile`).
1731+
const file = history.derived ? derivedFile(history.derived) : undefined
15871732
const functions = [
15881733
...generated,
15891734
...library,
@@ -1873,12 +2018,18 @@ function resolveHistory(history) {
18732018
LIB,
18742019
...(runesSource ? [RUNES] : []),
18752020
...(dotGenSource ? [DOTGEN] : []),
2021+
...(file ? [DERIVED] : []),
18762022
],
18772023
dotGenSource,
18782024
history,
18792025
source,
18802026
librarySource,
18812027
runesSource,
2028+
derived: file && {
2029+
spec: history.derived,
2030+
source: file.source,
2031+
statements: file.statements,
2032+
},
18822033
}
18832034
}
18842035

@@ -2263,6 +2414,22 @@ function sitesOf(plan) {
22632414
}
22642415
}
22652416
}
2417+
// The derived class's file (`derivedFile`), which no oracle owns. A
2418+
// statement before `super(...)`, and the `super` statement itself, have no
2419+
// site: no mutant, when active, may prevent or delay the constructor's
2420+
// `super` call (maintainer decision, 2026-11-09). After `super`, a push or
2421+
// tag has its call's site, and an `if` the sites of its condition and call.
2422+
for (const s of plan.derived?.statements ?? []) {
2423+
if (s.phase !== `after`) continue
2424+
const at = (operator, text) =>
2425+
add(DERIVED_FN, s.line, operator, text, { file: DERIVED })
2426+
if (s.kind === `if`) {
2427+
at(`if-true`, s.text)
2428+
at(`if-false`, s.text)
2429+
at(`binary-swap`, s.text)
2430+
}
2431+
at(`delete-call`, s.call)
2432+
}
22662433
// A call statement to a probe helper is probe-only code (law 2), at
22672434
// module level too.
22682435
for (const call of plan.loadCalls)
@@ -2348,7 +2515,7 @@ function ownersOf(plan) {
23482515
return (id) =>
23492516
new Set([
23502517
...(owners.get(id) ?? []),
2351-
...(plan.wholeFile === `none` || inLibrary.has(id)
2518+
...(plan.wholeFile === `none` || inLibrary.has(id) || id === DERIVED_FN
23522519
? []
23532520
: [plan.wholeFile]),
23542521
])
@@ -3208,6 +3375,7 @@ function fixtureFiles(plan, state = initialState(plan)) {
32083375
: plan.source,
32093376
[LIB]: plan.librarySource,
32103377
...(plan.runesSource ? { [RUNES]: plan.runesSource } : {}),
3378+
...(plan.derived ? { [DERIVED]: plan.derived.source } : {}),
32113379
...(plan.dotGenSource ? { [DOTGEN]: plan.dotGenSource } : {}),
32123380
'tests/strict.ts': `export const strict = ${state.strict}\n`,
32133381
// A workspace dependency with module state, linked through node_modules.
@@ -3528,6 +3696,7 @@ export {
35283696
SOURCE,
35293697
LIB,
35303698
RUNES,
3699+
DERIVED,
35313700
DOTGEN,
35323701
caseless,
35333702
removePath,

‎packages/oracles/oracle-gaps/gap-report-oracle.property.test.mjs‎

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ import {
297297
} from 'node:fs'
298298
import { tmpdir } from 'node:os'
299299
import { dirname, join, relative, resolve } from 'node:path'
300-
import { fileURLToPath } from 'node:url'
300+
import { fileURLToPath, pathToFileURL } from 'node:url'
301301
import fc from 'fast-check'
302302
import { declareOracle } from '../src/oracle-declaration.ts'
303303
import { socketOf, stateDirOf } from './daemon.mjs'
@@ -428,7 +428,7 @@ function runCli(dir, files, how = {}) {
428428
maxBuffer: 64 * 1024 * 1024,
429429
env: cleanEnv(),
430430
})
431-
return readRun(dir, out, child.status, child.stderr)
431+
return readRun(dir, out, child.status, child.stderr, how.cli ?? here)
432432
}
433433

434434
/** Runs the CLI several times at once on one state of the fixture. */
@@ -453,13 +453,34 @@ async function runClisAtOnce(dir, files, hows) {
453453
resolvePromise(code)
454454
})
455455
})
456-
return readRun(dir, out, status, stderr)
456+
return readRun(dir, out, status, stderr, how.cli ?? here)
457457
}),
458458
)
459459
}
460460

461+
// Output with each scratch directory named, as a path or as the file URL the
462+
// stack spells it by (its escapes included).
463+
function namedScratch(text, names) {
464+
let named = text
465+
for (const [path, name] of names)
466+
if (path !== undefined)
467+
named = named
468+
.replaceAll(pathToFileURL(path).href, name)
469+
.replaceAll(path, name)
470+
return named
471+
}
472+
461473
/** What one run of the CLI reported, from its exit status and its files. */
462-
function readRun(dir, out, status, stderr) {
474+
function readRun(dir, out, status, stderr, cli) {
475+
// The output names the CLI directory that ran and the package, as scratch
476+
// directories do, before it is cut to its last characters.
477+
const named =
478+
status === 0
479+
? undefined
480+
: namedScratch(`${stderr}`, [
481+
[cli, `<cli>`],
482+
[dir, `<package>`],
483+
])
463484
let results
464485
let report
465486
let summary = ``
@@ -472,7 +493,7 @@ function readRun(dir, out, status, stderr) {
472493
}
473494
return {
474495
exit: status,
475-
stderr: status === 0 ? undefined : `${stderr}`.slice(-1500),
496+
stderr: named === undefined ? undefined : named.slice(-1500),
476497
reported: results !== undefined,
477498
// Law 9 compares everything the run reports except how it was
478499
// produced: durations, the options it was given (the output directory
@@ -493,8 +514,7 @@ function readRun(dir, out, status, stderr) {
493514
),
494515
evidence: report?.evidence,
495516
// A refused run is compared by the cause it names.
496-
refusal:
497-
status === 0 ? undefined : `${stderr}`.match(/^Error: (.*)$/m)?.[1],
517+
refusal: named?.match(/^Error: (.*)$/m)?.[1],
498518
mutants: (results ?? []).map((r) => ({
499519
key: r.key,
500520
source: r.source,
@@ -640,12 +660,9 @@ async function incremental(dir, plan, cli, copy, observe, states) {
640660
exit: run.exit,
641661
refusal: run.refusal,
642662
report: run.report,
643-
// The first line of a failure, for the message, without the paths
644-
// of this history's scratch package and CLI copy.
645-
stderr: run.stderr
646-
?.split(`\n`)[0]
647-
.replaceAll(copy, `<cli>`)
648-
.replaceAll(dir, `<package>`),
663+
// The first line of a failure, for the message; readRun has named
664+
// the scratch package and CLI copy in it.
665+
stderr: run.stderr?.split(`\n`)[0],
649666
},
650667
})
651668
if (twice && step === `start`)
@@ -836,10 +853,12 @@ async function incremental(dir, plan, cli, copy, observe, states) {
836853

837854
async function driver(plan, observe) {
838855
// A package that resolves no TypeScript lives outside this repository.
839-
const dir = mkdtempSync(
840-
plan.fault === `noTypescript`
841-
? join(realpathSync(tmpdir()), `gap-fixture-`)
842-
: join(here, `.scratch-`),
856+
const dir = realpathSync(
857+
mkdtempSync(
858+
plan.fault === `noTypescript`
859+
? join(realpathSync(tmpdir()), `gap-fixture-`)
860+
: join(here, `.scratch-`),
861+
),
843862
)
844863
// A history with steps runs its own copy of the CLI, which the `cli` edit
845864
// changes; a history that installs the CLI under a path with a space and
@@ -1656,7 +1675,7 @@ oracleProperty({
16561675
law: {
16571676
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 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.`,
16581677
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.`,
1659-
limits: `Hangs only as an owner test that awaits a promise that never settles, under a 1 s first budget and a 6 s full limit, and a slow run only as one witness that waits 3 s before it judges; 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; no --only, --sample, or --diff-base; package configs only in vite.config.ts, vitest.config.ts, or vite.config.mjs, as an object or a sync or async function, with no plugins of their own and test.projects only as a refusal; no probe-bound states, so reach agreement's killing of probe mutants is not checked; no gap answers or gate; law 9's edits leave out files read through fs, 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; 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.`,
1678+
limits: `Hangs only as an owner test that awaits a promise that never settles, under a 1 s first budget and a 6 s full limit, and a slow run only as one witness that waits 3 s before it judges; 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; no --only, --sample, or --diff-base; 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 in vite.config.ts, vitest.config.ts, or vite.config.mjs, as an object or a sync or async function, with no plugins of their own and test.projects only as a refusal; no probe-bound states, so reach agreement's killing of probe mutants is not checked; no gap answers or gate; law 9's edits leave out files read through fs, 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; 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.`,
16601679
owner: `packages/oracles/oracle-gaps`,
16611680
},
16621681
histories: {

0 commit comments

Comments
 (0)