From 7f6217081ab25879d9f22e6859f87aaace3f897b Mon Sep 17 00:00:00 2001 From: Kyle Mathews Date: Thu, 3 Dec 2026 11:38:37 -0700 Subject: [PATCH 1/2] ci: Version Packages --- .changeset/add-eslint-plugin-oracles.md | 11 -- .changeset/add-oracle-framework-core.md | 5 - .changeset/add-oracle-gaps-cli.md | 5 - .changeset/calibration-difference.md | 5 - .changeset/calibration-history-bindings.md | 7 - .changeset/constructed-stream-independent.md | 9 - .changeset/copy-resolves-from-its-file.md | 5 - .changeset/daemon-replaced-context.md | 7 - .changeset/enumerated-declared-states.md | 5 - .changeset/fixed-history-take-back.md | 7 - .changeset/gap-cli-baseline-report.md | 12 -- .changeset/gap-cli-block-per-law.md | 5 - .changeset/gap-cli-config-find-up.md | 5 - .changeset/gap-cli-config.md | 9 - .changeset/gap-cli-copy-randomness.md | 5 - .changeset/gap-cli-daemon-fs-inputs.md | 9 - .changeset/gap-cli-extra-work.md | 5 - .changeset/gap-cli-greppable-lines.md | 18 -- .changeset/gap-cli-internal-error-prefix.md | 7 - .changeset/gap-cli-never-crash.md | 7 - .changeset/gap-cli-own-typescript.md | 5 - .changeset/gap-cli-probe-not-work.md | 5 - .changeset/gap-cli-runtime.md | 10 - .changeset/gap-cli-sqlite-evidence-store.md | 5 - .changeset/gap-cli-stopped-session-dir.md | 5 - .changeset/gap-cli-stream-log.md | 7 - .changeset/gap-cli-temp-state.md | 5 - .changeset/gap-cli-typescript-alias.md | 5 - .changeset/gap-diff-base-limits-run.md | 9 - .changeset/gap-report-directives.md | 5 - .changeset/gap-report-output-fixes.md | 10 - .changeset/gap-report-report-order.md | 7 - .changeset/gap-report-super-calls.md | 5 - .changeset/initial-release.md | 7 - .changeset/law-credit-label.md | 5 - .changeset/lint-remove-ignore-mode.md | 7 - .changeset/lint-test-source-recognition.md | 13 -- .changeset/oracle-gaps-ending-ask.md | 5 - .changeset/oracle-gaps-test-root-copies.md | 5 - .changeset/oracle-property-const-inference.md | 15 -- .changeset/oracle-property-owns.md | 5 - .changeset/oracles-release-docs.md | 5 - .changeset/plugin-consumer-parser.md | 9 - .changeset/plugin-empty-tests-and-scope.md | 9 - .changeset/quiet-monkeys-brake.md | 5 - .changeset/remove-legacy-campaigns.md | 5 - .changeset/scope-anchors-to-declarations.md | 9 - .changeset/shardable-units.md | 23 --- .changeset/ship-oracle-skills.md | 6 - .changeset/shrink-budget.md | 5 - packages/eslint-plugin-oracles/CHANGELOG.md | 65 ++++++ packages/eslint-plugin-oracles/package.json | 2 +- packages/oracles/CHANGELOG.md | 185 ++++++++++++++++++ packages/oracles/package.json | 2 +- 54 files changed, 252 insertions(+), 371 deletions(-) delete mode 100644 .changeset/add-eslint-plugin-oracles.md delete mode 100644 .changeset/add-oracle-framework-core.md delete mode 100644 .changeset/add-oracle-gaps-cli.md delete mode 100644 .changeset/calibration-difference.md delete mode 100644 .changeset/calibration-history-bindings.md delete mode 100644 .changeset/constructed-stream-independent.md delete mode 100644 .changeset/copy-resolves-from-its-file.md delete mode 100644 .changeset/daemon-replaced-context.md delete mode 100644 .changeset/enumerated-declared-states.md delete mode 100644 .changeset/fixed-history-take-back.md delete mode 100644 .changeset/gap-cli-baseline-report.md delete mode 100644 .changeset/gap-cli-block-per-law.md delete mode 100644 .changeset/gap-cli-config-find-up.md delete mode 100644 .changeset/gap-cli-config.md delete mode 100644 .changeset/gap-cli-copy-randomness.md delete mode 100644 .changeset/gap-cli-daemon-fs-inputs.md delete mode 100644 .changeset/gap-cli-extra-work.md delete mode 100644 .changeset/gap-cli-greppable-lines.md delete mode 100644 .changeset/gap-cli-internal-error-prefix.md delete mode 100644 .changeset/gap-cli-never-crash.md delete mode 100644 .changeset/gap-cli-own-typescript.md delete mode 100644 .changeset/gap-cli-probe-not-work.md delete mode 100644 .changeset/gap-cli-runtime.md delete mode 100644 .changeset/gap-cli-sqlite-evidence-store.md delete mode 100644 .changeset/gap-cli-stopped-session-dir.md delete mode 100644 .changeset/gap-cli-stream-log.md delete mode 100644 .changeset/gap-cli-temp-state.md delete mode 100644 .changeset/gap-cli-typescript-alias.md delete mode 100644 .changeset/gap-diff-base-limits-run.md delete mode 100644 .changeset/gap-report-directives.md delete mode 100644 .changeset/gap-report-output-fixes.md delete mode 100644 .changeset/gap-report-report-order.md delete mode 100644 .changeset/gap-report-super-calls.md delete mode 100644 .changeset/initial-release.md delete mode 100644 .changeset/law-credit-label.md delete mode 100644 .changeset/lint-remove-ignore-mode.md delete mode 100644 .changeset/lint-test-source-recognition.md delete mode 100644 .changeset/oracle-gaps-ending-ask.md delete mode 100644 .changeset/oracle-gaps-test-root-copies.md delete mode 100644 .changeset/oracle-property-const-inference.md delete mode 100644 .changeset/oracle-property-owns.md delete mode 100644 .changeset/oracles-release-docs.md delete mode 100644 .changeset/plugin-consumer-parser.md delete mode 100644 .changeset/plugin-empty-tests-and-scope.md delete mode 100644 .changeset/quiet-monkeys-brake.md delete mode 100644 .changeset/remove-legacy-campaigns.md delete mode 100644 .changeset/scope-anchors-to-declarations.md delete mode 100644 .changeset/shardable-units.md delete mode 100644 .changeset/ship-oracle-skills.md delete mode 100644 .changeset/shrink-budget.md create mode 100644 packages/eslint-plugin-oracles/CHANGELOG.md create mode 100644 packages/oracles/CHANGELOG.md diff --git a/.changeset/add-eslint-plugin-oracles.md b/.changeset/add-eslint-plugin-oracles.md deleted file mode 100644 index f39e7f04..00000000 --- a/.changeset/add-eslint-plugin-oracles.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -'@tanstack/eslint-plugin-oracles': patch ---- - -Add ESLint rules for oracle tests: no disabled oracles, no unit tests in oracle files, pure models, replayable seeds, and the production probe form. `oracle/no-unit-test` holds an oracle file to registering its tests only through `oracleProperty`. It reports every other test registration as a unit test, and a helper that registers its caller's body. It also reports an `oracleProperty` call without an inline `check`, and an imported helper that registers tests of its own. `oracle/no-unit-test`, `oracle/no-disabled`, and `oracle/oracle-property-only` share one account of a test function: a test framework's test function or suite, or a fixture of one, by the source of its binding (see the README's "Where a test function comes from"). They follow imports, aliases, namespace members, variables and their assignments, destructurings, casts, the branches of a conditional or logical expression, tagged-template `.each`, and the exports of relative test modules. A binding to anything else, and a member that is no registration such as `test.step`, is no test function, whatever its name. The README lists the forms that the rules do not recognize: a test function passed as a parameter, one that a third-party package exports under a name that no framework uses, a computed member that is not a string literal, and a modifier call that another module exports. A fixed history, case, calibration, or reach check goes in the property's histories, calibrations, and declared states; any other test goes in an ordinary test file. `settings.oracles` sets the environment prefix and the modules that count as implementation and replay-witness modules. - -Add the `oracle/oracle-property-only` rule, enabled in `configs.recommended`. In an oracle file it reports a raw property campaign (`fc.assert`, `fc.check`, or a `.prop` registration, through `fast-check` or `@fast-check/vitest`) and an import of `createOracleReach` or `runOracleCampaign`, so a generated-history law runs through `oracleProperty` and its constructed histories. Framework implementation modules are exempt. A non-array `implementationModules` or `replayWitnessModules` is reported at line 1 and read as empty. The rule never throws. - -Add the `oracle/no-oracle-disable` rule, enabled in `configs.recommended` and `configs.production`. It reports every ESLint directive that would silence an `oracle/*` rule: a rule list that names one (bare, single-quoted, or double-quoted), a directive with no rule list, and an inline config comment that names one. Oracle rules cannot be disabled inline. A report sits on the directive's line; a directive that names this rule or has no list, or that an earlier block directive covers, is reported at line 1, column 0. Residuals the rule cannot close: a directive on line 1 that names this rule or has no list, and a production config comment that turns this rule off. - -The `recommended` config sets `linterOptions.noInlineConfig` on oracle files. ESLint ignores every directive in those files, for every rule, not only the oracle rules. A directive for another rule in an oracle file has no effect, so a project that relied on one must move the suppression or fix the code. The production config's probe-form rule covers `packages/*/src` and a single-package `src` directory. diff --git a/.changeset/add-oracle-framework-core.md b/.changeset/add-oracle-framework-core.md deleted file mode 100644 index 8decfd3b..00000000 --- a/.changeset/add-oracle-framework-core.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -Add the oracle framework core, extracted from TanStack DB: `oracleProperty`, the controlled clock, failure fidelity, and replay witnesses. `configureOracles({ envPrefix, registry, retiredVariables })` lets a project keep its own environment variable names and property registry. The main entry is ES modules only; `@tanstack/oracles/route` is a browser-safe entry for the route helpers (`oracleRoute`, `oracleRouteOf`, and `oracleFixedSeed`). The published sources no longer cite files that the package does not ship, such as the CLI's and the framework's own oracle tests. diff --git a/.changeset/add-oracle-gaps-cli.md b/.changeset/add-oracle-gaps-cli.md deleted file mode 100644 index 7e77f853..00000000 --- a/.changeset/add-oracle-gaps-cli.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -Add the `oracle-gaps` CLI, which reports the gaps in a package's oracles. It runs operator mutants of the code that each oracle file owns (its `owns` lists) against only that file's tests, and classifies each surviving mutant: a comparison gap, a generator gap, no observed difference, or unowned code. A daemon (`--daemon`) reuses evidence across runs. `--env-prefix` names the project's oracle environment variables. diff --git a/.changeset/calibration-difference.md b/.changeset/calibration-difference.md deleted file mode 100644 index 6d62e91d..00000000 --- a/.changeset/calibration-difference.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -A calibration can now require the violation's difference as well as its law. Give it `difference`, a string that the violation's difference must contain, or a `RegExp` that it must match. The check must then reject the wrong answer for that reason. Before, a calibration could require only the law. An oracle that judged several faults under one law then had to put the fault in the law's name. The calibration test judges the law first. A corrupted trace that fails with another difference fails the calibration and names the difference that the check reported. A mutant driver goes on to the next candidate history, as it does for another law. A pattern matches anywhere in the difference, and a sticky (`y`) pattern matches only at its start. The empty difference holds `''` and `/(?:)/`, so such a requirement would reject any difference. It now fails the property's load. A check that gives a difference that is not text fails the calibration with an error that names the calibration and the law. A calibration without `difference` works as before. diff --git a/.changeset/calibration-history-bindings.md b/.changeset/calibration-history-bindings.md deleted file mode 100644 index 7e8f2a20..00000000 --- a/.changeset/calibration-history-bindings.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -Add direct `history` bindings for calibrations and `probeHistories` for automatic controls, so bound calibrations validate one selected premise instead of searching. Preserve fixed and enumerated history identity, including fixed declarations with unrelated `build` metadata, rebuild constructed histories from stable seeds, and resolve once per driver execution. Apply ordinary verdict ranking and optional difference requirements to bound mutants, validate clean declared reach, and retain selected-history error context. Retain search during migration with one warning per property outside collect-only runs, before search removal ahead of the first npm release. - -Dispatch selectors using their validated own key, so inherited selector tags cannot redirect a selected history or reject its source kind. diff --git a/.changeset/constructed-stream-independent.md b/.changeset/constructed-stream-independent.md deleted file mode 100644 index 0b3cb145..00000000 --- a/.changeset/constructed-stream-independent.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -A campaign's generated histories no longer depend on its constructed histories, and each constructed history runs several bases from a stream of its own. The `generated` unit draws only from the property's arbitrary. Constructed history k builds from each of the first `bases` draws of the arbitrary's sample at the campaign's seed plus k, and every base must enter the states it names. The new `histories.bases` option sets that number. It must be a whole number of at least 1 (default 5), or the property fails to load. So appending a constructed history keeps every fixed seed's generated histories and every other constructed history's bases. Before, half of the generated unit's runs were constructed histories, weighted by how many there were, so appending one moved every run's draw, and each constructed unit ran one history. - -A costly property can keep few fixed bases and still vary its constructed histories from run to run with the new `histories.drawnBases` option (a whole number of at least 0, default 0). After its fixed bases, each constructed unit runs that many more, drawn from the run's random seed: the seed the random units run, which the `ORACLE_SEED` line logs. That line now comes from the first unit that uses the seed, which may be a fixed-seed constructed unit. A failure on a drawn base says which base it was, prints its full history as the counterexample, and prints a replay line with the run's seed, at which the random unit of the same name runs that base at the same index. - -This shifts each fixed seed once, for properties that have at least one constructed history. Their `generated` unit now runs other histories, and a seed-and-path replay line printed before this change for that unit no longer replays the same history. A constructed unit keeps its first base, and its first replay path index still selects it. Replay lines for properties without constructed histories stay valid: their `generated` unit already drew from the arbitrary alone. Each constructed unit now runs `bases` histories, so a campaign takes longer; set `bases` lower for a property whose constructed histories are slow. diff --git a/.changeset/copy-resolves-from-its-file.md b/.changeset/copy-resolves-from-its-file.md deleted file mode 100644 index d0ec3402..00000000 --- a/.changeset/copy-resolves-from-its-file.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The gap oracle's CLI resolves a mutant copy's bare imports from the test file the copy stands for, as that file's own run does. Before, a package whose config root lay above it (with its dependencies in its own node_modules) failed every copy with a setup error. diff --git a/.changeset/daemon-replaced-context.md b/.changeset/daemon-replaced-context.md deleted file mode 100644 index 9499cd22..00000000 --- a/.changeset/daemon-replaced-context.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -Fix stale results from the gap CLI's daemon (`--daemon`). A warm context now records every module that a batch of mutant runs loads, so the next check invalidates a module that changed. Before, only single runs recorded what they loaded. A hang can replace the context that recorded a module. Another context could then keep the old module after an edit. The daemon then reported results from before the edit, such as a kill that the cold run no longer finds. - -A stored run now also lists the modules that its copy evaluated. A module that only a mutated branch imports at run time is then one of its inputs. Before, an edit of such a module left the stored verdict in place. A run whose known inputs change while it runs is no longer stored. diff --git a/.changeset/enumerated-declared-states.md b/.changeset/enumerated-declared-states.md deleted file mode 100644 index ea436442..00000000 --- a/.changeset/enumerated-declared-states.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -An enumerated source can declare the states its laws depend on: `histories: { enumerated, states, measured }`, where `enumerated` is the list a plain enumerated source passes, and `states` and `measured` are state names. Every enumerated history runs, so a required state needs no constructed history. A `reach` test after the histories fails when no enumerated history entered a state in `states`, and otherwise prints how many entered each declared state, as ` enumerated reach {...}`. A history counts once it is judged, passing or violating its law. The reach test reuses what each history's test recorded. It runs again only a history whose test never started, such as one that a `-t` filter left out. A history whose test failed before a verdict or timed out counts for nothing. A judged history that enters a state outside `states` and `measured` fails its test. An enumerated source fails to load when it holds a key other than `enumerated`, `states`, and `measured`, or a state that is not a name; only a generated source binds a probe to a state. A plain list of histories registers no `reach` test. Any enumerated source now fails to load when its `label` names a history `reach` or `determinism`, because the rerun command for that history would also select the framework test of that name. diff --git a/.changeset/fixed-history-take-back.md b/.changeset/fixed-history-take-back.md deleted file mode 100644 index 3c407f03..00000000 --- a/.changeset/fixed-history-take-back.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -`oracleProperty` checks, when it registers a generated source, that its arbitrary can take back (`canShrinkWithoutContext`) each fixed history and each constructed history built from the first fixed seed (or seed 0 when there is none). If it cannot, the property fails to load with an error that names the property, the history (a fixed history's index and name, or a constructed history's name), and the fix. Before, the check ran only when the history's test ran, after the campaigns, and its message blamed the language. In fast-check 4, a `.map` without an unmapper takes no value back, at the whole history or anywhere inside it, so a history inside the language failed too. Give that `.map` an unmapper (its second argument). `fc.constant` and `fc.constantFrom` take back only primitives or the same object reference, so build objects with `fc.record` or `fc.tuple` over primitive leaves. `.chain`, `fc.func`, and `fc.commands` cannot take a value back. - -The check runs when the test file loads. One history that the arbitrary cannot take back now fails the load of the whole file, so it also blocks the file's other properties. Constructed histories are now built at import: a `build` that throws there fails the load with an error that names the property and the constructed history, with the build's error as its `cause`. diff --git a/.changeset/gap-cli-baseline-report.md b/.changeset/gap-cli-baseline-report.md deleted file mode 100644 index d0c206f8..00000000 --- a/.changeset/gap-cli-baseline-report.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The `oracle-gaps` report leads with the baseline, and a failing oracle file no longer stops the run. - -- An oracle file that fails with no mutant active (a RED law, or a file that cannot load or launch) blocks only the mutants it owns. A mutant it owns that no passing owner kills is a new `blocked` gap, which names the failing file. The other mutants are judged, and the report says it is provisional. Before, the run refused with exit 2. A setup file that throws now blocks every owned mutant in the same way. -- A `blocked` line names each failing oracle file and its failing test, and says to make it pass and check again. -- With `--only`, the baseline runs only the owners of the selected mutants, so another file's failure no longer blocks the run. -- stdout and `summary.md` start with the baseline: each test file's result with its test counts, ordinary test files included, and for a failing file its failing test, its error, the law, difference, and counterexample of a law violation, and its replay command. Ordinary test files now run once in the baseline; they run against mutants only with `--ordinary`. `results.json` gains `provisional` and `baseline`. -- The legend says that a `crashed` gap is a gap, not a kill, and that its error is on the gap's Detail line in `summary.md` and in its `detail` in `results.json`. -- The last stdout line says that the check completed, with its gap count and its report (`oracle-gaps: done completed, gaps, report `). Exit codes do not change: 0 means the check completed, whatever its gaps. diff --git a/.changeset/gap-cli-block-per-law.md b/.changeset/gap-cli-block-per-law.md deleted file mode 100644 index eef812f8..00000000 --- a/.changeset/gap-cli-block-per-law.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -A failing law no longer blocks the gap report for its whole file. In `oracle-gaps`, a test of an oracle file that fails with no mutant active judges nothing: it is left out per test, as a nondeterministic test is, and the passing tests of its file still judge the mutants the file owns. A failing law still runs in every copy of its file: its calls count toward the copy's call budget, its I/O and timers toward idle, and it keeps its reach, but its verdicts judge nothing and it is never charged extra work. A count cut that a failing law causes blocks the mutant by that law. A test of a `describe` whose `beforeAll` or `afterAll` throws is a failing law too. An owner file that fails outside its tests (it does not load, or a file-level hook throws) judges nothing, and another owner file's passing tests still judge the mutants they share. A mutant that no deterministic passing owner test reached is `blocked` by its owners' failing laws that reached it, and by owner files that judge nothing; its directive names them. The baseline prints one `oracle-gaps: blocked` line per failing law, named by its file and test names (or one per broken file), `results.json` lists each failing file's `laws`, and the report stays provisional. diff --git a/.changeset/gap-cli-config-find-up.md b/.changeset/gap-cli-config-find-up.md deleted file mode 100644 index fe82218a..00000000 --- a/.changeset/gap-cli-config-find-up.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -Without `--config`, the `oracle-gaps` CLI now loads the Vitest config that Vitest itself would load for the package: the first of Vitest's config names in the package's directory, or else in the nearest parent directory that has one. Before, it looked only in the package's directory and ran Vitest's defaults when the config was in a parent. The baseline's replay command then ran under the parent's config, which Vitest found, and could find no test. A parent's config that defines `test.projects` now refuses the run, as the package's own does. diff --git a/.changeset/gap-cli-config.md b/.changeset/gap-cli-config.md deleted file mode 100644 index 249eefc4..00000000 --- a/.changeset/gap-cli-config.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The `oracle-gaps` CLI takes `--config `, relative to `--package`, to select the package's Vitest config. Without it, the run loads the config that Vitest discovers, as before. The baseline output now starts with `config: `, or `no config file: Vitest's default discovery`. A `--config` that names no file of the package refuses the run. A run names its config once its contexts have loaded it, also when the analysis or the baseline then refuses the run. A failing owner's `replay:` command names the `--config` file too, so it runs the failing test under the same config, even when Vitest would discover another one. - -The runner's wrapper config now has the module format that Vite gives the package's own config, so Vite bundles that config as Vitest loads it. An `.mjs` or `.mts` config, or a `.js` or `.ts` config in a package with `"type": "module"`, gets an `.mts` wrapper, where a top-level `await` works. A `.cjs` or `.cts` config, or a `.js` or `.ts` config in a package without that type, gets a `.cts` wrapper, where `require` and `require.resolve` work. Before, every wrapper was a `.ts` file. In a package without `"type": "module"`, Vite bundled such a wrapper as CommonJS, so an `.mjs` config with a top-level `await` refused the run, and older Vite versions printed their CommonJS deprecation warning. - -A run with more than ten warm contexts (`--contexts`, which defaults to up to 16) no longer prints `MaxListenersExceededWarning`. Each context is a Vitest instance that listens on the process until it closes; the runner now raises the process's listener limit by one for each open context and lowers it when the context closes. diff --git a/.changeset/gap-cli-copy-randomness.md b/.changeset/gap-cli-copy-randomness.md deleted file mode 100644 index 6eabe821..00000000 --- a/.changeset/gap-cli-copy-randomness.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -A mutant's copy of a test file now draws from `Math.random`, `crypto.getRandomValues`, and `crypto.randomUUID` what the original file draws. The `oracle-gaps` capture seeds these sources per test, by the test's key. It took the key from the copy's path, which names its batch, while the unmutated runs run the original file. A test that observes a draw therefore read as changed under a mutant that changed nothing. An `oracleProperty` campaign with no `--seed` draws its seed from `Math.random`, so its random units ran other histories under every mutant. A run with no `--seed` reported such mutants as `not-judged`, and its classes now match a seeded run's. diff --git a/.changeset/gap-cli-daemon-fs-inputs.md b/.changeset/gap-cli-daemon-fs-inputs.md deleted file mode 100644 index f05d0278..00000000 --- a/.changeset/gap-cli-daemon-fs-inputs.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -A check through `--daemon` now reruns a test after an edit to a file in the package that the test reads through `fs` (`readFileSync`, `readFile`, `existsSync`, `statSync`, or `fs/promises` `readFile` or `stat`), such as a JSON fixture or a snapshot. Before, the daemon reused the run that read the old file, while a cold run saw the edit. A directory that a test stats is an input as a directory. Reads outside the package, under `node_modules`, through other APIs, or from a test's own worker threads or child processes are no inputs. - -The daemon also stores each run under the text that the run read. Before, it stored a run under each input's text at the end of the run, so a module or file that changed during the run that read it (a test that rewrites a fixture it read, or a helper edited mid-check) kept the old verdict for the new text, and the next check through the daemon reported that stale verdict. A run whose input changed after it read it is now run again. - -A test that reads a source under test through `fs` (or as a `?raw` import) no longer makes each check through the daemon run its tests again. The test's read of the file and the instrumented module that the runner serves from it are now two inputs, each hashed by its own text. diff --git a/.changeset/gap-cli-extra-work.md b/.changeset/gap-cli-extra-work.md deleted file mode 100644 index da5d43dc..00000000 --- a/.changeset/gap-cli-extra-work.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The `oracle-gaps` report no longer reports a shortcut for speed as `not-observed`. A survivor that changed no observation but made a test do more work is now `extra-work`. Before, its directive said to observe a value or widen the oracle, which cannot work for a branch whose fast and general paths give the same result, and an author who removed the code instead made it slower. Work is the number of site evaluations that the test's instrumented production code makes, a deterministic count, never a time. The `extra-work` directive names the test, its work before and after, and the bound to declare. `oracleProperty` takes a new `work: { ratio }` option. Under the gap report, a mutant whose work in one of the property's tests is more than `ratio` times the unmodified code's work is killed under the law `work bound`. `ratio` must be a finite number of at least 1. A plain Vitest run has no unmodified run to compare with, so there the bound judges nothing. diff --git a/.changeset/gap-cli-greppable-lines.md b/.changeset/gap-cli-greppable-lines.md deleted file mode 100644 index 785ca92b..00000000 --- a/.changeset/gap-cli-greppable-lines.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -Every line the `oracle-gaps` CLI writes for a check now starts with `oracle-gaps: ` and its kind, on stdout and stderr alike, cold and through `--daemon`, so an agent can act on the results as they stream with `grep '^oracle-gaps: '` and filter one kind by the word after the prefix: - -- `oracle-gaps: config `, or `oracle-gaps: config none, Vitest's default discovery` -- `oracle-gaps: baseline pass : tests` and `oracle-gaps: baseline fail : …`, with the failing test, law, counterexample, and replay indented under it -- one decisive line before any mutant runs: `oracle-gaps: baseline all oracle files pass`, or `oracle-gaps: baseline of oracle files failed (provisional)` -- `oracle-gaps: blocked …` for each failing oracle file -- `oracle-gaps: gap L `, streamed and in the stdout summary -- `oracle-gaps: progress …`, `oracle-gaps: busy in for s`, and `oracle-gaps: note …` (Vite's own messages as `note vite: …`) -- the stdout summary as lines too: `oracle-gaps: summary …` for the totals, `oracle-gaps: legend : …` for each directive, and `oracle-gaps: function …` for each function's heading over its gap lines -- a last line for every run: `oracle-gaps: done completed, gaps, report ` (with `(provisional)` after the count when an oracle file failed), `oracle-gaps: done refused[, report ]` after a refusal's `refused:` and `fix:` block, `oracle-gaps: done error, log `, or `oracle-gaps: done stopped ()` - -The done line is the last line of both stdout and stderr, once each, and its status matches the exit code. Only the lines indented under a failing baseline file and a refusal's `refused:` and `fix:` block have no prefix, and no line is blank. A test's own writes to the process's stdout and stderr go to `test-output.log` in the output directory, which a note names. The stdout summary's `output: `, `Full report:`, and `completed: gaps` lines are replaced by the done line, and the refusal's `output: ` line by `oracle-gaps: done refused, report `. Exit codes do not change. - -The wrapper config now reads the package's config as Vite does: it awaits a promise default and refuses a default that is not an object. A config with a syntax error is refused with its first error, before Vite bundles it. diff --git a/.changeset/gap-cli-internal-error-prefix.md b/.changeset/gap-cli-internal-error-prefix.md deleted file mode 100644 index 5424f2d8..00000000 --- a/.changeset/gap-cli-internal-error-prefix.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The `oracle-gaps` CLI's internal error now prints one prefixed line, `oracle-gaps: error : a bug in oracle-gaps, not in your oracle; its stack is in `, before its `oracle-gaps: done error, log ` line. Before, its two message lines had no `oracle-gaps:` prefix. A line break in the message prints as an escape, so the message stays on one line. The stack stays in `error.log`, and the exit code stays 3. - -A path that a stream line names, such as the output directory in a done line or a note, now prints a line break or another control character as its `\uXXXX` escape, so a directory name cannot split the line. diff --git a/.changeset/gap-cli-never-crash.md b/.changeset/gap-cli-never-crash.md deleted file mode 100644 index 340f69a1..00000000 --- a/.changeset/gap-cli-never-crash.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The `oracle-gaps` CLI no longer ends a run with a bare stack trace. A problem in the author's own files or arguments (bad arguments, a `--source` that is missing or not a file, a broken `owns` declaration, no oracle file or no owner, a Vitest config that throws when it loads, has no default export, or defines `test.projects`, a Vitest that does not load, a setup file that throws, an oracle file that fails with no mutant active, an authored mutant file that is not JSON or is incomplete) refuses the run: it exits 2 and prints `refused: ` and `fix: `. When the output directory is known (even from `--out` alone, when other arguments are bad), the refusal is also written there as `results.json` (`{ "status": "refused", "cause", "directive" }`) and `summary.md`, replacing an earlier run's ending there, and the CLI's last line names that report (`oracle-gaps: done refused, report `). Any other error is a bug in the CLI: it exits 3, says so, and writes its stack to `error.log` in the output directory (or the system's temporary directory when none is known), with `results.json` status `internal-error`. A check through `--daemon` ends the same way. A daemon serves only a CLI of its own code, so a second install of the CLI starts its own daemon rather than reading another version's reply. - -Exit code 1 is no longer used: scripts that treated any non-zero exit as a failure keep working, and scripts that matched exit 1 must match 2 or 3. Arguments are now checked: an unknown option, an option with no value, a `--package` or `--mutants` directory that does not exist, a `--seed` that is not an integer, a count or limit that is not a positive whole number, and a `--pool` other than `threads` or `forks` each refuse the run instead of being ignored or failing later. diff --git a/.changeset/gap-cli-own-typescript.md b/.changeset/gap-cli-own-typescript.md deleted file mode 100644 index d6236c76..00000000 --- a/.changeset/gap-cli-own-typescript.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -Fix the `oracle-gaps` CLI crashing on a package whose TypeScript has no compiler API, as TypeScript 7's package has (it exposes only its version). The CLI now analyzes with its own TypeScript 5 dependency and never reads the package's TypeScript, so a package with no TypeScript, or with TypeScript 7, is analyzed instead of refused or crashed. The optional `typescript` peer dependency is removed for that reason. A copy of the CLI's own TypeScript without the compiler API is refused before any work, with a message that names the fix. diff --git a/.changeset/gap-cli-probe-not-work.md b/.changeset/gap-cli-probe-not-work.md deleted file mode 100644 index 086c81b9..00000000 --- a/.changeset/gap-cli-probe-not-work.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The `oracle-gaps` work count no longer includes probe code. A site in probe-only code (the probe guard, a probe statement, or a probe helper) counts nothing toward a test's work, so a work bound no longer kills a mutant whose only extra work is a probe, such as an `if` forced into a branch that only calls `report()`. diff --git a/.changeset/gap-cli-runtime.md b/.changeset/gap-cli-runtime.md deleted file mode 100644 index da53f5fd..00000000 --- a/.changeset/gap-cli-runtime.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The `oracle-gaps` CLI bounds a mutant's copies by counts, not by wall-clock limits, reports long runs, stops the processes it started, and writes nothing beside the tests. - -- No wall-clock limit decides an outcome. A copy that spins past its call budget, makes no progress, or whose work passes the mutant's work budget (the larger of 100,000 and ten times its owner files' unmutated work, counted in site evaluations, not in time) is killed by the built-in law `bounded work` or `no progress` on its test's route. A copy's call budget is a hundred times the most site evaluations that any unmutated test of its file made, and at least 100,000. A spin or a work-budget overrun kills only when the counts that decide it cannot follow the clock: a test that reads the clock, makes a timer, or does I/O of its own anywhere in its run is charged nothing, and its spin is a `timeout` named `(cause: spin)`. A copy makes no progress when none of its test's own timers is due before its backstop and none of its test's own I/O is pending; timers and I/O the runner keeps for itself, such as Vitest's task-update timer or a pending write that forwards the test's console output on Windows, do not keep it busy. Only the backstop (`--hang-limit`, 60 s by default, plus 3 s per second of the file's time) is a gap: the mutant is a `timeout`, named `(cause: backstop)` on its gap line, and no later copy runs. `--mutant-limit` and `--first-limit` are retired: they are checked and noted, and change nothing. -- While one copy of a test file runs for 30 s or more, the CLI prints `busy: in for s` every 30 s (`baseline` for a run with no mutant). Through `--daemon` the heartbeats arrive when the check ends. -- The check runs in a process group of its own, with every Vitest worker and every process a test starts, except one started detached in a session of its own. On SIGINT or SIGTERM the CLI signals the group, kills what is left 2 s later, and exits 130 or 143. Before, a SIGTERM left `forks` workers running. On Windows the run is not supervised. -- The runner's copies of the test files exist only in memory. Vitest's read of a copy for its per-file pragmas (`@vitest-environment`, `@module-tag`) is served its text, so a copy runs in its file's environment. The capture setup and Vitest configs are in a session directory of its own while it runs, which the run removes when it ends; one that a killed run left is removed by the next run. Before, the copies and configs sat beside the tests and the package's config, where a Vitest run started during a check found them and then failed when they were removed. diff --git a/.changeset/gap-cli-sqlite-evidence-store.md b/.changeset/gap-cli-sqlite-evidence-store.md deleted file mode 100644 index c8651dd2..00000000 --- a/.changeset/gap-cli-sqlite-evidence-store.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The `oracle-gaps` daemon keeps its evidence in a SQLite database instead of one JSON file, so a package with a large oracle file no longer fails every check with "Invalid string length" after two checks. The store prunes units no check has used for two weeks, returns the pages that replaced and pruned units freed, is written again when the OS cleans its directory while the daemon runs, starts over when its file is overwritten or corrupted while the daemon holds it (a check whose evidence cannot be written still reports its result), and keeps a unit it reuses from memory. The earlier `evidence.json` is removed when found. The static analysis keeps its ownership between checks while the production sources, the dependencies' declaration files, `owns` declarations, manifest, and lockfile are unchanged, so a daemon recheck after an edit to a test file skips the type-checker walk. With `ORACLE_GAPS_PROFILE`, each copy in a batch writes its own span. diff --git a/.changeset/gap-cli-stopped-session-dir.md b/.changeset/gap-cli-stopped-session-dir.md deleted file mode 100644 index 2919648a..00000000 --- a/.changeset/gap-cli-stopped-session-dir.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -A run of the `oracle-gaps` CLI that a stop ends, or whose check's process aborts, now removes its `/.oracle-gaps-/` session directory. Before, it left the directory for the next run to remove, and a run stopped as or before it started removed nothing, so the directory stayed in the package. Only a run whose own process is killed leaves it now, and the next run removes it. diff --git a/.changeset/gap-cli-stream-log.md b/.changeset/gap-cli-stream-log.md deleted file mode 100644 index d955aff3..00000000 --- a/.changeset/gap-cli-stream-log.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The `oracle-gaps` CLI now writes the lines it streams on stderr to `stream.log` in the output directory too, in order, cold and through `--daemon`, and the first line of a check on both streams names that file: `oracle-gaps: note log /stream.log`. An agent that starts a cold check in the background can read the run's progress and its done line there while it runs. A check through `--daemon` prints its lines at the end of its check, so its progress is readable there only after it ends. - -A run takes its output directory's claim in `run.pid` before it starts, and a second run on a live directory refuses without writing into it. A `run.pid` that names no running process (stale), that is empty, or that cannot be read (a directory, or a link to no file) also refuses the run, without writing into the directory, and the refusal's fix line tells you to delete `/run.pid` if no run uses that directory. The CLI never takes over another run's claim. A refusal of a run with no `--out` is written to the default output directory the run would have used. On Linux and macOS the run's supervisor needs no external command: a container without `ps`, or with BusyBox's `ps`, runs the check as any other system does. diff --git a/.changeset/gap-cli-temp-state.md b/.changeset/gap-cli-temp-state.md deleted file mode 100644 index 5e979364..00000000 --- a/.changeset/gap-cli-temp-state.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The `oracle-gaps` CLI keeps its working files out of the repository. The daemon's state (its lock, log, and evidence), the one-file bundles of workspace dependencies, and the default output directory now live in the OS temp directory, in a directory keyed by the package (`oracle-gaps-`, never a shared directory), which the OS cleans. A state that the OS removed is a cold start. `--out` is honored as before, and the run still prints its output path. While a run runs, its capture setup and Vitest configs are in `/.oracle-gaps-/`, which it removes when it ends; one that a killed run left is removed by the next run. A run leaves nothing in the package, so there is nothing to add to `.gitignore` or to delete. Before, every run wrote `/.oracle-gaps/` and `/.oracle-gaps/bundle-*.mjs`. diff --git a/.changeset/gap-cli-typescript-alias.md b/.changeset/gap-cli-typescript-alias.md deleted file mode 100644 index 3b54b47f..00000000 --- a/.changeset/gap-cli-typescript-alias.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The `oracle-gaps` CLI's TypeScript is now the npm alias dependency `typescript-for-tanstack-oracles` (`npm:typescript@^5.9.2`), and the CLI resolves it by that name. Before, the plain `typescript` dependency was hoisted by npm to an adopter's root. A project without TypeScript got a `typescript` package, and a project with its own TypeScript range could have that range deduped up to 5.9. Now neither happens. npm still links the alias's `tsc` and `tsserver` into `node_modules/.bin` in a project without TypeScript. After an incremental `npm install` of this package into a project with TypeScript, `.bin/tsc` points at the alias until a clean install (`npm ci`, or removing `node_modules`); a later plain `npm install` does not repair it. That is still strictly better than before, when the same incremental install raised the project's root `typescript` itself, for example from 5.4.5 to 5.9.3. On a clean install, the project's own `typescript` provides `tsc`. pnpm links only direct dependencies' commands, so it is not affected. diff --git a/.changeset/gap-diff-base-limits-run.md b/.changeset/gap-diff-base-limits-run.md deleted file mode 100644 index deb8fef5..00000000 --- a/.changeset/gap-diff-base-limits-run.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -`oracle-gaps --diff-base ` now judges only the mutants on lines changed since ``, for fast feedback after a change. Operator and authored mutants both count, and a mutant is on a changed line when any line from its first to its last is changed. Every line of a source file that git does not track is changed. The baseline still runs every test file that the run without the option runs, and each judged mutant gets the outcome it gets in the full run. An authored mutant that does not apply is reported on every run with the option, as it is without it. The run says so on its stream before the baseline, `oracle-gaps: note --diff-base : of mutants are on changed lines; the others are not judged in this run`, and in the same sentence in `summary.md`; `` counts the run without the option, with the same `--only` or `--sample`. Its `results.json` and `summary.md` inputs say `a partial run (--only, --sample, or --diff-base)`, as an `--only` or `--sample` run's do (their text used to read `(--only or --sample)`). Authored mutants are marked `inDiff` too. - -`oracle-gaps --diff-base ` refuses a revision that names no commit of the git repository that holds the package: a name git does not know, a range, a blob, an option such as `--cached`, an empty value, or a package in no repository. It exits 2 with `refused: --diff-base "" names no commit of the git repository that holds the package` and a `fix:` line, before any test runs. Before, the run went on and marked every mutant `inDiff: false`. `results.json` records the commit as `options.diffBase: { rev, commit }` (it was the revision as given), so the run identity follows the commit and not the name. - -Before, `--diff-base` only added `inDiff` to each operator mutant in `results.json`, and every mutant still ran. Run a full check without `--diff-base` to judge the other lines. diff --git a/.changeset/gap-report-directives.md b/.changeset/gap-report-directives.md deleted file mode 100644 index d9c0544f..00000000 --- a/.changeset/gap-report-directives.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The `oracle-gaps` report gives each gap a class and one directive with a concrete next step. A message never offers an exit such as an equivalent mutant or a maintainer approval. Survivors are `not-judged`, `indeterminate`, `dead-code`, `branch-never-taken`, `not-infected`, or `not-observed`. A `crashed` gap names the error that production threw, and tells the author to record it as an observation and state the law. Standard output is short. It has the totals, one legend line for each class, and gaps grouped by function. It also has the unowned warnings counted for each function, and the paths of `summary.md` and `results.json`. The full report is in `summary.md`. The CLI also streams its progress: the baseline result first, then one line for each gap when the CLI judges it, then the summary. diff --git a/.changeset/gap-report-output-fixes.md b/.changeset/gap-report-output-fixes.md deleted file mode 100644 index b9dfc210..00000000 --- a/.changeset/gap-report-output-fixes.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -Fix four parts of the `oracle-gaps` output. - -- The baseline's replay command now runs the failing test. Before, its `-t` pattern was the test's `>`-joined name in JSON quotes: Vitest 4 matches `-t` against names joined by a space, so a test in a `describe` ran nothing, and a name with regular-expression syntax, `$`, or a backtick broke the pattern or the shell. The pattern is now the suites' and the test's names, escaped, joined to match Vitest 4 and Vitest 5, anchored, and in single quotes. A file that fails with no failing test (it did not load) replays whole, with no `-t`, where before it printed `-t undefined`. A control character in a test's name or failure, such as a newline, prints as its `\uXXXX` escape, in the baseline and in messages, so each stays one line. -- A gap line stays one line: the code of an operator mutant and the intent of an authored mutant have their whitespace collapsed and are cut at 60 characters with `...`, counted by code point so that a cut never splits an emoji. An authored intent prints as a code span. `results.json` keeps the full text. -- A `not-infected` message prints each operand as a code span of a typed value: strings quoted, `-0` as `-0`, bigints with `n`, and `undefined`, `null`, `NaN`, and a value that is not a primitive kept apart. A string longer than 40 characters (code points) prints its first 37 and a digest. Before, `1` and `"1"`, `0` and `-0`, and two long strings with one prefix printed alike. -- A `not-observed` directive also tells the author to add a history where the mutated code computes something different, because the run cannot tell a value nothing observed from a forced branch that computed the original's result. diff --git a/.changeset/gap-report-report-order.md b/.changeset/gap-report-report-order.md deleted file mode 100644 index 7c1d1e82..00000000 --- a/.changeset/gap-report-report-order.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The tests and files that an `oracle-gaps` report names no longer depend on how the run was made. They are now in report order: by file path, compared by code unit, and within a file in the order of the baseline run's records. This applies to a message's test, the `Owners` and `Changed observations in` lists, the operands of a `not-infected` message, the tests of an `indeterminate` message, the files that a refusal names or that the report leaves out (`excluded`), and results.json's `nondeterministic` tests. Kill, crash, and framework-error messages also order files by path. Within a file, they use the order in which the reporter lists the file's tests. A batch that a hang cut off uses the order of the mutant run's records. An operator mutant's owner files also run in path order, so a kill names the laws of the first file that kills. - -Before, these lists followed the order in which the runner joined its contexts' units. So `--contexts`, whose default depends on the machine's cores, could change which test a message named. An authored mutant's lists followed the order in which its owners were declared. diff --git a/.changeset/gap-report-super-calls.md b/.changeset/gap-report-super-calls.md deleted file mode 100644 index 85b2ea2c..00000000 --- a/.changeset/gap-report-super-calls.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -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. diff --git a/.changeset/initial-release.md b/.changeset/initial-release.md deleted file mode 100644 index 1c0f81fa..00000000 --- a/.changeset/initial-release.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@tanstack/oracles': patch -'@tanstack/eslint-plugin-oracles': patch ---- - -Publish the first release of the oracle testing framework, the bundled -`oracle-gaps` CLI and skills, and the ESLint plugin for oracle tests. diff --git a/.changeset/law-credit-label.md b/.changeset/law-credit-label.md deleted file mode 100644 index e330623b..00000000 --- a/.changeset/law-credit-label.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The gap report's per-law table is now titled "First law to reject, by law". It says that each count credits only the first law that rejected a history, because a check returns its first violation and a later law on the same history is not checked. A law with no count is not shown to reject nothing. The section's next step tells the author to add a history that varies the input the law judges. diff --git a/.changeset/lint-remove-ignore-mode.md b/.changeset/lint-remove-ignore-mode.md deleted file mode 100644 index fe35e230..00000000 --- a/.changeset/lint-remove-ignore-mode.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@tanstack/eslint-plugin-oracles': patch ---- - -**Breaking (unreleased package):** `settings.oracles.unknownSources: 'ignore'` is removed. An unknown source never passes silently, and a global ignore mode contradicted that. The modes are now `'report'` (the default) and `'test'`. A configuration that still says `'ignore'` gets `malformedSetting` at line 1, with a message that names `settings.oracles.nonTestPackages`, and the rules read the setting as unset. To silence a specific package, list it in `settings.oracles.nonTestPackages`. - -The malformed-setting report has one message id, `malformedSetting`, in both `oracle/no-unit-test` and `oracle/oracle-property-only`. It replaces `malformedSourceSetting`, which `oracle/no-unit-test` reported before this change. diff --git a/.changeset/lint-test-source-recognition.md b/.changeset/lint-test-source-recognition.md deleted file mode 100644 index 30f2f749..00000000 --- a/.changeset/lint-test-source-recognition.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -'@tanstack/eslint-plugin-oracles': patch ---- - -`oracle/no-unit-test`, `oracle/no-disabled`, and `oracle/oracle-property-only` now decide whether a callee is a test function by where its binding comes from, not by its name alone. Before, any package's export named `it`, `test`, `describe`, `suite`, or `bench` was a test function, so Ramda's `test` and mitata's `bench` were reported. A default import was never a test function, so `import test from 'ava'`, `'node:test'`, or `'@playwright/test'` was silent, and so were `xit`, `fit`, node:test's `skip` and `only`, `Deno.test`, `require('node:test')`, and fixtures with other names. - -- The rules know the test frameworks: Vitest (and `@vitest/runner`, `vite-plus/test`, `@fast-check/vitest`, `@effect/vitest`), Playwright and its component-testing packages, Jest (`@jest/globals`, `jest-each`, `@fast-check/jest`), Mocha and `mocha-steps`, node:test (and the `test` package), AVA (and `@fast-check/ava`), tap, tape, zora, brittle, uvu, `bun:test`, `@std/testing/bdd`, QUnit, Japa, and Lab. Each framework's default, named, namespace, and `require` exports count, with the modifiers that an export carries (`xit`, `fit`, `skip`, `only`, `todo`) and its factories (`mergeTests`, uvu's `suite`, `jest-each`, Lab's `script`). Members such as `.fail`, `.failing`, `.expectFailure`, `.ignore`, `.if`, `.todoIf`, `.override`, `.scoped`, and `.effect` keep a registration. The globals of the Vitest, Jest, Mocha, and Jasmine environments count too, and so do `Deno.test` and `QUnit.test`. -- The rules know packages that export other functions under these names, such as Ramda, Rambda, remeda, lodash, mitata, benny, `@thi.ng/*`, and `@tensorflow/*`. Their exports are never reported. -- The rules read a project's own modules: relative modules, `#` imports through the nearest `package.json` `imports` (a target that names a package is classified as that package), and workspace packages (a `node_modules` link to a real path outside `node_modules`), through their `exports`. They never read a package under `node_modules`; a project whose own path is under a `node_modules` directory is still read. -- `settings.oracles.testPackages` maps a specifier to a framework's specifier or to a table of export roles, and `settings.oracles.nonTestPackages` lists packages without test functions. Both are read first. A setting that the rules cannot use, including a `settings.oracles` that is not an object, is reported as `malformedSetting` and read as unset; it never makes a rule throw. -- Any other source is one the rules cannot classify, whatever the import's name. By default (`settings.oracles.unknownSources: 'report'`), `oracle/no-unit-test` reports `unknownTestSource` once per import, at the import, for a title-shaped call through it (a string title, then a function), and for a call to a relative helper that makes one. A call with no title before its function, such as `pMap(xs, fn)` or `effect(fn)`, gets none. Machinery files (`oracle-*`) get the report too. `'test'` reads a framework's name from such a source as the framework's. There is no `'ignore'` mode: a package is silenced only by `settings.oracles.nonTestPackages`. -- A registration's body follows its title, except where the framework's title is optional (node:test, tap, tape, brittle, `Deno.test`), where `test(fn)` registers. Playwright's annotations (`test.skip()`, `test.skip('reason')`, `test.skip(condition, 'reason')`, `test.skip(fixtures => condition, 'reason')`, and the same forms of `fixme`, `fail`, and `slow`) register nothing; `oracle/no-disabled` reports the `skip` and `fixme` ones. -- The README's new "Decisions" section records the maintainer decision of 2026-11-12 and the limits it accepts. diff --git a/.changeset/oracle-gaps-ending-ask.md b/.changeset/oracle-gaps-ending-ask.md deleted file mode 100644 index b5af8ca3..00000000 --- a/.changeset/oracle-gaps-ending-ask.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -Change how `oracle-gaps` ends a run whose ending is interrupted. A stop that the supervisor has received ends the run stopped, even when the run's refusal had begun, with one `done stopped` line on each stream and exit 128 plus the signal. A child that dies before its ending is written ends the run with one `done error` line and exit 3, instead of an internal error or no line. A child whose supervisor is killed while it awaits the supervisor's answer is ended by its process group's kill, with no done line, as a supervised child is when its supervisor is killed. diff --git a/.changeset/oracle-gaps-test-root-copies.md b/.changeset/oracle-gaps-test-root-copies.md deleted file mode 100644 index dc1aa493..00000000 --- a/.changeset/oracle-gaps-test-root-copies.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The `oracle-gaps` CLI judges the mutants of a package whose Vitest config sets `test.root`. Before, the CLI resolved each in-memory copy of a test file to its path, so Vite named the copy from its root and imported it again by that name. Under a test root other than the package, that name (`/.oracle-gaps-…`) matched no copy, the copy failed to load, and the mutants of an owner there reported `setup-error`. The CLI now leaves a copy unresolved: Vite keeps the absolute path that Vitest imports it by, and the CLI serves the copy from that path. This works for a test root inside the package, above it, a root that holds no test file, and a root that is a symbolic link. diff --git a/.changeset/oracle-property-const-inference.md b/.changeset/oracle-property-const-inference.md deleted file mode 100644 index 861c1911..00000000 --- a/.changeset/oracle-property-const-inference.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -`oracleProperty` infers a history from a literal with `const`, so a zero-argument `constructed[].build` that returns a literal compiles, and an annotated `model` without `resolve` keeps its annotated type, as on main. `constructed[].build` may return the read-only view of a history, `ReadonlyHistory`, which is a new public type export. - -**Breaking (types only, accepted by the maintainers on 2026-11-23).** A history that a literal infers is read-only: its arrays are read-only tuples. Code that needs a mutable array type no longer accepts it, in five cases: - -1. **Mutating it.** `model: (plan) => { plan.items.push(2) }` on an `enumerated` literal fails. Migrate by copying the array first: `const items: Array = [...plan.items]`, then mutate `items`. -2. **Passing it to a mutable-array parameter.** `takesMutable(plan.items)`, where the parameter is `Array`, fails. Migrate with a copy: `takesMutable([...plan.items])`. -3. **A discriminated-union branch.** Each branch keeps its own read-only array, so case 2 applies inside `if (plan.kind === 'a')`. Migrate the same way, inside the branch. -4. **A generic constrained to a mutable array** (`T extends Array`). Migrate by passing a copy: `firstOf([...plan.items])`. -5. **The new `ReadonlyHistory` export.** Code that names it receives the read-only view of a history. - -Generic functions without an array constraint (`identity(plan.items)`) keep the read-only type. Histories from `arbitrary` and `fixed` are unchanged. diff --git a/.changeset/oracle-property-owns.md b/.changeset/oracle-property-owns.md deleted file mode 100644 index 960e476a..00000000 --- a/.changeset/oracle-property-owns.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -`oracleProperty` takes an `owns` list: the production files or functions (`src/x.ts`, `src/x.ts#fn`) whose static call tree the oracle owns. The `oracle-gaps` CLI reads `owns` from an object-literal argument of any call in a test file, so a wrapper that forwards `owns` to `oracleProperty` (`registerX('id', { owns: [...] })`) names it at its call. A test file that calls `oracleProperty`, or passes such a list, is an oracle file, and it owns the union of its lists. Every test file is read, because a file that never calls `oracleProperty` still owns code when it passes `owns` to a wrapper that it imports. An `owns` key inside an assertion's arguments is data, so it is not read: an `expect` chain (including `.not`, `.soft`, a computed matcher, and an aliased `expect`), `assert` and its members, `chai`, `expectTypeOf`, `assertType`, and every binding imported from Node's `assert` (named, default, or namespace). An `owns` key in an object literal passed to any other call is read, so an unrelated domain object with that key makes the file an oracle file. A local function named like an assertion, such as `function assert() {}`, is skipped too. Each list must be a literal array of string or plain template literals. It refuses a run that has no oracle file, or in which no file owns a selected source, with one diagnostic. Before, such a run reported zero gaps without judging anything. `law.owner` is removed. Each run writes its output to a directory of its own by default, not to a shared `/tmp/oracle-gaps`. diff --git a/.changeset/oracles-release-docs.md b/.changeset/oracles-release-docs.md deleted file mode 100644 index 8d14a04a..00000000 --- a/.changeset/oracles-release-docs.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -Add initial documentation outlines and agent-first onboarding with npm releases. Update the READMEs with a shared exploration prompt. diff --git a/.changeset/plugin-consumer-parser.md b/.changeset/plugin-consumer-parser.md deleted file mode 100644 index 909a3ad8..00000000 --- a/.changeset/plugin-consumer-parser.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@tanstack/eslint-plugin-oracles': patch ---- - -Fix the plugin failing to load in a repository whose TypeScript is 7 or absent. `oracle/no-unit-test` imported `@typescript-eslint/parser` at load time, and that parser rejects TypeScript 7, so every config of the plugin failed to import. The rule now parses each imported test module with the parser and parser options that ESLint uses for the file it lints, through ESLint's own `Linter`, so it agrees with the consumer's config and needs no TypeScript of its own. `@typescript-eslint/parser` is no longer a dependency. - -A related fix: under espree, the rule saw no references at all; it now reads espree's scopes. The rule never throws on a module that its parser cannot read. - -Behavior to expect: an imported module is parsed with the linted file's parser, not its own. A `.js` oracle file linted with espree that imports a module with TypeScript syntax (for example `./x.js` resolved to `x.ts`) cannot classify that module's helpers. diff --git a/.changeset/plugin-empty-tests-and-scope.md b/.changeset/plugin-empty-tests-and-scope.md deleted file mode 100644 index 93bd0db4..00000000 --- a/.changeset/plugin-empty-tests-and-scope.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@tanstack/eslint-plugin-oracles': patch ---- - -`oracle/no-unit-test` now reports a test whose body is an empty function in an oracle file, such as `it('x', () => {})`, `test('x', async () => {})`, or `it.skip('x', () => {})`, with "This test's body is empty, so it checks nothing. Remove it, or use it.todo." Before, an empty body was exempt as a placeholder, so an oracle file could hold tests that judge nothing. A replay placeholder can register with `it.todo` instead. `it.todo('x', () => {})` is reported with "it.todo takes no body; remove the body." - -The `recommended` and `production` configs no longer apply to tool config files: the configs of ESLint, Vite, and Vitest (`vite.config.ts`, `vitest.unit.config.mjs`) and any `*.oracle.config.*`, such as `eslint.oracle.config.mjs`, whose names match the oracle-file globs. Companion oracle modules such as `foo-oracle.ts`, and source modules such as `src/foo.config.ts`, keep the rules. A config that spreads a preset and sets its own `ignores` must merge them with the preset's (`[...preset.ignores, ...own]`), as the README shows. - -The rules' source comments no longer cite files that the package does not ship, such as this repository's scripts and the `@tanstack/oracles` sources. diff --git a/.changeset/quiet-monkeys-brake.md b/.changeset/quiet-monkeys-brake.md deleted file mode 100644 index 1162ca85..00000000 --- a/.changeset/quiet-monkeys-brake.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The gap report owns the functions of a module-level object literal when the literal is read dynamically (`handlers[key]()`), passed as a whole value, spread, or read with `Object.values`. A static read (`handlers.a()`) owns only that member, and an `owns` entry that names the literal owns none of its methods. Module functions that the literal names by shorthand (`{ helper }`) are owned whenever the literal is reached, as `{ helper: helper }` already is. A property name in an object literal no longer counts as a reference, so a static read or an `owns` entry on the literal no longer owns its arrow-function properties beyond the member read. diff --git a/.changeset/remove-legacy-campaigns.md b/.changeset/remove-legacy-campaigns.md deleted file mode 100644 index 5b581edd..00000000 --- a/.changeset/remove-legacy-campaigns.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/eslint-plugin-oracles': patch ---- - -`oracle/oracle-property-only` reports every raw campaign and legacy campaign import in an oracle file, and only a framework implementation module is exempt. No setting exempts a file. A configuration that sets `settings.oracles.legacyCampaigns`, to any value, gets one `removedSetting` report at line 1 of each oracle file, which says to convert the listed files to `oracleProperty` and delete the setting. diff --git a/.changeset/scope-anchors-to-declarations.md b/.changeset/scope-anchors-to-declarations.md deleted file mode 100644 index 40b61ba9..00000000 --- a/.changeset/scope-anchors-to-declarations.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -Scope a gap mutant's anchor to the innermost statement or declaration that holds it. A mutant in a default parameter, a property declaration, an enum member, a decorator, a heritage clause, or a computed member name of a class member, an object method, or an object accessor used to anchor to the whole file, so its gap key changed on every edit to that file. It now anchors to that declaration. A computed name on an object-literal property still anchors to its statement, as before. - -This changes gap keys once, and stored gaps for the changed keys should be re-baselined. Gaps recorded under the old keys show as new once. Measured on the 17 non-test gap-CLI sources as this branch ships them (base origin/main at fbb99aad, 7,269 mutants), 17 keys change in 5 files: 11 were whole-file anchors. One mutant in `classify.mjs`, a `value-undefined` on a default parameter inside a `const` statement, moved from its statement's anchor to its parameter. Five keys in `classify.mjs` (the `~2` to `~5` suffixes of one anchor) changed only their index, so a stored key for one of them now names a different mutant. The maintainers accepted these key changes ("slight change to gap keys is fine", 2026-11-23). - -Shipped bytes: the two shipped CLI files change by +469 bytes raw and +134 bytes gzip (`schemata.mjs` +454 raw, `report.mjs` +15 raw; the test file is not shipped). diff --git a/.changeset/shardable-units.md b/.changeset/shardable-units.md deleted file mode 100644 index f3c8eb58..00000000 --- a/.changeset/shardable-units.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -'@tanstack/oracles': patch -'@tanstack/eslint-plugin-oracles': patch ---- - -**Breaking for consumers.** Test names of generated sources change, and a path replay of a generated source now needs `${prefix}_UNIT`. A command or script that sets only the seed, the path, and the property now fails when the property registers. - -A generated source now registers each part of a campaign as its own test, so a runner can shard a long campaign across jobs. For each fixed seed N, `oracleProperty` registers `fixed seed N: ` for each constructed history and `fixed seed N: generated` for the generated histories. The random campaign registers `random seed: ` and `random seed: generated` in the same way. The determinism test becomes one test per history: `determinism: fixed history: `, `determinism: constructed history: `, and `determinism: generated 0` to `2`. The units of a seed run exactly the histories that the campaign ran. Each unit decides its own first failure, shrinks within its own timeout, and prints its own reach line, ` reach {...}`. A campaign's reach is the sum of its units' lines. A unit that fails or times out prints no reach line. An enumerated source keeps its one `determinism` test. - -Test names change. A `-t "fixed seed"` filter still selects the fixed-seed units, and `-t "random seed"` the random units. A filter that names the old `determinism` test of a generated source now selects all its determinism units. The random units of a property share one seed, which the first random unit that runs selects and logs in the one `ORACLE_SEED` line. - -A path replay now names its unit in the new `${prefix}_UNIT` variable, such as `ORACLE_UNIT='random seed: generated'`. `UNIT` requires `PROPERTY`. During a path replay, only the random unit of that name runs. A path replay of a generated source without `UNIT` fails when the property registers, with "`ORACLE_PATH` of a generated source requires `ORACLE_UNIT`". A `UNIT` that names no random unit of the replayed property also fails its registration. A failing unit prints its replay command, with the seed, the path, the property, the unit, and its `-t` pattern, under the configured prefix. A failing fixed-seed unit also prints `Rerun: -t '...'`, which reruns it. The retired-variable message names `${prefix}_UNIT`. - -To migrate a recorded path, rebase it onto its unit. In the old campaign, the first index of a path selected the history: an index k below n, the number of constructed histories, was constructed history k, and an index k of n or more was generated history k − n. With `PATH=k:`: - -- for k < n, set `${prefix}_UNIT='random seed: '` and `${prefix}_PATH=0:`; -- for k ≥ n, set `${prefix}_UNIT='random seed: generated'` and `${prefix}_PATH=(k − n):`. - -A path recorded from a fixed-seed campaign replays the same way, with that fixed seed as `${prefix}_SEED`. A new failure prints its replay command, so only paths recorded before this change need rebasing. - -A generated source fails to load when two of its tests would share a name: a constructed history named `generated`, two constructed histories of one name, or two fixed histories of one name. - -In `@tanstack/eslint-plugin-oracles`, `oracle/no-disabled` reads `${envPrefix}_UNIT` as a shared replay variable, and reports a `process.env` read of any other variable that ends in `_UNIT` as a private replay variable, as it does for `_SEED`, `_PATH`, `_PROPERTY`, and `_RUNS`. diff --git a/.changeset/ship-oracle-skills.md b/.changeset/ship-oracle-skills.md deleted file mode 100644 index 4228e14a..00000000 --- a/.changeset/ship-oracle-skills.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@tanstack/oracles': patch -'@tanstack/eslint-plugin-oracles': patch ---- - -Ship agent skills and docs inside `@tanstack/oracles`. The package now includes `skills/` with five skills: `oracles-explore` (the entry point: it probes a repository, shows what an oracle can find, and builds the first oracle with the developer), `oracles-setup`, `oracles-design`, `oracles-review`, and `oracles-evaluate-review`. It also includes `docs/`: an introduction to oracles, the oracle checklist (version 1, ORC-001 to ORC-016), a glossary, a techniques guide, model-style examples, and six instrument cards. A coding agent reads them from `node_modules`. `@tanstack/eslint-plugin-oracles` gains a README that lists its configs and rules. diff --git a/.changeset/shrink-budget.md b/.changeset/shrink-budget.md deleted file mode 100644 index 331282ac..00000000 --- a/.changeset/shrink-budget.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -A failing campaign now reports its law violation before its test times out, however slow its histories are. Before, fast-check shrank a failure without a limit. A slow property could then outlast its `timeout`, and Vitest reported only "Test timed out", with no law and no counterexample. Now a campaign starts no shrink run once half of the property's `timeout` has passed. It then reports the smallest counterexample that it found, with the first failure's law, and that counterexample replays. A counterexample that the limit stopped can be larger than the smallest that fails. To shrink further, raise `timeout`. A `timeout` of 0 or less means no timeout, as Vitest reads it, so it sets no limit. The limit is real time, so a seed-only rerun on another machine can report another counterexample under the same law. A path replay now runs its counterexample and does not shrink it again, so it reports the counterexample that it replays. A property whose runs each take less than half its `timeout` no longer needs `fc.limitShrink` to report its law in time. diff --git a/packages/eslint-plugin-oracles/CHANGELOG.md b/packages/eslint-plugin-oracles/CHANGELOG.md new file mode 100644 index 00000000..e636bc28 --- /dev/null +++ b/packages/eslint-plugin-oracles/CHANGELOG.md @@ -0,0 +1,65 @@ +# @tanstack/eslint-plugin-oracles + +## 0.0.1 + +### Patch Changes + +- Add ESLint rules for oracle tests: no disabled oracles, no unit tests in oracle files, pure models, replayable seeds, and the production probe form. `oracle/no-unit-test` holds an oracle file to registering its tests only through `oracleProperty`. It reports every other test registration as a unit test, and a helper that registers its caller's body. It also reports an `oracleProperty` call without an inline `check`, and an imported helper that registers tests of its own. `oracle/no-unit-test`, `oracle/no-disabled`, and `oracle/oracle-property-only` share one account of a test function: a test framework's test function or suite, or a fixture of one, by the source of its binding (see the README's "Where a test function comes from"). They follow imports, aliases, namespace members, variables and their assignments, destructurings, casts, the branches of a conditional or logical expression, tagged-template `.each`, and the exports of relative test modules. A binding to anything else, and a member that is no registration such as `test.step`, is no test function, whatever its name. The README lists the forms that the rules do not recognize: a test function passed as a parameter, one that a third-party package exports under a name that no framework uses, a computed member that is not a string literal, and a modifier call that another module exports. A fixed history, case, calibration, or reach check goes in the property's histories, calibrations, and declared states; any other test goes in an ordinary test file. `settings.oracles` sets the environment prefix and the modules that count as implementation and replay-witness modules. ([#2](https://github.com/TanStack/oracles/pull/2)) + + Add the `oracle/oracle-property-only` rule, enabled in `configs.recommended`. In an oracle file it reports a raw property campaign (`fc.assert`, `fc.check`, or a `.prop` registration, through `fast-check` or `@fast-check/vitest`) and an import of `createOracleReach` or `runOracleCampaign`, so a generated-history law runs through `oracleProperty` and its constructed histories. Framework implementation modules are exempt. A non-array `implementationModules` or `replayWitnessModules` is reported at line 1 and read as empty. The rule never throws. + + Add the `oracle/no-oracle-disable` rule, enabled in `configs.recommended` and `configs.production`. It reports every ESLint directive that would silence an `oracle/*` rule: a rule list that names one (bare, single-quoted, or double-quoted), a directive with no rule list, and an inline config comment that names one. Oracle rules cannot be disabled inline. A report sits on the directive's line; a directive that names this rule or has no list, or that an earlier block directive covers, is reported at line 1, column 0. Residuals the rule cannot close: a directive on line 1 that names this rule or has no list, and a production config comment that turns this rule off. + + The `recommended` config sets `linterOptions.noInlineConfig` on oracle files. ESLint ignores every directive in those files, for every rule, not only the oracle rules. A directive for another rule in an oracle file has no effect, so a project that relied on one must move the suppression or fix the code. The production config's probe-form rule covers `packages/*/src` and a single-package `src` directory. + +- Publish the first release of the oracle testing framework, the bundled ([#342](https://github.com/TanStack/oracles/pull/342)) + `oracle-gaps` CLI and skills, and the ESLint plugin for oracle tests. + +- **Breaking (unreleased package):** `settings.oracles.unknownSources: 'ignore'` is removed. An unknown source never passes silently, and a global ignore mode contradicted that. The modes are now `'report'` (the default) and `'test'`. A configuration that still says `'ignore'` gets `malformedSetting` at line 1, with a message that names `settings.oracles.nonTestPackages`, and the rules read the setting as unset. To silence a specific package, list it in `settings.oracles.nonTestPackages`. ([#52](https://github.com/TanStack/oracles/pull/52)) + + The malformed-setting report has one message id, `malformedSetting`, in both `oracle/no-unit-test` and `oracle/oracle-property-only`. It replaces `malformedSourceSetting`, which `oracle/no-unit-test` reported before this change. + +- `oracle/no-unit-test`, `oracle/no-disabled`, and `oracle/oracle-property-only` now decide whether a callee is a test function by where its binding comes from, not by its name alone. Before, any package's export named `it`, `test`, `describe`, `suite`, or `bench` was a test function, so Ramda's `test` and mitata's `bench` were reported. A default import was never a test function, so `import test from 'ava'`, `'node:test'`, or `'@playwright/test'` was silent, and so were `xit`, `fit`, node:test's `skip` and `only`, `Deno.test`, `require('node:test')`, and fixtures with other names. ([#45](https://github.com/TanStack/oracles/pull/45)) + + - The rules know the test frameworks: Vitest (and `@vitest/runner`, `vite-plus/test`, `@fast-check/vitest`, `@effect/vitest`), Playwright and its component-testing packages, Jest (`@jest/globals`, `jest-each`, `@fast-check/jest`), Mocha and `mocha-steps`, node:test (and the `test` package), AVA (and `@fast-check/ava`), tap, tape, zora, brittle, uvu, `bun:test`, `@std/testing/bdd`, QUnit, Japa, and Lab. Each framework's default, named, namespace, and `require` exports count, with the modifiers that an export carries (`xit`, `fit`, `skip`, `only`, `todo`) and its factories (`mergeTests`, uvu's `suite`, `jest-each`, Lab's `script`). Members such as `.fail`, `.failing`, `.expectFailure`, `.ignore`, `.if`, `.todoIf`, `.override`, `.scoped`, and `.effect` keep a registration. The globals of the Vitest, Jest, Mocha, and Jasmine environments count too, and so do `Deno.test` and `QUnit.test`. + - The rules know packages that export other functions under these names, such as Ramda, Rambda, remeda, lodash, mitata, benny, `@thi.ng/*`, and `@tensorflow/*`. Their exports are never reported. + - The rules read a project's own modules: relative modules, `#` imports through the nearest `package.json` `imports` (a target that names a package is classified as that package), and workspace packages (a `node_modules` link to a real path outside `node_modules`), through their `exports`. They never read a package under `node_modules`; a project whose own path is under a `node_modules` directory is still read. + - `settings.oracles.testPackages` maps a specifier to a framework's specifier or to a table of export roles, and `settings.oracles.nonTestPackages` lists packages without test functions. Both are read first. A setting that the rules cannot use, including a `settings.oracles` that is not an object, is reported as `malformedSetting` and read as unset; it never makes a rule throw. + - Any other source is one the rules cannot classify, whatever the import's name. By default (`settings.oracles.unknownSources: 'report'`), `oracle/no-unit-test` reports `unknownTestSource` once per import, at the import, for a title-shaped call through it (a string title, then a function), and for a call to a relative helper that makes one. A call with no title before its function, such as `pMap(xs, fn)` or `effect(fn)`, gets none. Machinery files (`oracle-*`) get the report too. `'test'` reads a framework's name from such a source as the framework's. There is no `'ignore'` mode: a package is silenced only by `settings.oracles.nonTestPackages`. + - A registration's body follows its title, except where the framework's title is optional (node:test, tap, tape, brittle, `Deno.test`), where `test(fn)` registers. Playwright's annotations (`test.skip()`, `test.skip('reason')`, `test.skip(condition, 'reason')`, `test.skip(fixtures => condition, 'reason')`, and the same forms of `fixme`, `fail`, and `slow`) register nothing; `oracle/no-disabled` reports the `skip` and `fixme` ones. + - The README's new "Decisions" section records the maintainer decision of 2026-11-12 and the limits it accepts. + +- Fix the plugin failing to load in a repository whose TypeScript is 7 or absent. `oracle/no-unit-test` imported `@typescript-eslint/parser` at load time, and that parser rejects TypeScript 7, so every config of the plugin failed to import. The rule now parses each imported test module with the parser and parser options that ESLint uses for the file it lints, through ESLint's own `Linter`, so it agrees with the consumer's config and needs no TypeScript of its own. `@typescript-eslint/parser` is no longer a dependency. ([#13](https://github.com/TanStack/oracles/pull/13)) + + A related fix: under espree, the rule saw no references at all; it now reads espree's scopes. The rule never throws on a module that its parser cannot read. + + Behavior to expect: an imported module is parsed with the linted file's parser, not its own. A `.js` oracle file linted with espree that imports a module with TypeScript syntax (for example `./x.js` resolved to `x.ts`) cannot classify that module's helpers. + +- `oracle/no-unit-test` now reports a test whose body is an empty function in an oracle file, such as `it('x', () => {})`, `test('x', async () => {})`, or `it.skip('x', () => {})`, with "This test's body is empty, so it checks nothing. Remove it, or use it.todo." Before, an empty body was exempt as a placeholder, so an oracle file could hold tests that judge nothing. A replay placeholder can register with `it.todo` instead. `it.todo('x', () => {})` is reported with "it.todo takes no body; remove the body." ([#16](https://github.com/TanStack/oracles/pull/16)) + + The `recommended` and `production` configs no longer apply to tool config files: the configs of ESLint, Vite, and Vitest (`vite.config.ts`, `vitest.unit.config.mjs`) and any `*.oracle.config.*`, such as `eslint.oracle.config.mjs`, whose names match the oracle-file globs. Companion oracle modules such as `foo-oracle.ts`, and source modules such as `src/foo.config.ts`, keep the rules. A config that spreads a preset and sets its own `ignores` must merge them with the preset's (`[...preset.ignores, ...own]`), as the README shows. + + The rules' source comments no longer cite files that the package does not ship, such as this repository's scripts and the `@tanstack/oracles` sources. + +- `oracle/oracle-property-only` reports every raw campaign and legacy campaign import in an oracle file, and only a framework implementation module is exempt. No setting exempts a file. A configuration that sets `settings.oracles.legacyCampaigns`, to any value, gets one `removedSetting` report at line 1 of each oracle file, which says to convert the listed files to `oracleProperty` and delete the setting. ([#23](https://github.com/TanStack/oracles/pull/23)) + +- **Breaking for consumers.** Test names of generated sources change, and a path replay of a generated source now needs `${prefix}_UNIT`. A command or script that sets only the seed, the path, and the property now fails when the property registers. ([#35](https://github.com/TanStack/oracles/pull/35)) + + A generated source now registers each part of a campaign as its own test, so a runner can shard a long campaign across jobs. For each fixed seed N, `oracleProperty` registers `fixed seed N: ` for each constructed history and `fixed seed N: generated` for the generated histories. The random campaign registers `random seed: ` and `random seed: generated` in the same way. The determinism test becomes one test per history: `determinism: fixed history: `, `determinism: constructed history: `, and `determinism: generated 0` to `2`. The units of a seed run exactly the histories that the campaign ran. Each unit decides its own first failure, shrinks within its own timeout, and prints its own reach line, ` reach {...}`. A campaign's reach is the sum of its units' lines. A unit that fails or times out prints no reach line. An enumerated source keeps its one `determinism` test. + + Test names change. A `-t "fixed seed"` filter still selects the fixed-seed units, and `-t "random seed"` the random units. A filter that names the old `determinism` test of a generated source now selects all its determinism units. The random units of a property share one seed, which the first random unit that runs selects and logs in the one `ORACLE_SEED` line. + + A path replay now names its unit in the new `${prefix}_UNIT` variable, such as `ORACLE_UNIT='random seed: generated'`. `UNIT` requires `PROPERTY`. During a path replay, only the random unit of that name runs. A path replay of a generated source without `UNIT` fails when the property registers, with "`ORACLE_PATH` of a generated source requires `ORACLE_UNIT`". A `UNIT` that names no random unit of the replayed property also fails its registration. A failing unit prints its replay command, with the seed, the path, the property, the unit, and its `-t` pattern, under the configured prefix. A failing fixed-seed unit also prints `Rerun: -t '...'`, which reruns it. The retired-variable message names `${prefix}_UNIT`. + + To migrate a recorded path, rebase it onto its unit. In the old campaign, the first index of a path selected the history: an index k below n, the number of constructed histories, was constructed history k, and an index k of n or more was generated history k − n. With `PATH=k:`: + + - for k < n, set `${prefix}_UNIT='random seed: '` and `${prefix}_PATH=0:`; + - for k ≥ n, set `${prefix}_UNIT='random seed: generated'` and `${prefix}_PATH=(k − n):`. + + A path recorded from a fixed-seed campaign replays the same way, with that fixed seed as `${prefix}_SEED`. A new failure prints its replay command, so only paths recorded before this change need rebasing. + + A generated source fails to load when two of its tests would share a name: a constructed history named `generated`, two constructed histories of one name, or two fixed histories of one name. + + In `@tanstack/eslint-plugin-oracles`, `oracle/no-disabled` reads `${envPrefix}_UNIT` as a shared replay variable, and reports a `process.env` read of any other variable that ends in `_UNIT` as a private replay variable, as it does for `_SEED`, `_PATH`, `_PROPERTY`, and `_RUNS`. + +- Ship agent skills and docs inside `@tanstack/oracles`. The package now includes `skills/` with five skills: `oracles-explore` (the entry point: it probes a repository, shows what an oracle can find, and builds the first oracle with the developer), `oracles-setup`, `oracles-design`, `oracles-review`, and `oracles-evaluate-review`. It also includes `docs/`: an introduction to oracles, the oracle checklist (version 1, ORC-001 to ORC-016), a glossary, a techniques guide, model-style examples, and six instrument cards. A coding agent reads them from `node_modules`. `@tanstack/eslint-plugin-oracles` gains a README that lists its configs and rules. ([#7](https://github.com/TanStack/oracles/pull/7)) diff --git a/packages/eslint-plugin-oracles/package.json b/packages/eslint-plugin-oracles/package.json index fd20450b..25b187c8 100644 --- a/packages/eslint-plugin-oracles/package.json +++ b/packages/eslint-plugin-oracles/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/eslint-plugin-oracles", - "version": "0.0.0", + "version": "0.0.1", "description": "ESLint rules for oracle tests: no disabled or unit-test oracles, pure models, replayable seeds, and the production probe form", "author": "Kyle Mathews", "license": "MIT", diff --git a/packages/oracles/CHANGELOG.md b/packages/oracles/CHANGELOG.md new file mode 100644 index 00000000..08edfa4b --- /dev/null +++ b/packages/oracles/CHANGELOG.md @@ -0,0 +1,185 @@ +# @tanstack/oracles + +## 0.0.1 + +### Patch Changes + +- Add the oracle framework core, extracted from TanStack DB: `oracleProperty`, the controlled clock, failure fidelity, and replay witnesses. `configureOracles({ envPrefix, registry, retiredVariables })` lets a project keep its own environment variable names and property registry. The main entry is ES modules only; `@tanstack/oracles/route` is a browser-safe entry for the route helpers (`oracleRoute`, `oracleRouteOf`, and `oracleFixedSeed`). The published sources no longer cite files that the package does not ship, such as the CLI's and the framework's own oracle tests. ([#1](https://github.com/TanStack/oracles/pull/1)) + +- Add the `oracle-gaps` CLI, which reports the gaps in a package's oracles. It runs operator mutants of the code that each oracle file owns (its `owns` lists) against only that file's tests, and classifies each surviving mutant: a comparison gap, a generator gap, no observed difference, or unowned code. A daemon (`--daemon`) reuses evidence across runs. `--env-prefix` names the project's oracle environment variables. ([#2](https://github.com/TanStack/oracles/pull/2)) + +- A calibration can now require the violation's difference as well as its law. Give it `difference`, a string that the violation's difference must contain, or a `RegExp` that it must match. The check must then reject the wrong answer for that reason. Before, a calibration could require only the law. An oracle that judged several faults under one law then had to put the fault in the law's name. The calibration test judges the law first. A corrupted trace that fails with another difference fails the calibration and names the difference that the check reported. A mutant driver goes on to the next candidate history, as it does for another law. A pattern matches anywhere in the difference, and a sticky (`y`) pattern matches only at its start. The empty difference holds `''` and `/(?:)/`, so such a requirement would reject any difference. It now fails the property's load. A check that gives a difference that is not text fails the calibration with an error that names the calibration and the law. A calibration without `difference` works as before. ([#32](https://github.com/TanStack/oracles/pull/32)) + +- Add direct `history` bindings for calibrations and `probeHistories` for automatic controls, so bound calibrations validate one selected premise instead of searching. Preserve fixed and enumerated history identity, including fixed declarations with unrelated `build` metadata, rebuild constructed histories from stable seeds, and resolve once per driver execution. Apply ordinary verdict ranking and optional difference requirements to bound mutants, validate clean declared reach, and retain selected-history error context. Retain search during migration with one warning per property outside collect-only runs, before search removal ahead of the first npm release. ([#31](https://github.com/TanStack/oracles/pull/31)) + + Dispatch selectors using their validated own key, so inherited selector tags cannot redirect a selected history or reject its source kind. + +- A campaign's generated histories no longer depend on its constructed histories, and each constructed history runs several bases from a stream of its own. The `generated` unit draws only from the property's arbitrary. Constructed history k builds from each of the first `bases` draws of the arbitrary's sample at the campaign's seed plus k, and every base must enter the states it names. The new `histories.bases` option sets that number. It must be a whole number of at least 1 (default 5), or the property fails to load. So appending a constructed history keeps every fixed seed's generated histories and every other constructed history's bases. Before, half of the generated unit's runs were constructed histories, weighted by how many there were, so appending one moved every run's draw, and each constructed unit ran one history. ([#122](https://github.com/TanStack/oracles/pull/122)) + + A costly property can keep few fixed bases and still vary its constructed histories from run to run with the new `histories.drawnBases` option (a whole number of at least 0, default 0). After its fixed bases, each constructed unit runs that many more, drawn from the run's random seed: the seed the random units run, which the `ORACLE_SEED` line logs. That line now comes from the first unit that uses the seed, which may be a fixed-seed constructed unit. A failure on a drawn base says which base it was, prints its full history as the counterexample, and prints a replay line with the run's seed, at which the random unit of the same name runs that base at the same index. + + This shifts each fixed seed once, for properties that have at least one constructed history. Their `generated` unit now runs other histories, and a seed-and-path replay line printed before this change for that unit no longer replays the same history. A constructed unit keeps its first base, and its first replay path index still selects it. Replay lines for properties without constructed histories stay valid: their `generated` unit already drew from the arbitrary alone. Each constructed unit now runs `bases` histories, so a campaign takes longer; set `bases` lower for a property whose constructed histories are slow. + +- The gap oracle's CLI resolves a mutant copy's bare imports from the test file the copy stands for, as that file's own run does. Before, a package whose config root lay above it (with its dependencies in its own node_modules) failed every copy with a setup error. ([#99](https://github.com/TanStack/oracles/pull/99)) + +- Fix stale results from the gap CLI's daemon (`--daemon`). A warm context now records every module that a batch of mutant runs loads, so the next check invalidates a module that changed. Before, only single runs recorded what they loaded. A hang can replace the context that recorded a module. Another context could then keep the old module after an edit. The daemon then reported results from before the edit, such as a kill that the cold run no longer finds. ([#37](https://github.com/TanStack/oracles/pull/37)) + + A stored run now also lists the modules that its copy evaluated. A module that only a mutated branch imports at run time is then one of its inputs. Before, an edit of such a module left the stored verdict in place. A run whose known inputs change while it runs is no longer stored. + +- An enumerated source can declare the states its laws depend on: `histories: { enumerated, states, measured }`, where `enumerated` is the list a plain enumerated source passes, and `states` and `measured` are state names. Every enumerated history runs, so a required state needs no constructed history. A `reach` test after the histories fails when no enumerated history entered a state in `states`, and otherwise prints how many entered each declared state, as ` enumerated reach {...}`. A history counts once it is judged, passing or violating its law. The reach test reuses what each history's test recorded. It runs again only a history whose test never started, such as one that a `-t` filter left out. A history whose test failed before a verdict or timed out counts for nothing. A judged history that enters a state outside `states` and `measured` fails its test. An enumerated source fails to load when it holds a key other than `enumerated`, `states`, and `measured`, or a state that is not a name; only a generated source binds a probe to a state. A plain list of histories registers no `reach` test. Any enumerated source now fails to load when its `label` names a history `reach` or `determinism`, because the rerun command for that history would also select the framework test of that name. ([#19](https://github.com/TanStack/oracles/pull/19)) + +- `oracleProperty` checks, when it registers a generated source, that its arbitrary can take back (`canShrinkWithoutContext`) each fixed history and each constructed history built from the first fixed seed (or seed 0 when there is none). If it cannot, the property fails to load with an error that names the property, the history (a fixed history's index and name, or a constructed history's name), and the fix. Before, the check ran only when the history's test ran, after the campaigns, and its message blamed the language. In fast-check 4, a `.map` without an unmapper takes no value back, at the whole history or anywhere inside it, so a history inside the language failed too. Give that `.map` an unmapper (its second argument). `fc.constant` and `fc.constantFrom` take back only primitives or the same object reference, so build objects with `fc.record` or `fc.tuple` over primitive leaves. `.chain`, `fc.func`, and `fc.commands` cannot take a value back. ([#15](https://github.com/TanStack/oracles/pull/15)) + + The check runs when the test file loads. One history that the arbitrary cannot take back now fails the load of the whole file, so it also blocks the file's other properties. Constructed histories are now built at import: a `build` that throws there fails the load with an error that names the property and the constructed history, with the build's error as its `cause`. + +- The `oracle-gaps` report leads with the baseline, and a failing oracle file no longer stops the run. ([#41](https://github.com/TanStack/oracles/pull/41)) + + - An oracle file that fails with no mutant active (a RED law, or a file that cannot load or launch) blocks only the mutants it owns. A mutant it owns that no passing owner kills is a new `blocked` gap, which names the failing file. The other mutants are judged, and the report says it is provisional. Before, the run refused with exit 2. A setup file that throws now blocks every owned mutant in the same way. + - A `blocked` line names each failing oracle file and its failing test, and says to make it pass and check again. + - With `--only`, the baseline runs only the owners of the selected mutants, so another file's failure no longer blocks the run. + - stdout and `summary.md` start with the baseline: each test file's result with its test counts, ordinary test files included, and for a failing file its failing test, its error, the law, difference, and counterexample of a law violation, and its replay command. Ordinary test files now run once in the baseline; they run against mutants only with `--ordinary`. `results.json` gains `provisional` and `baseline`. + - The legend says that a `crashed` gap is a gap, not a kill, and that its error is on the gap's Detail line in `summary.md` and in its `detail` in `results.json`. + - The last stdout line says that the check completed, with its gap count and its report (`oracle-gaps: done completed, gaps, report `). Exit codes do not change: 0 means the check completed, whatever its gaps. + +- A failing law no longer blocks the gap report for its whole file. In `oracle-gaps`, a test of an oracle file that fails with no mutant active judges nothing: it is left out per test, as a nondeterministic test is, and the passing tests of its file still judge the mutants the file owns. A failing law still runs in every copy of its file: its calls count toward the copy's call budget, its I/O and timers toward idle, and it keeps its reach, but its verdicts judge nothing and it is never charged extra work. A count cut that a failing law causes blocks the mutant by that law. A test of a `describe` whose `beforeAll` or `afterAll` throws is a failing law too. An owner file that fails outside its tests (it does not load, or a file-level hook throws) judges nothing, and another owner file's passing tests still judge the mutants they share. A mutant that no deterministic passing owner test reached is `blocked` by its owners' failing laws that reached it, and by owner files that judge nothing; its directive names them. The baseline prints one `oracle-gaps: blocked` line per failing law, named by its file and test names (or one per broken file), `results.json` lists each failing file's `laws`, and the report stays provisional. ([#176](https://github.com/TanStack/oracles/pull/176)) + +- Without `--config`, the `oracle-gaps` CLI now loads the Vitest config that Vitest itself would load for the package: the first of Vitest's config names in the package's directory, or else in the nearest parent directory that has one. Before, it looked only in the package's directory and ran Vitest's defaults when the config was in a parent. The baseline's replay command then ran under the parent's config, which Vitest found, and could find no test. A parent's config that defines `test.projects` now refuses the run, as the package's own does. ([#42](https://github.com/TanStack/oracles/pull/42)) + +- The `oracle-gaps` CLI takes `--config `, relative to `--package`, to select the package's Vitest config. Without it, the run loads the config that Vitest discovers, as before. The baseline output now starts with `config: `, or `no config file: Vitest's default discovery`. A `--config` that names no file of the package refuses the run. A run names its config once its contexts have loaded it, also when the analysis or the baseline then refuses the run. A failing owner's `replay:` command names the `--config` file too, so it runs the failing test under the same config, even when Vitest would discover another one. ([#26](https://github.com/TanStack/oracles/pull/26)) + + The runner's wrapper config now has the module format that Vite gives the package's own config, so Vite bundles that config as Vitest loads it. An `.mjs` or `.mts` config, or a `.js` or `.ts` config in a package with `"type": "module"`, gets an `.mts` wrapper, where a top-level `await` works. A `.cjs` or `.cts` config, or a `.js` or `.ts` config in a package without that type, gets a `.cts` wrapper, where `require` and `require.resolve` work. Before, every wrapper was a `.ts` file. In a package without `"type": "module"`, Vite bundled such a wrapper as CommonJS, so an `.mjs` config with a top-level `await` refused the run, and older Vite versions printed their CommonJS deprecation warning. + + A run with more than ten warm contexts (`--contexts`, which defaults to up to 16) no longer prints `MaxListenersExceededWarning`. Each context is a Vitest instance that listens on the process until it closes; the runner now raises the process's listener limit by one for each open context and lowers it when the context closes. + +- A mutant's copy of a test file now draws from `Math.random`, `crypto.getRandomValues`, and `crypto.randomUUID` what the original file draws. The `oracle-gaps` capture seeds these sources per test, by the test's key. It took the key from the copy's path, which names its batch, while the unmutated runs run the original file. A test that observes a draw therefore read as changed under a mutant that changed nothing. An `oracleProperty` campaign with no `--seed` draws its seed from `Math.random`, so its random units ran other histories under every mutant. A run with no `--seed` reported such mutants as `not-judged`, and its classes now match a seeded run's. ([#54](https://github.com/TanStack/oracles/pull/54)) + +- A check through `--daemon` now reruns a test after an edit to a file in the package that the test reads through `fs` (`readFileSync`, `readFile`, `existsSync`, `statSync`, or `fs/promises` `readFile` or `stat`), such as a JSON fixture or a snapshot. Before, the daemon reused the run that read the old file, while a cold run saw the edit. A directory that a test stats is an input as a directory. Reads outside the package, under `node_modules`, through other APIs, or from a test's own worker threads or child processes are no inputs. ([#55](https://github.com/TanStack/oracles/pull/55)) + + The daemon also stores each run under the text that the run read. Before, it stored a run under each input's text at the end of the run, so a module or file that changed during the run that read it (a test that rewrites a fixture it read, or a helper edited mid-check) kept the old verdict for the new text, and the next check through the daemon reported that stale verdict. A run whose input changed after it read it is now run again. + + A test that reads a source under test through `fs` (or as a `?raw` import) no longer makes each check through the daemon run its tests again. The test's read of the file and the instrumented module that the runner serves from it are now two inputs, each hashed by its own text. + +- The `oracle-gaps` report no longer reports a shortcut for speed as `not-observed`. A survivor that changed no observation but made a test do more work is now `extra-work`. Before, its directive said to observe a value or widen the oracle, which cannot work for a branch whose fast and general paths give the same result, and an author who removed the code instead made it slower. Work is the number of site evaluations that the test's instrumented production code makes, a deterministic count, never a time. The `extra-work` directive names the test, its work before and after, and the bound to declare. `oracleProperty` takes a new `work: { ratio }` option. Under the gap report, a mutant whose work in one of the property's tests is more than `ratio` times the unmodified code's work is killed under the law `work bound`. `ratio` must be a finite number of at least 1. A plain Vitest run has no unmodified run to compare with, so there the bound judges nothing. ([#48](https://github.com/TanStack/oracles/pull/48)) + +- Every line the `oracle-gaps` CLI writes for a check now starts with `oracle-gaps: ` and its kind, on stdout and stderr alike, cold and through `--daemon`, so an agent can act on the results as they stream with `grep '^oracle-gaps: '` and filter one kind by the word after the prefix: ([#46](https://github.com/TanStack/oracles/pull/46)) + + - `oracle-gaps: config `, or `oracle-gaps: config none, Vitest's default discovery` + - `oracle-gaps: baseline pass : tests` and `oracle-gaps: baseline fail : …`, with the failing test, law, counterexample, and replay indented under it + - one decisive line before any mutant runs: `oracle-gaps: baseline all oracle files pass`, or `oracle-gaps: baseline of oracle files failed (provisional)` + - `oracle-gaps: blocked …` for each failing oracle file + - `oracle-gaps: gap L `, streamed and in the stdout summary + - `oracle-gaps: progress …`, `oracle-gaps: busy in for s`, and `oracle-gaps: note …` (Vite's own messages as `note vite: …`) + - the stdout summary as lines too: `oracle-gaps: summary …` for the totals, `oracle-gaps: legend : …` for each directive, and `oracle-gaps: function …` for each function's heading over its gap lines + - a last line for every run: `oracle-gaps: done completed, gaps, report ` (with `(provisional)` after the count when an oracle file failed), `oracle-gaps: done refused[, report ]` after a refusal's `refused:` and `fix:` block, `oracle-gaps: done error, log `, or `oracle-gaps: done stopped ()` + + The done line is the last line of both stdout and stderr, once each, and its status matches the exit code. Only the lines indented under a failing baseline file and a refusal's `refused:` and `fix:` block have no prefix, and no line is blank. A test's own writes to the process's stdout and stderr go to `test-output.log` in the output directory, which a note names. The stdout summary's `output: `, `Full report:`, and `completed: gaps` lines are replaced by the done line, and the refusal's `output: ` line by `oracle-gaps: done refused, report `. Exit codes do not change. + + The wrapper config now reads the package's config as Vite does: it awaits a promise default and refuses a default that is not an object. A config with a syntax error is refused with its first error, before Vite bundles it. + +- The `oracle-gaps` CLI's internal error now prints one prefixed line, `oracle-gaps: error : a bug in oracle-gaps, not in your oracle; its stack is in `, before its `oracle-gaps: done error, log ` line. Before, its two message lines had no `oracle-gaps:` prefix. A line break in the message prints as an escape, so the message stays on one line. The stack stays in `error.log`, and the exit code stays 3. ([#128](https://github.com/TanStack/oracles/pull/128)) + + A path that a stream line names, such as the output directory in a done line or a note, now prints a line break or another control character as its `\uXXXX` escape, so a directory name cannot split the line. + +- The `oracle-gaps` CLI no longer ends a run with a bare stack trace. A problem in the author's own files or arguments (bad arguments, a `--source` that is missing or not a file, a broken `owns` declaration, no oracle file or no owner, a Vitest config that throws when it loads, has no default export, or defines `test.projects`, a Vitest that does not load, a setup file that throws, an oracle file that fails with no mutant active, an authored mutant file that is not JSON or is incomplete) refuses the run: it exits 2 and prints `refused: ` and `fix: `. When the output directory is known (even from `--out` alone, when other arguments are bad), the refusal is also written there as `results.json` (`{ "status": "refused", "cause", "directive" }`) and `summary.md`, replacing an earlier run's ending there, and the CLI's last line names that report (`oracle-gaps: done refused, report `). Any other error is a bug in the CLI: it exits 3, says so, and writes its stack to `error.log` in the output directory (or the system's temporary directory when none is known), with `results.json` status `internal-error`. A check through `--daemon` ends the same way. A daemon serves only a CLI of its own code, so a second install of the CLI starts its own daemon rather than reading another version's reply. ([#14](https://github.com/TanStack/oracles/pull/14)) + + Exit code 1 is no longer used: scripts that treated any non-zero exit as a failure keep working, and scripts that matched exit 1 must match 2 or 3. Arguments are now checked: an unknown option, an option with no value, a `--package` or `--mutants` directory that does not exist, a `--seed` that is not an integer, a count or limit that is not a positive whole number, and a `--pool` other than `threads` or `forks` each refuse the run instead of being ignored or failing later. + +- Fix the `oracle-gaps` CLI crashing on a package whose TypeScript has no compiler API, as TypeScript 7's package has (it exposes only its version). The CLI now analyzes with its own TypeScript 5 dependency and never reads the package's TypeScript, so a package with no TypeScript, or with TypeScript 7, is analyzed instead of refused or crashed. The optional `typescript` peer dependency is removed for that reason. A copy of the CLI's own TypeScript without the compiler API is refused before any work, with a message that names the fix. ([#5](https://github.com/TanStack/oracles/pull/5)) + +- The `oracle-gaps` work count no longer includes probe code. A site in probe-only code (the probe guard, a probe statement, or a probe helper) counts nothing toward a test's work, so a work bound no longer kills a mutant whose only extra work is a probe, such as an `if` forced into a branch that only calls `report()`. ([#121](https://github.com/TanStack/oracles/pull/121)) + +- The `oracle-gaps` CLI bounds a mutant's copies by counts, not by wall-clock limits, reports long runs, stops the processes it started, and writes nothing beside the tests. ([#40](https://github.com/TanStack/oracles/pull/40)) + + - No wall-clock limit decides an outcome. A copy that spins past its call budget, makes no progress, or whose work passes the mutant's work budget (the larger of 100,000 and ten times its owner files' unmutated work, counted in site evaluations, not in time) is killed by the built-in law `bounded work` or `no progress` on its test's route. A copy's call budget is a hundred times the most site evaluations that any unmutated test of its file made, and at least 100,000. A spin or a work-budget overrun kills only when the counts that decide it cannot follow the clock: a test that reads the clock, makes a timer, or does I/O of its own anywhere in its run is charged nothing, and its spin is a `timeout` named `(cause: spin)`. A copy makes no progress when none of its test's own timers is due before its backstop and none of its test's own I/O is pending; timers and I/O the runner keeps for itself, such as Vitest's task-update timer or a pending write that forwards the test's console output on Windows, do not keep it busy. Only the backstop (`--hang-limit`, 60 s by default, plus 3 s per second of the file's time) is a gap: the mutant is a `timeout`, named `(cause: backstop)` on its gap line, and no later copy runs. `--mutant-limit` and `--first-limit` are retired: they are checked and noted, and change nothing. + - While one copy of a test file runs for 30 s or more, the CLI prints `busy: in for s` every 30 s (`baseline` for a run with no mutant). Through `--daemon` the heartbeats arrive when the check ends. + - The check runs in a process group of its own, with every Vitest worker and every process a test starts, except one started detached in a session of its own. On SIGINT or SIGTERM the CLI signals the group, kills what is left 2 s later, and exits 130 or 143. Before, a SIGTERM left `forks` workers running. On Windows the run is not supervised. + - The runner's copies of the test files exist only in memory. Vitest's read of a copy for its per-file pragmas (`@vitest-environment`, `@module-tag`) is served its text, so a copy runs in its file's environment. The capture setup and Vitest configs are in a session directory of its own while it runs, which the run removes when it ends; one that a killed run left is removed by the next run. Before, the copies and configs sat beside the tests and the package's config, where a Vitest run started during a check found them and then failed when they were removed. + +- The `oracle-gaps` daemon keeps its evidence in a SQLite database instead of one JSON file, so a package with a large oracle file no longer fails every check with "Invalid string length" after two checks. The store prunes units no check has used for two weeks, returns the pages that replaced and pruned units freed, is written again when the OS cleans its directory while the daemon runs, starts over when its file is overwritten or corrupted while the daemon holds it (a check whose evidence cannot be written still reports its result), and keeps a unit it reuses from memory. The earlier `evidence.json` is removed when found. The static analysis keeps its ownership between checks while the production sources, the dependencies' declaration files, `owns` declarations, manifest, and lockfile are unchanged, so a daemon recheck after an edit to a test file skips the type-checker walk. With `ORACLE_GAPS_PROFILE`, each copy in a batch writes its own span. ([#314](https://github.com/TanStack/oracles/pull/314)) + +- A run of the `oracle-gaps` CLI that a stop ends, or whose check's process aborts, now removes its `/.oracle-gaps-/` session directory. Before, it left the directory for the next run to remove, and a run stopped as or before it started removed nothing, so the directory stayed in the package. Only a run whose own process is killed leaves it now, and the next run removes it. ([#164](https://github.com/TanStack/oracles/pull/164)) + +- The `oracle-gaps` CLI now writes the lines it streams on stderr to `stream.log` in the output directory too, in order, cold and through `--daemon`, and the first line of a check on both streams names that file: `oracle-gaps: note log /stream.log`. An agent that starts a cold check in the background can read the run's progress and its done line there while it runs. A check through `--daemon` prints its lines at the end of its check, so its progress is readable there only after it ends. ([#57](https://github.com/TanStack/oracles/pull/57)) + + A run takes its output directory's claim in `run.pid` before it starts, and a second run on a live directory refuses without writing into it. A `run.pid` that names no running process (stale), that is empty, or that cannot be read (a directory, or a link to no file) also refuses the run, without writing into the directory, and the refusal's fix line tells you to delete `/run.pid` if no run uses that directory. The CLI never takes over another run's claim. A refusal of a run with no `--out` is written to the default output directory the run would have used. On Linux and macOS the run's supervisor needs no external command: a container without `ps`, or with BusyBox's `ps`, runs the check as any other system does. + +- The `oracle-gaps` CLI keeps its working files out of the repository. The daemon's state (its lock, log, and evidence), the one-file bundles of workspace dependencies, and the default output directory now live in the OS temp directory, in a directory keyed by the package (`oracle-gaps-`, never a shared directory), which the OS cleans. A state that the OS removed is a cold start. `--out` is honored as before, and the run still prints its output path. While a run runs, its capture setup and Vitest configs are in `/.oracle-gaps-/`, which it removes when it ends; one that a killed run left is removed by the next run. A run leaves nothing in the package, so there is nothing to add to `.gitignore` or to delete. Before, every run wrote `/.oracle-gaps/` and `/.oracle-gaps/bundle-*.mjs`. ([#43](https://github.com/TanStack/oracles/pull/43)) + +- The `oracle-gaps` CLI's TypeScript is now the npm alias dependency `typescript-for-tanstack-oracles` (`npm:typescript@^5.9.2`), and the CLI resolves it by that name. Before, the plain `typescript` dependency was hoisted by npm to an adopter's root. A project without TypeScript got a `typescript` package, and a project with its own TypeScript range could have that range deduped up to 5.9. Now neither happens. npm still links the alias's `tsc` and `tsserver` into `node_modules/.bin` in a project without TypeScript. After an incremental `npm install` of this package into a project with TypeScript, `.bin/tsc` points at the alias until a clean install (`npm ci`, or removing `node_modules`); a later plain `npm install` does not repair it. That is still strictly better than before, when the same incremental install raised the project's root `typescript` itself, for example from 5.4.5 to 5.9.3. On a clean install, the project's own `typescript` provides `tsc`. pnpm links only direct dependencies' commands, so it is not affected. ([#18](https://github.com/TanStack/oracles/pull/18)) + +- `oracle-gaps --diff-base ` now judges only the mutants on lines changed since ``, for fast feedback after a change. Operator and authored mutants both count, and a mutant is on a changed line when any line from its first to its last is changed. Every line of a source file that git does not track is changed. The baseline still runs every test file that the run without the option runs, and each judged mutant gets the outcome it gets in the full run. An authored mutant that does not apply is reported on every run with the option, as it is without it. The run says so on its stream before the baseline, `oracle-gaps: note --diff-base : of mutants are on changed lines; the others are not judged in this run`, and in the same sentence in `summary.md`; `` counts the run without the option, with the same `--only` or `--sample`. Its `results.json` and `summary.md` inputs say `a partial run (--only, --sample, or --diff-base)`, as an `--only` or `--sample` run's do (their text used to read `(--only or --sample)`). Authored mutants are marked `inDiff` too. ([#290](https://github.com/TanStack/oracles/pull/290)) + + `oracle-gaps --diff-base ` refuses a revision that names no commit of the git repository that holds the package: a name git does not know, a range, a blob, an option such as `--cached`, an empty value, or a package in no repository. It exits 2 with `refused: --diff-base "" names no commit of the git repository that holds the package` and a `fix:` line, before any test runs. Before, the run went on and marked every mutant `inDiff: false`. `results.json` records the commit as `options.diffBase: { rev, commit }` (it was the revision as given), so the run identity follows the commit and not the name. + + Before, `--diff-base` only added `inDiff` to each operator mutant in `results.json`, and every mutant still ran. Run a full check without `--diff-base` to judge the other lines. + +- The `oracle-gaps` report gives each gap a class and one directive with a concrete next step. A message never offers an exit such as an equivalent mutant or a maintainer approval. Survivors are `not-judged`, `indeterminate`, `dead-code`, `branch-never-taken`, `not-infected`, or `not-observed`. A `crashed` gap names the error that production threw, and tells the author to record it as an observation and state the law. Standard output is short. It has the totals, one legend line for each class, and gaps grouped by function. It also has the unowned warnings counted for each function, and the paths of `summary.md` and `results.json`. The full report is in `summary.md`. The CLI also streams its progress: the baseline result first, then one line for each gap when the CLI judges it, then the summary. ([#12](https://github.com/TanStack/oracles/pull/12)) + +- Fix four parts of the `oracle-gaps` output. ([#20](https://github.com/TanStack/oracles/pull/20)) + + - The baseline's replay command now runs the failing test. Before, its `-t` pattern was the test's `>`-joined name in JSON quotes: Vitest 4 matches `-t` against names joined by a space, so a test in a `describe` ran nothing, and a name with regular-expression syntax, `$`, or a backtick broke the pattern or the shell. The pattern is now the suites' and the test's names, escaped, joined to match Vitest 4 and Vitest 5, anchored, and in single quotes. A file that fails with no failing test (it did not load) replays whole, with no `-t`, where before it printed `-t undefined`. A control character in a test's name or failure, such as a newline, prints as its `\uXXXX` escape, in the baseline and in messages, so each stays one line. + - A gap line stays one line: the code of an operator mutant and the intent of an authored mutant have their whitespace collapsed and are cut at 60 characters with `...`, counted by code point so that a cut never splits an emoji. An authored intent prints as a code span. `results.json` keeps the full text. + - A `not-infected` message prints each operand as a code span of a typed value: strings quoted, `-0` as `-0`, bigints with `n`, and `undefined`, `null`, `NaN`, and a value that is not a primitive kept apart. A string longer than 40 characters (code points) prints its first 37 and a digest. Before, `1` and `"1"`, `0` and `-0`, and two long strings with one prefix printed alike. + - A `not-observed` directive also tells the author to add a history where the mutated code computes something different, because the run cannot tell a value nothing observed from a forced branch that computed the original's result. + +- The tests and files that an `oracle-gaps` report names no longer depend on how the run was made. They are now in report order: by file path, compared by code unit, and within a file in the order of the baseline run's records. This applies to a message's test, the `Owners` and `Changed observations in` lists, the operands of a `not-infected` message, the tests of an `indeterminate` message, the files that a refusal names or that the report leaves out (`excluded`), and results.json's `nondeterministic` tests. Kill, crash, and framework-error messages also order files by path. Within a file, they use the order in which the reporter lists the file's tests. A batch that a hang cut off uses the order of the mutant run's records. An operator mutant's owner files also run in path order, so a kill names the laws of the first file that kills. ([#30](https://github.com/TanStack/oracles/pull/30)) + + Before, these lists followed the order in which the runner joined its contexts' units. So `--contexts`, whose default depends on the machine's cores, could change which test a message named. An authored mutant's lists followed the order in which its owners were declared. + +- 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. ([#3](https://github.com/TanStack/oracles/pull/3)) + +- Publish the first release of the oracle testing framework, the bundled ([#342](https://github.com/TanStack/oracles/pull/342)) + `oracle-gaps` CLI and skills, and the ESLint plugin for oracle tests. + +- The gap report's per-law table is now titled "First law to reject, by law". It says that each count credits only the first law that rejected a history, because a check returns its first violation and a later law on the same history is not checked. A law with no count is not shown to reject nothing. The section's next step tells the author to add a history that varies the input the law judges. ([#22](https://github.com/TanStack/oracles/pull/22)) + +- Change how `oracle-gaps` ends a run whose ending is interrupted. A stop that the supervisor has received ends the run stopped, even when the run's refusal had begun, with one `done stopped` line on each stream and exit 128 plus the signal. A child that dies before its ending is written ends the run with one `done error` line and exit 3, instead of an internal error or no line. A child whose supervisor is killed while it awaits the supervisor's answer is ended by its process group's kill, with no done line, as a supervised child is when its supervisor is killed. ([#307](https://github.com/TanStack/oracles/pull/307)) + +- The `oracle-gaps` CLI judges the mutants of a package whose Vitest config sets `test.root`. Before, the CLI resolved each in-memory copy of a test file to its path, so Vite named the copy from its root and imported it again by that name. Under a test root other than the package, that name (`/.oracle-gaps-…`) matched no copy, the copy failed to load, and the mutants of an owner there reported `setup-error`. The CLI now leaves a copy unresolved: Vite keeps the absolute path that Vitest imports it by, and the CLI serves the copy from that path. This works for a test root inside the package, above it, a root that holds no test file, and a root that is a symbolic link. ([#103](https://github.com/TanStack/oracles/pull/103)) + +- `oracleProperty` infers a history from a literal with `const`, so a zero-argument `constructed[].build` that returns a literal compiles, and an annotated `model` without `resolve` keeps its annotated type, as on main. `constructed[].build` may return the read-only view of a history, `ReadonlyHistory`, which is a new public type export. ([#195](https://github.com/TanStack/oracles/pull/195)) + + **Breaking (types only, accepted by the maintainers on 2026-11-23).** A history that a literal infers is read-only: its arrays are read-only tuples. Code that needs a mutable array type no longer accepts it, in five cases: + + 1. **Mutating it.** `model: (plan) => { plan.items.push(2) }` on an `enumerated` literal fails. Migrate by copying the array first: `const items: Array = [...plan.items]`, then mutate `items`. + 2. **Passing it to a mutable-array parameter.** `takesMutable(plan.items)`, where the parameter is `Array`, fails. Migrate with a copy: `takesMutable([...plan.items])`. + 3. **A discriminated-union branch.** Each branch keeps its own read-only array, so case 2 applies inside `if (plan.kind === 'a')`. Migrate the same way, inside the branch. + 4. **A generic constrained to a mutable array** (`T extends Array`). Migrate by passing a copy: `firstOf([...plan.items])`. + 5. **The new `ReadonlyHistory` export.** Code that names it receives the read-only view of a history. + + Generic functions without an array constraint (`identity(plan.items)`) keep the read-only type. Histories from `arbitrary` and `fixed` are unchanged. + +- `oracleProperty` takes an `owns` list: the production files or functions (`src/x.ts`, `src/x.ts#fn`) whose static call tree the oracle owns. The `oracle-gaps` CLI reads `owns` from an object-literal argument of any call in a test file, so a wrapper that forwards `owns` to `oracleProperty` (`registerX('id', { owns: [...] })`) names it at its call. A test file that calls `oracleProperty`, or passes such a list, is an oracle file, and it owns the union of its lists. Every test file is read, because a file that never calls `oracleProperty` still owns code when it passes `owns` to a wrapper that it imports. An `owns` key inside an assertion's arguments is data, so it is not read: an `expect` chain (including `.not`, `.soft`, a computed matcher, and an aliased `expect`), `assert` and its members, `chai`, `expectTypeOf`, `assertType`, and every binding imported from Node's `assert` (named, default, or namespace). An `owns` key in an object literal passed to any other call is read, so an unrelated domain object with that key makes the file an oracle file. A local function named like an assertion, such as `function assert() {}`, is skipped too. Each list must be a literal array of string or plain template literals. It refuses a run that has no oracle file, or in which no file owns a selected source, with one diagnostic. Before, such a run reported zero gaps without judging anything. `law.owner` is removed. Each run writes its output to a directory of its own by default, not to a shared `/tmp/oracle-gaps`. ([#11](https://github.com/TanStack/oracles/pull/11)) + +- Add initial documentation outlines and agent-first onboarding with npm releases. Update the READMEs with a shared exploration prompt. ([#344](https://github.com/TanStack/oracles/pull/344)) + +- The gap report owns the functions of a module-level object literal when the literal is read dynamically (`handlers[key]()`), passed as a whole value, spread, or read with `Object.values`. A static read (`handlers.a()`) owns only that member, and an `owns` entry that names the literal owns none of its methods. Module functions that the literal names by shorthand (`{ helper }`) are owned whenever the literal is reached, as `{ helper: helper }` already is. A property name in an object literal no longer counts as a reference, so a static read or an `owns` entry on the literal no longer owns its arrow-function properties beyond the member read. ([#197](https://github.com/TanStack/oracles/pull/197)) + +- Scope a gap mutant's anchor to the innermost statement or declaration that holds it. A mutant in a default parameter, a property declaration, an enum member, a decorator, a heritage clause, or a computed member name of a class member, an object method, or an object accessor used to anchor to the whole file, so its gap key changed on every edit to that file. It now anchors to that declaration. A computed name on an object-literal property still anchors to its statement, as before. ([#196](https://github.com/TanStack/oracles/pull/196)) + + This changes gap keys once, and stored gaps for the changed keys should be re-baselined. Gaps recorded under the old keys show as new once. Measured on the 17 non-test gap-CLI sources as this branch ships them (base origin/main at fbb99aad, 7,269 mutants), 17 keys change in 5 files: 11 were whole-file anchors. One mutant in `classify.mjs`, a `value-undefined` on a default parameter inside a `const` statement, moved from its statement's anchor to its parameter. Five keys in `classify.mjs` (the `~2` to `~5` suffixes of one anchor) changed only their index, so a stored key for one of them now names a different mutant. The maintainers accepted these key changes ("slight change to gap keys is fine", 2026-11-23). + + Shipped bytes: the two shipped CLI files change by +469 bytes raw and +134 bytes gzip (`schemata.mjs` +454 raw, `report.mjs` +15 raw; the test file is not shipped). + +- **Breaking for consumers.** Test names of generated sources change, and a path replay of a generated source now needs `${prefix}_UNIT`. A command or script that sets only the seed, the path, and the property now fails when the property registers. ([#35](https://github.com/TanStack/oracles/pull/35)) + + A generated source now registers each part of a campaign as its own test, so a runner can shard a long campaign across jobs. For each fixed seed N, `oracleProperty` registers `fixed seed N: ` for each constructed history and `fixed seed N: generated` for the generated histories. The random campaign registers `random seed: ` and `random seed: generated` in the same way. The determinism test becomes one test per history: `determinism: fixed history: `, `determinism: constructed history: `, and `determinism: generated 0` to `2`. The units of a seed run exactly the histories that the campaign ran. Each unit decides its own first failure, shrinks within its own timeout, and prints its own reach line, ` reach {...}`. A campaign's reach is the sum of its units' lines. A unit that fails or times out prints no reach line. An enumerated source keeps its one `determinism` test. + + Test names change. A `-t "fixed seed"` filter still selects the fixed-seed units, and `-t "random seed"` the random units. A filter that names the old `determinism` test of a generated source now selects all its determinism units. The random units of a property share one seed, which the first random unit that runs selects and logs in the one `ORACLE_SEED` line. + + A path replay now names its unit in the new `${prefix}_UNIT` variable, such as `ORACLE_UNIT='random seed: generated'`. `UNIT` requires `PROPERTY`. During a path replay, only the random unit of that name runs. A path replay of a generated source without `UNIT` fails when the property registers, with "`ORACLE_PATH` of a generated source requires `ORACLE_UNIT`". A `UNIT` that names no random unit of the replayed property also fails its registration. A failing unit prints its replay command, with the seed, the path, the property, the unit, and its `-t` pattern, under the configured prefix. A failing fixed-seed unit also prints `Rerun: -t '...'`, which reruns it. The retired-variable message names `${prefix}_UNIT`. + + To migrate a recorded path, rebase it onto its unit. In the old campaign, the first index of a path selected the history: an index k below n, the number of constructed histories, was constructed history k, and an index k of n or more was generated history k − n. With `PATH=k:`: + + - for k < n, set `${prefix}_UNIT='random seed: '` and `${prefix}_PATH=0:`; + - for k ≥ n, set `${prefix}_UNIT='random seed: generated'` and `${prefix}_PATH=(k − n):`. + + A path recorded from a fixed-seed campaign replays the same way, with that fixed seed as `${prefix}_SEED`. A new failure prints its replay command, so only paths recorded before this change need rebasing. + + A generated source fails to load when two of its tests would share a name: a constructed history named `generated`, two constructed histories of one name, or two fixed histories of one name. + + In `@tanstack/eslint-plugin-oracles`, `oracle/no-disabled` reads `${envPrefix}_UNIT` as a shared replay variable, and reports a `process.env` read of any other variable that ends in `_UNIT` as a private replay variable, as it does for `_SEED`, `_PATH`, `_PROPERTY`, and `_RUNS`. + +- Ship agent skills and docs inside `@tanstack/oracles`. The package now includes `skills/` with five skills: `oracles-explore` (the entry point: it probes a repository, shows what an oracle can find, and builds the first oracle with the developer), `oracles-setup`, `oracles-design`, `oracles-review`, and `oracles-evaluate-review`. It also includes `docs/`: an introduction to oracles, the oracle checklist (version 1, ORC-001 to ORC-016), a glossary, a techniques guide, model-style examples, and six instrument cards. A coding agent reads them from `node_modules`. `@tanstack/eslint-plugin-oracles` gains a README that lists its configs and rules. ([#7](https://github.com/TanStack/oracles/pull/7)) + +- A failing campaign now reports its law violation before its test times out, however slow its histories are. Before, fast-check shrank a failure without a limit. A slow property could then outlast its `timeout`, and Vitest reported only "Test timed out", with no law and no counterexample. Now a campaign starts no shrink run once half of the property's `timeout` has passed. It then reports the smallest counterexample that it found, with the first failure's law, and that counterexample replays. A counterexample that the limit stopped can be larger than the smallest that fails. To shrink further, raise `timeout`. A `timeout` of 0 or less means no timeout, as Vitest reads it, so it sets no limit. The limit is real time, so a seed-only rerun on another machine can report another counterexample under the same law. A path replay now runs its counterexample and does not shrink it again, so it reports the counterexample that it replays. A property whose runs each take less than half its `timeout` no longer needs `fc.limitShrink` to report its law in time. ([#29](https://github.com/TanStack/oracles/pull/29)) diff --git a/packages/oracles/package.json b/packages/oracles/package.json index c6025f58..748acd08 100644 --- a/packages/oracles/package.json +++ b/packages/oracles/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/oracles", - "version": "0.0.0", + "version": "0.0.1", "description": "Oracle-based testing: laws, generated histories, independent models, and gap reports", "author": "Kyle Mathews", "license": "MIT", From 607c7f71ce3223ae942fcf70fb842f3f98bdec99 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 3 Dec 2026 18:40:30 +0000 Subject: [PATCH 2/2] ci: Version Packages --- .changeset/add-eslint-plugin-oracles.md | 11 -- .changeset/add-oracle-framework-core.md | 5 - .changeset/add-oracle-gaps-cli.md | 5 - .changeset/calibration-difference.md | 5 - .changeset/calibration-history-bindings.md | 7 - .changeset/constructed-stream-independent.md | 9 - .changeset/copy-resolves-from-its-file.md | 5 - .changeset/daemon-replaced-context.md | 7 - .changeset/enumerated-declared-states.md | 5 - .changeset/fixed-history-take-back.md | 7 - .changeset/gap-cli-baseline-report.md | 12 -- .changeset/gap-cli-block-per-law.md | 5 - .changeset/gap-cli-config-find-up.md | 5 - .changeset/gap-cli-config.md | 9 - .changeset/gap-cli-copy-randomness.md | 5 - .changeset/gap-cli-daemon-fs-inputs.md | 9 - .changeset/gap-cli-extra-work.md | 5 - .changeset/gap-cli-greppable-lines.md | 18 -- .changeset/gap-cli-internal-error-prefix.md | 7 - .changeset/gap-cli-never-crash.md | 7 - .changeset/gap-cli-own-typescript.md | 5 - .changeset/gap-cli-probe-not-work.md | 5 - .changeset/gap-cli-runtime.md | 10 - .changeset/gap-cli-sqlite-evidence-store.md | 5 - .changeset/gap-cli-stopped-session-dir.md | 5 - .changeset/gap-cli-stream-log.md | 7 - .changeset/gap-cli-temp-state.md | 5 - .changeset/gap-cli-typescript-alias.md | 5 - .changeset/gap-diff-base-limits-run.md | 9 - .changeset/gap-report-directives.md | 5 - .changeset/gap-report-output-fixes.md | 10 - .changeset/gap-report-report-order.md | 7 - .changeset/gap-report-super-calls.md | 5 - .changeset/initial-release.md | 7 - .changeset/law-credit-label.md | 5 - .changeset/lint-remove-ignore-mode.md | 7 - .changeset/lint-test-source-recognition.md | 13 -- .changeset/oracle-gaps-ending-ask.md | 5 - .changeset/oracle-gaps-test-root-copies.md | 5 - .changeset/oracle-property-const-inference.md | 15 -- .changeset/oracle-property-owns.md | 5 - .changeset/plugin-consumer-parser.md | 9 - .changeset/plugin-empty-tests-and-scope.md | 9 - .changeset/quiet-monkeys-brake.md | 5 - .changeset/remove-legacy-campaigns.md | 5 - .changeset/scope-anchors-to-declarations.md | 9 - .changeset/shardable-units.md | 23 --- .changeset/ship-oracle-skills.md | 6 - .changeset/shrink-budget.md | 5 - packages/eslint-plugin-oracles/CHANGELOG.md | 65 +++++++ packages/eslint-plugin-oracles/package.json | 2 +- packages/oracles/CHANGELOG.md | 183 ++++++++++++++++++ packages/oracles/package.json | 2 +- 53 files changed, 250 insertions(+), 366 deletions(-) delete mode 100644 .changeset/add-eslint-plugin-oracles.md delete mode 100644 .changeset/add-oracle-framework-core.md delete mode 100644 .changeset/add-oracle-gaps-cli.md delete mode 100644 .changeset/calibration-difference.md delete mode 100644 .changeset/calibration-history-bindings.md delete mode 100644 .changeset/constructed-stream-independent.md delete mode 100644 .changeset/copy-resolves-from-its-file.md delete mode 100644 .changeset/daemon-replaced-context.md delete mode 100644 .changeset/enumerated-declared-states.md delete mode 100644 .changeset/fixed-history-take-back.md delete mode 100644 .changeset/gap-cli-baseline-report.md delete mode 100644 .changeset/gap-cli-block-per-law.md delete mode 100644 .changeset/gap-cli-config-find-up.md delete mode 100644 .changeset/gap-cli-config.md delete mode 100644 .changeset/gap-cli-copy-randomness.md delete mode 100644 .changeset/gap-cli-daemon-fs-inputs.md delete mode 100644 .changeset/gap-cli-extra-work.md delete mode 100644 .changeset/gap-cli-greppable-lines.md delete mode 100644 .changeset/gap-cli-internal-error-prefix.md delete mode 100644 .changeset/gap-cli-never-crash.md delete mode 100644 .changeset/gap-cli-own-typescript.md delete mode 100644 .changeset/gap-cli-probe-not-work.md delete mode 100644 .changeset/gap-cli-runtime.md delete mode 100644 .changeset/gap-cli-sqlite-evidence-store.md delete mode 100644 .changeset/gap-cli-stopped-session-dir.md delete mode 100644 .changeset/gap-cli-stream-log.md delete mode 100644 .changeset/gap-cli-temp-state.md delete mode 100644 .changeset/gap-cli-typescript-alias.md delete mode 100644 .changeset/gap-diff-base-limits-run.md delete mode 100644 .changeset/gap-report-directives.md delete mode 100644 .changeset/gap-report-output-fixes.md delete mode 100644 .changeset/gap-report-report-order.md delete mode 100644 .changeset/gap-report-super-calls.md delete mode 100644 .changeset/initial-release.md delete mode 100644 .changeset/law-credit-label.md delete mode 100644 .changeset/lint-remove-ignore-mode.md delete mode 100644 .changeset/lint-test-source-recognition.md delete mode 100644 .changeset/oracle-gaps-ending-ask.md delete mode 100644 .changeset/oracle-gaps-test-root-copies.md delete mode 100644 .changeset/oracle-property-const-inference.md delete mode 100644 .changeset/oracle-property-owns.md delete mode 100644 .changeset/plugin-consumer-parser.md delete mode 100644 .changeset/plugin-empty-tests-and-scope.md delete mode 100644 .changeset/quiet-monkeys-brake.md delete mode 100644 .changeset/remove-legacy-campaigns.md delete mode 100644 .changeset/scope-anchors-to-declarations.md delete mode 100644 .changeset/shardable-units.md delete mode 100644 .changeset/ship-oracle-skills.md delete mode 100644 .changeset/shrink-budget.md create mode 100644 packages/eslint-plugin-oracles/CHANGELOG.md create mode 100644 packages/oracles/CHANGELOG.md diff --git a/.changeset/add-eslint-plugin-oracles.md b/.changeset/add-eslint-plugin-oracles.md deleted file mode 100644 index f39e7f04..00000000 --- a/.changeset/add-eslint-plugin-oracles.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -'@tanstack/eslint-plugin-oracles': patch ---- - -Add ESLint rules for oracle tests: no disabled oracles, no unit tests in oracle files, pure models, replayable seeds, and the production probe form. `oracle/no-unit-test` holds an oracle file to registering its tests only through `oracleProperty`. It reports every other test registration as a unit test, and a helper that registers its caller's body. It also reports an `oracleProperty` call without an inline `check`, and an imported helper that registers tests of its own. `oracle/no-unit-test`, `oracle/no-disabled`, and `oracle/oracle-property-only` share one account of a test function: a test framework's test function or suite, or a fixture of one, by the source of its binding (see the README's "Where a test function comes from"). They follow imports, aliases, namespace members, variables and their assignments, destructurings, casts, the branches of a conditional or logical expression, tagged-template `.each`, and the exports of relative test modules. A binding to anything else, and a member that is no registration such as `test.step`, is no test function, whatever its name. The README lists the forms that the rules do not recognize: a test function passed as a parameter, one that a third-party package exports under a name that no framework uses, a computed member that is not a string literal, and a modifier call that another module exports. A fixed history, case, calibration, or reach check goes in the property's histories, calibrations, and declared states; any other test goes in an ordinary test file. `settings.oracles` sets the environment prefix and the modules that count as implementation and replay-witness modules. - -Add the `oracle/oracle-property-only` rule, enabled in `configs.recommended`. In an oracle file it reports a raw property campaign (`fc.assert`, `fc.check`, or a `.prop` registration, through `fast-check` or `@fast-check/vitest`) and an import of `createOracleReach` or `runOracleCampaign`, so a generated-history law runs through `oracleProperty` and its constructed histories. Framework implementation modules are exempt. A non-array `implementationModules` or `replayWitnessModules` is reported at line 1 and read as empty. The rule never throws. - -Add the `oracle/no-oracle-disable` rule, enabled in `configs.recommended` and `configs.production`. It reports every ESLint directive that would silence an `oracle/*` rule: a rule list that names one (bare, single-quoted, or double-quoted), a directive with no rule list, and an inline config comment that names one. Oracle rules cannot be disabled inline. A report sits on the directive's line; a directive that names this rule or has no list, or that an earlier block directive covers, is reported at line 1, column 0. Residuals the rule cannot close: a directive on line 1 that names this rule or has no list, and a production config comment that turns this rule off. - -The `recommended` config sets `linterOptions.noInlineConfig` on oracle files. ESLint ignores every directive in those files, for every rule, not only the oracle rules. A directive for another rule in an oracle file has no effect, so a project that relied on one must move the suppression or fix the code. The production config's probe-form rule covers `packages/*/src` and a single-package `src` directory. diff --git a/.changeset/add-oracle-framework-core.md b/.changeset/add-oracle-framework-core.md deleted file mode 100644 index 8decfd3b..00000000 --- a/.changeset/add-oracle-framework-core.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -Add the oracle framework core, extracted from TanStack DB: `oracleProperty`, the controlled clock, failure fidelity, and replay witnesses. `configureOracles({ envPrefix, registry, retiredVariables })` lets a project keep its own environment variable names and property registry. The main entry is ES modules only; `@tanstack/oracles/route` is a browser-safe entry for the route helpers (`oracleRoute`, `oracleRouteOf`, and `oracleFixedSeed`). The published sources no longer cite files that the package does not ship, such as the CLI's and the framework's own oracle tests. diff --git a/.changeset/add-oracle-gaps-cli.md b/.changeset/add-oracle-gaps-cli.md deleted file mode 100644 index 7e77f853..00000000 --- a/.changeset/add-oracle-gaps-cli.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -Add the `oracle-gaps` CLI, which reports the gaps in a package's oracles. It runs operator mutants of the code that each oracle file owns (its `owns` lists) against only that file's tests, and classifies each surviving mutant: a comparison gap, a generator gap, no observed difference, or unowned code. A daemon (`--daemon`) reuses evidence across runs. `--env-prefix` names the project's oracle environment variables. diff --git a/.changeset/calibration-difference.md b/.changeset/calibration-difference.md deleted file mode 100644 index 6d62e91d..00000000 --- a/.changeset/calibration-difference.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -A calibration can now require the violation's difference as well as its law. Give it `difference`, a string that the violation's difference must contain, or a `RegExp` that it must match. The check must then reject the wrong answer for that reason. Before, a calibration could require only the law. An oracle that judged several faults under one law then had to put the fault in the law's name. The calibration test judges the law first. A corrupted trace that fails with another difference fails the calibration and names the difference that the check reported. A mutant driver goes on to the next candidate history, as it does for another law. A pattern matches anywhere in the difference, and a sticky (`y`) pattern matches only at its start. The empty difference holds `''` and `/(?:)/`, so such a requirement would reject any difference. It now fails the property's load. A check that gives a difference that is not text fails the calibration with an error that names the calibration and the law. A calibration without `difference` works as before. diff --git a/.changeset/calibration-history-bindings.md b/.changeset/calibration-history-bindings.md deleted file mode 100644 index 7e8f2a20..00000000 --- a/.changeset/calibration-history-bindings.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -Add direct `history` bindings for calibrations and `probeHistories` for automatic controls, so bound calibrations validate one selected premise instead of searching. Preserve fixed and enumerated history identity, including fixed declarations with unrelated `build` metadata, rebuild constructed histories from stable seeds, and resolve once per driver execution. Apply ordinary verdict ranking and optional difference requirements to bound mutants, validate clean declared reach, and retain selected-history error context. Retain search during migration with one warning per property outside collect-only runs, before search removal ahead of the first npm release. - -Dispatch selectors using their validated own key, so inherited selector tags cannot redirect a selected history or reject its source kind. diff --git a/.changeset/constructed-stream-independent.md b/.changeset/constructed-stream-independent.md deleted file mode 100644 index 0b3cb145..00000000 --- a/.changeset/constructed-stream-independent.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -A campaign's generated histories no longer depend on its constructed histories, and each constructed history runs several bases from a stream of its own. The `generated` unit draws only from the property's arbitrary. Constructed history k builds from each of the first `bases` draws of the arbitrary's sample at the campaign's seed plus k, and every base must enter the states it names. The new `histories.bases` option sets that number. It must be a whole number of at least 1 (default 5), or the property fails to load. So appending a constructed history keeps every fixed seed's generated histories and every other constructed history's bases. Before, half of the generated unit's runs were constructed histories, weighted by how many there were, so appending one moved every run's draw, and each constructed unit ran one history. - -A costly property can keep few fixed bases and still vary its constructed histories from run to run with the new `histories.drawnBases` option (a whole number of at least 0, default 0). After its fixed bases, each constructed unit runs that many more, drawn from the run's random seed: the seed the random units run, which the `ORACLE_SEED` line logs. That line now comes from the first unit that uses the seed, which may be a fixed-seed constructed unit. A failure on a drawn base says which base it was, prints its full history as the counterexample, and prints a replay line with the run's seed, at which the random unit of the same name runs that base at the same index. - -This shifts each fixed seed once, for properties that have at least one constructed history. Their `generated` unit now runs other histories, and a seed-and-path replay line printed before this change for that unit no longer replays the same history. A constructed unit keeps its first base, and its first replay path index still selects it. Replay lines for properties without constructed histories stay valid: their `generated` unit already drew from the arbitrary alone. Each constructed unit now runs `bases` histories, so a campaign takes longer; set `bases` lower for a property whose constructed histories are slow. diff --git a/.changeset/copy-resolves-from-its-file.md b/.changeset/copy-resolves-from-its-file.md deleted file mode 100644 index d0ec3402..00000000 --- a/.changeset/copy-resolves-from-its-file.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The gap oracle's CLI resolves a mutant copy's bare imports from the test file the copy stands for, as that file's own run does. Before, a package whose config root lay above it (with its dependencies in its own node_modules) failed every copy with a setup error. diff --git a/.changeset/daemon-replaced-context.md b/.changeset/daemon-replaced-context.md deleted file mode 100644 index 9499cd22..00000000 --- a/.changeset/daemon-replaced-context.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -Fix stale results from the gap CLI's daemon (`--daemon`). A warm context now records every module that a batch of mutant runs loads, so the next check invalidates a module that changed. Before, only single runs recorded what they loaded. A hang can replace the context that recorded a module. Another context could then keep the old module after an edit. The daemon then reported results from before the edit, such as a kill that the cold run no longer finds. - -A stored run now also lists the modules that its copy evaluated. A module that only a mutated branch imports at run time is then one of its inputs. Before, an edit of such a module left the stored verdict in place. A run whose known inputs change while it runs is no longer stored. diff --git a/.changeset/enumerated-declared-states.md b/.changeset/enumerated-declared-states.md deleted file mode 100644 index ea436442..00000000 --- a/.changeset/enumerated-declared-states.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -An enumerated source can declare the states its laws depend on: `histories: { enumerated, states, measured }`, where `enumerated` is the list a plain enumerated source passes, and `states` and `measured` are state names. Every enumerated history runs, so a required state needs no constructed history. A `reach` test after the histories fails when no enumerated history entered a state in `states`, and otherwise prints how many entered each declared state, as ` enumerated reach {...}`. A history counts once it is judged, passing or violating its law. The reach test reuses what each history's test recorded. It runs again only a history whose test never started, such as one that a `-t` filter left out. A history whose test failed before a verdict or timed out counts for nothing. A judged history that enters a state outside `states` and `measured` fails its test. An enumerated source fails to load when it holds a key other than `enumerated`, `states`, and `measured`, or a state that is not a name; only a generated source binds a probe to a state. A plain list of histories registers no `reach` test. Any enumerated source now fails to load when its `label` names a history `reach` or `determinism`, because the rerun command for that history would also select the framework test of that name. diff --git a/.changeset/fixed-history-take-back.md b/.changeset/fixed-history-take-back.md deleted file mode 100644 index 3c407f03..00000000 --- a/.changeset/fixed-history-take-back.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -`oracleProperty` checks, when it registers a generated source, that its arbitrary can take back (`canShrinkWithoutContext`) each fixed history and each constructed history built from the first fixed seed (or seed 0 when there is none). If it cannot, the property fails to load with an error that names the property, the history (a fixed history's index and name, or a constructed history's name), and the fix. Before, the check ran only when the history's test ran, after the campaigns, and its message blamed the language. In fast-check 4, a `.map` without an unmapper takes no value back, at the whole history or anywhere inside it, so a history inside the language failed too. Give that `.map` an unmapper (its second argument). `fc.constant` and `fc.constantFrom` take back only primitives or the same object reference, so build objects with `fc.record` or `fc.tuple` over primitive leaves. `.chain`, `fc.func`, and `fc.commands` cannot take a value back. - -The check runs when the test file loads. One history that the arbitrary cannot take back now fails the load of the whole file, so it also blocks the file's other properties. Constructed histories are now built at import: a `build` that throws there fails the load with an error that names the property and the constructed history, with the build's error as its `cause`. diff --git a/.changeset/gap-cli-baseline-report.md b/.changeset/gap-cli-baseline-report.md deleted file mode 100644 index d0c206f8..00000000 --- a/.changeset/gap-cli-baseline-report.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The `oracle-gaps` report leads with the baseline, and a failing oracle file no longer stops the run. - -- An oracle file that fails with no mutant active (a RED law, or a file that cannot load or launch) blocks only the mutants it owns. A mutant it owns that no passing owner kills is a new `blocked` gap, which names the failing file. The other mutants are judged, and the report says it is provisional. Before, the run refused with exit 2. A setup file that throws now blocks every owned mutant in the same way. -- A `blocked` line names each failing oracle file and its failing test, and says to make it pass and check again. -- With `--only`, the baseline runs only the owners of the selected mutants, so another file's failure no longer blocks the run. -- stdout and `summary.md` start with the baseline: each test file's result with its test counts, ordinary test files included, and for a failing file its failing test, its error, the law, difference, and counterexample of a law violation, and its replay command. Ordinary test files now run once in the baseline; they run against mutants only with `--ordinary`. `results.json` gains `provisional` and `baseline`. -- The legend says that a `crashed` gap is a gap, not a kill, and that its error is on the gap's Detail line in `summary.md` and in its `detail` in `results.json`. -- The last stdout line says that the check completed, with its gap count and its report (`oracle-gaps: done completed, gaps, report `). Exit codes do not change: 0 means the check completed, whatever its gaps. diff --git a/.changeset/gap-cli-block-per-law.md b/.changeset/gap-cli-block-per-law.md deleted file mode 100644 index eef812f8..00000000 --- a/.changeset/gap-cli-block-per-law.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -A failing law no longer blocks the gap report for its whole file. In `oracle-gaps`, a test of an oracle file that fails with no mutant active judges nothing: it is left out per test, as a nondeterministic test is, and the passing tests of its file still judge the mutants the file owns. A failing law still runs in every copy of its file: its calls count toward the copy's call budget, its I/O and timers toward idle, and it keeps its reach, but its verdicts judge nothing and it is never charged extra work. A count cut that a failing law causes blocks the mutant by that law. A test of a `describe` whose `beforeAll` or `afterAll` throws is a failing law too. An owner file that fails outside its tests (it does not load, or a file-level hook throws) judges nothing, and another owner file's passing tests still judge the mutants they share. A mutant that no deterministic passing owner test reached is `blocked` by its owners' failing laws that reached it, and by owner files that judge nothing; its directive names them. The baseline prints one `oracle-gaps: blocked` line per failing law, named by its file and test names (or one per broken file), `results.json` lists each failing file's `laws`, and the report stays provisional. diff --git a/.changeset/gap-cli-config-find-up.md b/.changeset/gap-cli-config-find-up.md deleted file mode 100644 index fe82218a..00000000 --- a/.changeset/gap-cli-config-find-up.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -Without `--config`, the `oracle-gaps` CLI now loads the Vitest config that Vitest itself would load for the package: the first of Vitest's config names in the package's directory, or else in the nearest parent directory that has one. Before, it looked only in the package's directory and ran Vitest's defaults when the config was in a parent. The baseline's replay command then ran under the parent's config, which Vitest found, and could find no test. A parent's config that defines `test.projects` now refuses the run, as the package's own does. diff --git a/.changeset/gap-cli-config.md b/.changeset/gap-cli-config.md deleted file mode 100644 index 249eefc4..00000000 --- a/.changeset/gap-cli-config.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The `oracle-gaps` CLI takes `--config `, relative to `--package`, to select the package's Vitest config. Without it, the run loads the config that Vitest discovers, as before. The baseline output now starts with `config: `, or `no config file: Vitest's default discovery`. A `--config` that names no file of the package refuses the run. A run names its config once its contexts have loaded it, also when the analysis or the baseline then refuses the run. A failing owner's `replay:` command names the `--config` file too, so it runs the failing test under the same config, even when Vitest would discover another one. - -The runner's wrapper config now has the module format that Vite gives the package's own config, so Vite bundles that config as Vitest loads it. An `.mjs` or `.mts` config, or a `.js` or `.ts` config in a package with `"type": "module"`, gets an `.mts` wrapper, where a top-level `await` works. A `.cjs` or `.cts` config, or a `.js` or `.ts` config in a package without that type, gets a `.cts` wrapper, where `require` and `require.resolve` work. Before, every wrapper was a `.ts` file. In a package without `"type": "module"`, Vite bundled such a wrapper as CommonJS, so an `.mjs` config with a top-level `await` refused the run, and older Vite versions printed their CommonJS deprecation warning. - -A run with more than ten warm contexts (`--contexts`, which defaults to up to 16) no longer prints `MaxListenersExceededWarning`. Each context is a Vitest instance that listens on the process until it closes; the runner now raises the process's listener limit by one for each open context and lowers it when the context closes. diff --git a/.changeset/gap-cli-copy-randomness.md b/.changeset/gap-cli-copy-randomness.md deleted file mode 100644 index 6eabe821..00000000 --- a/.changeset/gap-cli-copy-randomness.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -A mutant's copy of a test file now draws from `Math.random`, `crypto.getRandomValues`, and `crypto.randomUUID` what the original file draws. The `oracle-gaps` capture seeds these sources per test, by the test's key. It took the key from the copy's path, which names its batch, while the unmutated runs run the original file. A test that observes a draw therefore read as changed under a mutant that changed nothing. An `oracleProperty` campaign with no `--seed` draws its seed from `Math.random`, so its random units ran other histories under every mutant. A run with no `--seed` reported such mutants as `not-judged`, and its classes now match a seeded run's. diff --git a/.changeset/gap-cli-daemon-fs-inputs.md b/.changeset/gap-cli-daemon-fs-inputs.md deleted file mode 100644 index f05d0278..00000000 --- a/.changeset/gap-cli-daemon-fs-inputs.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -A check through `--daemon` now reruns a test after an edit to a file in the package that the test reads through `fs` (`readFileSync`, `readFile`, `existsSync`, `statSync`, or `fs/promises` `readFile` or `stat`), such as a JSON fixture or a snapshot. Before, the daemon reused the run that read the old file, while a cold run saw the edit. A directory that a test stats is an input as a directory. Reads outside the package, under `node_modules`, through other APIs, or from a test's own worker threads or child processes are no inputs. - -The daemon also stores each run under the text that the run read. Before, it stored a run under each input's text at the end of the run, so a module or file that changed during the run that read it (a test that rewrites a fixture it read, or a helper edited mid-check) kept the old verdict for the new text, and the next check through the daemon reported that stale verdict. A run whose input changed after it read it is now run again. - -A test that reads a source under test through `fs` (or as a `?raw` import) no longer makes each check through the daemon run its tests again. The test's read of the file and the instrumented module that the runner serves from it are now two inputs, each hashed by its own text. diff --git a/.changeset/gap-cli-extra-work.md b/.changeset/gap-cli-extra-work.md deleted file mode 100644 index da5d43dc..00000000 --- a/.changeset/gap-cli-extra-work.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The `oracle-gaps` report no longer reports a shortcut for speed as `not-observed`. A survivor that changed no observation but made a test do more work is now `extra-work`. Before, its directive said to observe a value or widen the oracle, which cannot work for a branch whose fast and general paths give the same result, and an author who removed the code instead made it slower. Work is the number of site evaluations that the test's instrumented production code makes, a deterministic count, never a time. The `extra-work` directive names the test, its work before and after, and the bound to declare. `oracleProperty` takes a new `work: { ratio }` option. Under the gap report, a mutant whose work in one of the property's tests is more than `ratio` times the unmodified code's work is killed under the law `work bound`. `ratio` must be a finite number of at least 1. A plain Vitest run has no unmodified run to compare with, so there the bound judges nothing. diff --git a/.changeset/gap-cli-greppable-lines.md b/.changeset/gap-cli-greppable-lines.md deleted file mode 100644 index 785ca92b..00000000 --- a/.changeset/gap-cli-greppable-lines.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -Every line the `oracle-gaps` CLI writes for a check now starts with `oracle-gaps: ` and its kind, on stdout and stderr alike, cold and through `--daemon`, so an agent can act on the results as they stream with `grep '^oracle-gaps: '` and filter one kind by the word after the prefix: - -- `oracle-gaps: config `, or `oracle-gaps: config none, Vitest's default discovery` -- `oracle-gaps: baseline pass : tests` and `oracle-gaps: baseline fail : …`, with the failing test, law, counterexample, and replay indented under it -- one decisive line before any mutant runs: `oracle-gaps: baseline all oracle files pass`, or `oracle-gaps: baseline of oracle files failed (provisional)` -- `oracle-gaps: blocked …` for each failing oracle file -- `oracle-gaps: gap L `, streamed and in the stdout summary -- `oracle-gaps: progress …`, `oracle-gaps: busy in for s`, and `oracle-gaps: note …` (Vite's own messages as `note vite: …`) -- the stdout summary as lines too: `oracle-gaps: summary …` for the totals, `oracle-gaps: legend : …` for each directive, and `oracle-gaps: function …` for each function's heading over its gap lines -- a last line for every run: `oracle-gaps: done completed, gaps, report ` (with `(provisional)` after the count when an oracle file failed), `oracle-gaps: done refused[, report ]` after a refusal's `refused:` and `fix:` block, `oracle-gaps: done error, log `, or `oracle-gaps: done stopped ()` - -The done line is the last line of both stdout and stderr, once each, and its status matches the exit code. Only the lines indented under a failing baseline file and a refusal's `refused:` and `fix:` block have no prefix, and no line is blank. A test's own writes to the process's stdout and stderr go to `test-output.log` in the output directory, which a note names. The stdout summary's `output: `, `Full report:`, and `completed: gaps` lines are replaced by the done line, and the refusal's `output: ` line by `oracle-gaps: done refused, report `. Exit codes do not change. - -The wrapper config now reads the package's config as Vite does: it awaits a promise default and refuses a default that is not an object. A config with a syntax error is refused with its first error, before Vite bundles it. diff --git a/.changeset/gap-cli-internal-error-prefix.md b/.changeset/gap-cli-internal-error-prefix.md deleted file mode 100644 index 5424f2d8..00000000 --- a/.changeset/gap-cli-internal-error-prefix.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The `oracle-gaps` CLI's internal error now prints one prefixed line, `oracle-gaps: error : a bug in oracle-gaps, not in your oracle; its stack is in `, before its `oracle-gaps: done error, log ` line. Before, its two message lines had no `oracle-gaps:` prefix. A line break in the message prints as an escape, so the message stays on one line. The stack stays in `error.log`, and the exit code stays 3. - -A path that a stream line names, such as the output directory in a done line or a note, now prints a line break or another control character as its `\uXXXX` escape, so a directory name cannot split the line. diff --git a/.changeset/gap-cli-never-crash.md b/.changeset/gap-cli-never-crash.md deleted file mode 100644 index 340f69a1..00000000 --- a/.changeset/gap-cli-never-crash.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The `oracle-gaps` CLI no longer ends a run with a bare stack trace. A problem in the author's own files or arguments (bad arguments, a `--source` that is missing or not a file, a broken `owns` declaration, no oracle file or no owner, a Vitest config that throws when it loads, has no default export, or defines `test.projects`, a Vitest that does not load, a setup file that throws, an oracle file that fails with no mutant active, an authored mutant file that is not JSON or is incomplete) refuses the run: it exits 2 and prints `refused: ` and `fix: `. When the output directory is known (even from `--out` alone, when other arguments are bad), the refusal is also written there as `results.json` (`{ "status": "refused", "cause", "directive" }`) and `summary.md`, replacing an earlier run's ending there, and the CLI's last line names that report (`oracle-gaps: done refused, report `). Any other error is a bug in the CLI: it exits 3, says so, and writes its stack to `error.log` in the output directory (or the system's temporary directory when none is known), with `results.json` status `internal-error`. A check through `--daemon` ends the same way. A daemon serves only a CLI of its own code, so a second install of the CLI starts its own daemon rather than reading another version's reply. - -Exit code 1 is no longer used: scripts that treated any non-zero exit as a failure keep working, and scripts that matched exit 1 must match 2 or 3. Arguments are now checked: an unknown option, an option with no value, a `--package` or `--mutants` directory that does not exist, a `--seed` that is not an integer, a count or limit that is not a positive whole number, and a `--pool` other than `threads` or `forks` each refuse the run instead of being ignored or failing later. diff --git a/.changeset/gap-cli-own-typescript.md b/.changeset/gap-cli-own-typescript.md deleted file mode 100644 index d6236c76..00000000 --- a/.changeset/gap-cli-own-typescript.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -Fix the `oracle-gaps` CLI crashing on a package whose TypeScript has no compiler API, as TypeScript 7's package has (it exposes only its version). The CLI now analyzes with its own TypeScript 5 dependency and never reads the package's TypeScript, so a package with no TypeScript, or with TypeScript 7, is analyzed instead of refused or crashed. The optional `typescript` peer dependency is removed for that reason. A copy of the CLI's own TypeScript without the compiler API is refused before any work, with a message that names the fix. diff --git a/.changeset/gap-cli-probe-not-work.md b/.changeset/gap-cli-probe-not-work.md deleted file mode 100644 index 086c81b9..00000000 --- a/.changeset/gap-cli-probe-not-work.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The `oracle-gaps` work count no longer includes probe code. A site in probe-only code (the probe guard, a probe statement, or a probe helper) counts nothing toward a test's work, so a work bound no longer kills a mutant whose only extra work is a probe, such as an `if` forced into a branch that only calls `report()`. diff --git a/.changeset/gap-cli-runtime.md b/.changeset/gap-cli-runtime.md deleted file mode 100644 index da53f5fd..00000000 --- a/.changeset/gap-cli-runtime.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The `oracle-gaps` CLI bounds a mutant's copies by counts, not by wall-clock limits, reports long runs, stops the processes it started, and writes nothing beside the tests. - -- No wall-clock limit decides an outcome. A copy that spins past its call budget, makes no progress, or whose work passes the mutant's work budget (the larger of 100,000 and ten times its owner files' unmutated work, counted in site evaluations, not in time) is killed by the built-in law `bounded work` or `no progress` on its test's route. A copy's call budget is a hundred times the most site evaluations that any unmutated test of its file made, and at least 100,000. A spin or a work-budget overrun kills only when the counts that decide it cannot follow the clock: a test that reads the clock, makes a timer, or does I/O of its own anywhere in its run is charged nothing, and its spin is a `timeout` named `(cause: spin)`. A copy makes no progress when none of its test's own timers is due before its backstop and none of its test's own I/O is pending; timers and I/O the runner keeps for itself, such as Vitest's task-update timer or a pending write that forwards the test's console output on Windows, do not keep it busy. Only the backstop (`--hang-limit`, 60 s by default, plus 3 s per second of the file's time) is a gap: the mutant is a `timeout`, named `(cause: backstop)` on its gap line, and no later copy runs. `--mutant-limit` and `--first-limit` are retired: they are checked and noted, and change nothing. -- While one copy of a test file runs for 30 s or more, the CLI prints `busy: in for s` every 30 s (`baseline` for a run with no mutant). Through `--daemon` the heartbeats arrive when the check ends. -- The check runs in a process group of its own, with every Vitest worker and every process a test starts, except one started detached in a session of its own. On SIGINT or SIGTERM the CLI signals the group, kills what is left 2 s later, and exits 130 or 143. Before, a SIGTERM left `forks` workers running. On Windows the run is not supervised. -- The runner's copies of the test files exist only in memory. Vitest's read of a copy for its per-file pragmas (`@vitest-environment`, `@module-tag`) is served its text, so a copy runs in its file's environment. The capture setup and Vitest configs are in a session directory of its own while it runs, which the run removes when it ends; one that a killed run left is removed by the next run. Before, the copies and configs sat beside the tests and the package's config, where a Vitest run started during a check found them and then failed when they were removed. diff --git a/.changeset/gap-cli-sqlite-evidence-store.md b/.changeset/gap-cli-sqlite-evidence-store.md deleted file mode 100644 index c8651dd2..00000000 --- a/.changeset/gap-cli-sqlite-evidence-store.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The `oracle-gaps` daemon keeps its evidence in a SQLite database instead of one JSON file, so a package with a large oracle file no longer fails every check with "Invalid string length" after two checks. The store prunes units no check has used for two weeks, returns the pages that replaced and pruned units freed, is written again when the OS cleans its directory while the daemon runs, starts over when its file is overwritten or corrupted while the daemon holds it (a check whose evidence cannot be written still reports its result), and keeps a unit it reuses from memory. The earlier `evidence.json` is removed when found. The static analysis keeps its ownership between checks while the production sources, the dependencies' declaration files, `owns` declarations, manifest, and lockfile are unchanged, so a daemon recheck after an edit to a test file skips the type-checker walk. With `ORACLE_GAPS_PROFILE`, each copy in a batch writes its own span. diff --git a/.changeset/gap-cli-stopped-session-dir.md b/.changeset/gap-cli-stopped-session-dir.md deleted file mode 100644 index 2919648a..00000000 --- a/.changeset/gap-cli-stopped-session-dir.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -A run of the `oracle-gaps` CLI that a stop ends, or whose check's process aborts, now removes its `/.oracle-gaps-/` session directory. Before, it left the directory for the next run to remove, and a run stopped as or before it started removed nothing, so the directory stayed in the package. Only a run whose own process is killed leaves it now, and the next run removes it. diff --git a/.changeset/gap-cli-stream-log.md b/.changeset/gap-cli-stream-log.md deleted file mode 100644 index d955aff3..00000000 --- a/.changeset/gap-cli-stream-log.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The `oracle-gaps` CLI now writes the lines it streams on stderr to `stream.log` in the output directory too, in order, cold and through `--daemon`, and the first line of a check on both streams names that file: `oracle-gaps: note log /stream.log`. An agent that starts a cold check in the background can read the run's progress and its done line there while it runs. A check through `--daemon` prints its lines at the end of its check, so its progress is readable there only after it ends. - -A run takes its output directory's claim in `run.pid` before it starts, and a second run on a live directory refuses without writing into it. A `run.pid` that names no running process (stale), that is empty, or that cannot be read (a directory, or a link to no file) also refuses the run, without writing into the directory, and the refusal's fix line tells you to delete `/run.pid` if no run uses that directory. The CLI never takes over another run's claim. A refusal of a run with no `--out` is written to the default output directory the run would have used. On Linux and macOS the run's supervisor needs no external command: a container without `ps`, or with BusyBox's `ps`, runs the check as any other system does. diff --git a/.changeset/gap-cli-temp-state.md b/.changeset/gap-cli-temp-state.md deleted file mode 100644 index 5e979364..00000000 --- a/.changeset/gap-cli-temp-state.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The `oracle-gaps` CLI keeps its working files out of the repository. The daemon's state (its lock, log, and evidence), the one-file bundles of workspace dependencies, and the default output directory now live in the OS temp directory, in a directory keyed by the package (`oracle-gaps-`, never a shared directory), which the OS cleans. A state that the OS removed is a cold start. `--out` is honored as before, and the run still prints its output path. While a run runs, its capture setup and Vitest configs are in `/.oracle-gaps-/`, which it removes when it ends; one that a killed run left is removed by the next run. A run leaves nothing in the package, so there is nothing to add to `.gitignore` or to delete. Before, every run wrote `/.oracle-gaps/` and `/.oracle-gaps/bundle-*.mjs`. diff --git a/.changeset/gap-cli-typescript-alias.md b/.changeset/gap-cli-typescript-alias.md deleted file mode 100644 index 3b54b47f..00000000 --- a/.changeset/gap-cli-typescript-alias.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The `oracle-gaps` CLI's TypeScript is now the npm alias dependency `typescript-for-tanstack-oracles` (`npm:typescript@^5.9.2`), and the CLI resolves it by that name. Before, the plain `typescript` dependency was hoisted by npm to an adopter's root. A project without TypeScript got a `typescript` package, and a project with its own TypeScript range could have that range deduped up to 5.9. Now neither happens. npm still links the alias's `tsc` and `tsserver` into `node_modules/.bin` in a project without TypeScript. After an incremental `npm install` of this package into a project with TypeScript, `.bin/tsc` points at the alias until a clean install (`npm ci`, or removing `node_modules`); a later plain `npm install` does not repair it. That is still strictly better than before, when the same incremental install raised the project's root `typescript` itself, for example from 5.4.5 to 5.9.3. On a clean install, the project's own `typescript` provides `tsc`. pnpm links only direct dependencies' commands, so it is not affected. diff --git a/.changeset/gap-diff-base-limits-run.md b/.changeset/gap-diff-base-limits-run.md deleted file mode 100644 index deb8fef5..00000000 --- a/.changeset/gap-diff-base-limits-run.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -`oracle-gaps --diff-base ` now judges only the mutants on lines changed since ``, for fast feedback after a change. Operator and authored mutants both count, and a mutant is on a changed line when any line from its first to its last is changed. Every line of a source file that git does not track is changed. The baseline still runs every test file that the run without the option runs, and each judged mutant gets the outcome it gets in the full run. An authored mutant that does not apply is reported on every run with the option, as it is without it. The run says so on its stream before the baseline, `oracle-gaps: note --diff-base : of mutants are on changed lines; the others are not judged in this run`, and in the same sentence in `summary.md`; `` counts the run without the option, with the same `--only` or `--sample`. Its `results.json` and `summary.md` inputs say `a partial run (--only, --sample, or --diff-base)`, as an `--only` or `--sample` run's do (their text used to read `(--only or --sample)`). Authored mutants are marked `inDiff` too. - -`oracle-gaps --diff-base ` refuses a revision that names no commit of the git repository that holds the package: a name git does not know, a range, a blob, an option such as `--cached`, an empty value, or a package in no repository. It exits 2 with `refused: --diff-base "" names no commit of the git repository that holds the package` and a `fix:` line, before any test runs. Before, the run went on and marked every mutant `inDiff: false`. `results.json` records the commit as `options.diffBase: { rev, commit }` (it was the revision as given), so the run identity follows the commit and not the name. - -Before, `--diff-base` only added `inDiff` to each operator mutant in `results.json`, and every mutant still ran. Run a full check without `--diff-base` to judge the other lines. diff --git a/.changeset/gap-report-directives.md b/.changeset/gap-report-directives.md deleted file mode 100644 index d9c0544f..00000000 --- a/.changeset/gap-report-directives.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The `oracle-gaps` report gives each gap a class and one directive with a concrete next step. A message never offers an exit such as an equivalent mutant or a maintainer approval. Survivors are `not-judged`, `indeterminate`, `dead-code`, `branch-never-taken`, `not-infected`, or `not-observed`. A `crashed` gap names the error that production threw, and tells the author to record it as an observation and state the law. Standard output is short. It has the totals, one legend line for each class, and gaps grouped by function. It also has the unowned warnings counted for each function, and the paths of `summary.md` and `results.json`. The full report is in `summary.md`. The CLI also streams its progress: the baseline result first, then one line for each gap when the CLI judges it, then the summary. diff --git a/.changeset/gap-report-output-fixes.md b/.changeset/gap-report-output-fixes.md deleted file mode 100644 index b9dfc210..00000000 --- a/.changeset/gap-report-output-fixes.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -Fix four parts of the `oracle-gaps` output. - -- The baseline's replay command now runs the failing test. Before, its `-t` pattern was the test's `>`-joined name in JSON quotes: Vitest 4 matches `-t` against names joined by a space, so a test in a `describe` ran nothing, and a name with regular-expression syntax, `$`, or a backtick broke the pattern or the shell. The pattern is now the suites' and the test's names, escaped, joined to match Vitest 4 and Vitest 5, anchored, and in single quotes. A file that fails with no failing test (it did not load) replays whole, with no `-t`, where before it printed `-t undefined`. A control character in a test's name or failure, such as a newline, prints as its `\uXXXX` escape, in the baseline and in messages, so each stays one line. -- A gap line stays one line: the code of an operator mutant and the intent of an authored mutant have their whitespace collapsed and are cut at 60 characters with `...`, counted by code point so that a cut never splits an emoji. An authored intent prints as a code span. `results.json` keeps the full text. -- A `not-infected` message prints each operand as a code span of a typed value: strings quoted, `-0` as `-0`, bigints with `n`, and `undefined`, `null`, `NaN`, and a value that is not a primitive kept apart. A string longer than 40 characters (code points) prints its first 37 and a digest. Before, `1` and `"1"`, `0` and `-0`, and two long strings with one prefix printed alike. -- A `not-observed` directive also tells the author to add a history where the mutated code computes something different, because the run cannot tell a value nothing observed from a forced branch that computed the original's result. diff --git a/.changeset/gap-report-report-order.md b/.changeset/gap-report-report-order.md deleted file mode 100644 index 7c1d1e82..00000000 --- a/.changeset/gap-report-report-order.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The tests and files that an `oracle-gaps` report names no longer depend on how the run was made. They are now in report order: by file path, compared by code unit, and within a file in the order of the baseline run's records. This applies to a message's test, the `Owners` and `Changed observations in` lists, the operands of a `not-infected` message, the tests of an `indeterminate` message, the files that a refusal names or that the report leaves out (`excluded`), and results.json's `nondeterministic` tests. Kill, crash, and framework-error messages also order files by path. Within a file, they use the order in which the reporter lists the file's tests. A batch that a hang cut off uses the order of the mutant run's records. An operator mutant's owner files also run in path order, so a kill names the laws of the first file that kills. - -Before, these lists followed the order in which the runner joined its contexts' units. So `--contexts`, whose default depends on the machine's cores, could change which test a message named. An authored mutant's lists followed the order in which its owners were declared. diff --git a/.changeset/gap-report-super-calls.md b/.changeset/gap-report-super-calls.md deleted file mode 100644 index 85b2ea2c..00000000 --- a/.changeset/gap-report-super-calls.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -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. diff --git a/.changeset/initial-release.md b/.changeset/initial-release.md deleted file mode 100644 index 1c0f81fa..00000000 --- a/.changeset/initial-release.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@tanstack/oracles': patch -'@tanstack/eslint-plugin-oracles': patch ---- - -Publish the first release of the oracle testing framework, the bundled -`oracle-gaps` CLI and skills, and the ESLint plugin for oracle tests. diff --git a/.changeset/law-credit-label.md b/.changeset/law-credit-label.md deleted file mode 100644 index e330623b..00000000 --- a/.changeset/law-credit-label.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The gap report's per-law table is now titled "First law to reject, by law". It says that each count credits only the first law that rejected a history, because a check returns its first violation and a later law on the same history is not checked. A law with no count is not shown to reject nothing. The section's next step tells the author to add a history that varies the input the law judges. diff --git a/.changeset/lint-remove-ignore-mode.md b/.changeset/lint-remove-ignore-mode.md deleted file mode 100644 index fe35e230..00000000 --- a/.changeset/lint-remove-ignore-mode.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@tanstack/eslint-plugin-oracles': patch ---- - -**Breaking (unreleased package):** `settings.oracles.unknownSources: 'ignore'` is removed. An unknown source never passes silently, and a global ignore mode contradicted that. The modes are now `'report'` (the default) and `'test'`. A configuration that still says `'ignore'` gets `malformedSetting` at line 1, with a message that names `settings.oracles.nonTestPackages`, and the rules read the setting as unset. To silence a specific package, list it in `settings.oracles.nonTestPackages`. - -The malformed-setting report has one message id, `malformedSetting`, in both `oracle/no-unit-test` and `oracle/oracle-property-only`. It replaces `malformedSourceSetting`, which `oracle/no-unit-test` reported before this change. diff --git a/.changeset/lint-test-source-recognition.md b/.changeset/lint-test-source-recognition.md deleted file mode 100644 index 30f2f749..00000000 --- a/.changeset/lint-test-source-recognition.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -'@tanstack/eslint-plugin-oracles': patch ---- - -`oracle/no-unit-test`, `oracle/no-disabled`, and `oracle/oracle-property-only` now decide whether a callee is a test function by where its binding comes from, not by its name alone. Before, any package's export named `it`, `test`, `describe`, `suite`, or `bench` was a test function, so Ramda's `test` and mitata's `bench` were reported. A default import was never a test function, so `import test from 'ava'`, `'node:test'`, or `'@playwright/test'` was silent, and so were `xit`, `fit`, node:test's `skip` and `only`, `Deno.test`, `require('node:test')`, and fixtures with other names. - -- The rules know the test frameworks: Vitest (and `@vitest/runner`, `vite-plus/test`, `@fast-check/vitest`, `@effect/vitest`), Playwright and its component-testing packages, Jest (`@jest/globals`, `jest-each`, `@fast-check/jest`), Mocha and `mocha-steps`, node:test (and the `test` package), AVA (and `@fast-check/ava`), tap, tape, zora, brittle, uvu, `bun:test`, `@std/testing/bdd`, QUnit, Japa, and Lab. Each framework's default, named, namespace, and `require` exports count, with the modifiers that an export carries (`xit`, `fit`, `skip`, `only`, `todo`) and its factories (`mergeTests`, uvu's `suite`, `jest-each`, Lab's `script`). Members such as `.fail`, `.failing`, `.expectFailure`, `.ignore`, `.if`, `.todoIf`, `.override`, `.scoped`, and `.effect` keep a registration. The globals of the Vitest, Jest, Mocha, and Jasmine environments count too, and so do `Deno.test` and `QUnit.test`. -- The rules know packages that export other functions under these names, such as Ramda, Rambda, remeda, lodash, mitata, benny, `@thi.ng/*`, and `@tensorflow/*`. Their exports are never reported. -- The rules read a project's own modules: relative modules, `#` imports through the nearest `package.json` `imports` (a target that names a package is classified as that package), and workspace packages (a `node_modules` link to a real path outside `node_modules`), through their `exports`. They never read a package under `node_modules`; a project whose own path is under a `node_modules` directory is still read. -- `settings.oracles.testPackages` maps a specifier to a framework's specifier or to a table of export roles, and `settings.oracles.nonTestPackages` lists packages without test functions. Both are read first. A setting that the rules cannot use, including a `settings.oracles` that is not an object, is reported as `malformedSetting` and read as unset; it never makes a rule throw. -- Any other source is one the rules cannot classify, whatever the import's name. By default (`settings.oracles.unknownSources: 'report'`), `oracle/no-unit-test` reports `unknownTestSource` once per import, at the import, for a title-shaped call through it (a string title, then a function), and for a call to a relative helper that makes one. A call with no title before its function, such as `pMap(xs, fn)` or `effect(fn)`, gets none. Machinery files (`oracle-*`) get the report too. `'test'` reads a framework's name from such a source as the framework's. There is no `'ignore'` mode: a package is silenced only by `settings.oracles.nonTestPackages`. -- A registration's body follows its title, except where the framework's title is optional (node:test, tap, tape, brittle, `Deno.test`), where `test(fn)` registers. Playwright's annotations (`test.skip()`, `test.skip('reason')`, `test.skip(condition, 'reason')`, `test.skip(fixtures => condition, 'reason')`, and the same forms of `fixme`, `fail`, and `slow`) register nothing; `oracle/no-disabled` reports the `skip` and `fixme` ones. -- The README's new "Decisions" section records the maintainer decision of 2026-11-12 and the limits it accepts. diff --git a/.changeset/oracle-gaps-ending-ask.md b/.changeset/oracle-gaps-ending-ask.md deleted file mode 100644 index b5af8ca3..00000000 --- a/.changeset/oracle-gaps-ending-ask.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -Change how `oracle-gaps` ends a run whose ending is interrupted. A stop that the supervisor has received ends the run stopped, even when the run's refusal had begun, with one `done stopped` line on each stream and exit 128 plus the signal. A child that dies before its ending is written ends the run with one `done error` line and exit 3, instead of an internal error or no line. A child whose supervisor is killed while it awaits the supervisor's answer is ended by its process group's kill, with no done line, as a supervised child is when its supervisor is killed. diff --git a/.changeset/oracle-gaps-test-root-copies.md b/.changeset/oracle-gaps-test-root-copies.md deleted file mode 100644 index dc1aa493..00000000 --- a/.changeset/oracle-gaps-test-root-copies.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The `oracle-gaps` CLI judges the mutants of a package whose Vitest config sets `test.root`. Before, the CLI resolved each in-memory copy of a test file to its path, so Vite named the copy from its root and imported it again by that name. Under a test root other than the package, that name (`/.oracle-gaps-…`) matched no copy, the copy failed to load, and the mutants of an owner there reported `setup-error`. The CLI now leaves a copy unresolved: Vite keeps the absolute path that Vitest imports it by, and the CLI serves the copy from that path. This works for a test root inside the package, above it, a root that holds no test file, and a root that is a symbolic link. diff --git a/.changeset/oracle-property-const-inference.md b/.changeset/oracle-property-const-inference.md deleted file mode 100644 index 861c1911..00000000 --- a/.changeset/oracle-property-const-inference.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -`oracleProperty` infers a history from a literal with `const`, so a zero-argument `constructed[].build` that returns a literal compiles, and an annotated `model` without `resolve` keeps its annotated type, as on main. `constructed[].build` may return the read-only view of a history, `ReadonlyHistory`, which is a new public type export. - -**Breaking (types only, accepted by the maintainers on 2026-11-23).** A history that a literal infers is read-only: its arrays are read-only tuples. Code that needs a mutable array type no longer accepts it, in five cases: - -1. **Mutating it.** `model: (plan) => { plan.items.push(2) }` on an `enumerated` literal fails. Migrate by copying the array first: `const items: Array = [...plan.items]`, then mutate `items`. -2. **Passing it to a mutable-array parameter.** `takesMutable(plan.items)`, where the parameter is `Array`, fails. Migrate with a copy: `takesMutable([...plan.items])`. -3. **A discriminated-union branch.** Each branch keeps its own read-only array, so case 2 applies inside `if (plan.kind === 'a')`. Migrate the same way, inside the branch. -4. **A generic constrained to a mutable array** (`T extends Array`). Migrate by passing a copy: `firstOf([...plan.items])`. -5. **The new `ReadonlyHistory` export.** Code that names it receives the read-only view of a history. - -Generic functions without an array constraint (`identity(plan.items)`) keep the read-only type. Histories from `arbitrary` and `fixed` are unchanged. diff --git a/.changeset/oracle-property-owns.md b/.changeset/oracle-property-owns.md deleted file mode 100644 index 960e476a..00000000 --- a/.changeset/oracle-property-owns.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -`oracleProperty` takes an `owns` list: the production files or functions (`src/x.ts`, `src/x.ts#fn`) whose static call tree the oracle owns. The `oracle-gaps` CLI reads `owns` from an object-literal argument of any call in a test file, so a wrapper that forwards `owns` to `oracleProperty` (`registerX('id', { owns: [...] })`) names it at its call. A test file that calls `oracleProperty`, or passes such a list, is an oracle file, and it owns the union of its lists. Every test file is read, because a file that never calls `oracleProperty` still owns code when it passes `owns` to a wrapper that it imports. An `owns` key inside an assertion's arguments is data, so it is not read: an `expect` chain (including `.not`, `.soft`, a computed matcher, and an aliased `expect`), `assert` and its members, `chai`, `expectTypeOf`, `assertType`, and every binding imported from Node's `assert` (named, default, or namespace). An `owns` key in an object literal passed to any other call is read, so an unrelated domain object with that key makes the file an oracle file. A local function named like an assertion, such as `function assert() {}`, is skipped too. Each list must be a literal array of string or plain template literals. It refuses a run that has no oracle file, or in which no file owns a selected source, with one diagnostic. Before, such a run reported zero gaps without judging anything. `law.owner` is removed. Each run writes its output to a directory of its own by default, not to a shared `/tmp/oracle-gaps`. diff --git a/.changeset/plugin-consumer-parser.md b/.changeset/plugin-consumer-parser.md deleted file mode 100644 index 909a3ad8..00000000 --- a/.changeset/plugin-consumer-parser.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@tanstack/eslint-plugin-oracles': patch ---- - -Fix the plugin failing to load in a repository whose TypeScript is 7 or absent. `oracle/no-unit-test` imported `@typescript-eslint/parser` at load time, and that parser rejects TypeScript 7, so every config of the plugin failed to import. The rule now parses each imported test module with the parser and parser options that ESLint uses for the file it lints, through ESLint's own `Linter`, so it agrees with the consumer's config and needs no TypeScript of its own. `@typescript-eslint/parser` is no longer a dependency. - -A related fix: under espree, the rule saw no references at all; it now reads espree's scopes. The rule never throws on a module that its parser cannot read. - -Behavior to expect: an imported module is parsed with the linted file's parser, not its own. A `.js` oracle file linted with espree that imports a module with TypeScript syntax (for example `./x.js` resolved to `x.ts`) cannot classify that module's helpers. diff --git a/.changeset/plugin-empty-tests-and-scope.md b/.changeset/plugin-empty-tests-and-scope.md deleted file mode 100644 index 93bd0db4..00000000 --- a/.changeset/plugin-empty-tests-and-scope.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@tanstack/eslint-plugin-oracles': patch ---- - -`oracle/no-unit-test` now reports a test whose body is an empty function in an oracle file, such as `it('x', () => {})`, `test('x', async () => {})`, or `it.skip('x', () => {})`, with "This test's body is empty, so it checks nothing. Remove it, or use it.todo." Before, an empty body was exempt as a placeholder, so an oracle file could hold tests that judge nothing. A replay placeholder can register with `it.todo` instead. `it.todo('x', () => {})` is reported with "it.todo takes no body; remove the body." - -The `recommended` and `production` configs no longer apply to tool config files: the configs of ESLint, Vite, and Vitest (`vite.config.ts`, `vitest.unit.config.mjs`) and any `*.oracle.config.*`, such as `eslint.oracle.config.mjs`, whose names match the oracle-file globs. Companion oracle modules such as `foo-oracle.ts`, and source modules such as `src/foo.config.ts`, keep the rules. A config that spreads a preset and sets its own `ignores` must merge them with the preset's (`[...preset.ignores, ...own]`), as the README shows. - -The rules' source comments no longer cite files that the package does not ship, such as this repository's scripts and the `@tanstack/oracles` sources. diff --git a/.changeset/quiet-monkeys-brake.md b/.changeset/quiet-monkeys-brake.md deleted file mode 100644 index 1162ca85..00000000 --- a/.changeset/quiet-monkeys-brake.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -The gap report owns the functions of a module-level object literal when the literal is read dynamically (`handlers[key]()`), passed as a whole value, spread, or read with `Object.values`. A static read (`handlers.a()`) owns only that member, and an `owns` entry that names the literal owns none of its methods. Module functions that the literal names by shorthand (`{ helper }`) are owned whenever the literal is reached, as `{ helper: helper }` already is. A property name in an object literal no longer counts as a reference, so a static read or an `owns` entry on the literal no longer owns its arrow-function properties beyond the member read. diff --git a/.changeset/remove-legacy-campaigns.md b/.changeset/remove-legacy-campaigns.md deleted file mode 100644 index 5b581edd..00000000 --- a/.changeset/remove-legacy-campaigns.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/eslint-plugin-oracles': patch ---- - -`oracle/oracle-property-only` reports every raw campaign and legacy campaign import in an oracle file, and only a framework implementation module is exempt. No setting exempts a file. A configuration that sets `settings.oracles.legacyCampaigns`, to any value, gets one `removedSetting` report at line 1 of each oracle file, which says to convert the listed files to `oracleProperty` and delete the setting. diff --git a/.changeset/scope-anchors-to-declarations.md b/.changeset/scope-anchors-to-declarations.md deleted file mode 100644 index 40b61ba9..00000000 --- a/.changeset/scope-anchors-to-declarations.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -Scope a gap mutant's anchor to the innermost statement or declaration that holds it. A mutant in a default parameter, a property declaration, an enum member, a decorator, a heritage clause, or a computed member name of a class member, an object method, or an object accessor used to anchor to the whole file, so its gap key changed on every edit to that file. It now anchors to that declaration. A computed name on an object-literal property still anchors to its statement, as before. - -This changes gap keys once, and stored gaps for the changed keys should be re-baselined. Gaps recorded under the old keys show as new once. Measured on the 17 non-test gap-CLI sources as this branch ships them (base origin/main at fbb99aad, 7,269 mutants), 17 keys change in 5 files: 11 were whole-file anchors. One mutant in `classify.mjs`, a `value-undefined` on a default parameter inside a `const` statement, moved from its statement's anchor to its parameter. Five keys in `classify.mjs` (the `~2` to `~5` suffixes of one anchor) changed only their index, so a stored key for one of them now names a different mutant. The maintainers accepted these key changes ("slight change to gap keys is fine", 2026-11-23). - -Shipped bytes: the two shipped CLI files change by +469 bytes raw and +134 bytes gzip (`schemata.mjs` +454 raw, `report.mjs` +15 raw; the test file is not shipped). diff --git a/.changeset/shardable-units.md b/.changeset/shardable-units.md deleted file mode 100644 index f3c8eb58..00000000 --- a/.changeset/shardable-units.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -'@tanstack/oracles': patch -'@tanstack/eslint-plugin-oracles': patch ---- - -**Breaking for consumers.** Test names of generated sources change, and a path replay of a generated source now needs `${prefix}_UNIT`. A command or script that sets only the seed, the path, and the property now fails when the property registers. - -A generated source now registers each part of a campaign as its own test, so a runner can shard a long campaign across jobs. For each fixed seed N, `oracleProperty` registers `fixed seed N: ` for each constructed history and `fixed seed N: generated` for the generated histories. The random campaign registers `random seed: ` and `random seed: generated` in the same way. The determinism test becomes one test per history: `determinism: fixed history: `, `determinism: constructed history: `, and `determinism: generated 0` to `2`. The units of a seed run exactly the histories that the campaign ran. Each unit decides its own first failure, shrinks within its own timeout, and prints its own reach line, ` reach {...}`. A campaign's reach is the sum of its units' lines. A unit that fails or times out prints no reach line. An enumerated source keeps its one `determinism` test. - -Test names change. A `-t "fixed seed"` filter still selects the fixed-seed units, and `-t "random seed"` the random units. A filter that names the old `determinism` test of a generated source now selects all its determinism units. The random units of a property share one seed, which the first random unit that runs selects and logs in the one `ORACLE_SEED` line. - -A path replay now names its unit in the new `${prefix}_UNIT` variable, such as `ORACLE_UNIT='random seed: generated'`. `UNIT` requires `PROPERTY`. During a path replay, only the random unit of that name runs. A path replay of a generated source without `UNIT` fails when the property registers, with "`ORACLE_PATH` of a generated source requires `ORACLE_UNIT`". A `UNIT` that names no random unit of the replayed property also fails its registration. A failing unit prints its replay command, with the seed, the path, the property, the unit, and its `-t` pattern, under the configured prefix. A failing fixed-seed unit also prints `Rerun: -t '...'`, which reruns it. The retired-variable message names `${prefix}_UNIT`. - -To migrate a recorded path, rebase it onto its unit. In the old campaign, the first index of a path selected the history: an index k below n, the number of constructed histories, was constructed history k, and an index k of n or more was generated history k − n. With `PATH=k:`: - -- for k < n, set `${prefix}_UNIT='random seed: '` and `${prefix}_PATH=0:`; -- for k ≥ n, set `${prefix}_UNIT='random seed: generated'` and `${prefix}_PATH=(k − n):`. - -A path recorded from a fixed-seed campaign replays the same way, with that fixed seed as `${prefix}_SEED`. A new failure prints its replay command, so only paths recorded before this change need rebasing. - -A generated source fails to load when two of its tests would share a name: a constructed history named `generated`, two constructed histories of one name, or two fixed histories of one name. - -In `@tanstack/eslint-plugin-oracles`, `oracle/no-disabled` reads `${envPrefix}_UNIT` as a shared replay variable, and reports a `process.env` read of any other variable that ends in `_UNIT` as a private replay variable, as it does for `_SEED`, `_PATH`, `_PROPERTY`, and `_RUNS`. diff --git a/.changeset/ship-oracle-skills.md b/.changeset/ship-oracle-skills.md deleted file mode 100644 index 4228e14a..00000000 --- a/.changeset/ship-oracle-skills.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@tanstack/oracles': patch -'@tanstack/eslint-plugin-oracles': patch ---- - -Ship agent skills and docs inside `@tanstack/oracles`. The package now includes `skills/` with five skills: `oracles-explore` (the entry point: it probes a repository, shows what an oracle can find, and builds the first oracle with the developer), `oracles-setup`, `oracles-design`, `oracles-review`, and `oracles-evaluate-review`. It also includes `docs/`: an introduction to oracles, the oracle checklist (version 1, ORC-001 to ORC-016), a glossary, a techniques guide, model-style examples, and six instrument cards. A coding agent reads them from `node_modules`. `@tanstack/eslint-plugin-oracles` gains a README that lists its configs and rules. diff --git a/.changeset/shrink-budget.md b/.changeset/shrink-budget.md deleted file mode 100644 index 331282ac..00000000 --- a/.changeset/shrink-budget.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/oracles': patch ---- - -A failing campaign now reports its law violation before its test times out, however slow its histories are. Before, fast-check shrank a failure without a limit. A slow property could then outlast its `timeout`, and Vitest reported only "Test timed out", with no law and no counterexample. Now a campaign starts no shrink run once half of the property's `timeout` has passed. It then reports the smallest counterexample that it found, with the first failure's law, and that counterexample replays. A counterexample that the limit stopped can be larger than the smallest that fails. To shrink further, raise `timeout`. A `timeout` of 0 or less means no timeout, as Vitest reads it, so it sets no limit. The limit is real time, so a seed-only rerun on another machine can report another counterexample under the same law. A path replay now runs its counterexample and does not shrink it again, so it reports the counterexample that it replays. A property whose runs each take less than half its `timeout` no longer needs `fc.limitShrink` to report its law in time. diff --git a/packages/eslint-plugin-oracles/CHANGELOG.md b/packages/eslint-plugin-oracles/CHANGELOG.md new file mode 100644 index 00000000..e636bc28 --- /dev/null +++ b/packages/eslint-plugin-oracles/CHANGELOG.md @@ -0,0 +1,65 @@ +# @tanstack/eslint-plugin-oracles + +## 0.0.1 + +### Patch Changes + +- Add ESLint rules for oracle tests: no disabled oracles, no unit tests in oracle files, pure models, replayable seeds, and the production probe form. `oracle/no-unit-test` holds an oracle file to registering its tests only through `oracleProperty`. It reports every other test registration as a unit test, and a helper that registers its caller's body. It also reports an `oracleProperty` call without an inline `check`, and an imported helper that registers tests of its own. `oracle/no-unit-test`, `oracle/no-disabled`, and `oracle/oracle-property-only` share one account of a test function: a test framework's test function or suite, or a fixture of one, by the source of its binding (see the README's "Where a test function comes from"). They follow imports, aliases, namespace members, variables and their assignments, destructurings, casts, the branches of a conditional or logical expression, tagged-template `.each`, and the exports of relative test modules. A binding to anything else, and a member that is no registration such as `test.step`, is no test function, whatever its name. The README lists the forms that the rules do not recognize: a test function passed as a parameter, one that a third-party package exports under a name that no framework uses, a computed member that is not a string literal, and a modifier call that another module exports. A fixed history, case, calibration, or reach check goes in the property's histories, calibrations, and declared states; any other test goes in an ordinary test file. `settings.oracles` sets the environment prefix and the modules that count as implementation and replay-witness modules. ([#2](https://github.com/TanStack/oracles/pull/2)) + + Add the `oracle/oracle-property-only` rule, enabled in `configs.recommended`. In an oracle file it reports a raw property campaign (`fc.assert`, `fc.check`, or a `.prop` registration, through `fast-check` or `@fast-check/vitest`) and an import of `createOracleReach` or `runOracleCampaign`, so a generated-history law runs through `oracleProperty` and its constructed histories. Framework implementation modules are exempt. A non-array `implementationModules` or `replayWitnessModules` is reported at line 1 and read as empty. The rule never throws. + + Add the `oracle/no-oracle-disable` rule, enabled in `configs.recommended` and `configs.production`. It reports every ESLint directive that would silence an `oracle/*` rule: a rule list that names one (bare, single-quoted, or double-quoted), a directive with no rule list, and an inline config comment that names one. Oracle rules cannot be disabled inline. A report sits on the directive's line; a directive that names this rule or has no list, or that an earlier block directive covers, is reported at line 1, column 0. Residuals the rule cannot close: a directive on line 1 that names this rule or has no list, and a production config comment that turns this rule off. + + The `recommended` config sets `linterOptions.noInlineConfig` on oracle files. ESLint ignores every directive in those files, for every rule, not only the oracle rules. A directive for another rule in an oracle file has no effect, so a project that relied on one must move the suppression or fix the code. The production config's probe-form rule covers `packages/*/src` and a single-package `src` directory. + +- Publish the first release of the oracle testing framework, the bundled ([#342](https://github.com/TanStack/oracles/pull/342)) + `oracle-gaps` CLI and skills, and the ESLint plugin for oracle tests. + +- **Breaking (unreleased package):** `settings.oracles.unknownSources: 'ignore'` is removed. An unknown source never passes silently, and a global ignore mode contradicted that. The modes are now `'report'` (the default) and `'test'`. A configuration that still says `'ignore'` gets `malformedSetting` at line 1, with a message that names `settings.oracles.nonTestPackages`, and the rules read the setting as unset. To silence a specific package, list it in `settings.oracles.nonTestPackages`. ([#52](https://github.com/TanStack/oracles/pull/52)) + + The malformed-setting report has one message id, `malformedSetting`, in both `oracle/no-unit-test` and `oracle/oracle-property-only`. It replaces `malformedSourceSetting`, which `oracle/no-unit-test` reported before this change. + +- `oracle/no-unit-test`, `oracle/no-disabled`, and `oracle/oracle-property-only` now decide whether a callee is a test function by where its binding comes from, not by its name alone. Before, any package's export named `it`, `test`, `describe`, `suite`, or `bench` was a test function, so Ramda's `test` and mitata's `bench` were reported. A default import was never a test function, so `import test from 'ava'`, `'node:test'`, or `'@playwright/test'` was silent, and so were `xit`, `fit`, node:test's `skip` and `only`, `Deno.test`, `require('node:test')`, and fixtures with other names. ([#45](https://github.com/TanStack/oracles/pull/45)) + + - The rules know the test frameworks: Vitest (and `@vitest/runner`, `vite-plus/test`, `@fast-check/vitest`, `@effect/vitest`), Playwright and its component-testing packages, Jest (`@jest/globals`, `jest-each`, `@fast-check/jest`), Mocha and `mocha-steps`, node:test (and the `test` package), AVA (and `@fast-check/ava`), tap, tape, zora, brittle, uvu, `bun:test`, `@std/testing/bdd`, QUnit, Japa, and Lab. Each framework's default, named, namespace, and `require` exports count, with the modifiers that an export carries (`xit`, `fit`, `skip`, `only`, `todo`) and its factories (`mergeTests`, uvu's `suite`, `jest-each`, Lab's `script`). Members such as `.fail`, `.failing`, `.expectFailure`, `.ignore`, `.if`, `.todoIf`, `.override`, `.scoped`, and `.effect` keep a registration. The globals of the Vitest, Jest, Mocha, and Jasmine environments count too, and so do `Deno.test` and `QUnit.test`. + - The rules know packages that export other functions under these names, such as Ramda, Rambda, remeda, lodash, mitata, benny, `@thi.ng/*`, and `@tensorflow/*`. Their exports are never reported. + - The rules read a project's own modules: relative modules, `#` imports through the nearest `package.json` `imports` (a target that names a package is classified as that package), and workspace packages (a `node_modules` link to a real path outside `node_modules`), through their `exports`. They never read a package under `node_modules`; a project whose own path is under a `node_modules` directory is still read. + - `settings.oracles.testPackages` maps a specifier to a framework's specifier or to a table of export roles, and `settings.oracles.nonTestPackages` lists packages without test functions. Both are read first. A setting that the rules cannot use, including a `settings.oracles` that is not an object, is reported as `malformedSetting` and read as unset; it never makes a rule throw. + - Any other source is one the rules cannot classify, whatever the import's name. By default (`settings.oracles.unknownSources: 'report'`), `oracle/no-unit-test` reports `unknownTestSource` once per import, at the import, for a title-shaped call through it (a string title, then a function), and for a call to a relative helper that makes one. A call with no title before its function, such as `pMap(xs, fn)` or `effect(fn)`, gets none. Machinery files (`oracle-*`) get the report too. `'test'` reads a framework's name from such a source as the framework's. There is no `'ignore'` mode: a package is silenced only by `settings.oracles.nonTestPackages`. + - A registration's body follows its title, except where the framework's title is optional (node:test, tap, tape, brittle, `Deno.test`), where `test(fn)` registers. Playwright's annotations (`test.skip()`, `test.skip('reason')`, `test.skip(condition, 'reason')`, `test.skip(fixtures => condition, 'reason')`, and the same forms of `fixme`, `fail`, and `slow`) register nothing; `oracle/no-disabled` reports the `skip` and `fixme` ones. + - The README's new "Decisions" section records the maintainer decision of 2026-11-12 and the limits it accepts. + +- Fix the plugin failing to load in a repository whose TypeScript is 7 or absent. `oracle/no-unit-test` imported `@typescript-eslint/parser` at load time, and that parser rejects TypeScript 7, so every config of the plugin failed to import. The rule now parses each imported test module with the parser and parser options that ESLint uses for the file it lints, through ESLint's own `Linter`, so it agrees with the consumer's config and needs no TypeScript of its own. `@typescript-eslint/parser` is no longer a dependency. ([#13](https://github.com/TanStack/oracles/pull/13)) + + A related fix: under espree, the rule saw no references at all; it now reads espree's scopes. The rule never throws on a module that its parser cannot read. + + Behavior to expect: an imported module is parsed with the linted file's parser, not its own. A `.js` oracle file linted with espree that imports a module with TypeScript syntax (for example `./x.js` resolved to `x.ts`) cannot classify that module's helpers. + +- `oracle/no-unit-test` now reports a test whose body is an empty function in an oracle file, such as `it('x', () => {})`, `test('x', async () => {})`, or `it.skip('x', () => {})`, with "This test's body is empty, so it checks nothing. Remove it, or use it.todo." Before, an empty body was exempt as a placeholder, so an oracle file could hold tests that judge nothing. A replay placeholder can register with `it.todo` instead. `it.todo('x', () => {})` is reported with "it.todo takes no body; remove the body." ([#16](https://github.com/TanStack/oracles/pull/16)) + + The `recommended` and `production` configs no longer apply to tool config files: the configs of ESLint, Vite, and Vitest (`vite.config.ts`, `vitest.unit.config.mjs`) and any `*.oracle.config.*`, such as `eslint.oracle.config.mjs`, whose names match the oracle-file globs. Companion oracle modules such as `foo-oracle.ts`, and source modules such as `src/foo.config.ts`, keep the rules. A config that spreads a preset and sets its own `ignores` must merge them with the preset's (`[...preset.ignores, ...own]`), as the README shows. + + The rules' source comments no longer cite files that the package does not ship, such as this repository's scripts and the `@tanstack/oracles` sources. + +- `oracle/oracle-property-only` reports every raw campaign and legacy campaign import in an oracle file, and only a framework implementation module is exempt. No setting exempts a file. A configuration that sets `settings.oracles.legacyCampaigns`, to any value, gets one `removedSetting` report at line 1 of each oracle file, which says to convert the listed files to `oracleProperty` and delete the setting. ([#23](https://github.com/TanStack/oracles/pull/23)) + +- **Breaking for consumers.** Test names of generated sources change, and a path replay of a generated source now needs `${prefix}_UNIT`. A command or script that sets only the seed, the path, and the property now fails when the property registers. ([#35](https://github.com/TanStack/oracles/pull/35)) + + A generated source now registers each part of a campaign as its own test, so a runner can shard a long campaign across jobs. For each fixed seed N, `oracleProperty` registers `fixed seed N: ` for each constructed history and `fixed seed N: generated` for the generated histories. The random campaign registers `random seed: ` and `random seed: generated` in the same way. The determinism test becomes one test per history: `determinism: fixed history: `, `determinism: constructed history: `, and `determinism: generated 0` to `2`. The units of a seed run exactly the histories that the campaign ran. Each unit decides its own first failure, shrinks within its own timeout, and prints its own reach line, ` reach {...}`. A campaign's reach is the sum of its units' lines. A unit that fails or times out prints no reach line. An enumerated source keeps its one `determinism` test. + + Test names change. A `-t "fixed seed"` filter still selects the fixed-seed units, and `-t "random seed"` the random units. A filter that names the old `determinism` test of a generated source now selects all its determinism units. The random units of a property share one seed, which the first random unit that runs selects and logs in the one `ORACLE_SEED` line. + + A path replay now names its unit in the new `${prefix}_UNIT` variable, such as `ORACLE_UNIT='random seed: generated'`. `UNIT` requires `PROPERTY`. During a path replay, only the random unit of that name runs. A path replay of a generated source without `UNIT` fails when the property registers, with "`ORACLE_PATH` of a generated source requires `ORACLE_UNIT`". A `UNIT` that names no random unit of the replayed property also fails its registration. A failing unit prints its replay command, with the seed, the path, the property, the unit, and its `-t` pattern, under the configured prefix. A failing fixed-seed unit also prints `Rerun: -t '...'`, which reruns it. The retired-variable message names `${prefix}_UNIT`. + + To migrate a recorded path, rebase it onto its unit. In the old campaign, the first index of a path selected the history: an index k below n, the number of constructed histories, was constructed history k, and an index k of n or more was generated history k − n. With `PATH=k:`: + + - for k < n, set `${prefix}_UNIT='random seed: '` and `${prefix}_PATH=0:`; + - for k ≥ n, set `${prefix}_UNIT='random seed: generated'` and `${prefix}_PATH=(k − n):`. + + A path recorded from a fixed-seed campaign replays the same way, with that fixed seed as `${prefix}_SEED`. A new failure prints its replay command, so only paths recorded before this change need rebasing. + + A generated source fails to load when two of its tests would share a name: a constructed history named `generated`, two constructed histories of one name, or two fixed histories of one name. + + In `@tanstack/eslint-plugin-oracles`, `oracle/no-disabled` reads `${envPrefix}_UNIT` as a shared replay variable, and reports a `process.env` read of any other variable that ends in `_UNIT` as a private replay variable, as it does for `_SEED`, `_PATH`, `_PROPERTY`, and `_RUNS`. + +- Ship agent skills and docs inside `@tanstack/oracles`. The package now includes `skills/` with five skills: `oracles-explore` (the entry point: it probes a repository, shows what an oracle can find, and builds the first oracle with the developer), `oracles-setup`, `oracles-design`, `oracles-review`, and `oracles-evaluate-review`. It also includes `docs/`: an introduction to oracles, the oracle checklist (version 1, ORC-001 to ORC-016), a glossary, a techniques guide, model-style examples, and six instrument cards. A coding agent reads them from `node_modules`. `@tanstack/eslint-plugin-oracles` gains a README that lists its configs and rules. ([#7](https://github.com/TanStack/oracles/pull/7)) diff --git a/packages/eslint-plugin-oracles/package.json b/packages/eslint-plugin-oracles/package.json index fd20450b..25b187c8 100644 --- a/packages/eslint-plugin-oracles/package.json +++ b/packages/eslint-plugin-oracles/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/eslint-plugin-oracles", - "version": "0.0.0", + "version": "0.0.1", "description": "ESLint rules for oracle tests: no disabled or unit-test oracles, pure models, replayable seeds, and the production probe form", "author": "Kyle Mathews", "license": "MIT", diff --git a/packages/oracles/CHANGELOG.md b/packages/oracles/CHANGELOG.md new file mode 100644 index 00000000..51900aea --- /dev/null +++ b/packages/oracles/CHANGELOG.md @@ -0,0 +1,183 @@ +# @tanstack/oracles + +## 0.0.1 + +### Patch Changes + +- Add the oracle framework core, extracted from TanStack DB: `oracleProperty`, the controlled clock, failure fidelity, and replay witnesses. `configureOracles({ envPrefix, registry, retiredVariables })` lets a project keep its own environment variable names and property registry. The main entry is ES modules only; `@tanstack/oracles/route` is a browser-safe entry for the route helpers (`oracleRoute`, `oracleRouteOf`, and `oracleFixedSeed`). The published sources no longer cite files that the package does not ship, such as the CLI's and the framework's own oracle tests. ([#1](https://github.com/TanStack/oracles/pull/1)) + +- Add the `oracle-gaps` CLI, which reports the gaps in a package's oracles. It runs operator mutants of the code that each oracle file owns (its `owns` lists) against only that file's tests, and classifies each surviving mutant: a comparison gap, a generator gap, no observed difference, or unowned code. A daemon (`--daemon`) reuses evidence across runs. `--env-prefix` names the project's oracle environment variables. ([#2](https://github.com/TanStack/oracles/pull/2)) + +- A calibration can now require the violation's difference as well as its law. Give it `difference`, a string that the violation's difference must contain, or a `RegExp` that it must match. The check must then reject the wrong answer for that reason. Before, a calibration could require only the law. An oracle that judged several faults under one law then had to put the fault in the law's name. The calibration test judges the law first. A corrupted trace that fails with another difference fails the calibration and names the difference that the check reported. A mutant driver goes on to the next candidate history, as it does for another law. A pattern matches anywhere in the difference, and a sticky (`y`) pattern matches only at its start. The empty difference holds `''` and `/(?:)/`, so such a requirement would reject any difference. It now fails the property's load. A check that gives a difference that is not text fails the calibration with an error that names the calibration and the law. A calibration without `difference` works as before. ([#32](https://github.com/TanStack/oracles/pull/32)) + +- Add direct `history` bindings for calibrations and `probeHistories` for automatic controls, so bound calibrations validate one selected premise instead of searching. Preserve fixed and enumerated history identity, including fixed declarations with unrelated `build` metadata, rebuild constructed histories from stable seeds, and resolve once per driver execution. Apply ordinary verdict ranking and optional difference requirements to bound mutants, validate clean declared reach, and retain selected-history error context. Retain search during migration with one warning per property outside collect-only runs, before search removal ahead of the first npm release. ([#31](https://github.com/TanStack/oracles/pull/31)) + + Dispatch selectors using their validated own key, so inherited selector tags cannot redirect a selected history or reject its source kind. + +- A campaign's generated histories no longer depend on its constructed histories, and each constructed history runs several bases from a stream of its own. The `generated` unit draws only from the property's arbitrary. Constructed history k builds from each of the first `bases` draws of the arbitrary's sample at the campaign's seed plus k, and every base must enter the states it names. The new `histories.bases` option sets that number. It must be a whole number of at least 1 (default 5), or the property fails to load. So appending a constructed history keeps every fixed seed's generated histories and every other constructed history's bases. Before, half of the generated unit's runs were constructed histories, weighted by how many there were, so appending one moved every run's draw, and each constructed unit ran one history. ([#122](https://github.com/TanStack/oracles/pull/122)) + + A costly property can keep few fixed bases and still vary its constructed histories from run to run with the new `histories.drawnBases` option (a whole number of at least 0, default 0). After its fixed bases, each constructed unit runs that many more, drawn from the run's random seed: the seed the random units run, which the `ORACLE_SEED` line logs. That line now comes from the first unit that uses the seed, which may be a fixed-seed constructed unit. A failure on a drawn base says which base it was, prints its full history as the counterexample, and prints a replay line with the run's seed, at which the random unit of the same name runs that base at the same index. + + This shifts each fixed seed once, for properties that have at least one constructed history. Their `generated` unit now runs other histories, and a seed-and-path replay line printed before this change for that unit no longer replays the same history. A constructed unit keeps its first base, and its first replay path index still selects it. Replay lines for properties without constructed histories stay valid: their `generated` unit already drew from the arbitrary alone. Each constructed unit now runs `bases` histories, so a campaign takes longer; set `bases` lower for a property whose constructed histories are slow. + +- The gap oracle's CLI resolves a mutant copy's bare imports from the test file the copy stands for, as that file's own run does. Before, a package whose config root lay above it (with its dependencies in its own node_modules) failed every copy with a setup error. ([#99](https://github.com/TanStack/oracles/pull/99)) + +- Fix stale results from the gap CLI's daemon (`--daemon`). A warm context now records every module that a batch of mutant runs loads, so the next check invalidates a module that changed. Before, only single runs recorded what they loaded. A hang can replace the context that recorded a module. Another context could then keep the old module after an edit. The daemon then reported results from before the edit, such as a kill that the cold run no longer finds. ([#37](https://github.com/TanStack/oracles/pull/37)) + + A stored run now also lists the modules that its copy evaluated. A module that only a mutated branch imports at run time is then one of its inputs. Before, an edit of such a module left the stored verdict in place. A run whose known inputs change while it runs is no longer stored. + +- An enumerated source can declare the states its laws depend on: `histories: { enumerated, states, measured }`, where `enumerated` is the list a plain enumerated source passes, and `states` and `measured` are state names. Every enumerated history runs, so a required state needs no constructed history. A `reach` test after the histories fails when no enumerated history entered a state in `states`, and otherwise prints how many entered each declared state, as ` enumerated reach {...}`. A history counts once it is judged, passing or violating its law. The reach test reuses what each history's test recorded. It runs again only a history whose test never started, such as one that a `-t` filter left out. A history whose test failed before a verdict or timed out counts for nothing. A judged history that enters a state outside `states` and `measured` fails its test. An enumerated source fails to load when it holds a key other than `enumerated`, `states`, and `measured`, or a state that is not a name; only a generated source binds a probe to a state. A plain list of histories registers no `reach` test. Any enumerated source now fails to load when its `label` names a history `reach` or `determinism`, because the rerun command for that history would also select the framework test of that name. ([#19](https://github.com/TanStack/oracles/pull/19)) + +- `oracleProperty` checks, when it registers a generated source, that its arbitrary can take back (`canShrinkWithoutContext`) each fixed history and each constructed history built from the first fixed seed (or seed 0 when there is none). If it cannot, the property fails to load with an error that names the property, the history (a fixed history's index and name, or a constructed history's name), and the fix. Before, the check ran only when the history's test ran, after the campaigns, and its message blamed the language. In fast-check 4, a `.map` without an unmapper takes no value back, at the whole history or anywhere inside it, so a history inside the language failed too. Give that `.map` an unmapper (its second argument). `fc.constant` and `fc.constantFrom` take back only primitives or the same object reference, so build objects with `fc.record` or `fc.tuple` over primitive leaves. `.chain`, `fc.func`, and `fc.commands` cannot take a value back. ([#15](https://github.com/TanStack/oracles/pull/15)) + + The check runs when the test file loads. One history that the arbitrary cannot take back now fails the load of the whole file, so it also blocks the file's other properties. Constructed histories are now built at import: a `build` that throws there fails the load with an error that names the property and the constructed history, with the build's error as its `cause`. + +- The `oracle-gaps` report leads with the baseline, and a failing oracle file no longer stops the run. ([#41](https://github.com/TanStack/oracles/pull/41)) + + - An oracle file that fails with no mutant active (a RED law, or a file that cannot load or launch) blocks only the mutants it owns. A mutant it owns that no passing owner kills is a new `blocked` gap, which names the failing file. The other mutants are judged, and the report says it is provisional. Before, the run refused with exit 2. A setup file that throws now blocks every owned mutant in the same way. + - A `blocked` line names each failing oracle file and its failing test, and says to make it pass and check again. + - With `--only`, the baseline runs only the owners of the selected mutants, so another file's failure no longer blocks the run. + - stdout and `summary.md` start with the baseline: each test file's result with its test counts, ordinary test files included, and for a failing file its failing test, its error, the law, difference, and counterexample of a law violation, and its replay command. Ordinary test files now run once in the baseline; they run against mutants only with `--ordinary`. `results.json` gains `provisional` and `baseline`. + - The legend says that a `crashed` gap is a gap, not a kill, and that its error is on the gap's Detail line in `summary.md` and in its `detail` in `results.json`. + - The last stdout line says that the check completed, with its gap count and its report (`oracle-gaps: done completed, gaps, report `). Exit codes do not change: 0 means the check completed, whatever its gaps. + +- A failing law no longer blocks the gap report for its whole file. In `oracle-gaps`, a test of an oracle file that fails with no mutant active judges nothing: it is left out per test, as a nondeterministic test is, and the passing tests of its file still judge the mutants the file owns. A failing law still runs in every copy of its file: its calls count toward the copy's call budget, its I/O and timers toward idle, and it keeps its reach, but its verdicts judge nothing and it is never charged extra work. A count cut that a failing law causes blocks the mutant by that law. A test of a `describe` whose `beforeAll` or `afterAll` throws is a failing law too. An owner file that fails outside its tests (it does not load, or a file-level hook throws) judges nothing, and another owner file's passing tests still judge the mutants they share. A mutant that no deterministic passing owner test reached is `blocked` by its owners' failing laws that reached it, and by owner files that judge nothing; its directive names them. The baseline prints one `oracle-gaps: blocked` line per failing law, named by its file and test names (or one per broken file), `results.json` lists each failing file's `laws`, and the report stays provisional. ([#176](https://github.com/TanStack/oracles/pull/176)) + +- Without `--config`, the `oracle-gaps` CLI now loads the Vitest config that Vitest itself would load for the package: the first of Vitest's config names in the package's directory, or else in the nearest parent directory that has one. Before, it looked only in the package's directory and ran Vitest's defaults when the config was in a parent. The baseline's replay command then ran under the parent's config, which Vitest found, and could find no test. A parent's config that defines `test.projects` now refuses the run, as the package's own does. ([#42](https://github.com/TanStack/oracles/pull/42)) + +- The `oracle-gaps` CLI takes `--config `, relative to `--package`, to select the package's Vitest config. Without it, the run loads the config that Vitest discovers, as before. The baseline output now starts with `config: `, or `no config file: Vitest's default discovery`. A `--config` that names no file of the package refuses the run. A run names its config once its contexts have loaded it, also when the analysis or the baseline then refuses the run. A failing owner's `replay:` command names the `--config` file too, so it runs the failing test under the same config, even when Vitest would discover another one. ([#26](https://github.com/TanStack/oracles/pull/26)) + + The runner's wrapper config now has the module format that Vite gives the package's own config, so Vite bundles that config as Vitest loads it. An `.mjs` or `.mts` config, or a `.js` or `.ts` config in a package with `"type": "module"`, gets an `.mts` wrapper, where a top-level `await` works. A `.cjs` or `.cts` config, or a `.js` or `.ts` config in a package without that type, gets a `.cts` wrapper, where `require` and `require.resolve` work. Before, every wrapper was a `.ts` file. In a package without `"type": "module"`, Vite bundled such a wrapper as CommonJS, so an `.mjs` config with a top-level `await` refused the run, and older Vite versions printed their CommonJS deprecation warning. + + A run with more than ten warm contexts (`--contexts`, which defaults to up to 16) no longer prints `MaxListenersExceededWarning`. Each context is a Vitest instance that listens on the process until it closes; the runner now raises the process's listener limit by one for each open context and lowers it when the context closes. + +- A mutant's copy of a test file now draws from `Math.random`, `crypto.getRandomValues`, and `crypto.randomUUID` what the original file draws. The `oracle-gaps` capture seeds these sources per test, by the test's key. It took the key from the copy's path, which names its batch, while the unmutated runs run the original file. A test that observes a draw therefore read as changed under a mutant that changed nothing. An `oracleProperty` campaign with no `--seed` draws its seed from `Math.random`, so its random units ran other histories under every mutant. A run with no `--seed` reported such mutants as `not-judged`, and its classes now match a seeded run's. ([#54](https://github.com/TanStack/oracles/pull/54)) + +- A check through `--daemon` now reruns a test after an edit to a file in the package that the test reads through `fs` (`readFileSync`, `readFile`, `existsSync`, `statSync`, or `fs/promises` `readFile` or `stat`), such as a JSON fixture or a snapshot. Before, the daemon reused the run that read the old file, while a cold run saw the edit. A directory that a test stats is an input as a directory. Reads outside the package, under `node_modules`, through other APIs, or from a test's own worker threads or child processes are no inputs. ([#55](https://github.com/TanStack/oracles/pull/55)) + + The daemon also stores each run under the text that the run read. Before, it stored a run under each input's text at the end of the run, so a module or file that changed during the run that read it (a test that rewrites a fixture it read, or a helper edited mid-check) kept the old verdict for the new text, and the next check through the daemon reported that stale verdict. A run whose input changed after it read it is now run again. + + A test that reads a source under test through `fs` (or as a `?raw` import) no longer makes each check through the daemon run its tests again. The test's read of the file and the instrumented module that the runner serves from it are now two inputs, each hashed by its own text. + +- The `oracle-gaps` report no longer reports a shortcut for speed as `not-observed`. A survivor that changed no observation but made a test do more work is now `extra-work`. Before, its directive said to observe a value or widen the oracle, which cannot work for a branch whose fast and general paths give the same result, and an author who removed the code instead made it slower. Work is the number of site evaluations that the test's instrumented production code makes, a deterministic count, never a time. The `extra-work` directive names the test, its work before and after, and the bound to declare. `oracleProperty` takes a new `work: { ratio }` option. Under the gap report, a mutant whose work in one of the property's tests is more than `ratio` times the unmodified code's work is killed under the law `work bound`. `ratio` must be a finite number of at least 1. A plain Vitest run has no unmodified run to compare with, so there the bound judges nothing. ([#48](https://github.com/TanStack/oracles/pull/48)) + +- Every line the `oracle-gaps` CLI writes for a check now starts with `oracle-gaps: ` and its kind, on stdout and stderr alike, cold and through `--daemon`, so an agent can act on the results as they stream with `grep '^oracle-gaps: '` and filter one kind by the word after the prefix: ([#46](https://github.com/TanStack/oracles/pull/46)) + + - `oracle-gaps: config `, or `oracle-gaps: config none, Vitest's default discovery` + - `oracle-gaps: baseline pass : tests` and `oracle-gaps: baseline fail : …`, with the failing test, law, counterexample, and replay indented under it + - one decisive line before any mutant runs: `oracle-gaps: baseline all oracle files pass`, or `oracle-gaps: baseline of oracle files failed (provisional)` + - `oracle-gaps: blocked …` for each failing oracle file + - `oracle-gaps: gap L `, streamed and in the stdout summary + - `oracle-gaps: progress …`, `oracle-gaps: busy in for s`, and `oracle-gaps: note …` (Vite's own messages as `note vite: …`) + - the stdout summary as lines too: `oracle-gaps: summary …` for the totals, `oracle-gaps: legend : …` for each directive, and `oracle-gaps: function …` for each function's heading over its gap lines + - a last line for every run: `oracle-gaps: done completed, gaps, report ` (with `(provisional)` after the count when an oracle file failed), `oracle-gaps: done refused[, report ]` after a refusal's `refused:` and `fix:` block, `oracle-gaps: done error, log `, or `oracle-gaps: done stopped ()` + + The done line is the last line of both stdout and stderr, once each, and its status matches the exit code. Only the lines indented under a failing baseline file and a refusal's `refused:` and `fix:` block have no prefix, and no line is blank. A test's own writes to the process's stdout and stderr go to `test-output.log` in the output directory, which a note names. The stdout summary's `output: `, `Full report:`, and `completed: gaps` lines are replaced by the done line, and the refusal's `output: ` line by `oracle-gaps: done refused, report `. Exit codes do not change. + + The wrapper config now reads the package's config as Vite does: it awaits a promise default and refuses a default that is not an object. A config with a syntax error is refused with its first error, before Vite bundles it. + +- The `oracle-gaps` CLI's internal error now prints one prefixed line, `oracle-gaps: error : a bug in oracle-gaps, not in your oracle; its stack is in `, before its `oracle-gaps: done error, log ` line. Before, its two message lines had no `oracle-gaps:` prefix. A line break in the message prints as an escape, so the message stays on one line. The stack stays in `error.log`, and the exit code stays 3. ([#128](https://github.com/TanStack/oracles/pull/128)) + + A path that a stream line names, such as the output directory in a done line or a note, now prints a line break or another control character as its `\uXXXX` escape, so a directory name cannot split the line. + +- The `oracle-gaps` CLI no longer ends a run with a bare stack trace. A problem in the author's own files or arguments (bad arguments, a `--source` that is missing or not a file, a broken `owns` declaration, no oracle file or no owner, a Vitest config that throws when it loads, has no default export, or defines `test.projects`, a Vitest that does not load, a setup file that throws, an oracle file that fails with no mutant active, an authored mutant file that is not JSON or is incomplete) refuses the run: it exits 2 and prints `refused: ` and `fix: `. When the output directory is known (even from `--out` alone, when other arguments are bad), the refusal is also written there as `results.json` (`{ "status": "refused", "cause", "directive" }`) and `summary.md`, replacing an earlier run's ending there, and the CLI's last line names that report (`oracle-gaps: done refused, report `). Any other error is a bug in the CLI: it exits 3, says so, and writes its stack to `error.log` in the output directory (or the system's temporary directory when none is known), with `results.json` status `internal-error`. A check through `--daemon` ends the same way. A daemon serves only a CLI of its own code, so a second install of the CLI starts its own daemon rather than reading another version's reply. ([#14](https://github.com/TanStack/oracles/pull/14)) + + Exit code 1 is no longer used: scripts that treated any non-zero exit as a failure keep working, and scripts that matched exit 1 must match 2 or 3. Arguments are now checked: an unknown option, an option with no value, a `--package` or `--mutants` directory that does not exist, a `--seed` that is not an integer, a count or limit that is not a positive whole number, and a `--pool` other than `threads` or `forks` each refuse the run instead of being ignored or failing later. + +- Fix the `oracle-gaps` CLI crashing on a package whose TypeScript has no compiler API, as TypeScript 7's package has (it exposes only its version). The CLI now analyzes with its own TypeScript 5 dependency and never reads the package's TypeScript, so a package with no TypeScript, or with TypeScript 7, is analyzed instead of refused or crashed. The optional `typescript` peer dependency is removed for that reason. A copy of the CLI's own TypeScript without the compiler API is refused before any work, with a message that names the fix. ([#5](https://github.com/TanStack/oracles/pull/5)) + +- The `oracle-gaps` work count no longer includes probe code. A site in probe-only code (the probe guard, a probe statement, or a probe helper) counts nothing toward a test's work, so a work bound no longer kills a mutant whose only extra work is a probe, such as an `if` forced into a branch that only calls `report()`. ([#121](https://github.com/TanStack/oracles/pull/121)) + +- The `oracle-gaps` CLI bounds a mutant's copies by counts, not by wall-clock limits, reports long runs, stops the processes it started, and writes nothing beside the tests. ([#40](https://github.com/TanStack/oracles/pull/40)) + + - No wall-clock limit decides an outcome. A copy that spins past its call budget, makes no progress, or whose work passes the mutant's work budget (the larger of 100,000 and ten times its owner files' unmutated work, counted in site evaluations, not in time) is killed by the built-in law `bounded work` or `no progress` on its test's route. A copy's call budget is a hundred times the most site evaluations that any unmutated test of its file made, and at least 100,000. A spin or a work-budget overrun kills only when the counts that decide it cannot follow the clock: a test that reads the clock, makes a timer, or does I/O of its own anywhere in its run is charged nothing, and its spin is a `timeout` named `(cause: spin)`. A copy makes no progress when none of its test's own timers is due before its backstop and none of its test's own I/O is pending; timers and I/O the runner keeps for itself, such as Vitest's task-update timer or a pending write that forwards the test's console output on Windows, do not keep it busy. Only the backstop (`--hang-limit`, 60 s by default, plus 3 s per second of the file's time) is a gap: the mutant is a `timeout`, named `(cause: backstop)` on its gap line, and no later copy runs. `--mutant-limit` and `--first-limit` are retired: they are checked and noted, and change nothing. + - While one copy of a test file runs for 30 s or more, the CLI prints `busy: in for s` every 30 s (`baseline` for a run with no mutant). Through `--daemon` the heartbeats arrive when the check ends. + - The check runs in a process group of its own, with every Vitest worker and every process a test starts, except one started detached in a session of its own. On SIGINT or SIGTERM the CLI signals the group, kills what is left 2 s later, and exits 130 or 143. Before, a SIGTERM left `forks` workers running. On Windows the run is not supervised. + - The runner's copies of the test files exist only in memory. Vitest's read of a copy for its per-file pragmas (`@vitest-environment`, `@module-tag`) is served its text, so a copy runs in its file's environment. The capture setup and Vitest configs are in a session directory of its own while it runs, which the run removes when it ends; one that a killed run left is removed by the next run. Before, the copies and configs sat beside the tests and the package's config, where a Vitest run started during a check found them and then failed when they were removed. + +- The `oracle-gaps` daemon keeps its evidence in a SQLite database instead of one JSON file, so a package with a large oracle file no longer fails every check with "Invalid string length" after two checks. The store prunes units no check has used for two weeks, returns the pages that replaced and pruned units freed, is written again when the OS cleans its directory while the daemon runs, starts over when its file is overwritten or corrupted while the daemon holds it (a check whose evidence cannot be written still reports its result), and keeps a unit it reuses from memory. The earlier `evidence.json` is removed when found. The static analysis keeps its ownership between checks while the production sources, the dependencies' declaration files, `owns` declarations, manifest, and lockfile are unchanged, so a daemon recheck after an edit to a test file skips the type-checker walk. With `ORACLE_GAPS_PROFILE`, each copy in a batch writes its own span. ([#314](https://github.com/TanStack/oracles/pull/314)) + +- A run of the `oracle-gaps` CLI that a stop ends, or whose check's process aborts, now removes its `/.oracle-gaps-/` session directory. Before, it left the directory for the next run to remove, and a run stopped as or before it started removed nothing, so the directory stayed in the package. Only a run whose own process is killed leaves it now, and the next run removes it. ([#164](https://github.com/TanStack/oracles/pull/164)) + +- The `oracle-gaps` CLI now writes the lines it streams on stderr to `stream.log` in the output directory too, in order, cold and through `--daemon`, and the first line of a check on both streams names that file: `oracle-gaps: note log /stream.log`. An agent that starts a cold check in the background can read the run's progress and its done line there while it runs. A check through `--daemon` prints its lines at the end of its check, so its progress is readable there only after it ends. ([#57](https://github.com/TanStack/oracles/pull/57)) + + A run takes its output directory's claim in `run.pid` before it starts, and a second run on a live directory refuses without writing into it. A `run.pid` that names no running process (stale), that is empty, or that cannot be read (a directory, or a link to no file) also refuses the run, without writing into the directory, and the refusal's fix line tells you to delete `/run.pid` if no run uses that directory. The CLI never takes over another run's claim. A refusal of a run with no `--out` is written to the default output directory the run would have used. On Linux and macOS the run's supervisor needs no external command: a container without `ps`, or with BusyBox's `ps`, runs the check as any other system does. + +- The `oracle-gaps` CLI keeps its working files out of the repository. The daemon's state (its lock, log, and evidence), the one-file bundles of workspace dependencies, and the default output directory now live in the OS temp directory, in a directory keyed by the package (`oracle-gaps-`, never a shared directory), which the OS cleans. A state that the OS removed is a cold start. `--out` is honored as before, and the run still prints its output path. While a run runs, its capture setup and Vitest configs are in `/.oracle-gaps-/`, which it removes when it ends; one that a killed run left is removed by the next run. A run leaves nothing in the package, so there is nothing to add to `.gitignore` or to delete. Before, every run wrote `/.oracle-gaps/` and `/.oracle-gaps/bundle-*.mjs`. ([#43](https://github.com/TanStack/oracles/pull/43)) + +- The `oracle-gaps` CLI's TypeScript is now the npm alias dependency `typescript-for-tanstack-oracles` (`npm:typescript@^5.9.2`), and the CLI resolves it by that name. Before, the plain `typescript` dependency was hoisted by npm to an adopter's root. A project without TypeScript got a `typescript` package, and a project with its own TypeScript range could have that range deduped up to 5.9. Now neither happens. npm still links the alias's `tsc` and `tsserver` into `node_modules/.bin` in a project without TypeScript. After an incremental `npm install` of this package into a project with TypeScript, `.bin/tsc` points at the alias until a clean install (`npm ci`, or removing `node_modules`); a later plain `npm install` does not repair it. That is still strictly better than before, when the same incremental install raised the project's root `typescript` itself, for example from 5.4.5 to 5.9.3. On a clean install, the project's own `typescript` provides `tsc`. pnpm links only direct dependencies' commands, so it is not affected. ([#18](https://github.com/TanStack/oracles/pull/18)) + +- `oracle-gaps --diff-base ` now judges only the mutants on lines changed since ``, for fast feedback after a change. Operator and authored mutants both count, and a mutant is on a changed line when any line from its first to its last is changed. Every line of a source file that git does not track is changed. The baseline still runs every test file that the run without the option runs, and each judged mutant gets the outcome it gets in the full run. An authored mutant that does not apply is reported on every run with the option, as it is without it. The run says so on its stream before the baseline, `oracle-gaps: note --diff-base : of mutants are on changed lines; the others are not judged in this run`, and in the same sentence in `summary.md`; `` counts the run without the option, with the same `--only` or `--sample`. Its `results.json` and `summary.md` inputs say `a partial run (--only, --sample, or --diff-base)`, as an `--only` or `--sample` run's do (their text used to read `(--only or --sample)`). Authored mutants are marked `inDiff` too. ([#290](https://github.com/TanStack/oracles/pull/290)) + + `oracle-gaps --diff-base ` refuses a revision that names no commit of the git repository that holds the package: a name git does not know, a range, a blob, an option such as `--cached`, an empty value, or a package in no repository. It exits 2 with `refused: --diff-base "" names no commit of the git repository that holds the package` and a `fix:` line, before any test runs. Before, the run went on and marked every mutant `inDiff: false`. `results.json` records the commit as `options.diffBase: { rev, commit }` (it was the revision as given), so the run identity follows the commit and not the name. + + Before, `--diff-base` only added `inDiff` to each operator mutant in `results.json`, and every mutant still ran. Run a full check without `--diff-base` to judge the other lines. + +- The `oracle-gaps` report gives each gap a class and one directive with a concrete next step. A message never offers an exit such as an equivalent mutant or a maintainer approval. Survivors are `not-judged`, `indeterminate`, `dead-code`, `branch-never-taken`, `not-infected`, or `not-observed`. A `crashed` gap names the error that production threw, and tells the author to record it as an observation and state the law. Standard output is short. It has the totals, one legend line for each class, and gaps grouped by function. It also has the unowned warnings counted for each function, and the paths of `summary.md` and `results.json`. The full report is in `summary.md`. The CLI also streams its progress: the baseline result first, then one line for each gap when the CLI judges it, then the summary. ([#12](https://github.com/TanStack/oracles/pull/12)) + +- Fix four parts of the `oracle-gaps` output. ([#20](https://github.com/TanStack/oracles/pull/20)) + + - The baseline's replay command now runs the failing test. Before, its `-t` pattern was the test's `>`-joined name in JSON quotes: Vitest 4 matches `-t` against names joined by a space, so a test in a `describe` ran nothing, and a name with regular-expression syntax, `$`, or a backtick broke the pattern or the shell. The pattern is now the suites' and the test's names, escaped, joined to match Vitest 4 and Vitest 5, anchored, and in single quotes. A file that fails with no failing test (it did not load) replays whole, with no `-t`, where before it printed `-t undefined`. A control character in a test's name or failure, such as a newline, prints as its `\uXXXX` escape, in the baseline and in messages, so each stays one line. + - A gap line stays one line: the code of an operator mutant and the intent of an authored mutant have their whitespace collapsed and are cut at 60 characters with `...`, counted by code point so that a cut never splits an emoji. An authored intent prints as a code span. `results.json` keeps the full text. + - A `not-infected` message prints each operand as a code span of a typed value: strings quoted, `-0` as `-0`, bigints with `n`, and `undefined`, `null`, `NaN`, and a value that is not a primitive kept apart. A string longer than 40 characters (code points) prints its first 37 and a digest. Before, `1` and `"1"`, `0` and `-0`, and two long strings with one prefix printed alike. + - A `not-observed` directive also tells the author to add a history where the mutated code computes something different, because the run cannot tell a value nothing observed from a forced branch that computed the original's result. + +- The tests and files that an `oracle-gaps` report names no longer depend on how the run was made. They are now in report order: by file path, compared by code unit, and within a file in the order of the baseline run's records. This applies to a message's test, the `Owners` and `Changed observations in` lists, the operands of a `not-infected` message, the tests of an `indeterminate` message, the files that a refusal names or that the report leaves out (`excluded`), and results.json's `nondeterministic` tests. Kill, crash, and framework-error messages also order files by path. Within a file, they use the order in which the reporter lists the file's tests. A batch that a hang cut off uses the order of the mutant run's records. An operator mutant's owner files also run in path order, so a kill names the laws of the first file that kills. ([#30](https://github.com/TanStack/oracles/pull/30)) + + Before, these lists followed the order in which the runner joined its contexts' units. So `--contexts`, whose default depends on the machine's cores, could change which test a message named. An authored mutant's lists followed the order in which its owners were declared. + +- 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. ([#3](https://github.com/TanStack/oracles/pull/3)) + +- Publish the first release of the oracle testing framework, the bundled ([#342](https://github.com/TanStack/oracles/pull/342)) + `oracle-gaps` CLI and skills, and the ESLint plugin for oracle tests. + +- The gap report's per-law table is now titled "First law to reject, by law". It says that each count credits only the first law that rejected a history, because a check returns its first violation and a later law on the same history is not checked. A law with no count is not shown to reject nothing. The section's next step tells the author to add a history that varies the input the law judges. ([#22](https://github.com/TanStack/oracles/pull/22)) + +- Change how `oracle-gaps` ends a run whose ending is interrupted. A stop that the supervisor has received ends the run stopped, even when the run's refusal had begun, with one `done stopped` line on each stream and exit 128 plus the signal. A child that dies before its ending is written ends the run with one `done error` line and exit 3, instead of an internal error or no line. A child whose supervisor is killed while it awaits the supervisor's answer is ended by its process group's kill, with no done line, as a supervised child is when its supervisor is killed. ([#307](https://github.com/TanStack/oracles/pull/307)) + +- The `oracle-gaps` CLI judges the mutants of a package whose Vitest config sets `test.root`. Before, the CLI resolved each in-memory copy of a test file to its path, so Vite named the copy from its root and imported it again by that name. Under a test root other than the package, that name (`/.oracle-gaps-…`) matched no copy, the copy failed to load, and the mutants of an owner there reported `setup-error`. The CLI now leaves a copy unresolved: Vite keeps the absolute path that Vitest imports it by, and the CLI serves the copy from that path. This works for a test root inside the package, above it, a root that holds no test file, and a root that is a symbolic link. ([#103](https://github.com/TanStack/oracles/pull/103)) + +- `oracleProperty` infers a history from a literal with `const`, so a zero-argument `constructed[].build` that returns a literal compiles, and an annotated `model` without `resolve` keeps its annotated type, as on main. `constructed[].build` may return the read-only view of a history, `ReadonlyHistory`, which is a new public type export. ([#195](https://github.com/TanStack/oracles/pull/195)) + + **Breaking (types only, accepted by the maintainers on 2026-11-23).** A history that a literal infers is read-only: its arrays are read-only tuples. Code that needs a mutable array type no longer accepts it, in five cases: + + 1. **Mutating it.** `model: (plan) => { plan.items.push(2) }` on an `enumerated` literal fails. Migrate by copying the array first: `const items: Array = [...plan.items]`, then mutate `items`. + 2. **Passing it to a mutable-array parameter.** `takesMutable(plan.items)`, where the parameter is `Array`, fails. Migrate with a copy: `takesMutable([...plan.items])`. + 3. **A discriminated-union branch.** Each branch keeps its own read-only array, so case 2 applies inside `if (plan.kind === 'a')`. Migrate the same way, inside the branch. + 4. **A generic constrained to a mutable array** (`T extends Array`). Migrate by passing a copy: `firstOf([...plan.items])`. + 5. **The new `ReadonlyHistory` export.** Code that names it receives the read-only view of a history. + + Generic functions without an array constraint (`identity(plan.items)`) keep the read-only type. Histories from `arbitrary` and `fixed` are unchanged. + +- `oracleProperty` takes an `owns` list: the production files or functions (`src/x.ts`, `src/x.ts#fn`) whose static call tree the oracle owns. The `oracle-gaps` CLI reads `owns` from an object-literal argument of any call in a test file, so a wrapper that forwards `owns` to `oracleProperty` (`registerX('id', { owns: [...] })`) names it at its call. A test file that calls `oracleProperty`, or passes such a list, is an oracle file, and it owns the union of its lists. Every test file is read, because a file that never calls `oracleProperty` still owns code when it passes `owns` to a wrapper that it imports. An `owns` key inside an assertion's arguments is data, so it is not read: an `expect` chain (including `.not`, `.soft`, a computed matcher, and an aliased `expect`), `assert` and its members, `chai`, `expectTypeOf`, `assertType`, and every binding imported from Node's `assert` (named, default, or namespace). An `owns` key in an object literal passed to any other call is read, so an unrelated domain object with that key makes the file an oracle file. A local function named like an assertion, such as `function assert() {}`, is skipped too. Each list must be a literal array of string or plain template literals. It refuses a run that has no oracle file, or in which no file owns a selected source, with one diagnostic. Before, such a run reported zero gaps without judging anything. `law.owner` is removed. Each run writes its output to a directory of its own by default, not to a shared `/tmp/oracle-gaps`. ([#11](https://github.com/TanStack/oracles/pull/11)) + +- The gap report owns the functions of a module-level object literal when the literal is read dynamically (`handlers[key]()`), passed as a whole value, spread, or read with `Object.values`. A static read (`handlers.a()`) owns only that member, and an `owns` entry that names the literal owns none of its methods. Module functions that the literal names by shorthand (`{ helper }`) are owned whenever the literal is reached, as `{ helper: helper }` already is. A property name in an object literal no longer counts as a reference, so a static read or an `owns` entry on the literal no longer owns its arrow-function properties beyond the member read. ([#197](https://github.com/TanStack/oracles/pull/197)) + +- Scope a gap mutant's anchor to the innermost statement or declaration that holds it. A mutant in a default parameter, a property declaration, an enum member, a decorator, a heritage clause, or a computed member name of a class member, an object method, or an object accessor used to anchor to the whole file, so its gap key changed on every edit to that file. It now anchors to that declaration. A computed name on an object-literal property still anchors to its statement, as before. ([#196](https://github.com/TanStack/oracles/pull/196)) + + This changes gap keys once, and stored gaps for the changed keys should be re-baselined. Gaps recorded under the old keys show as new once. Measured on the 17 non-test gap-CLI sources as this branch ships them (base origin/main at fbb99aad, 7,269 mutants), 17 keys change in 5 files: 11 were whole-file anchors. One mutant in `classify.mjs`, a `value-undefined` on a default parameter inside a `const` statement, moved from its statement's anchor to its parameter. Five keys in `classify.mjs` (the `~2` to `~5` suffixes of one anchor) changed only their index, so a stored key for one of them now names a different mutant. The maintainers accepted these key changes ("slight change to gap keys is fine", 2026-11-23). + + Shipped bytes: the two shipped CLI files change by +469 bytes raw and +134 bytes gzip (`schemata.mjs` +454 raw, `report.mjs` +15 raw; the test file is not shipped). + +- **Breaking for consumers.** Test names of generated sources change, and a path replay of a generated source now needs `${prefix}_UNIT`. A command or script that sets only the seed, the path, and the property now fails when the property registers. ([#35](https://github.com/TanStack/oracles/pull/35)) + + A generated source now registers each part of a campaign as its own test, so a runner can shard a long campaign across jobs. For each fixed seed N, `oracleProperty` registers `fixed seed N: ` for each constructed history and `fixed seed N: generated` for the generated histories. The random campaign registers `random seed: ` and `random seed: generated` in the same way. The determinism test becomes one test per history: `determinism: fixed history: `, `determinism: constructed history: `, and `determinism: generated 0` to `2`. The units of a seed run exactly the histories that the campaign ran. Each unit decides its own first failure, shrinks within its own timeout, and prints its own reach line, ` reach {...}`. A campaign's reach is the sum of its units' lines. A unit that fails or times out prints no reach line. An enumerated source keeps its one `determinism` test. + + Test names change. A `-t "fixed seed"` filter still selects the fixed-seed units, and `-t "random seed"` the random units. A filter that names the old `determinism` test of a generated source now selects all its determinism units. The random units of a property share one seed, which the first random unit that runs selects and logs in the one `ORACLE_SEED` line. + + A path replay now names its unit in the new `${prefix}_UNIT` variable, such as `ORACLE_UNIT='random seed: generated'`. `UNIT` requires `PROPERTY`. During a path replay, only the random unit of that name runs. A path replay of a generated source without `UNIT` fails when the property registers, with "`ORACLE_PATH` of a generated source requires `ORACLE_UNIT`". A `UNIT` that names no random unit of the replayed property also fails its registration. A failing unit prints its replay command, with the seed, the path, the property, the unit, and its `-t` pattern, under the configured prefix. A failing fixed-seed unit also prints `Rerun: -t '...'`, which reruns it. The retired-variable message names `${prefix}_UNIT`. + + To migrate a recorded path, rebase it onto its unit. In the old campaign, the first index of a path selected the history: an index k below n, the number of constructed histories, was constructed history k, and an index k of n or more was generated history k − n. With `PATH=k:`: + + - for k < n, set `${prefix}_UNIT='random seed: '` and `${prefix}_PATH=0:`; + - for k ≥ n, set `${prefix}_UNIT='random seed: generated'` and `${prefix}_PATH=(k − n):`. + + A path recorded from a fixed-seed campaign replays the same way, with that fixed seed as `${prefix}_SEED`. A new failure prints its replay command, so only paths recorded before this change need rebasing. + + A generated source fails to load when two of its tests would share a name: a constructed history named `generated`, two constructed histories of one name, or two fixed histories of one name. + + In `@tanstack/eslint-plugin-oracles`, `oracle/no-disabled` reads `${envPrefix}_UNIT` as a shared replay variable, and reports a `process.env` read of any other variable that ends in `_UNIT` as a private replay variable, as it does for `_SEED`, `_PATH`, `_PROPERTY`, and `_RUNS`. + +- Ship agent skills and docs inside `@tanstack/oracles`. The package now includes `skills/` with five skills: `oracles-explore` (the entry point: it probes a repository, shows what an oracle can find, and builds the first oracle with the developer), `oracles-setup`, `oracles-design`, `oracles-review`, and `oracles-evaluate-review`. It also includes `docs/`: an introduction to oracles, the oracle checklist (version 1, ORC-001 to ORC-016), a glossary, a techniques guide, model-style examples, and six instrument cards. A coding agent reads them from `node_modules`. `@tanstack/eslint-plugin-oracles` gains a README that lists its configs and rules. ([#7](https://github.com/TanStack/oracles/pull/7)) + +- A failing campaign now reports its law violation before its test times out, however slow its histories are. Before, fast-check shrank a failure without a limit. A slow property could then outlast its `timeout`, and Vitest reported only "Test timed out", with no law and no counterexample. Now a campaign starts no shrink run once half of the property's `timeout` has passed. It then reports the smallest counterexample that it found, with the first failure's law, and that counterexample replays. A counterexample that the limit stopped can be larger than the smallest that fails. To shrink further, raise `timeout`. A `timeout` of 0 or less means no timeout, as Vitest reads it, so it sets no limit. The limit is real time, so a seed-only rerun on another machine can report another counterexample under the same law. A path replay now runs its counterexample and does not shrink it again, so it reports the counterexample that it replays. A property whose runs each take less than half its `timeout` no longer needs `fc.limitShrink` to report its law in time. ([#29](https://github.com/TanStack/oracles/pull/29)) diff --git a/packages/oracles/package.json b/packages/oracles/package.json index c6025f58..748acd08 100644 --- a/packages/oracles/package.json +++ b/packages/oracles/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/oracles", - "version": "0.0.0", + "version": "0.0.1", "description": "Oracle-based testing: laws, generated histories, independent models, and gap reports", "author": "Kyle Mathews", "license": "MIT",