Skip to content

fix(oracle-gaps): no wall-clock cut decides an outcome - #99

Draft
KyleAMathews wants to merge 166 commits into
mainfrom
fix/gap-cli-deterministic-cuts
Draft

KyleAMathews wants to merge 166 commits into
mainfrom
fix/gap-cli-deterministic-cuts

Conversation

@KyleAMathews

@KyleAMathews KyleAMathews commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This branch makes a gap-CLI count cut decide its outcome from the cut itself, not from which tests happened to run, and it bounds every history's wall-clock backstop. It also carries the merged work of the side branches fix99-attr, fix99-b4 and main (through #176, #195 and #206). The branch is a draft and is not ready for review yet: one known random-seed failure is open (below), and the precedence constructed histories are not yet in the oracle.

What changed

Fixes

Attributions and open items

Per-job times (merged head 7038156, run 45376762468, 60 jobs)

Job Result Time
Gap report end-to-end oracle (fixed seed, 1/5) success 7.1 min
(fixed seed, 2/5) success 6.2
(fixed seed, 3/5) success 6.8
(fixed seed, 4/5) success 6.6
(fixed seed, 5/5) success 7.6
(random seed, 1/5) success 5.6 min
(random seed, 2/5) success 7.5
(random seed, 3/5) success 5.4 min
(random seed, 4/5) success 5.3 min
(random seed, 5/5) success 7.4
(determinism, 1/8) success 5.9 min
(determinism, 2/8) success 8.8
(determinism, 3/8) success 7.9
(determinism, 4/8) success 10.2 (over 10)
(determinism, 5/8) success 10.2 (over 10)
(determinism, 6/8) success 6.9
(determinism, 7/8) success 7.6
(determinism, 8/8) success 8.2
Windows gap report end-to-end oracle (fixed seed, 3/10) success 14.0 (over 10)
(fixed seed, 8/10) success 6.2
(fixed seed, 10/10) success 7.5
Framework self-oracle (1 to 9 of 9) success 2.5 to 8.7

Every other job is under 10 minutes. The table lists the jobs above 6 minutes, the random and determinism shards, and every job over 10; the run page has all 60.

Limits

  • Precedence constructed histories and their mutants are not in the oracle yet. The three histories (a passing law's unclocked spin is a kill; a clocked spin is indeterminate; a failing law's spin is blocked) and a mutant for each are the next step. Existing histories cover the states but do not yet pin the precedence.
  • The twin constructed history for seed 1919642959's slow-owner case is not recorded: its base is not recoverable from the 2,000-character cap on the History line (oracle-property: the History line is capped at 2000 characters, so a failing history cannot be filed in full #185). The seed replays stand in for it.
  • The random 3/4 daemon race is reproduced only by replay (4 of 20), not by a deterministic constructed history.
  • The authored-mutant path (judgeAuthored, model's authored branch) uses the same clocked-cut label; a failing law's spin on an authored mutant is not covered by a constructed history.
  • Three jobs run over 10 minutes (determinism 4/8 and 5/8 at 10.2 min; Windows fixed 3/10 at 14.0 min). Repacking is needed before ready.
  • Limits prose in the oracle's limits string follows main's rewrite, with a sentence for fix(oracle-gaps): no wall-clock cut decides an outcome #99. The fuller list is here.
  • Not marked ready. Ready waits for the precedence histories, the 3 over-limit jobs, and the fix99-stop merge.

This pull request and its description were written by Isaac.

KyleAMathews and others added 8 commits November 14, 2026 16:37
…s not wait

Determinism under load (2026-11-13): a run's outcome must not depend on
how long a run took. A constructed history, "a slow owner's kill and
another owner's kill", has one mutant that file a's random-route test
and file b's fixed-seed test both kill. Its driver also runs the slow
twin: the same package, where a's test waits 3 s past its first budget
wherever the output differs and then judges as before. The law compares
the two reports, `randomAlso` included.

On main, a's slow copy is cut at its first budget and queued for a
confirmation, b's kill decides the mutant first, and a's random failure
is never recorded: the twin reports `randomAlso: false` where the package
reports `true`. `slowTwin` is constructed-only (no generated history
draws it; `histories` takes it back without it).

Co-authored-by: Isaac <no-reply@databricks.com>
…t, and a timer under load

Deterministic cuts, option A (register M, 2026-11-14): no wall-clock cut
decides an outcome, so a mutant's copies are judged by count, not by time.
Three laws are added to the end-to-end oracle, each RED on the parent
commit before any production change.

- The budget witness w_slowpair becomes a work-budget witness: its two
  owners' tests call the function PAIR_LOOPS times where their output
  differs. Each copy stays inside its call budget, the two together pass
  the mutant's work budget (WORK_FLOOR), so the mutant is a timeout by
  count, whatever the clock says. The model judges the budget in owner
  order, a kill before the budget runs out still deciding.
- A slow kill whose test waits 16 s, past Vitest's 15 s per-test limit, is
  killed: no limit that the CLI leaves to Vitest decides the outcome.
- A copy whose test starts a timer, spins under load, then waits for the
  timer, is killed and never cut as idle (the idle law is state, not time).

Constructed-only test fields (slowMs, loops, busy) are held by the drawn
test record at neutral constants and taken back to them by the histories'
map, so no generated history draws them (generator rule, 2026-11-14). The
constructed histories are appended at the end of the list, and the slow
owner's history moved there from the middle of it.

Co-authored-by: Isaac <no-reply@databricks.com>
…he work budget

The first RED (9412eac) lets each copy of w_slowpair make 37,500 calls
beyond its first. At three site evaluations a call that is 112,500 per copy,
past the 100,000 call budget, so main cuts each copy by count and the mutant
is a timeout on either side; the work law is not reached. At 30,000 calls a
copy makes 60,000 to 90,000 site evaluations, inside its budget, and the two
copies together pass the work budget, so main must report survived.

Co-authored-by: Isaac <no-reply@databricks.com>
…-clock budget

Register M entry "Deterministic cuts, option A" (2026-11-14): no wall-clock
cut decides an outcome; a mutant's budget is a work count, and the wall-clock
budget is only a backstop that reports a gap. The model's wall-clock clause
(two budgets: a slow owner file's confirmations past --mutant-limit predict a
timeout) is removed as the repair the M entry requires. This is not a model
change to match production: the clause's authority is the retired confirmation
path, and the M entry retires it.

Consequence, a RED on main: the constructed history "a slow kill past Vitest's
15 s limit" (a 16 s wait where its output differs) now predicts `killed`, and
main reports `timeout` for it, because main's confirmation is cut by the
mutant budget at 15 s (diagnostic on a scratch branch: the copy's outcome is
"run time limit", not Vitest's "Test timed out").

Also: a test that awaits its busy witness is async (the emitter marks it so),
so the baseline loads.

Co-authored-by: Isaac <no-reply@databricks.com>
…states are listed apart

Register M entry "Deterministic cuts, option A" (2026-11-14), with the
coordinator's ruling 3 (fallback): a test that Vitest's own limit ends
("Test timed out") is reported as a backstop gap, like a timed-out run. It
is `timeout` after any kill, and it never keeps a kill from deciding. The
previous rule read a Vitest timeout only when every failing test had one,
so a timed-out test beside a verdict-less failure was `crashed`, and a
timed-out test beside an unregistered kill was not a timeout at all. The
`every` branch and the `!timeout` filter are now redundant and removed.

Law: a run's outcome does not depend on how long a test took (determinism
under load); a clock limit may only report a gap.
RED: the classify oracle on the parent classify.mjs (HEAD before this commit,
built from the same fixtures) fails with "mutant m0: unregistered-kill, owed
timeout", and the parent's crashed/timeout split fails the same law.
Mutant: timeout checked before the kills (scratch copy): the classify oracle
fails, "mutant m0: timeout, owed killed"; the mutant is rejected.
GREEN: the classify oracle passes (276 tests). The model counts a timeout
message only in a file that loaded, as production does (a file that fails to
load gives no tests).

The e2e oracle's states "a slow owner's kill reported as when it did not
wait", "a slow kill past fifteen seconds killed" and "a copy waiting on a
timer under load killed" are listed as separate: they have their own
histories, so "every outcome class" must not enter them.

Co-authored-by: Isaac <no-reply@databricks.com>
Register M entry "Deterministic cuts, option A" (2026-11-14). A copy runs
until it finishes, goes idle, or spins; the only wall-clock limit is a
backstop that reports a gap and never decides a kill.

- No first budget and no confirmation: a copy runs once, to its end, under
  the backstop limit (hang-limit plus three seconds per second of the file's
  unmutated time). The cut marking and the confirming run are removed.
- G1 becomes a work budget: a mutant's copies, summed in their owner files'
  report order, may do at most max(WORK_FLOOR, 10 x the owners' unmutated
  calls) site evaluations (WORK_FLOOR = CALL_FLOOR, 100,000). Past it, the
  copy that crosses and every later copy is a timeout, so a kill among them
  does not count. This is deterministic because the work is a count; the
  owner order is the report's, not the completion order.
- The wall-clock mutant budget (--mutant-limit) is a backstop checked after
  all copies: no kill and elapsed over budget is a timeout; it never decides a
  kill.
- Defaults (coordinator rulings, 2026-11-14): --hang-limit 60 s, --mutant-limit
  180 s, --test-timeout 65 s (hang-limit plus 5 s). Cost to state: an unmutated
  hang that no CLI limit cuts now fails after 65 s, not 15 s; under option A an
  idle hang is cut by `no progress` in about 500 ms, so only a busy hang with no
  instrumented site waits for the backstop.
- --first-limit is validated and retired: it prints a note and changes nothing.
- A test that Vitest's own limit ends is a backstop gap (classify.mjs; its
  RED and mutant are in the prior commit, 4b063c8).

Correction to 4b063c8's message: that message said the parent's crashed/timeout
split fails the classify oracle. I did not run that case. The verified RED is
the one in 4b063c8's body: the parent gives "unregistered-kill" where the model
owes "timeout".

Co-authored-by: Isaac <no-reply@databricks.com>
… in the test

The counter-witness (register, 2026-11-13 "Determinism under load"; the
2026-11-14 entry "Deterministic cuts, option A") was a copy whose test spun
for 600 ms and then waited 2 s on a timer. Its spin kept event-loop
utilization above 5%, which alone keeps a copy from looking idle, so the
timer check never mattered: mutant 2 (elapsed-only idle, the timer checks
disabled) passed the witness. The witness now waits on one timer due 3 s
out, inside the horizon, with nothing else in the test. A copy with its
timer pending is never idle; only that check stands between it and an idle
cut. A loaded variant, if wanted, is a CPU hog outside the worker.

The state is "a copy waiting on a timer killed"; the constructed field is
timerWait (a constructed-only test field, taken back to null; no generated
test draws it).

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>

# Conflicts:
#	packages/oracles/oracle-gaps/gap-report-model-oracle.mjs
#	packages/oracles/oracle-gaps/gap-report-oracle.property.test.mjs
#	packages/oracles/scripts/pr-shards.mjs
@changeset-bot

changeset-bot Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 03f0f84

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes changesets to release 1 package
Name Type
@tanstack/oracles Minor

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Nov 15, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

KyleAMathews and others added 18 commits November 14, 2026 23:08
… copies

Register C entry "Deterministic cuts, outcome rule (under M option A)",
2026-11-14: a copy cut by a clock or by its call count ends the mutant's
copies; no later copy runs. The model now predicts that: a copy that spins
(a count) stops the owner files after it, so a later owner's kill does not
count and the outcome is a timeout.

Witness: a constructed history whose one function spins in the mutant (the
until loop of w_spin) with two owners, a and b. Owner a's copy spins first;
owner b's judging test would kill. Production (main at this commit) runs
b's copy after a's spin and reports killed. The model owes timeout.

RED: on this commit, the new witness fails (the CLI reports killed where the
model owes timeout; pool run dc-rule-red-*).
Limits: the model's rule covers copies cut by a count; a wall-clock cut
(the backstop and Vitest's limit) is a backstop gap under the same rule, and
its own witness is pending (finding 4, the H1 witness).

Co-authored-by: Isaac <no-reply@databricks.com>
…ant, uncharged

Register C entry "Deterministic cuts, outcome rule (under M option A)",
2026-11-14: only counts and states decide a mutant's outcome.

- A copy cut by a clock or by its call count (its own timeout, or Vitest's
  "Test timed out") is never charged, and it ends the mutant's copies: no
  later copy runs, and a kill among later copies does not count (review B2).
- A copy's work is the calls of its deterministic, unclocked tests
  (`baseline.work`, classify.mjs), and the owner files' most-working tests
  set the budget and the call budget (review B3).
- The mutant-level elapsed-seconds backstop is removed: it summed cached
  units' stored seconds, so a daemon reuse could differ from a cold run
  (review finding 3). Each copy's own wall cut remains the backstop. Whether
  --mutant-limit still has a role is open (it now only affects identity).
- Model: a copy cut by a count or a clock ends the owner files (no later file
  runs), so the model owes the same outcome.

Witness: a constructed history with two owners, each making 30,000 extra
calls; owner a's copy is under the budget, owner b's would kill but passes
the budget, so the mutant is a timeout by count. The reversed-sum mutant
(review H2, 968bfd7) is the mutant it must fail.

Not witnessed here: a spin in an earlier owner ahead of a kill in a later
one. A spin witness was tried first and removed: the later owner runs the same
spinning function, so it spins too and never kills, and the witness passed on
the parent. Finding 4's backstop witness (H1) is pending.

Co-authored-by: Isaac <no-reply@databricks.com>
…r copy, wall cuts end the mutant

Register C entry "Deterministic cuts, outcome rule (under M option A)", as
refined by the coordinator: a copy ending in "no progress" (a state) or a spin
past its call budget (a count) is a deterministic timeout for that copy. It is
charged nothing (the rows of a cut copy are not kept, and the per-copy call
budget already bounds it), and the next owner's copy still runs, so a later
kill decides. Only a wall-clock cut (the CLI backstop, or Vitest's "Test timed
out") ends the remaining copies, as a backstop gap that is never charged.

- Model: runsOf tags each cut with its kind (wall, count, state); judge ends
  the owner files only on a wall cut.
- Check: spin and idle copies settle with spin or idle set; cutByTime covers
  wall cuts only.
- --mutant-limit is retired (validated, noted, changes nothing); the driver no
  longer passes it.
- Constructed history "a backstop cut ends the copies ahead of a later kill":
  owner a's copy waits past a 2 s backstop; owner b would kill, and does not
  run. The state "a backstop cut ends the copies ahead of a later kill" is
  entered.

Open: "a declaration fault: noTypescript" (shard 3) streams 161 gap lines where
the model expects 159; a per-mutant check is pending. It is a model and CLI
disagreement, not a duplicate line (the scratch diagnostic found no repeated
line).

Co-authored-by: Isaac <no-reply@databricks.com>
…ot in scope there)

Co-authored-by: Isaac <no-reply@databricks.com>
…p, never a silent one

Review finding 5 (register L8). The 10 s close waits in closeContexts and in
replace continued silently after a close was still pending. Now each close
waits up to the 60 s backstop; a close still pending is an error that names
the backstop gap, and no replacement is warmed while the old context is still
closing. Closes that finish are unchanged.

Witness: none. A pending close needs a context whose close never settles, which
costs 60 s per run; it is a limit of this change (the coverage is by inspection
of closeWithin and its two callers).

Co-authored-by: Isaac <no-reply@databricks.com>
…oes idle

Owner a's copy now awaits a promise that never resolves, while a repeating
timer stays due inside its horizon, so the copy is never idle and no site
spins. Only the backstop cuts it, on every machine. The witness no longer
depends on whether a 12 s wait lands inside the backstop band (register
2026-11-14, outcome rule item 5).

Co-authored-by: Isaac <no-reply@databricks.com>
…ress, or work budget

A copy's cut is now recorded as its cause and carried into the mutant's timeout
detail, results.json, and the gap line (cause: ...). The model predicts the
cause of each timeout: a backstop cut (a wall-clock limit), a spin past the
copy's call budget (a count, outcome rule item 4), no progress (a state), or
the mutant's work budget. The model had no per-copy call budget, so the
work-budget history's 4-sites-per-call mutant was a spin and not a work-budget
timeout; the model now predicts that. ORACLE_GAPS_PROFILE rows carry each
copy's cause, its file's measured time, its limit and its duration.

RED: the e2e oracle, with the cause predicted and production unchanged, fails
on the backstop history (its timeout is cut by run time limit).

Co-authored-by: Isaac <no-reply@databricks.com>
…s as constants

The deterministic-cuts constructed fields are constants in every drawn record,
so no draw changes: the tests line hashes the records without them and is
main's (e9029433a23d1f10). slowMs, loops, timerWait and pulse each get a line
after the others, with its neutral value checked on every generated test, and
hangMs is a drawn constant (null where generated) with its own line. The
constructed histories #99 adds are appended after main's 26, by name and index.

Co-authored-by: Isaac <no-reply@databricks.com>
…e current cuts

--help and the index header give the defaults (--test-timeout 65000, --hang-limit
60000) and mark --first-limit and --mutant-limit retired. The README, the
changeset and the e2e law 4 text describe the backstop, the call and work
counts, and the cause each timeout names. Stale states and names are renamed
(confirmations, the first budget, the 15 s limit): a slow kill after a 16 s
wait, and a mutant's copies past its work budget. MUTANT_LIMIT_MS, unused, is
removed. The determinism twin is described as a determinism check: it passes
on its parent, so the outcome rule's RED is the classify oracle's.

Co-authored-by: Isaac <no-reply@databricks.com>
… and counts

The README's gap section and the changeset's bullet describe the counts and the
backstop, the cause each timeout names (on the gap line too), and the retired
options, in place of the confirmation budget. The classify oracle's gap-line
law (in bfca29a) accepts a timeout's cause suffix.

Co-authored-by: Isaac <no-reply@databricks.com>
Resolves the constructed list (main's 29 histories first, then the five #99 histories at 29 to 33), the drawn record (main's pauseEngages and warmReplaced, then hangMs), the take-back, the limits text (main's Windows notes, with #99's work-budget wording), and the shard lists (#99's histories in shard 4, main's test.projects line in shard 5). The fingerprint canary passes.

Co-authored-by: Isaac <no-reply@databricks.com>
…; the Windows shards list the new histories

The constructed backstop (hangMs) is a drawn constant now, so its take-back returns
the drawn value (null), which the arbitrary can take back. The fixed-seed shards
of main are kept as they are: the new histories fall into the Linux rest shard,
and the Windows partition, which is exact, lists them in shard 10.

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
…n the CLI arguments

Co-authored-by: Isaac <no-reply@databricks.com>
…'d timer

An unref'd timer is not among the process's active resources, so only the copy's
own pending-timer record keeps it busy (the idle rule, held state, M 2026-11-15).
The witness is a constructed history of its own; the reach state is recorded.

Co-authored-by: Isaac <no-reply@databricks.com>
…dition

A copy is idle when no counted timer is due within its horizon, no timer is listed
beyond its test's base, and no I/O handle is open (M entry 2026-11-15). Sample
lateness and the event loop's utilization no longer reset the window: a busy
synchronous or microtask loop blocks the sampler, so it cannot look idle. The
held-state witnesses (a copy waiting on a timer, ref'd or unref'd) keep the
copy busy, and the mutants that ignore a due timer are killed.

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
…ef'd timer history

The e2e shard check named the removed history 'a slow kill past Vitest's 15 s limit'
and had no shard for the unref'd timer history, so CI's test:oracle-gaps:shards
failed. The check now partitions the e2e tests exactly.

Co-authored-by: Isaac <no-reply@databricks.com>
@pkg-pr-new

pkg-pr-new Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/TanStack/oracles/@tanstack/eslint-plugin-oracles@99
npm i https://pkg.pr.new/TanStack/oracles/@tanstack/oracles@99

commit: 03f0f84

… wall-clock cut

With the idle rule decided by state (M entry, 2026-11-15), a timer due beyond the
copy's horizon does not keep it busy, so it is idle and cut as no progress. The
model's wall-clock cut for such a wait was stale; the load experiment's 12 s copies
gave the same outcome on three repeats under a concurrent run (the model owed a
backstop cut).

Co-authored-by: Isaac <no-reply@databricks.com>
KyleAMathews and others added 3 commits November 28, 2026 22:13
…-file replay, and none if it owns nothing

A describe's failing hook fails its file outside its tests, so the baseline
replays the whole file (`vitest run <file>`), which runs every test that ran.
The replay check now runs for every failing-law plan (285c7a7), so these
hook plans were checked for the first time, and the model owed no replay for
them: the RED on 0f97bf7's shard 5 was "the replay command
\"vitest run tests/a.test.ts\" ran [...], owed none" for "a failing beforeAll
around a law" and "a failing afterAll around a law that calls production",
whose file owns a function.

The model now owes the whole-file replay for such a file (replayedFile: the
count of its tests the baseline ran, which the whole file runs again), and
owes none for a file that owns no function. The driver compares a whole-file
replay by its command (no `-t`) and its count.

Law: the first failing owner's replay (law 3). A failing law's file that owns
a function replays the failing test, or, when it fails outside its tests,
the whole file; one that owns no function replays nothing.
Reach: the owner-less afterAll history enters the state "a failing law whose
file owns no function prints no replay" (its build is appended at the end).
RED: local `-t 'fixed seed 20261105: a (failing|heavy failing)'` on 23fb026's
production: "a failing afterAll in a file that owns no function prints no
replay": the replay ran [hooked a law..., writes to the console streams],
owed none (1 failed, 10 passed). The owner hook cases pass (GREEN here).
Limits: the whole-file count is the baseline's, not an independent count of
the file's tests.
Co-authored-by: Isaac <no-reply@databricks.com>
…no replay outside its tests either

The baseline's file-level replay (a file that fails outside its tests, such as
a describe's failing hook) printed for every oracle file, whether or not it
owns a function. The failing-law rule (law 3) covers that file too: it is a
failing law's file, so one that owns no function prints none, as the
test-level replay already does (0f97bf7). Ordinary files are unchanged.

Law: the first failing owner's replay (law 3); a failing law's file that owns
no function prints none.
Reach: "a failing afterAll in a file that owns no function prints no replay"
(constructed; enters the state "a failing law whose file owns no function
prints no replay").
RED: ea622e9 on 23fb026's production: "the replay command
\"vitest run tests/a.test.ts\" ran [hooked a law..., writes to the console
streams], owed none".
GREEN: this commit; local `-t 'fixed seed 20261105: a (failing|heavy failing)'`
11 passed, 430 skipped.
Mutant: scratch branch scratch/r99z-mut-noreplay (a failing law prints no
replay at all); the pool result is in the pull request body.
Co-authored-by: Isaac <no-reply@databricks.com>
…w, and the ownerless state is not every-outcome

Two faults in the replay check I added (ea622e9, 0f97bf7's test pair):

1. The gate was `plan.failingLaw !== undefined`, but a plan's `failingLaw` is
   `none` by default, so every plan was checked. RED: fixed seed 20261105
   "a declaration fault: setupThrows" on ee04980: "the replay command
   \"vitest run tests/a.test.ts\" ran [], owed none".
2. The state "a failing law whose file owns no function prints no replay"
   was in `required`, so `every outcome class` must enter it, and it cannot.
   RED: fixed seed 20261105 "every outcome class" on ee04980: "did not enter a
   failing law whose file owns no function prints no replay". It is now in
   `constructedOnly`, which keeps it out of the every-outcome history and
   stays declared in `required` for its own constructed histories.

The gate is now `failsALaw(plan)`: a plan with a failing law, or a broken
owner.
Law: the replay check is for the plans that have a failing law or a broken
owner (law 3); other plans owe nothing here.
GREEN: local `-t 'fixed seed 20261105: (a declaration fault: setupThrows|every outcome class|a failing (law|heavy|afterAll|beforeAll))'`:
13 passed, 428 skipped.
Limits: the other fault plans (setupThrows, did-not-load) are not checked for
the replay rule; their replays are the outside-tests branch of 1b? (see the
pull request body).
Co-authored-by: Isaac <no-reply@databricks.com>
KyleAMathews and others added 3 commits November 29, 2026 03:16
…ne owner file" is appended, not inserted

914823c placed this constructed history before recorded ones (after "a failing
law that spins under a mutant before a passing law"), so every later history's
base (seed + index) moved. The fingerprint canary requires new constructed
histories at the end (C-6), and it failed on 2e73987 as well.

RED: CI run 46248551785 on 16085b5, job "Test" (141301218745) and "Windows unit
suites" (141301255660): "appends new constructed histories, and never inserts
one before a recorded one", the listing has "a failing law's spin in one owner
file blocks a passing kill in another" at index 98.
GREEN: this commit moves the block to the end of the constructed list; local
`pnpm exec vitest --run tests/gap-report-history-fingerprint.test.ts` 4 passed.
The recorded names (oracle-gaps/constructed-order.json, main's list) are unchanged.
The moved history's own base changes; its shard names are unchanged.
Limits: the moved history's evidence (random seed 1675767311) is re-drawn.
Co-authored-by: Isaac <no-reply@databricks.com>
…owns a unit

CI run 46251491827 on 7eec5eb, random seed 4/5, seed -1191141657 path 0
("random seed: a failing owner under its parent's config"): the baseline
printed no replay for the broken owner file b, and the model owed
"broken (b.*) $x it's fixed seed 999". b owns no function here, so under the
rule (a failing law's file that owns nothing prints no replay) the model was
wrong. The model's broken-owner branch had no ownership check.

Law: law 3, as the rule of this branch: a failing law's file that owns a unit
replays; one that owns none prints none. Authority: the maintainer's rule as
stated for this change (a failing law's file that owns no function prints no
replay); "function" is read as "function or module data", the CLI's owned
unit, so an owner of module data replays too (flagged for the maintainer).

Fixes in the same commit:
- model: the broken owner's replay is owed only when the file owns a unit
  (ownsAnyFunction); ownsAnyFunction counts module data owned by the file
  (plan.history.dataOwners).
- constructed history "a failing owner under its parent's config": the failing
  owner now owns the function (owners [b], judging in b), so its replay is
  owed; its state was unreached on the random base (no replay printed).

RED: CI 46251491827 random 4/5 (job 141312295066) and local repro of the same
seed; the model owed the replay, production printed none.
GREEN: local repro passes; `-t 'failing owner'` 9 passed; `-t 'fixed seed
20261105: a (failing|heavy failing)'` 11 passed; fingerprint canary, pr-shards
and e2e-shards checks pass.
Mutant: a production gate that prints every broken owner (no ownership) fails
the owned broken-owner units (r99z-mut3 kills the replay family; the
brokenOwner cases in the fixed seeds).
Limits: the random seed's replay is one draw; the module-data reading of
"function" is a maintainer decision and is recorded in the away-log.
Co-authored-by: Isaac <no-reply@databricks.com>
Determinism 4/9 took 10.7 minutes on CI run 46255225033 (7bd7237), over the
10-minute job limit. The shard lists were balanced by earlier weights. Each
test's measured duration comes from the verbose logs of the nine determinism
shards on the pool (16085b5, 119 tests that ran; 15 skipped on Linux have no
time and are spread by count). Longest-first assignment gives nine bins of
275 to 276 s each. The CI per-job times were not per-test, so the check is the
next CI run's per-job times.

Partitions: pr-shards and e2e-shards checks pass.
Co-authored-by: Isaac <no-reply@databricks.com>
KyleAMathews and others added 14 commits November 29, 2026 06:02
…ns x 1.65

CI run 46261301537 (14f1d34) had determinism 9/9 at 11.6 min and 8/9 at 10.2
min on nine shards. CI per-test times are not in the job logs, so the repack
uses the pool's per-test durations scaled by the measured CI factor (~1.65):
ten bins of ~6.8 min estimated CI weight. The matrix and the job name move to
/10; both shard checks pass.

Co-authored-by: Isaac <no-reply@databricks.com>
Determinism 9/10 took 10.0 min on run 46265370483 (a845b55). One unit (the
first half of "an edit sequence over the witness module", 92 s of pool time)
moves from shard 9 to the lightest shard, 7. Both shard checks pass.
Co-authored-by: Isaac <no-reply@databricks.com>
The model judged a spun copy's clock over its whole run. Seed -1863113194
path 1 (delete-call of out.push('s4') in src/sut.ts): the test's loop runs
past the call budget in part 1, and its timer wait comes after that loop.
The model counted the wait, so it owed indeterminate. Production's cut row
reads the clock at the cut, sees no clock, timer, or I/O before it, and
kills by the built-in law on the unregistered route (unregistered-kill).

Law (register C 2026-11-29, "A cut is clocked only by what happened before
it", refining "A count cut's label never depends on timing", C 2026-11-23):
whether a count cut is clocked is judged at the cut. The model now records
where each campaign's clock and timer events fall in the fixture's emitted
order (before the production call, a slow wait before the loop, and the
waits and `after` read after it), and judges a spun copy's clock at its cut
mark. A clock read after the cut point does not count, and neither does a
timer wait of the cut part when the budget falls in the loop before it.
Unmutated work judgement (R19a) is unchanged.

Evidence (the replay is the history: the same model, driver and comparison):
- RED on 985b804: ORACLE_SEED=-1863113194 ORACLE_PATH=1
  ORACLE_PROPERTY=oracle-gaps.report ORACLE_UNIT='random seed: generated',
  one failing test; "unregistered-kill, owed indeterminate".
- GREEN with this commit: the same replay passes.
- Production-side trace (ORACLE_GAPS_PROFILE-era scratch hooks, not
  committed): the spin row at calls 100001 with no clock, I/O, or timer
  event before it; the model's part-1 mark has cumulative work 270009 with
  the budget at 100000, and its production call's work (9) below it.

Co-authored-by: Isaac <no-reply@databricks.com>
The shards of the random, determinism, and Windows fixed-seed jobs were
packed from Arclet timings scaled by an estimate. CI disagreed: determinism
9/10 ran 11.5 min on 985b804.

scripts/pack-shards-from-ci.mjs fetch reads the verbose logs of recent runs
into scripts/ci-durations.json, with the run ids. pack takes each test's
longest passing time across the runs, adds each job's measured setup, packs
longest-first into the shard counts, and writes scripts/ci-packed-shards.mjs,
which pr-shards.mjs reads. A failing test's time is charged only when no run
passed it: Windows fixed seed 3/11 "every outcome class" failed in run
46268858514 at 616 s, against 215 s and 219 s in the passing runs. A test
with no printed time is charged 300 ms.

Predicted per job: determinism 10 shards at about 7:44; random 5 shards at
about 8:41; Windows fixed seed 11 shards at 5:11 to 5:17. No shard count
changed, and the pr.yml matrices are unchanged.

The Linux fixed-seed job ran without the verbose reporter, so its log had
no test times. It keeps its hand-written shards (slowest measured job 8:03)
and now runs with --reporter=verbose, so a later pack can measure it.

Durations from runs 46268858514 (985b804), 46265370483 (a845b55), and
46261301537 (14f1d34).

Co-authored-by: Isaac <no-reply@databricks.com>
Law: an excluded (nondeterministic) test never judges a mutant, before a
cut or after one (M 2026-11-23, "An excluded test still runs"). A verdict
recorded before a cut kills only when it comes from a judging test on a
reproducible route (C 2026-11-24, "A verdict before a cut still kills").
Authority: the maintainer decision and register C entries cited there.

Reach: a new state, "a no-progress cut beside a flaky test's verdict",
declared required and entered by the constructed history below. Generated
histories also enter it (measured per unit as the reach line).

History: "a flaky test's verdict before a no-progress cut kills nothing",
the counterexample of random seed -954490119 path 0 (apiLessTypescript).
Its fixed and random units replay the history.

RED (parent 985b804, this commit): `vitest run gap-report-oracle -t "kills
nothing"` fails with "Difference: src/sut.ts:f0:31:delete-call#0: killed,
owed unregistered-kill" on both the fixed-seed and random-seed units. The
original seed replay (ORACLE_SEED=-954490119 ORACLE_PATH=0) reports
"src/sut.ts:C1.run:39:delete-call#0: killed, owed unregistered-kill".

Limits: the history's mutant label differs from the seed replay's (f0:31
vs C1.run:39), so the constructed form is a close replay, not identical.

Co-authored-by: Isaac <no-reply@databricks.com>
…tant

A copy that a cut ended kept the verdicts it recorded before the cut, and
outcomeOf counted each one as a kill. It did not check the nondeterministic
set first, so a flaky test's verdict (which judges nothing, M 2026-11-23)
killed the mutant. The copy's record names the copy's file, so the key is
built from the owner's file and the test name, the form the baseline uses.

Law: "An excluded test still runs" (M 2026-11-23): an excluded test never
judges. "A verdict before a cut still kills" (C 2026-11-24) is kept for
judging tests on reproducible routes.

RED: see the preceding commit (the constructed history and the seed replay
both report killed, owed unregistered-kill).
GREEN: the constructed history passes, fixed and random units; seed
-954490119 path 0 passes (vitest run gap-report-oracle, ORACLE_SEED etc.).
Mutant: dropping every early verdict (hostile) still passes the history
above; the oracle has no history where a judging test's verdict before a
cut must kill (recorded as a limit; a follow-up).

Co-authored-by: Isaac <no-reply@databricks.com>
"every outcome class" witnesses each required state it does not own, so the
new required state (a no-progress cut beside a flaky test's verdict) failed
its fixed-seed and Windows units: that history does not set up the flaky
test beside the hang. Listing the state in constructedOnly leaves it
required and named by its own constructed history only.

Found by the pool: fixed seed 3/5 (r99b-s954-fx3) and the Windows 3/11
stand-in (r99b-s954-win3-head) on the previous commit.

Co-authored-by: Isaac <no-reply@databricks.com>
…thing

The merge keeps the CI-packed shard layout. The packer now takes each
partition's tests from e2e-shards.mjs, so a test that no CI run has timed
yet (here the new constructed history) is charged the mean measured time
instead of landing in no shard. e2e-shards.mjs runs its command line only
as the entry module, so the packer can import its list.

Co-authored-by: Isaac <no-reply@databricks.com>
The constructed history for seed -954490119 was inserted before recorded
histories, and the append-only order check failed (C-6). It now follows
the last recorded history, and constructed-order.json records it.

Co-authored-by: Isaac <no-reply@databricks.com>
Law: 'A verdict before a cut still kills' (C 2026-11-24): a verdict a
judging test records on a reproducible route before its copy is cut stays
a kill, and a later cut, the backstop included, never erases it.

The model owed timeout for a copy the backstop cut after such a verdict:
its hang runs dropped their verdicts. It now keeps the verdicts of a
backstop or no-progress cut (not a count's, as check.mjs spunRun carries
none). Production (classify.mjs, early rows) already kills.

Reach: a constructed history (appended last) with a judging, deterministic
test that catches its own verdict (caughtVerdict, judging tests fire it
where output differs) and hangs with a timer alive. Reach state: 'a
judging test's verdict before a backstop cut kills', 1 in fixed seed and
1 in random seed (generator reach 0; caughtVerdict is a constant the
generator does not draw, a decision for the maintainer).

RED: model without the early-verdict rule: 'killed, owed timeout'.
Mutant M1 (drop every early verdict in classify): 'timeout, owed killed'.
GREEN: named history passes on head production.

Co-authored-by: Isaac <no-reply@databricks.com>
…spin

Law: "A verdict before a cut still kills" (register C 2026-11-24): a
verdict that a judging test records on a reproducible route before any cut
ends its copy is a kill, soft verdicts too. A count cut is a cut.

Production dropped those verdicts when a spun copy ran to its end:
check.mjs spunRun carried no early verdicts, so a clocked count cut after a
verdict was indeterminate, and a property test whose soft assertion failed
in an earlier run was judged only by the later run's spin. spunRun now
carries the early rows written before the copy's spin row; a row after the
spin (a test that caught the budget's throw and went on) comes after the
cut. The model's previous rule, which dropped a count cut's verdicts to
match spunRun, had no authority; each model verdict now records the work
done when it fired (atWork), and a spun run keeps those within the call
budget.

Histories (appended last):
- "a judging test's verdict before a clocked count cut kills": a judging
  test reads the clock, catches its own verdict, then loops past its call
  budget. Reach 1 in fixed seed and in random seed.
- The seed 61620462 literal now enters "a soft verdict before a property
  test's later spin kills" (its test judges by expect.soft).
- "a non-judging property test's later run spins into bounded work", its
  twin with a test that judges nothing, keeps the cut-route witness.

RED (production before this commit): "delete-call#0: indeterminate, owed
killed" and "loop-false#0: unregistered-kill, owed killed".
GREEN: the early-verdict, spin, count-cut and call-budget histories pass
(fixed and random); unit suite 124; fast gap suites 33,995.
Mutants: M1 (classify drops every early verdict) fails the backstop and
count-cut histories; the pre-fix check.mjs fails the count-cut and
property histories.
Limits: no history has a verdict written after its own spin row, so the
spin-row bound is shown by reading only; caughtVerdict is not drawn.

The random-seed partition packs into 6 shards with the twin's borrowed
weight (pack-shards-from-ci.mjs weighsAs).

Co-authored-by: Isaac <no-reply@databricks.com>
A drawn spinData (1 in 4 bases) makes file b's verdict test spin where its
output differs, so no owner-b copy can judge a mutant. On seed -587710675 the
base drew spinData, and "every outcome class" lost "killed by a second owner",
"a kill in one owner after a gap in another", and "each owner's value change
killed its own mutant": each of their owner-b copies was cut by count
(indeterminate). The model classifies the same way (judge: timeout, cause
spin), so this is a builder leak, not a model or production divergence.

Law: a constructed history reaches every state it names (the constructed
history rule). The builder pins a base field that would break a named state,
as the other histories that need owner b's kills already do.

Reach: seed -587710675 base (spinData true) -> the replay enters every state.
RED: parent commit, replay of seed -587710675 fails with the three states.
GREEN: same replay passes; fixed-seed and determinism units for
"every outcome class" pass; the unit suite and test:oracle-gaps:fast pass.
Mutant: dropping the pin restores the RED on the same seed.
Limits: other bases that draw spinData are not replayed here, and the second
and third halves are covered by their own units only.

Co-authored-by: Isaac <no-reply@databricks.com>
KyleAMathews and others added 5 commits November 30, 2026 16:17
…e blocks

Gate 5 of #99 (BLK-5): "fixed seed, 4/5" ran 10m06s on run 46479535603,
over P12's 10 minutes, after the property-spin twin joined its hand-written
shard. The Linux fixed-seed job logs each test's time now, so its five
shards are packed from measured durations like the other partitions
(predicted 8.5 min each). ci-durations.json is refetched from runs
46479535603, 46446101234, 46268858514, 46265370483 and 46261301537.

Windows end-to-end jobs become blocking (register M 2026-11-16 and
M 2026-11-30, BLK-6): continue-on-error is removed, and the preview needs
them. They were green on #99's final runs.

The gap oracle's known limits now name two open items owned by #185 (M
2026-11-30, BLK-3 and BLK-6): the flaky two-part spin, reached only by the
fixed replay of seed -880625410, and the unattributed Windows fixed seed
3/11 failure on 985b804.

Co-authored-by: Isaac <no-reply@databricks.com>
…erdicts after a spin

Gate 5 of #99, BLK-2 and BLK-4.

BLK-2. Law: C 2026-11-24, "Every built-in cut by an excluded test ends the
copy as a gap" (indeterminate when a flaky test caused it), and M
2026-11-23, "An excluded test still runs". classify.mjs outcomeOf pushed a
built-in verdict for any cut test. Only a spin was screened (check.mjs
countOnly), so a no-progress cut that a flaky test caused killed the
mutant. outcomeOf now drops the built-in verdicts of tests in the
nondeterministic set for every cause. judgeMutant and judgeAuthored map a
timeout by no progress to indeterminate, as they map a clocked spin. A
failing law's no-progress cut is a gap too (indeterminate, not blocked):
"blocked" (C 2026-11-23, precedence step 1) covers count cuts only.

The emitter could not hang a flaky test, so the case was unreached. New
constructed-only fields: flakyHang and catchesBudget (constants; the
fingerprint lines are recorded). New histories, appended last:
- "a flaky test's no-progress cut ends its copy as a gap": RED on
  fe5a4a2 (production killed by no progress, owed indeterminate), GREEN
  after.
- "a flaky test's loop spins past the call budget as a gap" and "an
  excluded owner's calls are not charged to the work budget". These pass
  on the parent: countOnly and baseline.work already guarded them. They
  close the class.

Mutants: no filter with countOnly kept fails the no-progress history. No
filter with countOnly off fails the spin history. Charging every row fails
the work-budget history.

BLK-4. Law: C 2026-11-24, "A verdict before a cut still kills" (only
before). New history "a verdict after a clocked count cut's budget throw
does not kill": a test catches the budget's throw, then records a verdict.
Production and the model already agree (indeterminate). Mutant: dropping
`!spun.has(row.file)` in earlyVerdictsOf makes it "killed, owed
indeterminate".

Checks: unit suite 124; fast gap suites 33,995; the new histories with
their flaky, spin, verdict, no-progress and budget neighbours pass
(9 consecutive passes alone and in the combined set). Both shard checks
pass.

Limit: the random-seed run of the work-budget history failed once, while
other agents' runs loaded the machine. Its output was not kept, and nine
reruns passed.

Co-authored-by: Isaac <no-reply@databricks.com>
Gate 5 of #99, BLK-1. Law: M 2026-11-23, "Backstops are fine, set high":
the backstop sits with a wide margin above the slowest legal copy. Its
reading C 2026-11-30, "The backstop's margin is 3x over the legal maximum".

limitFor priced the call budget's work at a constant per site
(SITE_BACKSTOP_MS, 0.2 us). That cost is not the file's own: a 1 s file
with 10^6 calls has a legal copy of about 99 s against an 83 s limit, so a
legal copy became a backstop gap. The limit is now the base plus 3 x the
file's unmutated time x its call budget / max(most calls, CALL_FLOOR). The
floor bounds the scale at 100 for a file with few calls, whose time is
mostly its tests' overhead. SITE_BACKSTOP_MS is removed.

Vitest's per-test limit stays 65 s (M 2026-11-30): baseline and mutant
copies share contexts warmed before the baseline, so it cannot follow each
file. A mutant copy whose test runs past it is a gap, never a kill. The
usage text and README say so.

Witness, a new constructed history appended last: "a copy at 99% of its
call budget finishes, not a backstop gap". A constructed-only `callWork`
field (a counted loop per call, with no clock and no instrumented site)
makes each call cost real time. The copy does 980,000 loops beside 10,000
heavy calls with a 500 ms hang base. RED on the parent formula: the copy is
cut with cause "backstop" (outcome timeout), while the model owes
not-judged. GREEN: it passes on both seeds. The old formula put back as a
mutant fails it.

Checks: the witness, the backstop, slow-kill and hang units (18 passed),
"a load failure beside a hang" (no stall), the unit suite (124), the fast
gap suites (33,995), and both shard checks.

Limit: random seed 1710167751 ("a reset check after its warm daemon was
replaced", if-false#0: timeout, owed indeterminate) still ends at the
backstop under the new limit. It is a separate divergence and not
diagnosed here.

Co-authored-by: Isaac <no-reply@databricks.com>
…erdicts after a spin

Conflicts: the property's known limits (both sentences kept), pr-shards.mjs
(the Linux fixed-seed partition stays packed), and ci-packed-shards.mjs
(repacked).

Co-authored-by: Isaac <no-reply@databricks.com>
…work

Conflicts: the constructed-only fields (flakyHang, catchesBudget from
fix99-blk24 and callWork from this branch, all kept, with fingerprint
lines), the emitter's loop lines (catchesBudget's try around the loop,
with callWork's perCall cost in both), constructed-order.json (the backstop
witness appended after the BLK-2 and BLK-4 histories, and moved to match
in the property file), pr-shards.mjs (packed), and ci-packed-shards.mjs
(repacked).

Co-authored-by: Isaac <no-reply@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant