Repository navigation
test: adopt @tanstack/oracles d1b508a (owns on oracleProperty, no law.owner) - #2407
Conversation
Co-authored-by: Isaac <no-reply@databricks.com>
@tanstack/oracles d1b508a drops `owner` from OracleLaw: code ownership belongs to CODEOWNERS (maintainer decision, 2026-11-10). Remove the field from every law literal passed to oracleProperty and from the shared law objects that those calls receive. Co-authored-by: Isaac <no-reply@databricks.com>
The same removal as the previous commit, for the oracle laws under scripts/. Co-authored-by: Isaac <no-reply@databricks.com>
@tanstack/oracles d1b508a lets oracleProperty take `owns`, with the meaning that declareOracle's `owns` has. Move each file's owns list into its inline oracleProperty calls, verbatim and in order. A file with several calls repeats the list on each call; the gap report judges ownership per file, so the meaning is the same. A declareOracle call left with no part is removed with its import. Files that register through a driver or wrapper and have no inline oracleProperty call keep their declareOracle owns. The set of (file, owns entry) pairs that the gap report reads is unchanged: 515 pairs in 242 files before and after. Co-authored-by: Isaac <no-reply@databricks.com>
State where an oracle file names the production code it judges: the inline `owns` list of each oracleProperty call, in the literal form the gap report reads statically. A file with no inline oracleProperty call keeps declareOracle's owns during the migration. A law has no owner field; code ownership belongs to CODEOWNERS. The coverage map's oracle owner keeps its meaning. Co-authored-by: Isaac <no-reply@databricks.com>
|
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Incremental update benchmarkComparing Overall median write time vs base: 1.01× · cold hydrate time: 1.01× (geometric mean of per-case ratios; lower is faster). Writes: 1 regression(s), 0 improvement(s) (threshold: ±20% and >0.05ms). Cold hydrate: No significant changes (threshold: ±50% and >5ms). CI regression gate: PASS. Query geometric means: >+30% writes or >+50% cold. A case also fails when every repetition exceeds the entire base range by >+50% and the metric's absolute floor. Per-case flags are noisy on shared runners. Read the geometric means first. Writes
Cold hydrate
Each row aggregates that query's scale/index/write-mode configurations; per-configuration tables below. 100 rows/collection | source indexes: none | synced writes — geomean 0.87×, cold 0.89×
100 rows/collection | source indexes: none | optimistic writes — geomean 1.03×, cold 0.95×, 1 change(s)
100 rows/collection | source indexes: manual | synced writes — geomean 1.01×, cold 0.90×
100 rows/collection | source indexes: manual | optimistic writes — geomean 0.96×, cold 1.08×
1,000 rows/collection | source indexes: none | synced writes — geomean 1.04×, cold 1.07×
1,000 rows/collection | source indexes: none | optimistic writes — geomean 1.12×, cold 1.07×
1,000 rows/collection | source indexes: manual | synced writes — geomean 1.01×, cold 1.02×
1,000 rows/collection | source indexes: manual | optimistic writes — geomean 1.02×, cold 1.11×
10,000 rows/collection | source indexes: none | synced writes — geomean 1.10×, cold 1.06×
10,000 rows/collection | source indexes: none | optimistic writes — geomean 0.97×, cold 0.98×
10,000 rows/collection | source indexes: manual | synced writes — geomean 0.98×, cold 0.93×
10,000 rows/collection | source indexes: manual | optimistic writes — geomean 1.00×, cold 1.04×
Runner: node v24.8.0, linux 7.0.0-1017-azure, AMD EPYC 9V74 80-Core Processor. Timings on shared CI runners are noisy; treat small deltas as indicative only. |
|
Size Change: 0 B Total Size: 199 kB ℹ️ View Unchanged
|
More templates
@tanstack/angular-db
@tanstack/browser-db-sqlite-persistence
@tanstack/capacitor-db-sqlite-persistence
@tanstack/cloudflare-durable-objects-db-sqlite-persistence
@tanstack/convex-db-collection
@tanstack/db
@tanstack/db-ivm
@tanstack/db-sqlite-persistence-core
@tanstack/electric-db-collection
@tanstack/electron-db-sqlite-persistence
@tanstack/expo-db-sqlite-persistence
@tanstack/node-db-sqlite-persistence
@tanstack/offline-transactions
@tanstack/powersync-db-collection
@tanstack/preact-db
@tanstack/query-db-collection
@tanstack/react-db
@tanstack/react-native-db-sqlite-persistence
@tanstack/react-router-with-db
@tanstack/rxdb-db-collection
@tanstack/solid-db
@tanstack/svelte-db
@tanstack/tauri-db-sqlite-persistence
@tanstack/trailbase-db-collection
@tanstack/vue-db
commit: |
Takes main's rewrites of the eager live-source conformance oracles and the TrailBase lifecycle oracle, then reapplies this branch's codemods to the merged tree: 46 law.owner properties removed in 21 files, and owns moved into oracleProperty in 14 more files. The (file, owns entry) pairs equal main's: 537 pairs, identical. Co-authored-by: Isaac <no-reply@databricks.com>
Summary
This pull request adopts
@tanstack/oraclesand@tanstack/eslint-plugin-oraclesat TanStack/oraclesd1b508a(TanStack/oracles#11). It is an API migration. It does not change behavior. It prepares the later oracles change that removeslegacyCampaignsanddeclareOracle.d1b508amakes two changes that affect this repository:OracleLawhas noownerfield. Code ownership belongs to CODEOWNERS (maintainer decision, 2026-11-10). Anowner:property in a law literal is now a TypeScript excess-property error.oraclePropertytakesowns, with the same meaning as theownsofdeclareOracle. The gap CLI readsownsfrom both calls during the migration.Changes
Pins. The three
pkg.pr.newpins change fromb6bf6fctod1b508a: the rootpackage.json(both packages) andpackages/db/package.json. The lockfile changes only in the two tarball URLs and their integrity hashes. The manifests of the new tarballs have the same dependencies, peer dependencies, engines, and bin as the old ones.pnpm install --frozen-lockfileaccepts the lockfile, and a laterpnpm installreports "Already up to date".law.ownerremoved. A TypeScript-AST codemod removed 359ownerproperties (one line each) from 190 files:law: { ... }object literals.const lifecycleLaw = { statement, authority, limits, owner }withlaw: lifecycleLawor{ ...pagerLaw, statement }.No code reads
law.owner, and no repository type declares it. Otherownernames, such as product fields, variables, and coverage-map prose, are unchanged. The scripts' oracle files are in a separate commit because the first commit missed them.ownsmoved tooracleProperty. A TypeScript-AST codemod movedownsin each of the 162 files that have both adeclareOracle({ owns })and at least one inlineoracleProperty({ ... })call:ownsarray goes into each inlineoraclePropertycall, directly afterlaw. The entries are byte-identical and in the same order. 77 files have one call. 85 files have several calls, and each call gets the same list (390 calls in total). The gap CLI judges ownership per file, so a repeated list has the same meaning.declareOraclecalls withowns:live-query-observer-hydration-oracle.property.test.tsandwindow-render-oracle.test.tsx. Each call gets the ordered union of the lists, without duplicates. In both files, the second list was a subset of the first.declareOraclekeeps itscheck,model,grammar,typeModel, and other parts, becauseoracle/no-unit-testreads them. 28declareOraclecalls had onlyowns. They were removed, and their import was removed in the 26 files that had no otherdeclareOracleuse. Nooracle/rule readsownsfromdeclareOracle:no-unit-testcollects only identifier parts andtypeModelstrings.oraclePropertycall. These are a// What this oracle owns: ...comment directly above adeclareOraclecall, and any comment directly above a removed call. Other comments stay in place.declareOracle({ owns }), because they have no inlineoraclePropertycall (the list follows). If a file registers through a wrapper in another module, moving its list there would assign the ownership to that other file.Legacy entries. No change.
legacyCampaignskeeps its two entries. See the decisions below.Docs. The docs did not tell authors to write
law.owneror to putownsondeclareOracle. They did not describeownsat all. This change adds the guidance:docs/contributing/oracle-rubric.md: the inline-literalownsform onoracleProperty, thedeclareOraclefallback, and the rule that a law has no owner field.docs/contributing/glossary.md: the "oracle owner" row now says that it is not a law field, and a new "owned code" row.docs/contributing/oracle-coverage.md: the paragraph on the gap report now says where the report readsowns.AGENTS.mdand.agents/skills/oracle-authoring/SKILL.md: one short pointer each.The coverage map keeps its "owner" column, which is the oracle owner.
No changeset: this change touches only tests, docs, and development dependencies, and the similar pull requests (#2402, #2403, #2406) have none.
Counts
owner:law lines removedlaw:literals, 23 shared law objects), in 190 filesownsmoved tooraclePropertyowns)declareOraclecalls removed (onlyownsremained)declareOracle({ owns })The task estimate was about 431
ownerlines. The AST scan found 359 lawownerproperties. Noownerproperty is left in a law-shaped object.Files that keep
declareOracle({ owns })None of these files has an inline
oracleProperty({ ... })call:registerIncludesProperty), orit/testover their declared parts.The 80 files
e2e or Playwright spec
packages/browser-db-sqlite-persistence/e2e/electric-source-prefix-oracle.opfs.spec.tspackages/browser-db-sqlite-persistence/e2e/leader-close-oracle.opfs.spec.tspackages/browser-db-sqlite-persistence/e2e/opfs-open-outcome-oracle.e2e.test.tspackages/browser-db-sqlite-persistence/e2e/opfs-request-order-oracle.opfs.spec.tspackages/browser-db-sqlite-persistence/e2e/reload-class-oracle.opfs.spec.tspackages/browser-db-sqlite-persistence/e2e/shared-driver-fairness-oracle.opfs.spec.tspackages/electron-db-sqlite-persistence/tests/reload-class-oracle.electron.e2e.test.tsregisters through a driver, wrapper, or ordinary it/test
packages/browser-db-sqlite-persistence/tests/multi-tab-electric-oracle.test.tspackages/browser-db-sqlite-persistence/tests/opfs-open-outcome-oracle.test.tspackages/browser-db-sqlite-persistence/tests/per-collection-coordinator-oracle.test.tspackages/browser-db-sqlite-persistence/tests/shared-driver-fairness-oracle.test.tspackages/db-ivm/tests/temporal-group-key-oracle.test.tspackages/db-sqlite-persistence-core/tests/persisted-demand-coverage-oracle.test.tspackages/db-sqlite-persistence-core/tests/sqlite-temporal-value-oracle.test.tspackages/db/tests/collection-cleanup-restart-oracle.test.tspackages/db/tests/collection-index-value-oracle.test.tspackages/db/tests/collection-row-metadata-composition-oracle.test.tspackages/db/tests/collection-subscription-reentrancy-oracle.test.tspackages/db/tests/conformance/indexing-reuse-oracle.test.tspackages/db/tests/db-client-hydration-authority-oracle.test.tspackages/db/tests/duration-query-equality-oracle.test.tspackages/db/tests/effect-disposal-oracle.test.tspackages/db/tests/index-suggestion-oracle.test.tspackages/db/tests/indexed-db/cross-tab-boundary-oracle.test.tspackages/db/tests/indexed-db/local-write-order-oracle.test.tspackages/db/tests/indexed-db/pending-history-oracle.test.tspackages/db/tests/indexed-db/persistence-values-oracle.test.tspackages/db/tests/indexed-db/retirement-oracle.test.tspackages/db/tests/indexed-db/transport-oracle.test.tspackages/db/tests/indexed-db/wrapper-settlement-oracle.test.tspackages/db/tests/local-only-direct-write-oracle.test.tspackages/db/tests/local-storage-order-oracle.test.tspackages/db/tests/optimistic-composition-oracle.test.tspackages/db/tests/optimistic-history-publication-oracle.test.tspackages/db/tests/paced-mutations-oracle.test.tspackages/db/tests/production-error-messages-oracle.test.tspackages/db/tests/proxy-iteration-contract-oracle.test.tspackages/db/tests/query/includes-alias-shadowing-oracle.test.tspackages/db/tests/query/includes-collection-oracle.property.test.tspackages/db/tests/query/includes-context-transport-oracle.test.tspackages/db/tests/query/includes-cross-formulation-oracle.property.test.tspackages/db/tests/query/includes-functional-projection-oracle.test.tspackages/db/tests/query/includes-optimistic-oracle.property.test.tspackages/db/tests/query/includes-oracle.property.test.tspackages/db/tests/query/includes-outer-join-route-work-oracle.test.tspackages/db/tests/query/includes-publication-oracle.test.tspackages/db/tests/query/includes-query-shape-oracle.test.tspackages/db/tests/query/includes-space-oracle.test.tspackages/db/tests/query/includes-temporal-oracle.test.tspackages/db/tests/query/includes-work-counter-oracle.test.tspackages/db/tests/query/index-path-collision-oracle.test.tspackages/db/tests/query/load-subset-source-readiness-refinement-oracle.test.tspackages/db/tests/query/load-subset-transaction-refinement-oracle.test.tspackages/db/tests/query/mixed-index-order-oracle.test.tspackages/db/tests/query/optimizer-semantics-oracle.test.tspackages/db/tests/query/ordered-source-loader-oracle.test.tspackages/db/tests/query/subquery-user-value-oracle.test.tspackages/db/tests/query/virtual-row-fields-effect-oracle.test.tspackages/db/tests/query/virtual-row-fields-input-oracle.test.tspackages/db/tests/query/virtual-row-fields-oracle.test.tspackages/db/tests/query/virtual-row-fields-types-oracle.test.tspackages/db/tests/truncate-readiness-oracle.test.tspackages/electric-db-collection/tests/pg-serializer-oracle.property.test.tspackages/electron-db-sqlite-persistence/tests/electron-ipc-readiness-oracle.test.tspackages/offline-transactions/tests/connectivity-replay-oracle.test.tspackages/query-db-collection/tests/includes-work-counter-oracle.test.tspackages/query-db-collection/tests/ownership-lifecycle.oracle.test.tspackages/query-db-collection/tests/persisted-direct-write-window.oracle.test.tspackages/query-db-collection/tests/ssr-dehydration-oracle.test.tspackages/react-db/tests/convex-lazy-paging-oracle.test.tsxpackages/react-db/tests/effect-callback-oracle.test.tsxpackages/react-db/tests/infinite-query-render-cuts-oracle.test.tsxpackages/react-db/tests/usePacedMutations-render-cuts-oracle.test.tsxpackages/vue-db/tests/useLiveQuery-publication-oracle.test.tscompanion module (no test registration)
packages/db/tests/collection-metadata-publication-oracle.tspackages/db/tests/comparison-laws-oracle.tspackages/electric-db-collection/tests/documented-mutations-oracle.test.tspackages/offline-transactions/tests/executor-environment-oracle.property.test.tspackages/offline-transactions/tests/transaction-serializer-oracle.tspackages/query-db-collection/tests/documented-mutations-oracle.test.tsLegacy-entry decisions
packages/db/tests/declared-reach-oracle.property.test.ts: kept. This file is the self-oracle for the vendoredcreateOracleReachandrunOracleCampaignhelpers, and the helpers are its subject. To judge them, it must import them, andoracle/oracle-property-onlyreports that import. Option (a), conversion, would remove the judgments. Option (b), retirement, does not apply: this migration does not make the helpers unneeded.createOracleReachstill has callers outside the legacy list:documented-mutations-support.ts,live-query-bound-options-support.ts,query-db-collection/tests/query.test.ts,electric-db-collection/e2e/collection-gc.e2e.test.ts, and fourdb-sqlite-persistence-core/tests/sync-metadata-*modules. Only this oracle,legacy-campaign.test.ts, andscripts/oracle-campaign-inventory.mjsuserunOracleCampaign. Retiring it alone would leave the entry in place, because of thecreateOracleReachimport. A maintainer decides whether to retirerunOracleCampaignand its judgments now.packages/node-db-sqlite-persistence/tests/expression-index-oracle.test.ts: kept. Its product campaigns already useoracleProperty. The legacy uses are four rawfc.checkcontrols:missing=<kind>.counterexamplePathand fail again when the same seed and path replay.Native
oraclePropertycalibrations atd1b508atake only a mutantdriverorcorruptand a law name. They do not mutate the history arbitrary and do not expose shrink coordinates.d1b508adoes not change calibrations. Conversion would therefore drop the shrink-and-replay and ablation judgments. This entry needs a framework calibration that exposes the shrink path and supports grammar ablation.Verification
Evidence: no behavior changes, the owns pairs are identical, typecheck and lint pass, and the sampled oracles pass.
Owns pairs.
/tmpscripts read every tracked file that callsoraclePropertyordeclareOracle. One script uses the gap CLI's ownreadOwns(oracle-gaps/owners.mjs). It returns 515 (file, entry) pairs in 242 files on both trees, and the sets are identical. A second, independent AST reader compares the raw source text of each entry. It finds the same ordered entry lists per file, and everyoraclePropertylist in a file equals that file's former list. After the change, 80 files haveownsonly ondeclareOracle, 162 files only onoracleProperty, and no file has both.Gap CLI ownership (static only, no mutation sweep).
node node_modules/@tanstack/oracles/oracle-gaps/index.mjs --helpworks. The CLI has no static-only flag, so the check calls itsanalyze(), which instruments and reads ownership but runs no tests. It runs onpackages/dbwith--source src/collection/lifecycle.ts:collection-gc-transaction-oracle.property.test.tsis one of the owners.git archiveofpackages/dbbefore theownscommit) gives an identical owners-by-function map.Typecheck.
tsc --noEmit -pran in every package with atsconfig.json(27 packages), afterpnpm build:packages/dbandpackages/db-collection-e2eeach have one TS6059rootDirerror, forscripts/publishable-module-output.mjsfromvite.config.tsand forsupport/test-context.ts. These are configuration errors in files that this branch does not change.ownerorowns.Lint.
pnpm lint:changedpasses.pnpm lint:oraclespasses: the legacy-campaign gate reports{"added":[]}, and theoracle/rules pass on every oracle file. The pre-commit hook (theoracle/rules andeslint --fix) passed on each commit. Prettier reports all changed files as formatted.Sampled oracles (
--maxWorkers=2). Each file runs its declared fixed-seed campaigns and a random campaign:packages/db/tests/collection-gc-transaction-oracle.property.test.ts(fixed seed 20261024) andpackages/db/tests/live-query-observer-hydration-oracle.property.test.ts(20260, -88123, and 2345, the merged-list file): 2 files, 50 tests passed.packages/convex-db-collection/tests/offline-oracle.property.test.ts(20261022, 20261023): 9 tests passed.packages/db-ivm/tests/multiset-consolidate-oracle.property.test.ts(2026929, where the codemod removed itsdeclareOracleand moved its comment): 41 tests passed.packages/react-db/tests/window-render-oracle.test.tsx(2291 and 2345, with several nested calls): 480 tests passed.These are the three packages with the most changed files (db, convex-db-collection, db-ivm), plus react-db.
Scripts oracles.
vitest run --config scripts/oracle-scripts.vitest.config.mjs --maxWorkers=2: 9 files and 394 tests pass.packages/dbhas notest:oracle-frameworkscript.Limits
ownsmoved. The other files changed only by an insertedownsproperty and a removedownerproperty. Typecheck, lint, and theownscomparison cover them.readOwnspairs for every file, and an identical owners map forsrc/collection/lifecycle.ts.legacyCampaignsentries remain, as described above.This pull request and its description were written by Isaac.
Summary by CodeRabbit