Convert the files demoted from oracle owners back into oracles
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 28/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- testing
调研方向
Read the oracle rubric at docs/contributing/oracle-rubric.md, then inspect the listed demoted test files and their renamed counterparts, including collection-subscription-lifecycle-cells.test.ts. For each law, determine whether an oracle model applies, add generated or fixed histories with declared checks, and verify a hostile regression fails. Done means the coverage map records each new oracle owner and its limits, or a maintainer decision with a reason for rows where an oracle is impractical.
由索引模型根据 Issue 内容生成。
描述
Problem
The oracle/no-unit-test lint rule (#2234, step after #2237) requires every test in an oracle file to reach a declared check, model, or grammar. A test that compares production with a hand-written value is a unit test, and it moves to an ordinary test file.
During the migration, some files named as oracle owners had no check or model at all. Every expectation in them is a hand-written value. The migration renamed these files to ordinary test names. Their tests still run unchanged, but the laws they owned now have only focused tests and no oracle coverage.
This issue tracks each demoted law until it has an oracle again. A maintainer can also accept focused tests for a law. Then the coverage map records the gap.
Demoted owners
| Former file | New name | Law | Candidate model |
|---|---|---|---|
packages/db/tests/temporal-index-order-oracle.test.ts |
temporal-index-order.test.ts |
ZonedDateTime instant order and time-only Duration order (#1519). The law covers BasicIndex and BTreeIndex reads and first-row public reads. Includes PlainDate extended-year order and the mixed-Temporal rejection lane. | Sort the generated rows with Temporal.ZonedDateTime.compare, Temporal.Duration.compare, and Temporal.PlainDate.compare. Compare the index read and the public first row with that order. Generate instants, offsets, and collations instead of the two fixed rows. |
packages/db/tests/collection-mutation-startup-oracle.test.ts |
collection-mutation-startup.test.ts |
Collection mutation admission before startup: which mutations a Collection admits, rejects, or defers before its sync starts, and how many source starts each causes. | The file's prose names a finite admission model, but every test compares with literal values. Write the admission model as a function over (Collection state, mutation kind), enumerate the finite cells, and compare admission and start counts with it. |
packages/svelte-db/tests/descriptor-query-release-oracle.svelte.test.ts |
descriptor-query-release.svelte.test.ts |
A failed source start does not stop a later source of the same Svelte query from starting. A later direct reader can preload a source that a failed descriptor factory left deferred. | The file's prose already states a model: two independent source start counts. Write it as a model function, generate which source fails and when, and compare start counts, ready status, and subscription release with it. |
packages/electric-db-collection/tests/electric-oracle-lifecycle.test.ts |
electric-lifecycle.test.ts |
The Electric oracle cleanup machinery keeps the primary failure and reports each cleanup failure. | This file tests oracle machinery, not a product law. Decide whether it needs an oracle, or whether it stays an ordinary test of the harness. |
packages/db/tests/mutation-handler-type-oracle.test-d.ts |
mutation-handler-type.test-d.ts |
Mutation handlers receive their sibling Collection, key, and utilities types. | Type-level only. Decide whether an independent type model is useful, or whether the coverage map records this as a type test. |
packages/db-sqlite-persistence-core/tests/persisted-options-type-oracle.test-d.ts |
persisted-options-type.test-d.ts |
Local and synced persisted options have the specified input, output, and key types. | Resolved by #2259. persisted-options-type-oracle.ts now generates option shapes and compiles typed consumers against them through the core and browser entries (persisted-options.test.ts). It replaces the fixed type test, and covers its three cases. |
packages/db/tests/db-client-preload-identity-oracle.test.ts |
db-client-preload-identity.test.ts |
Bounded same-hash preload within one DbClient: a second preload reuses a result only when its source Collection objects are the same at each query position. Otherwise it rejects and leaves the first result intact. The coverage map names this file as the owner. | The header states a source-object-identity model over a finite history: concrete then descriptor, descriptor then concrete, two concrete sources, and a same-object control. The cases still write their outcomes by hand. Write the model as a function of the source objects per position and the preload order, generate pairings that include union-branch swaps and pooled views, and compare outcomes and dehydrated rows with it. |
packages/db/tests/indexed-db/compatibility-oracle.test.ts |
compatibility.test.ts |
The IndexedDB compatibility boundary: which existing databases, stores, and versions a Collection opens, upgrades, or rejects. The coverage map names it as the boundary owner. | Each scenario writes an "authored array per store" inline. Write the per-store model as a function of a generated prior layout and an open request, and compare opened rows and outcomes with it. |
packages/db/tests/indexed-db/deletion-queue-oracle.test.ts |
deletion-queue.test.ts |
Administrative receipt authority for queued database deletion. The coverage map and ORACLE.md name it as the owner. |
The header cites deletion_queue_oracle.tla, but the cells hand-copy its outcomes. Make the TLA model executable (or port its next-state relation), generate queue histories, and compare native and caller outcomes. |
packages/db/tests/indexed-db/settlement-oracle.test.ts |
settlement.test.ts |
The IndexedDB persistence-boundary settlement law: a write settles to the before or after snapshot that its decision selects. ORACLE.md names it. |
The expectations are authored before and after snapshots selected by a written decision. Generate the decisions and interleavings, and compute the expected snapshot from a model of the decision. |
packages/db/e2e/indexed-db/host-oracle.spec.ts |
host.spec.ts |
IndexedDB host receiving laws in a real browser. The coverage map names it. | expected(stores, model) projects an authored Map of literal states. Give the receiving witness a declared model shared with the unit oracle, and drive it with generated histories. |
packages/db-ivm/tests/d2-work-oracle.test.ts |
d2-work.test.ts |
D2 operator work: an idle branch of the dataflow graph does no work when an unrelated branch receives input. The coverage map names this file as the owner of D2 operator work. | The prose calls a per-branch input ledger an "independent reference", but its five cases set the ledger by hand at three fixed positions plus one reversal. Write the ledger as a function of a generated input schedule across branches, and compare per-operator call counts and outputs with it. |
packages/db/tests/local-storage-peer-oracle.test.ts |
local-storage-peer-history.test.ts |
Active LocalStorage Collections that share one Storage object and key agree with the durable snapshot at each persistence receipt. A delayed event does not erase a later accepted write, and a failed write publishes no unaccepted row. Only a valid whole stored snapshot establishes readiness. The coverage map names this file as the owner of peer snapshots and ownership. | The prose names two models: a fold of authored rows keyed by typed ID, and a classifier for absent, valid, and malformed bytes. Neither is executable. expectedRows only sorts hand-written rows, and the observers also used it to sort production rows. Write both models as functions, generate writer orders, typed keys, and delayed events, and compare durable and public snapshots with the models. |
packages/query-db-collection/tests/load-subset-lifecycle-oracle.test.ts |
load-subset-lifecycle.test.ts |
Query-backed loadSubset identity and lifecycle. Equal demands share one Query transport. An applied full-source result serves a later narrower demand. Distinct predicates, values, order, cursor, and scope stay distinct. The final owner controls cancellation. Failure reaches every dependent, and a refetch stays pending while result application is deferred. The coverage map names this file as the "load lifecycle" owner (Query DB and observer row). | The prose names a model with two provider categories and a small reference history of acquisition leases. Every case compares with literal demand counts and rows (98 tests). Write the lease model as a function over acquire, release, apply, fail, and refetch events. Then generate histories over demand shapes and compare transport identity, signals, and public rows with it. |
packages/powersync-db-collection/tests/correctness-oracle.test.ts |
correctness.test.ts |
A PowerSync Collection preserves the local SQLite truth: an update writes only its authored fields, so a newer disjoint SQLite field survives. Persistence waits for diff observation of each effective write. Public rows expose exactly the declared view, with schema-transformed values. The coverage map lists this file as the explicit oracle for #1831. | The file's prose names three reference laws, but the tests compare observer projections with literal rows and patches. Write them as models: compose disjoint patches by changed field, derive readable keys from the declared view, and derive public values from the schema. Generate field edits that race the held watcher, and compare the native SQLite row, the final CRUD patch, and the public row with the models. |
Oracle-style tests that moved to an ordinary file
-
packages/db/tests/collection-subscription-lifecycle-oracle.test.ts: four scenario tables (start, failure, release, and restart ownership) moved tocollection-subscription-lifecycle-cells.test.ts. Their expected values are computed from the scenario, so they are oracle-style tests. They are also the only recorders of some acquisition cells, and theafterAllcoverage audit sees only recorders in its own file. Restore: extract each table's computation as a named model. Then put the cell witnesses and the audit in a structure that keeps them together in an oracle file. -
packages/query-db-collection/tests/persisted-direct-write-window.oracle.test.ts: the "direct writes interleaved with refetches follow the precedence model" suite (about 12 tests) moved topersisted-direct-write.test.ts. The file kept its reference-collection matrix as an oracle. The precedence section states five rules as a model (write order, accepted-only precedence, newest-wins per key, refetch settles after its rows apply, retired writes reject), but each case states its expected rows by hand. These rows of the file's ownership table now have no oracle owner: rejected writes gain no precedence, a later accepted write keeps precedence, refetch settles after its rows apply, and cleanup during the wait rejects. Restore: write the five rules as a model over a history of writes, fetch starts, fetch results, and cleanup. Then generate interleavings, and compare rows, Query cache, and stored rows with it. -
packages/electric-db-collection/tests/electric-sdk-delivery-oracle.property.test.ts: three cases whose prose names a model moved toelectric-sdk-delivery.test.ts. Each states its expected rows by hand. The cases: "discards an old SDK snapshot after managed cache rotation" (source model), "serializes concurrent subset snapshots on one SDK stream", and "satisfies subset demand after a fresh persisted launch" (4 cases, "independent model"). Restore: write the source and cache-generation model as a function, generate rotation and snapshot interleavings, and compare public and stored rows with it. -
packages/offline-transactions/tests/leadership-replay-oracle.property.test.ts: "never fulfills an unadmitted action when it $history" (4 cases, prose "safety relation") and "does not readmit a permanently rejected row from a stale outbox read" ("Law:" comment) moved toleadership-replay.test.ts, with 13 other pinned cases. The oracle keeps its generated campaigns and the ledger fold modelfoldReplayLedger. Restore: state the safety relation as a predicate over the ledger fold, and add those histories to the generated campaigns. -
packages/electric-db-collection/tests/electric-sdk-delivery-oracle.property.test.ts: "quarantines uncertified cache rows across later scoped demands after $cause" (3 cases) also moved toelectric-sdk-delivery.test.ts. It is the only test of the scoped-restart law: after tag state is lost, a persisted row is only a cache, and a later scoped snapshot must not re-admit a removed row from SQLite. Restore: a source model that changes and removes rows while the Collection is closed, generated demand orders at the second launch, and a comparison of public rows and local reads with it. -
packages/offline-transactions/tests/transaction-settlement-oracle.property.test.ts: 19 hand-written cases (42 tests) moved totransaction-settlement.test.ts. The opening prose still states laws for held deletion, retry deadlines, and hook faults, but only those cases test them.preserves the default retry deadline when the hook agreescompares production with a no-hook production run. This is a metamorphic relation, so it can come back as a generated property over hook decisions. Restore: add held deletion and hook faults to the generated settlement histories, and compare withexpectedRetryDecisionand the FIFO local-row model. -
packages/query-db-collection/tests/ownership-lifecycle.oracle.test.ts: 138 hand-written registrations (359 tests) moved toownership-lifecycle.test.ts. The oracle keeps the result-settlement, refetch-call, handler-boundary, and mutation-refresh reducers, the reacquisition and published-owner models, and the direct-write history drivers. Many moved suites name an "independent reference" or "model" in their prose, but each case states its expected rows by hand. The largest families: direct-write ownership and reconciliation after refetch; eager cache-patch projection through a Query shared by two Collections; retry and revalidation error visibility; and reacquired claims across release publication. Restore: extend the ownership-graph reference to direct-write positions and shared-Query cache patches, then turn these families into generated histories against it. Also:observeHandlerIdentitystays declared as the identity model, but its prediction is constant (every alias preserves identity), so it is weak evidence. -
packages/node-db-sqlite-persistence/tests/expression-index-oracle.test.ts: two hostile-mutant kills (the overbroad mutant and the legacy path-binding mutant) state their expected verdicts by hand. They moved toexpression-index.test.ts. The generated scenario grammar's per-kind expected keys hold by construction but are not a named model. Restore: add both mutants as fault kinds of the generated property, and state the scenario construction as a model. -
packages/react-native-db-sqlite-persistence/tests/op-sqlite-driver-oracle.test.ts: frozen provider receipts ("decodes frozen provider receipt" and two neighbors) and the malformed-envelope table with its calibration moved toop-sqlite-driver.test.ts. Adversarial envelope coverage now lives only in unit tests. Restore: a generated envelope grammar with a verdict model, and a receiving witness that declares the recorded receipts. -
packages/browser-db-sqlite-persistence/tests/browser-coordinator-oracle.test.ts: 174 fixed-scenario tests moved tobrowser-coordinator.test.ts. The oracle keeps the leadership need-table cells and five generated RPC, disposal, and retention properties. Moved tests whose prose names an independent reference but whose expected values are written by hand:- surviving source Collection stays usable
- reconciled stream position ("adapter log is the independent sequence reference")
- passive follower stays on the newer elected route ("independent ledger increments once per election")
Restore: generated election and reconciliation histories, compared with an election ledger and a stream-position model.
-
packages/db-sqlite-persistence-core/tests/persisted-oracle.test.ts: 624 fixed-scenario tests moved to 13 ordinarypersisted-*.test.tsfiles. The oracle keeps five generated-history drivers, the snapshot, ledger, reconciliation, FIFO, and hydration-source models, and the follower demand and reacquisition models. Laws that now rest only on fixed tests, and that the oracle's prose no longer claims: cache-generation claims and seq-gap timing, construction and descriptor ownership, admission characterization, retained on-demand acquisition failure, and partial-update dependency work counts (expectPendingKeyMembershipWorktakes its expected count from the caller). Restore: generated claim and renewal histories against a claim-lease model, and a work-count model for partial updates. -
packages/db/tests/query/includes-context-transport-oracle.test.ts: the dotted and nested path witnesses, the cycle and accessor tests, and the query-ref metadata cells moved toincludes-context-transport.test.ts. They state their expected values by hand. These ARCHITECTURE.md laws now rest only on those fixed tests: route-metadata discovery never invokes an accessor, cycles survive metadata removal, and plain record results carry route metadata under a private symbol. The object-query-ref-scalar branch ofrunPublicSurfaceCellstill writes literal anchor ids inside the declared driver. Restore: add accessor-valued, cyclic, and query-ref rows as dimensions of the route-context grammar, and compute the scalar-anchor expectation from the source rows. -
packages/db/tests/query/includes-temporal-oracle.test.ts: 36 tests moved toincludes-temporal.test.ts. They are hand-written scenarios, including the prose "Model B" (demand cancellation) and "Model C" (progressive delivery) cases. The oracle keeps readiness, scheduled settlement, release reentry, and lagging-source readiness. These ARCHITECTURE.md laws now rest only on fixed tests:- law 6: obsolete demand does not block readiness, and an obsolete acquisition does not complete the current preload
- law 7: "waits for actual source application"
- law 9: failed replay retention, and failed-replacement visibility
- law 10: fragmented churn consolidation, failure preservation, obsolete replacement, and growth loading only uncovered keys
- progressive timing
Restore: an independent demand-churn and cancellation model, and a progressive-publication model, both driven by generated schedules.
-
packages/db/tests/query/includes-alias-shadowing-oracle.test.ts: six rejection and identity witnesses moved toincludes-alias-shadowing.test.ts. They are ancestor and descendant alias reuse, union duplicate branch, nested-include rejection, missing captured projection, and repeated spread identity. These ARCHITECTURE.md identity laws now rest on fixed tests only. Alpha-renaming keeps its oracle. Restore: generate alias placements over the include tree, and compare acceptance and the error class with a scope model. Also,load-subset-replay-refinement-oracle.test.ts'scheckOrderedReplaystill computes its expected window inline, so name it as a model. -
Weak models accepted during the migration, kept declared but worth strengthening:
local-storage-order-oracle.test.ts(expectedManualAfterAutomaticInsertandexpectedUnawaitedManualRowsare boolean-keyed literal tables),persisted-oracle.test.ts(modelSourceReconciliationhas two fixed states), and the browser coordinator's need table. -
packages/db/tests/optimistic-transaction-oracle.property.test.ts: 14 fixed scenarios moved tooptimistic-transaction.test.ts, including the failed-callback and replacement cases. The failed-callback restoration law now has no oracle case. Restore: add a failing mutation callback to the transaction drivers' history grammar, and compare the restored rows with the expected world. -
packages/db/tests/query/ordered-lifecycle-oracle.property.test.ts: the nullable-order modelexpectedNullablePaletteIdsis a written palette table (9 rows, four group orders, both null placements), not a computed sort. -
packages/db/tests/query/includes-alias-shadowing-oracle.test.ts(second pass): 74 more cases moved toincludes-alias-shadowing.test.ts. The ARCHITECTURE.md Identity law "a bound reference captured from an unrelated query is rejected" now has no model-checked owner. Its cases are join operands outside lexical scope, non-join expressions, include filters, correlations, hidden inner bindings, and sibling captures.validate-aliases.test.tscovers only same-scope and union rejection. The moved describejoined subqueries reject captured sibling sourcescites an "independent scope model" that does not exist in code. Two alpha-renaming identity checks are now unit tests as well. Restore: a lexical scope model that predicts acceptance or the error class for generated reference placements. -
packages/db/tests/query/ir-stable-identity-oracle.test.ts: 50 tests with hand-written identity equalities moved toir-stable-identity.test.ts. Generated "distinct when not equivalent" coverage now exists only for output programs and reference-valued captures. These are now unit tests only:- argument order of function calls and orderBy
- the limit/offset window
- groupBy/having normalization
- union source ordering
- demand-key exclusion of cursor, signal, and subscription
- custom comparator identity
__proto__keys- invalid Date/Temporal equality
- captured status values
The coverage map says this oracle owns demand-key encoding, but only two generated tests now reach
getLoadSubsetDemandKey. Restore: extend the canonical-form model and its generated grammar to those dimensions. -
packages/db-ivm/tests/temporal-group-key-oracle.test.ts: its "bounded grammar" is the fixedtemporalCaseslist, with no generated histories.packages/db-ivm/tests/hash-oracle.property.test.ts: the calibration ofexpectEqualHashesmoved tohash.test.ts, so no declared check calibrates that comparison. -
packages/db/tests/indexed-db/persistence-oracle.test.ts:runHistorykeeps its model as inline state interleaved with production calls.local-write-order-oracle.test.tscompares inline per cut.transport-oracle.test.tsmoved 29 literal scenarios totransport.test.ts. Name the inline models so that the checks are separable. -
packages/db/tests/conformance/infinite-suite-oracle.ts: eight scenarios that state literal outcomes (error messages, boolean settlement flags) moved toinfinite-suite-cases.ts, which runs in the same cross-framework describe. The "fulfills only after the window request fulfills" law (fetch-settlement) has no model-based check. Also,expectPageRowsinpage-laws-oracle.tsis declared as a check but takes its visible rows from the caller. It checks the page-partition law over them, and 14 conformance scenarios reach a part only through it. Their visible rows are written as source slices such asrows(8).slice(0, 6). Restore: a visible-window model computed from the source, page count, and edits, so thatexpectPageRowscompares with the model instead of a caller-written slice.
More rows can come: the migration is not complete. The migration adds each new demoted owner here.
What done means, per row
- An oracle file with a declared check (and model, if one applies) that the law's tests reach, with generated or fixed histories. Follow the oracle rubric.
- A RED result: a hostile mutant, such as the regression that the law guards, fails the new oracle.
- The coverage map names the new owner and its limits.
Or, for a row where an oracle is not practical: a maintainer decision, recorded in the coverage map with the reason.
Refs #2234
- 主要语言
- TypeScript
- 星标
- 4k
- 派生
- 277
- 平均合并
- 21 小时 21 分钟
- 30 天内合并 PR
- 218
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
TanStack/db 的其他 Issue
-
难度 1/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
OfflineExecutor.dispose() never settles pendingTransactionPromises可能已有人在做 @Claire-ovo 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 4/5 1-2 天 新手友好度 58/100
维护者通常 1 天内回复
相似的 Issue
-
area: server priority: P3 type: bug
难度 2/5 1-3 小时 新手友好度 83/100
appandflow/stim#4538 ·
维护者通常 1 天内回复
-
[BUG] Published Docker images lack the redis extra: HEADROOM_COMPRESS_SESSION_STORE stops startup可能已有人在做 @AlessandroSpallina 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
headroomlabs-ai/headroom#4513 ·
维护者通常 1 天内回复
-
bug extension extension: obsidian platform: Windows
难度 2/5 1-3 小时 新手友好度 68/100
raycast/extensions#32838 · 1 条评论 ·
维护者通常 1 天内回复
-
copy design-review mac P3
难度 2/5 1-3 小时 新手友好度 88/100
tosunlab/hisarapp-core#510 ·
-
bug priority-medium to-agent
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复