Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .changeset/calm-oracles-check-loss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
'@tanstack/db': patch
'@tanstack/db-sqlite-persistence-core': patch
'@tanstack/electric-db-collection': patch
'@tanstack/query-db-collection': patch
---

Retain query-backed rows until their explicit owners release them.

Harden Electric resume and lifecycle handling so partial updates cannot materialize unknown or moved-out rows, stale async work and waiters cannot cross cleanup or restart—including automatic garbage collection—and valid batches behave the same across callback partitions and persistence hydration.

Preserve hydrated baseline rows during persistence reloads, accept complete-row updates from explicit full-replica resumes, retain committed match evidence until reset, and restart persisted resumes when hydration completion cannot be verified.

Reduce live-update work to scale with the incoming batch instead of the full collection while preserving conservative reset recovery and committed mutation evidence.
5 changes: 5 additions & 0 deletions .changeset/lazy-runtime-reference-identities.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tanstack/db': patch
---

Lazily initialize runtime reference identities to avoid generating random values during Cloudflare Worker module evaluation.
23 changes: 23 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,29 @@ classifier, fixture, or assertion that let it pass. Use that analysis to suggest
the smallest test or oracle improvement that would catch the same class of bug,
not only the reported example.

### Keep Oracles Independent

An oracle is useful only when its expected result comes from a source independent
of the implementation under test. Do not translate production branches, state
machines, classifiers, or helper functions into a second implementation and call
that an oracle. Both copies can encode the same wrong assumption.

- Derive expected behavior from public contracts, documented prior behavior,
mathematical laws, or a separately specified reference model.
- Keep the reference model structurally different from production. Do not import
the production helper or reuse its classifications to compute expected results.
- Preserve existing contract tests unless a product or design decision explicitly
changes the contract. Rewriting a passing expectation to match new production
behavior is a design review, not routine test maintenance.
- When production work suggests an oracle change, compare the old and new
semantics with counterexamples before editing the oracle.
- Use hostile mutants to prove the oracle rejects plausible wrong designs,
including the mistake production currently makes. A green oracle without a
demonstrated kill is weak evidence.
- Use process grammar to explore lifecycle paths, and design grammar to challenge
the oracle's reference semantics. More generated traces cannot repair a wrong
reference model.

### Name Tests After Behavior

Test names should state the behavior they prove. Do not put issue or pull
Expand Down
Loading
Loading