Skip to content

fix(db): preserve observer row sharing and freshness - #2346

Merged
KyleAMathews merged 13 commits into
mainfrom
codex/observer-row-container-sharing
Nov 3, 2026
Merged

KyleAMathews merged 13 commits into
mainfrom
codex/observer-row-container-sharing

Conversation

@KyleAMathews

@KyleAMathews KyleAMathews commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

🎯 Changes

Status and health updates replace the observer's row containers even when no rows change. Consumers that compare those containers by reference can repeat row work after each metadata update.

Capture each row revision once and share its data array and lazy state Map across metadata snapshots. Metadata changes still produce a fresh full snapshot with current status and health. Value writes replace the row containers, and retained snapshots keep their captured rows. Membership and ordering changes remain visible through layoutRevision. Actions that change no public fact retain the full snapshot identity.

The cache trusts Collection's row and layout clocks. Equal-content writes can create fresh virtual wrappers without changing those clocks, so snapshots keep their existing capture. This PR also fixes three freshness hazards at that boundary:

  • Discarding deferred delivery keeps committed row revisions monotonic. Restoring a discarded layout clock also advances row invalidation, so a detached observer cannot retain an obsolete capture when clock numbers repeat.
  • Replacing a nested plain record with a class or null-prototype record publishes an update, even when its enumerable fields match. This follows the maintainer's approved prototype policy. Draft reconstruction keeps its separate class/plain equivalence.
  • Replacing an array hole with a defined value publishes the update. Previously, a hole-skipping comparison could change Collection reads without advancing its clock, leaving observers stale. A hole still compares equal to undefined.

Supported inputs are Collections and pooled views from this DB instance. Reject absent or non-finite revision clocks before client binding, row reads, or sync activation. Pooled views use their ordinary change stream for layout updates, so the separate layout channel stays optional. Remove the unsupported clockless compatibility branch and check clocks before enumerating unchanged rows. Apply client hydration captures once through the publication queue. The cache keeps references to the live capture and last materialized visible capture, which can differ between publication and a read.

Review also found factorial Set comparison and a quadratic common-case regression in its first fix. First compare corresponding members, which establishes equality in linear work for paired equal inputs. Otherwise, build candidates and find a one-to-one assignment, preferring free candidates before reassignment. The utility oracle checks large equal inputs, multiplicity deficits, and a case that requires reassignment. Generic deepEquals retains its established keyed-class/plain/null/cross-realm record policy. Only Collection row equality gains the approved prototype distinction.

This preserves @benjavicente's original commit from #2328 and adds the oracle, freshness, and size improvements. The source PR disables maintainer edits, so this PR contains the follow-up changes. Production changes affect the shared observer, Collection invalidation, and equality utility in @tanstack/db. Framework adapter sources stay unchanged. The Angular adapter's separate row-state projection belongs to #2327. The latest combined tree with that PR remains unverified.

The size comparison uses current main 1443dc92e, identical production defines, and identical compression:

Measurement Delta
Observer module, minified −408 bytes
Collection changes, minified −7 bytes
Equality utility, minified +186 bytes
Net production, minified −229 bytes
DB export bundle, gzip −97 bytes
DB export bundle, brotli +50 bytes

All eight app scenarios shrink by 49–83 gzip bytes. Brotli changes range from −161 to +55 bytes. The DB export and group-by scenario grow under brotli compression. A deterministic unchanged granular-attachment probe reduces row enumerations from two to one. The remaining enumeration is Collection subscription bootstrap. A real hydration handoff applies the observer cache once instead of twice. The prototype check adds no traversal and uses prototypes the comparison already reads.

🔬 Oracle Coverage

The primary snapshot owner is packages/db/tests/live-query-observer-snapshot-oracle.property.test.ts. Its sharing, capture-path, and record-shape properties check independent row/rank and shape/number models.

  • Law: Metadata changes preserve row containers, writes and layout changes remain visible, retained snapshots keep their rows, and no-op actions preserve snapshot identity. Collection invalidation stays monotonic across discarded delivery. Record prototypes publish under the 2026-11-03 maintainer decision. The observer and Collection contracts supply the other laws.
  • Reach: Sharing runs 24 examples plus 40 generated histories per campaign, with 17 states. Capture paths run 16 examples plus 40 generated histories, with 27 states. Record shape runs 16 examples plus 40 generated histories, with 12 states. Every shape history exercises direct Collection and projected-query receivers. Both fixed and random campaigns meet all declared minima. No run budget decreases.
  • RED: The merge-base observer fails metadata sharing. Head e02e09c70 fails equal-refresh attachment sharing. Unchanged 71bb4c659 fails eight intended assertions in the extended five-owner gate. These include discarded value/layout captures and prototype replacements through both receivers. Clock seed 2346, path 0, retains version 2 instead of 3. Shape seed 234602, path 0:1:0:2:2, retains plain shape after a class replacement.
  • GREEN: The final audit gate passes 508 tests in eleven focused suites. These cover utilities, snapshots, observer delivery, pooled views, draft tracking, production errors, and generated docs. Angular ordinary and conformance tests also pass: 109 tests plus one todo, with no type errors. TypeScript, ESLint, changed-file lint, minified API, error erasure, and mangle checks pass. The earlier merged-main gate passed 1,868 tests in 16 suites. The gate includes the Effect metadata/callback owner. Focused TypeScript, ESLint, changed-file oracle lint, mangle validation, minified build, and public API checks pass. The merged gate repeats all three hostile mutants and guarded replays. Guarded direct replay passes each requested clock and shape witness.
  • Mutant: Restoring row-clock rollback fails value freshness. Omitting only the discarded-layout fence fails ordering after the value case passes. Restoring class/plain equality fails both shape receivers. Earlier wrapper-comparison, no-op identity, layout, cardinality, and health mutants remain documented.
  • Set work and pooled views: The small utility lane runs 100 fixed and 100 random histories with thirteen states, each reached 200 times. Independent counts and capacity judge each comparison domain. The large paired lane adds ten histories per campaign and eight states, each reached 20 times. Its widths span 1,024–3,072. Scalar-read and scoped native-operation ceilings are linear for this paired family. The original matcher and precheck-only mutant exceed the cubic scalar-read ceiling. Candidate reuse fails equality. The pooled owner compares wholesale, granular and detached readers in all 160 generated histories. Before the fix, subscription throws on the absent channel. A silent fallback fails the granular mirror assertion. The final source gate passes 190 tests, the built-dist gate passes 357, Preact conformance passes 136, and pooled GC passes 21.
  • CI counter overhead: Both Set campaigns exceeded the five-second timeout in the database shard. The scalar-read counter now allocates diagnostics only when its unchanged ceiling fails. All 87 utility tests and the combined 100-test utility/pooled gate pass locally. Every Set reach still records 200 histories. The original matcher still fails at read 2,049 against ceiling 2,048. Inputs, run counts, work limits, and timeouts remain unchanged.
  • Third review calibration: Before fix, paired Set work exceeds 4,096 reads and generic equal-record comparison fails. Ten invalid-clock witnesses also fail before the constructor fix. Removing the paired fast path, restoring strict generic prototypes, using greedy-only matching, and restoring factorial search each fail intended direct-replay observations. Paired Set linearity does not extend to arbitrary unordered inputs or nested-value traversal.
  • Four-agent audit: The sparse-array grammar now distinguishes holes from defined neighbors through both equality APIs, records, and singleton Sets. Seven utility states each reach 200 histories. Fourteen real publication states each reach 20 histories per campaign, including each direct/projected, mode, and attachment path. Unchanged production fails both owners before the indexed fix. Restoring hole skipping fails both guarded replays. Scoped native Map/Set counters reject a cached factorial matcher that scalar reads accepted. The draft model now preserves signed zero and rejects lost writes through root, nested, and Float64 paths. The observer checker comment now states value/order agreement without an unsupported row-reference identity promise. The fixes address all four audit findings. Existing budgets remain unchanged.
  • Limits: These comparisons observe direct core actions and queued query reads. They establish no framework scheduling, provider timing, arbitrary concurrency, cleanup/reset sharing, caller-mutation isolation, or infinite-page-array identity promise. The shape grammar covers sync replacements with keyed record prototypes through records, arrays, Map values, and Set members. Exotic built-in subclasses, descriptors, cycles, and optimistic assignment policy remain outside that grammar.

From packages/db, run the snapshot owner with:

pnpm exec vitest run tests/live-query-observer-snapshot-oracle.property.test.ts --coverage.enabled=false --maxWorkers=2

The versioned evidence record contains the laws, reach counts, replay inputs, mutants, measurements, and the external and four-agent review audits. The first review records five fixed findings, three refutations, and two accepted design choices. The second records seven fixed findings, one refutation, and one accepted design choice. The supplement records both CodeRabbit reviews, the Set work fix, and CI corrections. The third external review records five fixes, one accepted readonly-sharing design, and the explicitly separate draft bug #2349. Editing a nested sibling can temporarily strip an untouched class/null-prototype leaf. The maintainer identified that bug and kept its fix outside this PR. No known counterexample remains in the metadata-sharing and discarded-publication scope. The separate cleanup/restart issue #2334 remains open. Its shared-model trace also fails after readiness in both modes on 162eebf39. The coverage map records its owner and next witness. This PR does not establish general observer lifecycle correctness. The coverage map records the owners and their limits.

✅ Checklist

  • I have tested this code locally with pnpm test.

The full workspace suite did not run locally. The focused gates above pass. CI for 22da3b06e completed with 25 successful checks and one skipped CodeRabbit check. CI for 779466c62 found the missing generated error page and an Angular test mock without a layout clock. The fixes address both mechanical omissions. CI for 5911d5e00 found five source-type errors in the new sparse-array driver and a separate ordered-loader oracle failure. The driver correction passes both sparse campaigns, the full DB TypeScript source check, ESLint, and changed-file lint. The original sparse-array mutant still fails all receiving paths. The loader failure reproduces identically on exact main 1443dc92e; its seed, shrink path, full trace, owner, and next experiment are preserved in the coverage map. Its repair location remains unresolved. The independently replayed trace is tracked in #2296. The maintainer approved merging this scoped observer fix with that investigation tracked separately. No test, budget, or seed was changed to bypass it. CI for corrected head acdfb6f14 completed successfully: 25 successful checks and one skipped CodeRabbit check. Production remains at ba336f4b2. CodeRabbit is paused and its latest covered production commit remains 162eebf39; it has not reviewed the later semantic changes. This green random campaign does not close the recorded loader counterexample, the separate #2334 cleanup/restart defect, or the unverified combined #2327 integration. General readiness remains unproven. The separate Electric sampling reach issue remains tracked in #2347.

🚀 Release Impact

Summary by CodeRabbit

  • Bug Fixes
    • Live-query snapshots preserve row data and state containers when only status or health metadata changes. Row value and ordering changes appear in new snapshots, while earlier snapshots retain their point-in-time data.
    • Discarded publication deferrals now invalidate detached observer snapshots when needed, ensuring subsequent reads reflect current collection data.
    • Record comparisons now distinguish plain, class, and null-prototype records, while same-shape equal writes remain equal.
  • Documentation
    • Clarified snapshot-sharing behavior, record-shape equality, and the limits of observer coverage.

benjavicente and others added 2 commits November 1, 2026 20:48
Cache row materialization separately from full observer snapshots. Keep lazy
state Maps and data arrays stable across status/health changes while preserving
value-only updates, layout changes, and retained point-in-time reads.

Law: metadata-only snapshots retain their row containers (maintainer decision
2026-11-01; LiveQuerySnapshot contract).
Reach: 52 fixed and 52 random histories cross both observer modes, attached and
detached reads, empty/nonempty rows, read order, readiness, health, and writes.
RED: unchanged production fails metadata reference equality; seed 1101,
path 0:0:0:0, in live-query-observer.row-container-sharing.
GREEN: 100 observer tests, 89 existing Angular tests (one TODO), focused types,
ESLint, oracle lint, mangle validation, package build, and docs snippets pass on
Node 24.8.0. The patch Changeset releases this independently of Angular fixes.
Mutant: same-cardinality reuse fails a same-key value write; seed 1101,
path 0:0:1:2. The final implementation is restored.
Limits: the new lane uses synchronous direct Collections with 0..3 string keys;
existing ordered/findOne/hydration suites cover neighboring laws. No new host
scheduling or external-provider guarantee.
Exercise subscribe/unsubscribe transitions, require genuine health-only
reach, and register the sharing lane with guarded replay. Reuse captured
entries for layout comparison and materialize the shared Map directly.

Law: same-row-revision metadata changes share containers; values and retained
snapshots remain correct. Authority: LiveQuerySnapshot and maintainer decision.
Reach: 24 examples plus 40 generated histories per fixed/random campaign;
nonempty attach/detach/reattach reached in both modes.
RED: original implementation fails metadata identity, seed 1101 path 0:0:0:0.
GREEN: 112 observer tests, guarded replay, TypeScript, lint, mangle, and minified
API checks pass.
Mutant: unconditional entry replacement fails guarded replay at seed 1101,
path 2:3:1:6:4:3; cardinality-only reuse and false health reach also fail.
Limits: synchronous direct Collection path; no new host/provider or reset
sharing claim. Full evidence is in the observer row-container review record.

Production observer is 75 minified bytes smaller than the original merge-base;
DB package delta is -34 gzip and -111 brotli bytes.
@changeset-bot

changeset-bot Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: acdfb6f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 25 packages
Name Type
@tanstack/db Patch
@tanstack/angular-db Patch
@tanstack/capacitor-db-sqlite-persistence-e2e-app Patch
@tanstack/convex-db-collection Patch
@tanstack/db-adapter-conformance Patch
@tanstack/db-sqlite-persistence-core Patch
@tanstack/electric-db-collection Patch
@tanstack/expo-db-sqlite-persistence-e2e-app Patch
@tanstack/powersync-db-collection Patch
@tanstack/preact-db Patch
@tanstack/react-db Patch
@tanstack/rxdb-db-collection Patch
@tanstack/solid-db Patch
@tanstack/svelte-db Patch
@tanstack/tauri-db-sqlite-persistence-e2e-app Patch
@tanstack/trailbase-db-collection Patch
@tanstack/vue-db Patch
@tanstack/browser-db-sqlite-persistence Patch
@tanstack/capacitor-db-sqlite-persistence Patch
@tanstack/cloudflare-durable-objects-db-sqlite-persistence Patch
@tanstack/electron-db-sqlite-persistence Patch
@tanstack/expo-db-sqlite-persistence Patch
@tanstack/node-db-sqlite-persistence Patch
@tanstack/react-native-db-sqlite-persistence Patch
@tanstack/tauri-db-sqlite-persistence Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

Live-query observers retain captured data and state containers across metadata-only updates and refresh captures from collection revisions. Discarded layout publications advance the state revision. Deep equality distinguishes record prototypes and uses bounded matching for object-valued Sets.

Changes: Observer capture and revision tracking

Layer / File(s) Summary
Revision tracking and observer capture
packages/db/src/collection/changes.ts, packages/db/src/collection/index.ts, packages/db/src/live-query-observer.ts, packages/db/tests/live-query-observer-snapshot-oracle.property.test.ts, packages/db/tests/live-query-observer.test.ts, packages/db/tests/query/bucket-facade-adapter.test.ts, packages/db/tests/query/pooled-live-query-oracle.property.test.ts, packages/db/tests/oracle-config.ts, packages/db/tests/oracle-replay-manifest.ts, packages/db/mangle-cache.json, .changeset/observer-row-container-sharing.md, docs/contributing/oracle-coverage.md, docs/contributing/oracle-reviews/2026-11-01-observer-row-containers.md
Discarded layout epochs advance the state revision without rewinding it. The observer refreshes captures when either collection revision changes and reuses data and state containers when row contents remain unchanged. Tests cover metadata updates, capture paths, publication deferrals, and retained snapshots.
Record shape and Set equality
packages/db/src/utils.ts, packages/db/tests/utils-oracle.property.test.ts, packages/db/tests/utils.test.ts, packages/db/tests/live-query-observer-snapshot-oracle.property.test.ts, docs/contributing/glossary.md, docs/contributing/oracle-coverage.md, docs/contributing/oracle-reviews/2026-11-01-observer-row-containers.md
Deep equality distinguishes plain, class, and null-prototype records, with a draft-comparison exception when prototypes differ and at least one is plain. Object-valued Sets use candidate matching with augmenting paths. Tests cover record prototypes, nested payloads, and bounded Set comparisons.

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant Collection
  participant LiveQueryObserver
  participant Snapshot
  Collection->>LiveQueryObserver: state and layout revisions
  LiveQueryObserver->>Collection: read entries when either revision changes
  LiveQueryObserver->>Snapshot: provide captured data and state containers
Loading

Possibly related issues

Merge Risk: Minimal · up to 162ee

No concrete issue requiring a fix before merge was identified. Normal validation and pending CI should still complete.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main change: preserving observer row sharing and freshness in the database package.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description follows the repository template and provides substantive content. It has a detailed Changes section covering the row-container sharing, the freshness fixes, the Set matching change, an…
Full details: Description check

Explanation

The description follows the repository template and provides substantive content. It has a detailed Changes section covering the row-container sharing, the freshness fixes, the Set matching change, and the size measurements. It also has an Oracle Coverage section naming the owner file, laws, reach counts, RED/GREEN results, mutants, and limits. The checklist and release impact sections are present. The release impact box is checked for a changeset, which matches the raw summary. The description is very long and dense, and the Oracle Coverage section is hard to parse in places. It also contains unresolved items: a known loader counterexample tracked in #2296, a separate draft bug #2349, cleanup/restart issue #2334, and an unverified combined #2327 integration. These are disclosed, not hidden. The checklist item for local tests is unchecked, but the author states focused gates pass and the full workspace suite did not run. The template asks for RED/GREEN evidence for bug fixes, which the description provides. The description is mostly complete and satisfies the template's required information.

Full details: Docstring Coverage

Explanation

Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 9 functions across 12 files. (3 skipped: 3 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f7be63ef-51ec-4f50-98e5-6d025a4bb292
Commits

Reviewing files that changed from the base of the PR and between f66d684 and 162eebf.

Files selected for processing: 9
  • .changeset/observer-row-container-sharing.md
  • docs/contributing/oracle-coverage.md
  • docs/contributing/oracle-reviews/2026-11-01-observer-row-containers.md
  • packages/db/src/live-query-observer.ts
  • packages/db/src/utils.ts
  • packages/db/tests/oracle-config.ts
  • packages/db/tests/query/bucket-facade-adapter.test.ts
  • packages/db/tests/query/pooled-live-query-oracle.property.test.ts
  • packages/db/tests/utils-oracle.property.test.ts
Files skipped from review as they are similar to previous changes: 2
  • .changeset/observer-row-container-sharing.md
  • docs/contributing/oracle-reviews/2026-11-01-observer-row-containers.md

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review.

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Incremental update benchmark

Comparing 65c6d2b5d (this PR) against 1443dc92e (base). Write times are per-write medians over 100 iterations (20 warmup writes). Cold hydrate is one timed first load of each query.

Overall median write time vs base: 0.96× · cold hydrate time: 1.03× (geometric mean of per-case ratios; lower is faster).

Writes: 0 regression(s), 3 improvement(s) (threshold: ±20% and >0.05ms).

Cold hydrate: 3 regression(s), 1 improvement(s) (threshold: ±50% and >5ms).

Per-case flags are noisy on shared runners. Read the geometric means first.

Writes

Query Δ median write time (geomean) Best case Worst case Flags
list: newest 50 open +0.2% -40.2% +49.5% —
list + author +2.1% -10.7% +49.2% —
list + comment count -3.6% -39.2% +14.2% 1 🟢
list + 3 recent comments -7.1% -56.3% +33.8% 1 🟢
issue detail + comments -14.1% -60.4% +10.7% 1 🟢

Cold hydrate

Query Δ cold hydrate time (geomean) Best case Worst case Flags
list: newest 50 open -2.3% -46.8% +40.5% —
list + author +8.9% -20.9% +256.1% 1 🔴
list + comment count -10.3% -63.7% +41.5% 1 🟢
list + 3 recent comments +7.5% -44.8% +115.1% 1 🔴
issue detail + comments +20.2% -5.3% +193.2% 1 🔴

Each row aggregates the 14.4 scale/index/write-mode configurations of that query; per-configuration tables below.

100 rows/collection | source indexes: none | synced writes — geomean 1.05×, cold 1.10×
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.109ms 0.130ms +19.2% 0.226ms 0.264ms +16.9% 10.811ms 9.179ms -15.1%
list: newest 50 open 0.288ms 0.295ms +2.6% 0.629ms 0.529ms -16.0% 2.773ms 3.896ms +40.5%
list + author 0.100ms 0.110ms +10.2% 0.206ms 0.225ms +8.9% 8.745ms 9.160ms +4.7%
list + comment count 0.235ms 0.267ms +13.8% 0.368ms 0.426ms +15.5% 9.007ms 8.203ms -8.9%
list + 3 recent comments 0.136ms 0.118ms -13.3% 0.233ms 0.244ms +4.7% 8.610ms 7.080ms -17.8%
issue detail + comments 0.067ms 0.067ms +0.2% 0.138ms 0.153ms +10.8% 1.512ms 2.893ms +91.4%
100 rows/collection | source indexes: none | optimistic writes — geomean 0.98×, cold 1.07×
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.066ms 0.079ms +18.9% 0.132ms 0.149ms +12.9% 1.952ms 2.088ms +7.0%
list: newest 50 open 0.041ms 0.042ms +2.8% 0.068ms 0.098ms +43.8% 1.461ms 1.620ms +10.9%
list + author 0.075ms 0.071ms -4.8% 0.172ms 0.164ms -4.8% 5.597ms 6.924ms +23.7%
list + comment count 0.119ms 0.111ms -7.1% 0.261ms 0.226ms -13.4% 3.716ms 4.291ms +15.5%
list + 3 recent comments 0.057ms 0.059ms +3.5% 0.125ms 0.131ms +4.9% 7.297ms 5.942ms -18.6%
issue detail + comments 0.085ms 0.066ms -22.3% 0.183ms 0.155ms -15.6% 1.059ms 1.133ms +7.0%
100 rows/collection | source indexes: manual | synced writes — geomean 1.06×, cold 0.99×
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.090ms 0.087ms -3.9% 0.163ms 0.140ms -14.4% 2.590ms 2.937ms +13.4%
list: newest 50 open 0.204ms 0.188ms -8.1% 0.392ms 0.373ms -4.8% 1.777ms 1.697ms -4.5%
list + author 0.067ms 0.099ms +49.2% 0.129ms 0.145ms +12.8% 4.282ms 3.443ms -19.6%
list + comment count 0.116ms 0.133ms +14.2% 0.216ms 0.256ms +18.8% 3.082ms 3.225ms +4.6%
list + 3 recent comments 0.074ms 0.071ms -3.3% 0.170ms 0.154ms -9.0% 3.951ms 4.297ms +8.8%
issue detail + comments 0.052ms 0.052ms -1.2% 0.121ms 0.104ms -14.1% 0.599ms 0.572ms -4.5%
100 rows/collection | source indexes: manual | optimistic writes — geomean 1.04×, cold 1.09×
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.048ms 0.059ms +22.6% 0.107ms 0.108ms +0.4% 1.198ms 1.168ms -2.4%
list: newest 50 open 0.040ms 0.042ms +5.3% 0.100ms 0.099ms -1.3% 0.975ms 1.127ms +15.5%
list + author 0.063ms 0.061ms -2.5% 0.127ms 0.134ms +5.7% 4.399ms 3.480ms -20.9%
list + comment count 0.088ms 0.088ms +0.1% 0.200ms 0.192ms -3.9% 3.124ms 4.421ms +41.5%
list + 3 recent comments 0.052ms 0.052ms +0.4% 0.104ms 0.102ms -2.4% 3.693ms 4.961ms +34.3%
issue detail + comments 0.043ms 0.043ms -1.5% 0.094ms 0.061ms -35.6% 0.472ms 0.463ms -1.9%
1,000 rows/collection | source indexes: none | synced writes — geomean 0.75×, cold 0.99×, 1 change(s)
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.067ms 0.041ms -38.8% 0.085ms 0.073ms -14.3% 6.916ms 4.720ms -31.7%
list: newest 50 open 0.506ms 0.562ms +11.0% 1.015ms 1.096ms +8.0% 9.228ms 8.357ms -9.4%
list + author 0.057ms 0.051ms -10.7% 0.148ms 0.117ms -20.8% 22.781ms 21.813ms -4.2%
list + comment count 0.153ms 0.162ms +5.7% 0.220ms 0.311ms +40.9% 10.863ms 8.283ms -23.7%
list + 3 recent comments 0.168ms 0.073ms -56.3% 0.196ms 0.215ms +9.8% 🟢 7.186ms 14.115ms +96.4% 🔴
issue detail + comments 0.088ms 0.056ms -36.5% 0.170ms 0.117ms -31.6% 1.281ms 1.364ms +6.5%
1,000 rows/collection | source indexes: none | optimistic writes — geomean 1.05×, cold 0.92×
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.074ms 0.110ms +49.5% 0.136ms 0.154ms +13.3% 12.531ms 6.664ms -46.8%
list: newest 50 open 0.033ms 0.034ms +2.5% 0.074ms 0.051ms -31.8% 4.737ms 4.996ms +5.5%
list + author 0.056ms 0.055ms -1.2% 0.101ms 0.085ms -15.2% 25.524ms 28.495ms +11.6%
list + comment count 0.078ms 0.075ms -3.5% 0.117ms 0.116ms -1.4% 8.971ms 6.906ms -23.0%
list + 3 recent comments 0.047ms 0.044ms -6.6% 0.096ms 0.055ms -42.7% 6.710ms 7.737ms +15.3%
issue detail + comments 0.040ms 0.039ms -2.4% 0.055ms 0.054ms -1.0% 0.904ms 0.968ms +7.1%
1,000 rows/collection | source indexes: manual | synced writes — geomean 0.98×, cold 0.96×
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.038ms 0.039ms +3.2% 0.044ms 0.050ms +13.2% 0.980ms 1.327ms +35.4%
list: newest 50 open 0.154ms 0.167ms +8.4% 0.318ms 0.332ms +4.4% 0.895ms 0.958ms +7.0%
list + author 0.051ms 0.051ms +1.4% 0.093ms 0.097ms +4.5% 2.550ms 2.630ms +3.1%
list + comment count 0.103ms 0.096ms -7.1% 0.160ms 0.177ms +10.9% 2.954ms 2.772ms -6.2%
list + 3 recent comments 0.064ms 0.061ms -4.5% 0.075ms 0.097ms +29.6% 8.083ms 4.458ms -44.8%
issue detail + comments 0.051ms 0.045ms -11.9% 0.059ms 0.065ms +11.3% 0.466ms 0.482ms +3.4%
1,000 rows/collection | source indexes: manual | optimistic writes — geomean 0.91×, cold 1.24×, 1 change(s)
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.042ms 0.042ms -0.9% 0.088ms 0.082ms -7.0% 0.853ms 0.950ms +11.4%
list: newest 50 open 0.036ms 0.036ms -1.2% 0.052ms 0.058ms +11.8% 0.980ms 1.005ms +2.6%
list + author 0.055ms 0.053ms -3.6% 0.096ms 0.098ms +3.1% 2.629ms 2.610ms -0.7%
list + comment count 0.144ms 0.088ms -39.2% 0.185ms 0.172ms -7.1% 🟢 2.842ms 3.231ms +13.7%
list + 3 recent comments 0.051ms 0.047ms -7.6% 0.085ms 0.058ms -32.1% 3.595ms 7.735ms +115.1%
issue detail + comments 0.042ms 0.047ms +10.7% 0.071ms 0.094ms +31.9% 0.385ms 0.509ms +32.0%
10,000 rows/collection | source indexes: none | synced writes — geomean 1.04×, cold 1.07×
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.038ms 0.039ms +0.4% 0.070ms 0.045ms -35.4% 46.299ms 49.781ms +7.5%
list: newest 50 open 4.695ms 4.987ms +6.2% 5.314ms 5.835ms +9.8% 36.831ms 46.710ms +26.8%
list + author 0.092ms 0.090ms -2.5% 0.119ms 0.115ms -2.8% 202.603ms 205.800ms +1.6%
list + comment count 0.085ms 0.087ms +2.9% 0.112ms 0.122ms +8.8% 47.857ms 42.949ms -10.3%
list + 3 recent comments 0.063ms 0.084ms +33.8% 0.086ms 0.149ms +73.7% 51.400ms 58.410ms +13.6%
issue detail + comments 0.046ms 0.041ms -9.8% 0.061ms 0.052ms -13.7% 5.230ms 5.473ms +4.6%
10,000 rows/collection | source indexes: none | optimistic writes — geomean 0.76×, cold 1.15×, 1 change(s)
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.073ms 0.044ms -40.2% 0.112ms 0.084ms -25.4% 46.627ms 46.742ms +0.2%
list: newest 50 open 0.033ms 0.033ms -1.8% 0.064ms 0.047ms -26.4% 46.144ms 42.369ms -8.2%
list + author 0.056ms 0.055ms -2.1% 0.082ms 0.069ms -16.3% 192.835ms 194.142ms +0.7%
list + comment count 0.105ms 0.094ms -10.8% 0.207ms 0.137ms -33.5% 55.556ms 44.989ms -19.0%
list + 3 recent comments 0.046ms 0.044ms -5.3% 0.062ms 0.064ms +3.7% 47.846ms 50.121ms +4.8%
issue detail + comments 0.099ms 0.039ms -60.4% 0.144ms 0.053ms -62.8% 🟢 4.295ms 12.594ms +193.2% 🔴
10,000 rows/collection | source indexes: manual | synced writes — geomean 1.04×, cold 1.07×, 2 change(s)
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.038ms 0.037ms -2.2% 0.048ms 0.044ms -8.5% 2.088ms 1.720ms -17.6%
list: newest 50 open 0.579ms 0.589ms +1.7% 0.958ms 0.695ms -27.5% 1.706ms 1.940ms +13.7%
list + author 0.049ms 0.054ms +9.6% 0.083ms 0.102ms +23.5% 3.238ms 11.528ms +256.1% 🔴
list + comment count 0.097ms 0.106ms +9.6% 0.133ms 0.208ms +56.5% 10.957ms 3.981ms -63.7% 🟢
list + 3 recent comments 0.066ms 0.064ms -1.7% 0.076ms 0.128ms +69.2% 4.180ms 4.931ms +18.0%
issue detail + comments 0.045ms 0.048ms +7.0% 0.060ms 0.088ms +46.2% 0.660ms 0.693ms +5.0%
10,000 rows/collection | source indexes: manual | optimistic writes — geomean 0.95×, cold 0.80×
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.045ms 0.043ms -4.6% 0.066ms 0.072ms +9.7% 2.712ms 1.468ms -45.9%
list: newest 50 open 0.039ms 0.035ms -8.7% 0.049ms 0.044ms -10.4% 1.721ms 1.545ms -10.2%
list + author 0.058ms 0.054ms -7.3% 0.095ms 0.142ms +49.7% 5.058ms 4.273ms -15.5%
list + comment count 0.122ms 0.113ms -7.8% 0.239ms 0.164ms -31.4% 3.650ms 3.843ms +5.3%
list + 3 recent comments 0.056ms 0.059ms +5.7% 0.113ms 0.116ms +2.3% 6.243ms 4.013ms -35.7%
issue detail + comments 0.047ms 0.044ms -8.2% 0.064ms 0.050ms -21.1% 0.704ms 0.666ms -5.3%

Runner: node v24.8.0, linux 7.0.0-1017-azure, AMD EPYC 9V45 96-Core Processor. Timings on shared CI runners are noisy; treat small deltas as indicative only.

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Size Change: +42 B (+0.02%)

Total Size: 239 kB

📦 View Changed
Filename Size Change
packages/db/dist/esm/collection/changes.js 3.06 kB -4 B (-0.13%)
packages/db/dist/esm/collection/index.js 6.28 kB +51 B (+0.82%)
packages/db/dist/esm/live-query-observer.js 3.21 kB -91 B (-2.76%)
packages/db/dist/esm/utils.js 1.81 kB +86 B (+4.98%) 🔍
ℹ️ View Unchanged
Filename Size
packages/db/dist/esm/client.js 5.51 kB
packages/db/dist/esm/collection-options-brand.js 219 B
packages/db/dist/esm/collection-options.js 258 B
packages/db/dist/esm/collection/change-events.js 1.76 kB
packages/db/dist/esm/collection/cleanup-queue.js 828 B
packages/db/dist/esm/collection/config-errors.js 547 B
packages/db/dist/esm/collection/events.js 504 B
packages/db/dist/esm/collection/health-tree.js 698 B
packages/db/dist/esm/collection/indexes.js 2.3 kB
packages/db/dist/esm/collection/lifecycle.js 5.59 kB
packages/db/dist/esm/collection/mutations.js 2.94 kB
packages/db/dist/esm/collection/state.js 7.69 kB
packages/db/dist/esm/collection/subscription.js 9.86 kB
packages/db/dist/esm/collection/sync.js 6.51 kB
packages/db/dist/esm/collection/validate-config.js 1.17 kB
packages/db/dist/esm/collection/validate-indexing.js 366 B
packages/db/dist/esm/deferred.js 207 B
packages/db/dist/esm/error-message.js 642 B
packages/db/dist/esm/errors.js 7.15 kB
packages/db/dist/esm/event-emitter.js 1.06 kB
packages/db/dist/esm/index.js 4.75 kB
packages/db/dist/esm/indexed-db-wrapper.js 1.91 kB
packages/db/dist/esm/indexed-db.js 3.8 kB
packages/db/dist/esm/indexes/auto-index.js 924 B
packages/db/dist/esm/indexes/base-index.js 1.92 kB
packages/db/dist/esm/indexes/basic-index.js 1.93 kB
packages/db/dist/esm/indexes/btree-index.js 1.62 kB
packages/db/dist/esm/indexes/index-registry.js 916 B
packages/db/dist/esm/indexes/reverse-index.js 1.01 kB
packages/db/dist/esm/live-query-adapter.js 845 B
packages/db/dist/esm/live-query-observer-client.js 2.21 kB
packages/db/dist/esm/live-query-options.js 2.65 kB
packages/db/dist/esm/live-query-primitives.js 406 B
packages/db/dist/esm/live-query-window-binding.js 1.56 kB
packages/db/dist/esm/live-query-window-controller.js 4.02 kB
packages/db/dist/esm/local-only.js 1 kB
packages/db/dist/esm/local-storage.js 4.58 kB
packages/db/dist/esm/optimistic-action.js 359 B
packages/db/dist/esm/paced-mutations.js 1.11 kB
packages/db/dist/esm/proxy.js 3.51 kB
packages/db/dist/esm/query/builder/clone-query.js 854 B
packages/db/dist/esm/query/builder/functions.js 1.61 kB
packages/db/dist/esm/query/builder/group-keys.js 157 B
packages/db/dist/esm/query/builder/include-functions.js 229 B
packages/db/dist/esm/query/builder/index.js 7.67 kB
packages/db/dist/esm/query/builder/query-ir.js 312 B
packages/db/dist/esm/query/builder/ref-proxy-identity.js 292 B
packages/db/dist/esm/query/builder/ref-proxy.js 1.67 kB
packages/db/dist/esm/query/builder/wrapper-identity.js 221 B
packages/db/dist/esm/query/compiler/evaluators.js 2.51 kB
packages/db/dist/esm/query/compiler/expressions.js 603 B
packages/db/dist/esm/query/compiler/find-aggregate.js 328 B
packages/db/dist/esm/query/compiler/group-by.js 4.38 kB
packages/db/dist/esm/query/compiler/grouping.js 161 B
packages/db/dist/esm/query/compiler/index.js 10.3 kB
packages/db/dist/esm/query/compiler/joins.js 3.29 kB
packages/db/dist/esm/query/compiler/lazy-targets.js 1.11 kB
packages/db/dist/esm/query/compiler/order-by.js 2.87 kB
packages/db/dist/esm/query/compiler/parent-routes.js 325 B
packages/db/dist/esm/query/compiler/query-equivalence.js 568 B
packages/db/dist/esm/query/compiler/route-metadata.js 1.45 kB
packages/db/dist/esm/query/compiler/select.js 1.66 kB
packages/db/dist/esm/query/effect.js 5.81 kB
packages/db/dist/esm/query/equality-conjunct.js 486 B
packages/db/dist/esm/query/equality-value-identity.js 736 B
packages/db/dist/esm/query/expression-helpers.js 1.61 kB
packages/db/dist/esm/query/ir-stable-identity.js 4.29 kB
packages/db/dist/esm/query/ir.js 2.26 kB
packages/db/dist/esm/query/join-conditions.js 257 B
packages/db/dist/esm/query/live-query-collection.js 391 B
packages/db/dist/esm/query/live/bucket-facade-adapter.js 3.17 kB
packages/db/dist/esm/query/live/collection-config-builder.js 8.57 kB
packages/db/dist/esm/query/live/collection-registry.js 264 B
packages/db/dist/esm/query/live/collection-subscriber.js 2.69 kB
packages/db/dist/esm/query/live/graph-scheduler.js 305 B
packages/db/dist/esm/query/live/includes-runtime.js 212 B
packages/db/dist/esm/query/live/internal.js 145 B
packages/db/dist/esm/query/live/materialized-pipeline.js 1.94 kB
packages/db/dist/esm/query/live/ordered-source-loader.js 6.61 kB
packages/db/dist/esm/query/live/public-key-reduction.js 970 B
packages/db/dist/esm/query/live/subset-demand-controller.js 2.44 kB
packages/db/dist/esm/query/live/utils.js 1.35 kB
packages/db/dist/esm/query/optimizer.js 2.95 kB
packages/db/dist/esm/query/pooled-live-query.js 5.14 kB
packages/db/dist/esm/query/pooled-source.js 219 B
packages/db/dist/esm/query/query-once.js 359 B
packages/db/dist/esm/query/runtime-reference-identity.js 630 B
packages/db/dist/esm/query/subset-dedupe.js 493 B
packages/db/dist/esm/query/validate-limit.js 247 B
packages/db/dist/esm/scheduler.js 1.23 kB
packages/db/dist/esm/SortedMap.js 1.77 kB
packages/db/dist/esm/strategies/commit-completion.js 154 B
packages/db/dist/esm/strategies/debounceStrategy.js 658 B
packages/db/dist/esm/strategies/queueStrategy.js 523 B
packages/db/dist/esm/strategies/serial-pacer.js 486 B
packages/db/dist/esm/strategies/throttleStrategy.js 738 B
packages/db/dist/esm/sync-persistence.js 669 B
packages/db/dist/esm/sync-receipt.js 211 B
packages/db/dist/esm/transaction-commit-work.js 351 B
packages/db/dist/esm/transactions.js 4.66 kB
packages/db/dist/esm/utils/array-utils.js 270 B
packages/db/dist/esm/utils/browser-polyfills.js 304 B
packages/db/dist/esm/utils/btree.js 3.02 kB
packages/db/dist/esm/utils/callbacks.js 219 B
packages/db/dist/esm/utils/comparison.js 1.95 kB
packages/db/dist/esm/utils/cursor.js 753 B
packages/db/dist/esm/utils/error.js 262 B
packages/db/dist/esm/utils/get-or-create.js 155 B
packages/db/dist/esm/utils/index-optimization.js 2.58 kB
packages/db/dist/esm/utils/source-record.js 140 B
packages/db/dist/esm/utils/type-guards.js 230 B
packages/db/dist/esm/utils/uuid.js 530 B
packages/db/dist/esm/virtual-props.js 400 B
packages/react-db/dist/esm/DbProvider.js 317 B
packages/react-db/dist/esm/development.js 190 B
packages/react-db/dist/esm/HydrationBoundary.js 263 B
packages/react-db/dist/esm/index.js 330 B
packages/react-db/dist/esm/source-id-bindings.js 339 B
packages/react-db/dist/esm/useLiveInfiniteQuery.js 1.45 kB
packages/react-db/dist/esm/useLiveQuery.js 3.08 kB
packages/react-db/dist/esm/useLiveQueryEffect.js 504 B
packages/react-db/dist/esm/useLiveSuspenseQuery.js 1.27 kB
packages/react-db/dist/esm/usePacedMutations.js 429 B

compressed-size-action::db-and-react-package-size

@pkg-pr-new

pkg-pr-new Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
More templates

@tanstack/angular-db

npm i https://pkg.pr.new/@tanstack/angular-db@2346

@tanstack/browser-db-sqlite-persistence

npm i https://pkg.pr.new/@tanstack/browser-db-sqlite-persistence@2346

@tanstack/capacitor-db-sqlite-persistence

npm i https://pkg.pr.new/@tanstack/capacitor-db-sqlite-persistence@2346

@tanstack/cloudflare-durable-objects-db-sqlite-persistence

npm i https://pkg.pr.new/@tanstack/cloudflare-durable-objects-db-sqlite-persistence@2346

@tanstack/convex-db-collection

npm i https://pkg.pr.new/@tanstack/convex-db-collection@2346

@tanstack/db

npm i https://pkg.pr.new/@tanstack/db@2346

@tanstack/db-ivm

npm i https://pkg.pr.new/@tanstack/db-ivm@2346

@tanstack/db-sqlite-persistence-core

npm i https://pkg.pr.new/@tanstack/db-sqlite-persistence-core@2346

@tanstack/electric-db-collection

npm i https://pkg.pr.new/@tanstack/electric-db-collection@2346

@tanstack/electron-db-sqlite-persistence

npm i https://pkg.pr.new/@tanstack/electron-db-sqlite-persistence@2346

@tanstack/expo-db-sqlite-persistence

npm i https://pkg.pr.new/@tanstack/expo-db-sqlite-persistence@2346

@tanstack/node-db-sqlite-persistence

npm i https://pkg.pr.new/@tanstack/node-db-sqlite-persistence@2346

@tanstack/offline-transactions

npm i https://pkg.pr.new/@tanstack/offline-transactions@2346

@tanstack/powersync-db-collection

npm i https://pkg.pr.new/@tanstack/powersync-db-collection@2346

@tanstack/preact-db

npm i https://pkg.pr.new/@tanstack/preact-db@2346

@tanstack/query-db-collection

npm i https://pkg.pr.new/@tanstack/query-db-collection@2346

@tanstack/react-db

npm i https://pkg.pr.new/@tanstack/react-db@2346

@tanstack/react-native-db-sqlite-persistence

npm i https://pkg.pr.new/@tanstack/react-native-db-sqlite-persistence@2346

@tanstack/react-router-with-db

npm i https://pkg.pr.new/@tanstack/react-router-with-db@2346

@tanstack/rxdb-db-collection

npm i https://pkg.pr.new/@tanstack/rxdb-db-collection@2346

@tanstack/solid-db

npm i https://pkg.pr.new/@tanstack/solid-db@2346

@tanstack/svelte-db

npm i https://pkg.pr.new/@tanstack/svelte-db@2346

@tanstack/tauri-db-sqlite-persistence

npm i https://pkg.pr.new/@tanstack/tauri-db-sqlite-persistence@2346

@tanstack/trailbase-db-collection

npm i https://pkg.pr.new/@tanstack/trailbase-db-collection@2346

@tanstack/vue-db

npm i https://pkg.pr.new/@tanstack/vue-db@2346

commit: acdfb6f

Test added 2 commits November 3, 2026 08:38
Law: LiveQuerySnapshot and the 2026-11-01 maintainer decision require
unchanged rows to retain containers, while values and ordered keys stay fresh.
No-op actions also preserve full-snapshot identity.

Reach: 17 sharing and 16 real-query capture states have fixed witnesses;
fixed/random campaigns use 24+40 and 16+40 histories respectively.
All measured counts are in the versioned evidence record.

RED: Parent e02e09c fails metadata keeps data after refresh, subscribe,
report. Seed 1101, path 2:4:5:6:8:5. New receiving paths passed before edits.

GREEN: 118 observer tests and 41 replay tests pass, plus TypeScript, ESLint,
oracle lint, minified build/API and mangle checks. Observer -99 minified
bytes; DB -40 gzip and -97 brotli bytes against the original merge-base.

Mutant: Original wrapper comparison fails guarded replay. Ignoring layout
clocks fails ordered rows at seed 2346, path 0:2:0:1:1:0. Snapshot cloning
survives the old lane and fails the added no-op assertion.

Limits: Core direct/query snapshot cuts, bounded rows/actions, no arbitrary
concurrency, framework/provider timing, cleanup sharing, caller-mutation
isolation or infinite-page-array identity promise. No budget decreased.
Keep committed row revisions monotonic and fence discarded layout clocks.
Publish nested record prototype changes under the maintainer decision.
Remove unsupported clockless compatibility and redundant observer capture work.

Law: committed reads remain fresh, retained snapshots keep capture-time rows,
and metadata-only updates share containers. Record prototype changes publish
under the maintainer decision of 2026-11-03. Draft equality remains separate.
Reach: capture histories reach all 27 declared states, with nested discarded
value/layout writes, both modes, ordered/findOne, hydration and reattachment.
Record-shape histories reach all 12 states through source and query receivers.
RED: unchanged 71bb4c6 fails 8 intended assertions in the extended five-owner
gate; clock seed2346/path0 and shape seed234602/path0:1:0:2:2 fail publicly.
GREEN: 1423 tests in15 suites pass; latest utility reach rerun83/83 passes.
Focused types, lint, minified API/build, mangle validation and guarded replay pass.
Mutant: original row rollback, layout-fence omission and old record equality
all fail the intended comparisons. All production files restored afterward.
Limits: bounded core sync histories and queued-query reads; no host/provider
timing, exotic built-in subclasses, cleanup sharing or infinite page identity.

Full evidence and nine-finding dispositions are in
 docs/contributing/oracle-reviews/2026-11-01-observer-row-containers.md.
Shipped minified bytes are net -339 versus the original merge base.
@KyleAMathews KyleAMathews changed the title perf(db): preserve observer row containers with stronger oracle coverage fix(db): preserve observer row sharing and freshness Nov 3, 2026
Resolve the record-equality conflict while retaining upstream signed-zero,
comparison-mode and Effect publication policies.

Law: retain fresh committed captures, metadata sharing and record prototypes,
under the established contracts and maintainer decision of 2026-11-03.
Reach: all sharing, capture and shape states reached on the merged tree.
RED: row rollback, layout-fence omission and old prototype equality each fail
the merged oracle at the intended public comparison.
GREEN: 1868 tests in16 suites, focused types, lint, minified API and mangle pass.
Mutant: all three repeated against merged main and rejected; guarded replay
passes after restoring production.
Limits: bounded core/query cuts; combined Angular tree and full local workspace
suite unverified. Exact pushed-head CI is separate.

Production remains net -339 minified bytes against current main1443dc92e.
Full evidence: docs/contributing/oracle-reviews/2026-11-01-observer-row-containers.md.

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Fix comments: Fix CodeRabbit comments on this PR

Comment thread packages/db/src/utils.ts Resolved

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Fix comments: Fix CodeRabbit comments on this PR

Test added 3 commits November 3, 2026 10:03
Law: unordered structural Sets require a bijection; AGENTS.md excludes
combinatorial comparison work. Supported pooled observers publish the same
rows, status and deltas as their live-query Collection. Prototype publication
follows the maintainer decision of 2026-11-03.

Reach: utils.42 runs 100 fixed + 100 random histories; all 12 declared states
reach 200. Pooled wholesale/granular/detached receivers each reach 160.

RED: extended utility owner on f66d684 fails scalar read 2049 > 2048
(seed 20260911, path 0:0:0). Extended pooled owner fails subscription before
repair (seed 44502001, path 0:0:0:0:0:0).

GREEN: final focused source gate 190 tests; prior broader gate 786 tests;
built-dist 357 tests; real Preact conformance 136 tests; pooled GC 21 tests.
Types, ESLint, changed-file oracle lint, minified API and mangle checks pass.

Mutant: factorial matcher and precheck-only matcher fail work assertions;
candidate reuse fails bag equality. Silent pooled attach fallback fails the
granular mirror (seed 44502001, path 1:0:0:0:3:2:2). All mutants restored.

Limits: bounded scalar Set work, corresponding parent cycles, core pooled
histories and real Preact receiving witness. No global nested-value cost or
latest combined Angular tree claim. Production is -285 minified bytes against
main1443dc92e. See the versioned row-container review report for the audits.
Test added 5 commits November 3, 2026 11:29
Restore generic record equality while retaining prototype-sensitive Collection
publication. Reuse Set cycle bookkeeping, prefer free candidates, and enforce
observer revision clocks before resource acquisition. Simplify capture callers.

Law: generic and row equality retain their distinct approved domains; paired
equal Sets need bounded work; invalid Collection clocks reject before mutation.
Reach: small Set 13 states x 200 histories; paired Set 8 states x 20 histories.
RED: extended pre-fix utility gate fails paired work (4097 > 4096) and generic
record equality; ten constructor invariant witnesses fail before that repair.
GREEN: seven focused suites pass 381 tests; types, ESLint, changed-file lint,
minified API, production error erasure, and mangle checks pass.
Mutant: no paired fast path, strict generic prototypes, greedy-only assignment,
and original factorial matching all fail intended observations in direct replay.
Limits: arbitrary Set reorder/nested cost and graph topology are unbounded;
#2349 draft prototype loss is explicitly outside this PR. #2334 stays open.
Production: -262 minified bytes vs exact origin/main 1443dc9.
@KyleAMathews
KyleAMathews merged commit 70a744b into main Nov 3, 2026
26 checks passed
@KyleAMathews
KyleAMathews deleted the codex/observer-row-container-sharing branch November 3, 2026 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants