Repository navigation
docs(skills): soak an oracle before it is ready or wired into CI - #304
schiller-manuel wants to merge 1 commit into
Conversation
Extend the random-campaign paragraph of the design skill's step 7 to new and changed oracles: 10 runs at a run multiplier of 10, as a loop of the test command whose two greps print each failing unit's replay line and each law's share of failing runs. Step 9 reports the soak. The explore skill soaks before it presents an oracle as ready, and the setup skill soaks an oracle file before CI runs it with a random seed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
A random-only false failure can surface late. In a downstream project, a law failed on correct production because of a model bug. The model removed a declaration that binds no names, and the driver did not. It failed in about 1 of 27 default random runs and in every run at a multiplier of 100. The fixed seed and the gap check (fixed seeds only) never hit it, and neither did 40 random runs on another day. A reviewer found it with a multiplier of 10. Once CI ran the oracle with a random seed on every run, this would have been a flaky job. The feedback asked for a soak mode (N random campaigns at a raised
<PREFIX>_RUNS_MULTIPLIER) and for skills that require a soak before an oracle is declared ready or wired into CI.This PR is docs only. A plain loop of the test command already prints what a soak mode would report (see "Why no soak mode" below).
What changed
oracles-designstep 7. docs(skills): run the random campaign several times before a production change is done #264's paragraph ("Before you call a production change done, run the random campaign several times") now also covers an oracle called ready. It gains two bullets:mktemp -ddirectory, and twogreps. One prints each failing unit'sReplay:line. The other prints how many runs each law failed in. The bullet says why several runs beat one long run: a unit stops at its first failure, and the multiplier does not stretch a test'stimeout(timeoutOfinoracle-property.ts). It also says that the multiplier lengthens the fixed-seed campaigns too.oracles-designstep 9. A new evidence item, Soak: the budget, and each failing law with its share and replay line.oracles-explorestep 5. When the gaps are closed, soak the oracle before presenting it as ready. A soak failure is handled like a first red run: replay, constructed history, fix, soak again. Step 6's "what you built" names the soak's result.oracles-setupstep 7. A new paragraph, "Soak before CI draws random seeds": soak an oracle file before CI runs it with the test command, and wire it in only once the soak passes. A random CI failure is replayed, then kept as a constructed history. Step 8's report names the soak.Evidence
A probe package built on origin/main
0175017, with this repository'sdist/and CLI. It lived in a gitignored scratch directory and has been deleted.prune(declarations, used)is correct: it keeps a declaration that binds a used name or binds no name. The oracle's model has the downstream bug:!names.every(unused)removes a declaration with no names. The grammar draws an emptynameswith weight 1 in 5,500 (fc.oneof), and the oracle hasruns: 100andfixedSeeds: [1]. Sampling 1,000,000 histories withfc.sample, the model and production disagree on 1 history in 2,639.vitest run(default random seed)random seed: generated, every timeoracle-gaps --package . --source src/prune.tsbaseline pass,6 mutants, 6 killed, 0 gaps,seed (none)--seed 426 mutants, 6 killed, 0 gaps,seed 42ORACLE_RUNS_MULTIPLIER=10random seed: generatedORACLE_RUNS_MULTIPLIER=100fixed seed 110 times,random seed9 timesThe probe's bug fails about 1 default run in 50, and every run at ×100, as the downstream one did. The gap check never sees it, because its random units are fixed per test name (#276).
What a plain loop prints. This is the recipe from the new bullet, run with
<oracle file>replaced, on the buggy model:That is every failing seed with its replay line, and the law's share (2 of 10 runs). It took 4.3 s.
Replay, then keep. I ran one soak replay line (
ORACLE_SEED=-1083224269 ORACLE_PATH=499:0 …) twice. Both runs failed withCounterexample: [{"declarations":[[]],"used":[]}](1 failed | 5 skipped). Kept as a constructed history (statebinds nothing), the counterexample failed the fixed seed in 3 of 3 plain runs. The gap check then printedbaseline fail tests/prune-oracle.property.test.mjs: 2 of 9 tests failed, withfixed seed 1: a declaration that binds no namesfailing under(law: prune). With the model fixed, the gap check printedbaseline pass … 9 testsand6 mutants, 6 killed, 0 gaps, and a 10 × ×10 soak had no failing run.Time cost. Startup dominates the probe: 10 runs took 3 s at ×10 and 3 s at ×100. On this repository's
gap-report-classifyoracle, a run took 1.1 s at ×1, 2.2 s at ×10 and 14.1 s at ×100 (282 tests, all passing). The multiplied campaign is what grows, so a 10 × ×10 soak of that file takes about 22 s.Docs only, so there is no changeset.
build,format:check,lint:checkandtypecheckpass at the root.Why no soak mode
The candidates were (a) a documented recipe with the existing variables, and (b)
oracle-gaps --soak <n>or a small separate bin. (b) was to be built only if a loop of the test command could not give the failing seeds and the share without extra work. It can:Replay: <PREFIX>_SEED=… <PREFIX>_PATH=… <PREFIX>_PROPERTY=… <PREFIX>_UNIT=… vitest run -t '…'(documented in theoracle-property.tsmodule comment). Onegrep '^Replay:'collects them.(law: <name>)(violationError). Onegrep -oper log, deduplicated per run, thenuniq -c, gives the runs each law failed in.oracleCampaignSeed), and<PREFIX>_RUNS_MULTIPLIERalready scales every campaign (oracleRuns).A
--soakmode inoracle-gapswould also have to run outside the mutant machinery and undo the per-test seeding ofMath.randomthat keeps the gap check's random units fixed (#276). It would be this loop with a summary printed after it. The repository's style is composable primitives with no new mode that a documented one-line loop already gives, so the recipe goes in the skill.Overlap
Replay:line that fix(oracles): a failing random-seed unit says to replay its seed before rerunning #266's note sits beside. docs(oracle-gaps): say that the gap check's random units are fixed #276's design-skill text explains why the gap check cannot soak, and this PR does not repeat it.git merge-treeagainst the head of every open PR that touchesoracles-design,oracles-exploreororacles-setup(docs(skills): give each clause of a law statement its own check #301, feat(oracle-gaps): write a partial report when the run's process dies in its mutant phase #300, feat(oracle-gaps): --only accepts a mutant's stable key beside its id #299, feat(oracle-gaps): keep the newest 10 default run directories #297, fix(oracle-gaps): report a full disk as out of disk space, not as a bug #296, docs(skills): tie a survivor past a stated range to that range in the evidence #294, docs(skills): split an oracle file that a reviewer can no longer hold, over one shared module #287, docs(skills): give each parallel reviewer its own lens, and merge their findings in one ledger #286, docs(oracle-gaps): say what --diff-base marks and that it does not shorten a run #285, docs(skills): remove code on gap evidence only when owned laws decide every entry point's value #280, feat(oracles): notAllowed states the freedom an allowed set rests on #277, docs(oracle-gaps): say that the gap check's random units are fixed #276, fix(oracle-gaps): call code dead last, and only with its evidence #274, docs(skills): point the setup report's timeout example to the design skill #273, docs(skills): own the source of truth for vendored or generated code #272, docs(skills): ask an open law question with a caller scenario and real outputs #271, docs(skills): draft the history grammar from what real callers do #270, docs(skills): a change that makes production match the model needs a second formulation #269, docs(skills): scope the fix history and install the package in a monorepo #268, feat(oracle-gaps): --compare prints a refactor's evidence by mutant key #267, docs(skills): trigger the independent review where work ends #265, feat(oracles): counted probes report how often each history entered them #263, feat(oracle-gaps): mark a gap that an ordinary test kills #262, docs(skills): run the gap check once over every source file of the package #257, feat(oracle-gaps): a gap says in how many histories its code ran #256, fix(oracles): a history the arbitrary cannot take back fails its property, not its file #255, docs(skills): validate a fast-path removal before proposing it #253, fix(oracle-gaps): name the step that avoids a native crash in the done error line #252, docs(skills): say how a probe loads packages and runs TypeScript, before the first probe #251, docs(oracles): add an API quick reference with one complete oracle file #250, docs(skills): one rule for an older Vitest, raised during the look-around #249, docs(skills): removing or replacing a whole algorithm needs sign-off #248, docs(skills): say what an explore run does with no developer in the loop #247, feat(oracle-gaps): run the package's authored-mutants directory by default #241, fix(oracle-gaps): --config may name a Vitest config outside the package #240, docs(skills): keep authored mutants in the package's authored-mutants/ directory #239, fix(oracle-gaps): --only refuses a selection that judges nothing #236, fix(oracle-gaps): direct a finite rewrite of a production loop before the timeout shortfall #235, fix(oracle-gaps): name dead code in the not-distinguished directive of a value made undefined #234, fix(oracle-gaps): class a work rise no bound judges as clocked-work, not not-observed #231, feat(oracle-gaps): a baseline-only run goes on past an owns entry that names nothing #230, feat(oracle-gaps): a gap line gives its mutant's column #229, docs(skills): a model is synchronous; compare an awaited reference in the check #227, feat(oracle-gaps): note each owns entry that no mutant tests #226, docs(skills): name the printed replay as the one way to run Vitest alone #224, feat(oracle-gaps): print every failing law's observed and owed values in the baseline #223, fix(oracle-gaps): let an owns entry name a class #222, feat(oracle-gaps): --baseline-only runs every test file's baseline and judges no mutant #221, docs(skills): ignore the gap check's session directory in setup #220, fix(oracle-gaps): name a dead store in the not-observed directive #217, fix(oracle-gaps): direct a setup-error to a driver's dynamic import #215, fix(oracle-gaps): say that extra-work can be a difference no history reaches #214, fix(oracle-gaps): tell the three causes of a timeout gap apart #213, docs(skills): say that a driver runs each history several times in one module instance #212, docs(oracles): write owns inline as literals; TypeScript probes on newer Node #70) finds no conflict. The step 9 item first sat next to the "Gaps:" item, which docs(skills): tie a survivor past a stated range to that range in the evidence #294 rewrites, so it moved up beside "Before and after".Limits
Replay:line but has no(law: …), so it shows only in the first grep. A law name that contains)is cut short.timeoutcomes from the code (timeoutOfreturnsoptions.timeout ?? 120_000). No probe run here reached a timeout.ORACLE_RUNS_MULTIPLIER. A project with its own prefix uses<PREFIX>_RUNS_MULTIPLIER, which docs(skills): run the random campaign several times before a production change is done #264's bullet just above it already names.For approval
oracles-designstep 7 and step 9,oracles-explorestep 5) and before CI runs it with a random seed (oracles-setupstep 7).greps, instead oforacle-gaps --soakor a separate bin, for the reasons above.🤖 Generated with Claude Code