Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
273 commits
Select commit Hold shift + click to select a range
55a3c53
docs(oracles): say that a generated property can state its law inline
Oct 26, 2026
003a8b6
test(oracles): move unit tests out of collection-state-retention oracle
Oct 26, 2026
557b048
test(oracles): declare the btree map refinement check and model
Oct 26, 2026
fcac7be
test(oracles): move unit tests out of SortedMap oracle
Oct 26, 2026
967d202
test(oracles): move unit tests out of change-event history oracle
Oct 26, 2026
077896f
test(oracles): move unit tests out of collection-index-value oracle
Oct 26, 2026
28da04c
test(oracles): declare effect disposal caller and report checks
Oct 26, 2026
98faa80
test(oracles): declare truncate readiness status model and checks
Oct 26, 2026
7aa6596
test(oracles): declare duration equality model and key-set check
Oct 26, 2026
71b56f1
test(oracles): move unit tests out of index suggestion oracle
Oct 26, 2026
748a209
test(oracles): declare hydration authority model and checks
Oct 26, 2026
eb213c7
test(oracles): rename preload identity file as an ordinary test
Oct 26, 2026
3d7b265
test(oracles): move unit tests out of local-only direct-write oracle
Oct 26, 2026
9d1443d
test(oracles): move unit tests out of reverse-index oracle
Oct 26, 2026
230d770
test(oracles): declare live-query observer snapshot checks and model
Oct 26, 2026
4341b6c
test(oracles): declare cleanup queue state check and model
Oct 26, 2026
63b93de
test(oracles): declare outcome checker and move cleanup self-test
Oct 26, 2026
9698366
test(oracles): declare production error message checks
Oct 26, 2026
229fc48
test(oracles): declare optimistic ownership model and move scenario t…
Oct 26, 2026
9e5400e
test(oracles): move unit tests out of proxy native-methods oracle
Oct 26, 2026
9b7b2a5
test(oracles): declare only the proxy native-methods checks
Oct 26, 2026
cec51f4
test(oracles): move unit tests out of cursor oracle
Oct 26, 2026
59a35a9
test(oracles): rename temporal index order file as an ordinary test
Oct 26, 2026
bb53bb8
test(oracles): rename mutation handler type file as an ordinary test
Oct 26, 2026
f38503a
test(oracles): move unit tests out of proxy iteration oracle
Oct 26, 2026
238c4c9
test(oracles): move unit tests out of proxy detachment oracle
Oct 26, 2026
bc78d85
test(oracles): move unit tests out of flat change tracking oracle
Oct 26, 2026
be96847
test(oracles): move unit tests out of subscription reentrancy oracle
Oct 26, 2026
2caec30
test(oracles): declare row metadata composition model, check, and gra…
Oct 26, 2026
ebf008a
test(oracles): declare native write model and move member-literal tests
Oct 26, 2026
577319d
test(oracles): share cursor orderBy helper with the moved buildCursor…
Oct 26, 2026
4611b1e
test(oracles): declare transaction ownership driver and model
Oct 26, 2026
5ed3f0e
test(oracles): declare proxy revert checks, model, and grammar; move …
Oct 26, 2026
75386c7
test(oracles): declare proxy callback, native-row checks; move unit t…
Oct 26, 2026
41aa4ef
test(oracles): declare observer history checks and model; move stale-…
Oct 26, 2026
d9f3053
test(oracles): rename mutation startup file as an ordinary test
Oct 26, 2026
62ef282
test(oracles): move metadata world alias test to an ordinary test file
Oct 26, 2026
fcf6241
test(oracles): declare metadata publication driver and cancellation c…
Oct 26, 2026
fff38c3
test(oracles): declare comparison law checks; move literal comparison…
Oct 26, 2026
7a8f78e
test(oracles): declare cleanup boundary model and check; move unit te…
Oct 26, 2026
d594651
test(oracles): declare replay drivers and publication model; move uni…
Oct 26, 2026
c2228cf
test(oracles): declare D2 reconciliation checks, model, and grammar; …
Oct 26, 2026
755ba4b
test(oracles): declare listener history driver, overlay model, and gr…
Oct 26, 2026
2fe95f3
test(oracles): declare deferred acquisition drivers and model; move p…
Oct 26, 2026
1986aad
test(oracles): restore cleanup admission tests to their model compari…
Oct 26, 2026
0918cbc
test(oracles): declare paced timeline, held-pacing, and settlement pa…
Oct 26, 2026
d225039
test(oracles): declare publication check, model, and grammar; move un…
Oct 26, 2026
ecb51f0
test(oracles): move literal deepEquals cases out of utils oracle
Oct 26, 2026
ed46af2
test(oracles): declare index update parts; move unit tests out of ind…
Oct 26, 2026
a6f2ae4
test(oracles): declare subscription lifecycle parts; move unit tests …
Oct 26, 2026
fe8f6f5
test(oracles): move unit tests out of live-updates oracle suite
Oct 26, 2026
14acb44
test(oracles): move unit tests out of electric descriptor oracle
Oct 26, 2026
49938e9
test(oracles): rename electric lifecycle calibration as not an oracle
Oct 26, 2026
3499a02
test(oracles): declare the Vue publication check
Oct 26, 2026
780e8aa
test(oracles): rename svelte descriptor release file as not an oracle
Oct 26, 2026
f211ff3
test(oracles): declare the paced mutation driver and its model
Oct 26, 2026
58dd1d5
test(oracles): declare the connectivity replay model
Oct 27, 2026
0a1f14a
test(oracles): declare the optimistic refetch window model
Oct 27, 2026
112d1d1
test(oracles): declare the SSR hydrated-row check
Oct 27, 2026
2ab3ece
test(oracles): move cursor boundary unit tests out of the oracle file
Oct 27, 2026
0cfae76
test(oracles): declare the interruption settlement check
Oct 27, 2026
158527b
test(oracles): move large-page and repeated-cursor tests out of the c…
Oct 27, 2026
0108817
test(oracles): move the shallow-peer delivery test out of the integra…
Oct 27, 2026
4228180
test(oracles): declare the predicate evaluator; move two pinned Postg…
Oct 27, 2026
2f3405e
test(oracles): declare the PostgreSQL array check; move pinned serial…
Oct 27, 2026
5ae75d9
test(oracles): declare render-cut checks and models; move GC and star…
Oct 27, 2026
3436e50
test(oracles): declare the source reuse check; move pinned source-ID …
Oct 27, 2026
9470b64
test(oracles): rename the PowerSync correctness file as not an oracle
Oct 27, 2026
2d67810
test(oracles): declare the descriptor model; move pinned descriptor t…
Oct 27, 2026
4220790
test(oracles): drop a duplicate row type from the source ID test file
Oct 27, 2026
aa685c9
test(oracles): move the restarted-source pin out of the render-cut or…
Oct 27, 2026
604b76a
fix(lint): count a .prop registration with a named predicate
Oct 27, 2026
a1cd894
test(oracles): declare the refetch prefix check and models; move two …
Oct 27, 2026
2b4e138
test(oracles): declare the direct-write matrix checks; move precedenc…
Oct 27, 2026
e09f624
test(oracles): declare the KeyScheduler run check and model; move the…
Oct 27, 2026
ab58f22
test(oracles): declare the persisted restart and publication checks; …
Oct 27, 2026
9c6ff2c
test(oracles): declare the TrailBase lifecycle checks; move the start…
Oct 27, 2026
11fd3a1
test(oracles): declare the installed-SDK checks; move six hand-writte…
Oct 27, 2026
4aa4556
test(oracles): keep two moved SDK cases byte-identical under prettier…
Oct 27, 2026
de30035
test(oracles): declare the ledger fold model; move fifteen hand-writt…
Oct 27, 2026
cb8ff1d
test(oracles): format the moved SDK delivery cases normally
Oct 27, 2026
2a7515c
test(oracles): restore the scoped-restart quarantine test as a unit test
Oct 27, 2026
eaa2697
test(oracles): declare the settlement checks and models; move twenty …
Oct 27, 2026
8739a97
test(oracles): declare the serializer check; move 28 hand-written ser…
Oct 27, 2026
93e3a89
test(oracles): declare the Electric checks and models; move 56 hand-w…
Oct 27, 2026
f745bae
test(oracles): stop declaring the Electric trace runners as checks
Oct 27, 2026
7ce52cd
test(oracles): rename load-subset lifecycle file as not an oracle
Oct 27, 2026
b050e2c
test(oracles): declare the ownership checks and models; move 138 hand…
Oct 27, 2026
7500aa5
test(oracles): move unit tests out of browser OPFS e2e oracle files
Oct 26, 2026
c5c8076
test(oracles): move unit tests out of browser coordinator and OPFS or…
Oct 26, 2026
da4cd50
test(oracles): move unit tests out of SQLite core oracle files
Oct 26, 2026
49e9544
test(oracles): declare the Electron reload checkpoint as an oracle part
Oct 26, 2026
7c66889
test(oracles): stop declaring the typed-value assertion helper as a c…
Oct 27, 2026
5d04063
test(oracles): stop declaring the settlement-set helper as a check
Oct 27, 2026
9a8d6d1
test(oracles): declare the Electron readiness comparisons and models
Oct 27, 2026
2026c01
test(oracles): move the boolean-arity scenario tests to an ordinary file
Oct 27, 2026
f4618af
test(oracles): declare the fairness grammars; move replay config tests
Oct 27, 2026
2106687
test(oracles): move the hand-written scheduling scenarios to an ordin…
Oct 27, 2026
bae67e9
test(oracles): declare the ordinary-work companion; move its unit tests
Oct 27, 2026
b7b7e78
test(oracles): declare the resume-snapshot checks and move unit scena…
Oct 27, 2026
f3cc214
test(oracles): split the sqlite core adapter contract out of the orac…
Oct 27, 2026
e8fb023
test(oracles): declare the expression-index checks; move unit scenarios
Oct 27, 2026
f2859ab
test(oracles): declare the alias reference model; move op-sqlite unit…
Oct 27, 2026
294c037
test(oracles): move unit tests out of the browser coordinator oracle
Oct 27, 2026
6b50bf7
fix(lint): follow each-table rows when a test reaches an oracle part
Oct 27, 2026
0c0e2f7
test(oracles): move persisted-oracle unit tests to ordinary files
Oct 27, 2026
9870dbf
test(oracles): declare the virtual field classification; move the cle…
Oct 27, 2026
90f3cce
test(oracles): declare the pooled release differential; move fixed-sc…
Oct 27, 2026
693c614
test(oracles): declare the staged window model and grammar; move fixe…
Oct 27, 2026
f94bcff
test(oracles): declare the rank window model and check
Oct 27, 2026
050759b
test(oracles): declare the abort receipt model; move the pre-start ab…
Oct 27, 2026
0f3a9ef
test(oracles): declare the path and selected-order models; move the c…
Oct 27, 2026
9e485ed
test(oracles): declare the join pair driver and model
Oct 27, 2026
5c13c5e
test(oracles): declare the in-evaluator check and reference model
Oct 27, 2026
21317bc
test(oracles): declare the pooled publication checks and models
Oct 27, 2026
f580f95
test(oracles): declare the mixed-order corpus driver as the check
Oct 27, 2026
cffd792
test(oracles): declare the readiness source model; move the join outc…
Oct 27, 2026
1dbdf1c
test(oracles): declare the Row type in the moved ordinary tests
Oct 27, 2026
380cc10
test(oracles): move the fixed root-shape test out of the virtual fiel…
Oct 27, 2026
92bfa36
test(oracles): declare the shape and compound join models; move the f…
Oct 27, 2026
8c4e8e5
test(oracles): declare the LIKE check, model, and grammar; move the e…
Oct 27, 2026
d8ab747
test(oracles): declare the aggregate, pushdown, and join models; move…
Oct 27, 2026
a59199c
test(oracles): declare the functional projection model; move the unit…
Oct 27, 2026
20999ee
fix(lint): count only functions in an each table as reaching a part
Oct 27, 2026
08d34a0
test(oracles): declare the route-context grammar and models; move the…
Oct 27, 2026
91f5cc3
test(oracles): declare the temporal readiness and lagging-source mode…
Oct 27, 2026
b96bfb0
test(oracles): declare the derived-delete check and model; move the u…
Oct 27, 2026
c869d1c
test(oracles): declare the aggregate select check and models; move th…
Oct 27, 2026
72fa174
test(oracles): declare the alias grid check and model; move the unit …
Oct 27, 2026
2505704
test(oracles): declare the optimistic relationship check and model; m…
Oct 27, 2026
95de6c7
test(oracles): declare the WHERE publication check and models; move t…
Oct 27, 2026
a001439
test(oracles): move the fixed replay refinement tests; declare the or…
Oct 27, 2026
c763ada
test(oracles): declare the pagination window model and driver; move t…
Oct 27, 2026
2961170
test(oracles): declare the query-shape check and models; move the cle…
Oct 27, 2026
d642a31
test(oracles): declare the DISTINCT check and model; move the user-ro…
Oct 27, 2026
848ac7f
test(oracles): declare the cold-join and compound checks and models; …
Oct 27, 2026
75d6357
fix(lint): ignore parameter reach for helpers imported from another m…
Oct 27, 2026
ab2a0bf
test(oracles): stop declaring the shared trace runner as a query-shap…
Oct 27, 2026
dfd690e
test(oracles): declare the LocalStorage order model; move fixed-scena…
Oct 27, 2026
74314d8
test(oracles): declare the LocalStorage peer model; move fixed-scenar…
Oct 27, 2026
ae5d3e9
test(oracles): declare the value-fidelity check and model
Oct 27, 2026
307138d
test(oracles): name the held-repair reference as a declared model
Oct 27, 2026
3edb7ec
test(oracles): declare the route-work model at top level
Oct 27, 2026
41124ef
test(oracles): declare the facade-count model; move setup and literal…
Oct 27, 2026
98b0a64
test(oracles): name the aggregate and findOne references as models
Oct 27, 2026
117ddfa
test(oracles): declare the publication check and model
Oct 27, 2026
4309596
test(oracles): declare the multi-order check and reference
Oct 27, 2026
393dbff
test(oracles): rename the LocalStorage peer file as not an oracle
Oct 27, 2026
c11ba0b
test(oracles): declare the work-counter checks, model, and grammar; m…
Oct 27, 2026
084b981
test(oracles): declare the cross-formulation checks and models; move …
Oct 27, 2026
e4efbd6
test(oracles): declare the facade rollback check and model; move unit…
Oct 27, 2026
155922c
fix(lint): check that a named property predicate reads its input
Oct 27, 2026
c2fb295
test(oracles): declare the ordered work checks and models; move unit …
Oct 27, 2026
64659bd
test(oracles): declare the lifecycle checks and models; move unit tests
Oct 27, 2026
869c004
test(oracles): declare the transaction drivers and typed-key model; m…
Oct 27, 2026
a67f314
test(oracles): declare the exact demand checks; move unit tests
Oct 27, 2026
c3dfaeb
test(oracles): declare the request-authority check; move unit tests
Oct 27, 2026
70bcc81
test(oracles): declare the facade model; move unit tests
Oct 27, 2026
31e53a8
test(oracles): move unit tests out of ordered-source-loader-state-oracle
Oct 27, 2026
802a13d
test(oracles): move facade row-cloning unit test to includes-collection
Oct 27, 2026
b6f935a
test(oracles): declare includes recompute model and sibling grammar; …
Oct 27, 2026
269961a
test(oracles): move trace-driver unit tests out of includes oracle
Oct 27, 2026
9eec5e7
test(oracles): declare alias-scope models; move unit tests out of ali…
Oct 27, 2026
056b21b
Revert "test(oracles): move trace-driver unit tests out of includes o…
Oct 27, 2026
57747a6
test(oracles): declare the output-denotation check and model; move un…
Oct 27, 2026
cb2f1a1
test(oracles): stop declaring the IR output comparison as a check
Oct 27, 2026
8172a54
test(oracles): rename D2 work test as not an oracle
Oct 27, 2026
7c958d6
test(oracles): declare the ordered history grammar for incrementaliza…
Oct 27, 2026
0814f89
test(oracles): declare the murmur stream digest check
Oct 27, 2026
7695bf6
test(oracles): declare the top-K relation checker for support windows
Oct 27, 2026
79b17f2
test(oracles): declare the temporal group model; move serialization u…
Oct 27, 2026
0fa8959
test(oracles): declare the index refinement check, model, and grammar
Oct 27, 2026
0edc725
test(oracles): declare the top-K relation checker for its calibrations
Oct 27, 2026
2534212
test(oracles): declare the key-order check; move helper-only hash tests
Oct 27, 2026
9bfc377
fix(lint): match an exported class to its declaration
Oct 27, 2026
7beb15c
test(oracles): declare the retry check and model; move the shrink sel…
Oct 27, 2026
f74b35b
test(oracles): declare the mixed-graph check and its topology and unf…
Oct 27, 2026
0dcbd63
test(oracles): declare the identity check and normal-form model; move…
Oct 27, 2026
78d3717
test(oracles): declare the graph check and models; move unit tests to…
Oct 27, 2026
9eba5ec
test(oracles): declare the consolidation check, model, and grammar; m…
Oct 27, 2026
b4b67a2
test(oracles): move six fixed top-K batch tests to topk-batch.test.ts
Oct 27, 2026
3853470
test(oracles): declare the identity checks, model, and grammar; move …
Oct 27, 2026
0ac06e8
test(oracles): move sixteen fixed top-K window tests to topKWithFract…
Oct 27, 2026
7f66886
test(oracles): declare the settled-history driver and manual model; m…
Oct 27, 2026
431bbaf
test(oracles): rename compatibility file as not an oracle
Oct 27, 2026
8131cfc
test(oracles): rename deletion-queue file as not an oracle
Oct 27, 2026
708afed
test(oracles): declare the local write fold model; move three scenari…
Oct 27, 2026
87429ef
test(oracles): declare the native outcome fold; move eight scenario g…
Oct 27, 2026
3c87c56
test(oracles): rename settlement file as not an oracle
Oct 27, 2026
3ae787d
test(oracles): declare the wrapper settlement conjunction as the model
Oct 27, 2026
fecbc34
test(oracles): declare two peer-edit folds as models; move 29 scenari…
Oct 27, 2026
62f71c0
test(oracles): move two unit tests out of the cross-tab native spec
Oct 27, 2026
e8d3cd6
test(oracles): declare the first-open model; move the foreign-alias w…
Oct 27, 2026
bc072b7
test(oracles): rename host spec as not an oracle
Oct 27, 2026
832e89c
test(oracles): point the value spec comment at the renamed compatibil…
Oct 27, 2026
00df818
test(oracles): declare the infinite-query oracle parts; move eight un…
Oct 27, 2026
23f5f5d
feat(lint): let a type-level oracle declare its model types
Oct 27, 2026
d78a303
test(oracles): declare the virtual row field type models
Oct 27, 2026
1091151
chore(tests): point oracle scripts and runners at the moved tests
Oct 27, 2026
3aac9f1
docs(oracles): mark renamed owners as fixed tests and point moved law…
Oct 27, 2026
f75802e
docs(oracles): stop claiming a PowerSync oracle campaign
Oct 27, 2026
e08019a
fix(tests): keep declareOracle out of the Node-only oracle config
Oct 27, 2026
9054349
test(oracles): point moved replay properties at their new files
Oct 27, 2026
e74f95e
Merge branch 'main' into feat/oracle-replay-selection
Oct 27, 2026
9cdb3b9
test(oracles): type the extracted Electric move-out rows
Oct 27, 2026
ac5a423
Merge branch 'feat/oracle-replay-selection' into feat/oracle-type-model
Oct 27, 2026
6f2e056
Merge commit '7e46f81ad' (squashed #2237) into feat/oracle-type-model
Oct 27, 2026
61584ad
Merge remote-tracking branch 'origin/main' into feat/oracle-type-model
Oct 27, 2026
f808a2b
test(oracles): follow the live-updates registration order in the conf…
Oct 27, 2026
66794a9
docs(oracles): drop stale oracle claims for demoted Svelte and PowerS…
Oct 27, 2026
d968b2d
test(oracles): run lint-rule suites under vitest and rename them by law
Oct 27, 2026
d6bbdc9
test(oracles): restore the lint-rule test filenames
Oct 27, 2026
4d2f746
test(oracles): generate declared-reach histories for oracle files (RED)
Oct 27, 2026
997ec2c
fix(oracles): resolve declared reach across cycles and per lint, and …
Oct 27, 2026
20c1ee3
refactor(oracles): register SQLite and infinite-suite unit tests from…
Oct 27, 2026
cf02949
test(oracles): generate caller-passed registration bodies (RED)
Oct 27, 2026
ef70def
fix(oracles): judge a caller-passed body at the call, not the helper …
Oct 27, 2026
e86ecba
refactor(oracles): register the op-sqlite columnar contract suite fro…
Oct 27, 2026
9c6713f
refactor(oracles): register the live-updates unit tests from each con…
Oct 27, 2026
ee4525c
fix(oracles): track run budgets defined in modules the oracle imports
Oct 27, 2026
305a918
style(oracles): format the run-budget replay owner
Oct 27, 2026
e39e0bf
test(oracles): move the literal-table tests out of local-storage-orde…
Oct 27, 2026
c63eace
test(oracles): move the hydration-commit literal table to its ordinar…
Oct 27, 2026
6bfeefd
test(oracles): move the source-reconciliation table test out of persi…
Oct 27, 2026
74ccd30
test(oracles): move the leadership-need table and compareNeedPosts to…
Oct 27, 2026
3250f56
test(oracles): undeclare the nullable palette table in ordered-lifecy…
Oct 27, 2026
7f69237
test(oracles): undeclare the constant handler-identity prediction in …
Oct 27, 2026
5e75761
docs(oracles): state that a literal table is not a model
Oct 27, 2026
9864d52
fix(oracles): lint the oracle files that depend on an edited test module
Oct 27, 2026
e825f7f
test(oracles): register the lint-scope oracle property
Oct 28, 2026
3e8a99c
test(oracles): declare the nullable-order comparator as the palette m…
Oct 28, 2026
6d472ac
docs(oracles): point the hydration-commit coverage entry at its fixed…
Oct 28, 2026
6f55107
docs(oracles): credit the moved table tests to their fixed-test files
Oct 28, 2026
55247a9
fix(oracles): track run budgets through support modules and report re…
Oct 28, 2026
add02ab
fix(oracles): lint new, untracked, and JavaScript oracle files after …
Oct 28, 2026
6a5cec9
fix(oracles): replay script oracles from their own directory
Oct 28, 2026
807ac65
fix(oracles): judge every import form, driver binding, and helper lay…
Oct 28, 2026
883597e
Merge origin/main (#2168) into feat/oracle-declared-check
Oct 28, 2026
b4bb296
Merge branch 'wip/oracle-scripts-r2' into feat/oracle-declared-check
Oct 28, 2026
4603112
Merge branch 'wip/oracle-rule-r2' into feat/oracle-declared-check
Oct 28, 2026
4bb1c04
test(oracles): lint JavaScript oracle files and rename the fixed acti…
Oct 28, 2026
4f47f1f
test(oracles): return the generation-notice campaigns to persisted-or…
Oct 28, 2026
05e4dcd
test(oracles): return the generated descriptor-write property to the …
Oct 28, 2026
15a725e
docs(oracles): record helper-computed run budgets as a run-budget tra…
Oct 28, 2026
6681945
test(oracles): name persisted-oracle as the generation-notice replay …
Oct 28, 2026
8821300
refactor(oracles): apply the review's simplifications
Oct 28, 2026
2d448f7
docs(oracles): record the aggregate select oracle's rare reach miss
Oct 28, 2026
2092422
Merge origin/main (#2230) into feat/oracle-declared-check
Oct 28, 2026
640368a
ci: apply automated fixes
autofix-ci[bot] Oct 28, 2026
93a698a
test(trailbase): import ListResponse in the ordinary lifecycle tests
Oct 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,7 @@ examples/react-native/shopping-list/ios/
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
tsconfig.vitest-temp.json

# The part-reach oracle lints scratch programs inside the repository; an
# interrupted run can leave them behind.
/part-reach-scratch-*/
16 changes: 13 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,10 @@ the harness's own edit tools make. After an edit through a shell command, or
in a harness without these hooks, run `pnpm lint:changed` before you finish.

The end-of-turn hook and `pnpm lint:changed` also report every oracle run
budget that the branch lowered, and CI prints it as a warning. A lowered
budget can be deliberate. Restore it, or explain the reason in the pull
request.
budget that the branch lowered or removed, and CI prints it as a warning. A
budget is removed when its key is in no oracle file, or in a module that an
oracle file imports, any more. A lowered or removed budget can be deliberate.
Restore it, or explain the reason in the pull request.

Fix a report. Do not turn the rule off. The hooks, `pnpm lint:changed`, the
pre-commit hook, and CI ignore `eslint-disable` comments for these rules. A
Expand Down Expand Up @@ -729,6 +730,15 @@ Modules that define the model, checker, or its history grammar also qualify.
Identify the actual mechanism before renaming a file. A coverage-map entry,
contract comment, or collection of fixed assertions is not sufficient evidence.

An oracle file holds only oracle tests. It declares its check, model, and history
grammar with `declareOracle` from `packages/db/tests/oracle-declaration.ts`. A
type-level oracle names its model types in `typeModel`. Each
part is optional. Every test in the file must use a declared part, directly
or through a driver, or run a generated property that states its law inline.
A test that compares production with a hand-written value is a unit test:
put it in an ordinary test file. The `oracle/no-unit-test` lint rule reports
a test that does neither.

Ordinary example tests, type assertions, fixtures, registration wrappers, and
runner utilities keep their ordinary names. A module that only drives production
or records observations is not an oracle definition. Report oracle owners and
Expand Down
139 changes: 101 additions & 38 deletions docs/contributing/oracle-coverage.md

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions docs/contributing/oracle-rubric.md
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,45 @@ Use `oracle` in filenames that own an independent expected-result computation,
state model, differential or metamorphic comparison, or reusable law checker.
A separate module that defines that model, checker, or its history grammar also
qualifies. Identify the mechanism in the code before applying the name.

An oracle file holds only oracle tests. It names its parts with
`declareOracle({ check: [...], model: [...], grammar: [...] })` from
[`oracle-declaration.ts`](../../packages/db/tests/oracle-declaration.ts), which
imports nothing so that browser and native-app modules can use it: the check
compares production observations with the model or with a second
formulation, and the grammar is the generators that produce legal histories.
Each part is optional. Every test in the file uses a declared part, directly
or through a driver:

- A generated property or a fixed history runs through the check.
- A model pin steps the model and checks one rule against its authority.
- A calibration shows that the check rejects a wrong answer (ORC-006).
- A grammar calibration shows that the generators reach the states that the
laws need (ORC-004, ORC-015).
- A generated property can state its law inline: its predicate relates
production to inputs that nobody wrote down. A property whose arbitraries
are all constants, or whose predicate ignores its input, checks written
values instead.
- A type-level test compares an inferred type with a type model. A type has no
value to pass, so the file names its model types in
`declareOracle({ typeModel: [...] })`. Each name is a type alias or
interface in the same file, and a type built from one counts as using it.

A test that uses none of them compares production with a hand-written value. It
is a unit test, even when it asserts a contract, and it belongs in an
ordinary test file beside the oracle. A finite table of hand-written expected
values selected by a test's parameters is not a model. The `oracle/no-unit-test` lint rule
reports such a test. Files named `oracle-*`, such as `oracle-config.ts`, are
the shared oracle machinery and declare no parts.

An oracle file also registers no test through a helper from an ordinary module.
The rule reports a call to such a helper, because the helper's tests then appear
under the oracle file. The ordinary runner registers those tests, and passes the
shared suite a registrar when the suite needs one. A helper from an oracle-named
module is linted on its own, so the rule does not report a call to it. An
`oracle-` machinery module, such as `oracle-config.ts`, is not linted, so the
rule judges a call to its helpers as it judges an ordinary module's.

ORC-016 keeps ordinary unit tests and concrete type assertions out of oracle
files. Fixed regressions replay the shared law; supplemental examples live in
ordinary test files.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ import config from '../eslint.config.mjs'
* Moving a callback definition before an alias cannot change that alias's value
* when the callback runs after initialization.
*
* This finite syntax oracle covers the bindings, call forms, and scopes below.
* These are fixed tests, not an oracle: each expected diagnostic count is a
* written value, chosen by the method under test (the operations table). They
* cover the bindings, call forms, and scopes below.
* It does not model execution paths, inter-module re-exports, function arguments,
* factory returns, dynamic method names, or aliases stored in new containers.
* Mutable aliases conservatively retain their Collection classification.
Expand Down
16 changes: 13 additions & 3 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,19 @@
const chunkSize = 40

export default {
// The oracle rules, without inline directives. lint-staged appends the
// staged oracle files as arguments.
'*oracle*.{ts,tsx}': `node scripts/agent-lint-feedback.mjs`,
// The oracle rules, without inline directives. The script lints the oracle
// files that each staged test or support module affects, so every module
// that an oracle can import is passed. It selects the oracle files itself.
'*.{ts,tsx,js,mjs}': (files) => {
const commands = []
for (let start = 0; start < files.length; start += chunkSize) {
const chunk = files.slice(start, start + chunkSize)
commands.push(
`node scripts/agent-lint-feedback.mjs ${chunk.map((file) => `"${file}"`).join(` `)}`,
)
}
return commands
},
'*.{ts,tsx}': (files) => {
const commands = []
for (let start = 0; start < files.length; start += chunkSize) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"lint:changed": "node scripts/agent-lint-feedback.mjs",
"lint:oracles": "node scripts/agent-lint-feedback.mjs --all",
"lint:run-budgets": "node scripts/check-oracle-run-counts.mjs",
"test:lint-rules": "node --test \"scripts/eslint-plugin-oracle/*.test.js\"",
"test:lint-rules": "vitest run --config scripts/eslint-plugin-oracle/vitest.config.mjs && vitest run --config scripts/oracle-scripts.vitest.config.mjs",
"lint-all": "eslint . --fix",
"prepare": "husky",
"test": "pnpm --filter \"./packages/**\" test && pnpm --filter @tanstack/db test:indexed-db:package",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
/**
* Harness self-test for the hydration-commit checkpoint: the fixture's cleanup
* failures must not replace the primary observation. The real-provider matrix below
* is in this file too.
*/
import { expect, test } from '@playwright/test'
import type { HydrationCommitObservation } from './hydration-commit.opfs'

// ORC-010 calibration: two teardown failures cannot erase the independently
// captured observation, mutate its receipt errors, or hide one another.
test(`preserves the primary observation through multiple cleanup failures`, async ({
page,
}) => {
await page.goto(
`/e2e/hydration-commit.opfs.html?phase=after-ready&baseline=false&coordinator=browser&rich=false&cleanupFault=true`,
)
await page.waitForFunction(() => window.__hydrationCommitDone === true)
const result = await page.evaluate(() => ({
observation: window.__hydrationCommitResult,
error: window.__hydrationCommitError,
cleanup: window.__hydrationCommitCleanupErrors,
}))
expect(result.error).toBeUndefined()
expect(result.observation?.cycleCalls).toBe(0)
expect(result.observation?.errors).toEqual([])
expect(result.observation?.reopenedRows).toEqual([
{ id: `r1`, value: 1 },
{ id: `tail`, value: 9 },
])
expect(result.cleanup).toEqual([
`Error: injected first cleanup failure`,
`Error: injected last cleanup failure`,
])
})

/**
* Real-provider refinement of the law/driver in hydration-commit.opfs.ts.
* The insert history retains baseline+r1. The rich history replaces all rows,
Expand All @@ -10,8 +45,23 @@
* post-cleanup fresh claim checks durable rows, not offline Collection restore;
* a partial on-demand cache has no authority to restore public rows alone.
*/
import { expect, test } from '@playwright/test'
import type { HydrationCommitObservation } from './hydration-commit.opfs'
// The edit-log model's rows after the receipt cut and the ordinary tail: the rich
// history replaces all rows with r2; the insert history keeps r1 and an optional baseline.
function expectedHydrationCommitRows(
baseline: boolean,
rich: boolean,
): Array<{ id: string; value: number }> {
return rich
? [
{ id: `r2`, value: 3 },
{ id: `tail`, value: 9 },
]
: [
...(baseline ? [{ id: `baseline`, value: 0 }] : []),
{ id: `r1`, value: 1 },
{ id: `tail`, value: 9 },
]
}

for (const phase of [`startup`, `subscription`, `after-ready`] as const) {
for (const baseline of [false, true]) {
Expand Down Expand Up @@ -82,16 +132,7 @@ for (const phase of [`startup`, `subscription`, `after-ready`] as const) {
ordinary: `fulfilled`,
exited: phase === `after-ready` ? null : true,
})
const expected = rich
? [
{ id: `r2`, value: 3 },
{ id: `tail`, value: 9 },
]
: [
...(baseline ? [{ id: `baseline`, value: 0 }] : []),
{ id: `r1`, value: 1 },
{ id: `tail`, value: 9 },
]
const expected = expectedHydrationCommitRows(baseline, rich)
expect(observed.rows).toEqual(expected)
expect(observed.durableRows).toEqual(expected)
expect(observed.reopenedRows).toEqual(expected)
Expand Down Expand Up @@ -122,30 +163,3 @@ for (const phase of [`startup`, `subscription`, `after-ready`] as const) {
}
}
}

// ORC-010 calibration: two teardown failures cannot erase the independently
// captured observation, mutate its receipt errors, or hide one another.
test(`preserves the primary observation through multiple cleanup failures`, async ({
page,
}) => {
await page.goto(
`/e2e/hydration-commit.opfs.html?phase=after-ready&baseline=false&coordinator=browser&rich=false&cleanupFault=true`,
)
await page.waitForFunction(() => window.__hydrationCommitDone === true)
const result = await page.evaluate(() => ({
observation: window.__hydrationCommitResult,
error: window.__hydrationCommitError,
cleanup: window.__hydrationCommitCleanupErrors,
}))
expect(result.error).toBeUndefined()
expect(result.observation?.cycleCalls).toBe(0)
expect(result.observation?.errors).toEqual([])
expect(result.observation?.reopenedRows).toEqual([
{ id: `r1`, value: 1 },
{ id: `tail`, value: 9 },
])
expect(result.cleanup).toEqual([
`Error: injected first cleanup failure`,
`Error: injected last cleanup failure`,
])
})
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import { fileURLToPath } from 'node:url'
import { chromium } from '@playwright/test'
import { afterAll, beforeAll, expect, it } from 'vitest'
import { createServer, preview } from 'vite'
import { declareOracle } from '../../db/tests/oracle-declaration'
import { buildForProduction } from './packaged-consumer'
import type { Browser } from '@playwright/test'
import type { BrowserWASQLiteDatabase } from '../src'
Expand Down Expand Up @@ -169,6 +170,23 @@ const layoutCases: Array<LayoutCase> = [
})),
]

declareOracle({
check: [expectLayoutOutcome],
model: [expectedOutcome],
grammar: [layoutCases],
})

// The check: the installed copy's observed outcome equals the layout model's
// prediction for the same case and install facts.
async function expectLayoutOutcome(
layoutCase: LayoutCase,
install: InstallFacts,
): Promise<void> {
expect(await openInLayout(install, layoutCase)).toEqual(
expectedOutcome(layoutCase, install),
)
}

let browser: Browser
const coveredOutcomes = new Set<string>()
beforeAll(async () => {
Expand All @@ -188,7 +206,7 @@ it.each(layoutCases)(
const install = installLayout(temporaryDirectory, layoutCase.layout)
const expected = expectedOutcome(layoutCase, install)
coveredOutcomes.add(JSON.stringify(expected))
expect(await openInLayout(install, layoutCase)).toEqual(expected)
await expectLayoutOutcome(layoutCase, install)
} finally {
rmSync(temporaryDirectory, { recursive: true, force: true })
}
Expand Down
Loading
Loading