Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Adopt the IndexedDB request-batch profile

Research snapshot of November 23, 2026. Code and issue observations refer to the cited revisions and collection times.

The What the scale measurements establish and which experiment comes next specifies what a browser or deployed adapter must prove for the reserved profile. Adoption is the proposal in this book. A repository owner still needs to record the disposition.

Proposed #9082 verdict: adopt the bounded, opt-in browser record-store adapter demonstrated in Chromium. The decision concerns the profile in the shared conformance fixture. Product activation, other browser engines and using browser storage as the sole durable copy each require independent evidence. The initial product use is an ID-owned, origin-local offline projection or explicitly local draft. Its provenance and sync state must be visible. Native redb and hosted Turso/libSQL retain their committed roles. Drew’s scope amendment · Architectural extension amendment · Latest recorded handoff

What the evaluation proved

At main 4cfceaa8afc08cf2cea88b9d733a2ace14c8ad5a, the executable adapter is TypeScript using native IndexedDB. Rust defines the port contract, redb/libSQL capability profiles and shared fixture/reference test. There is no Rust/WASM IndexedDB backend in this evaluation. The raw-API TS path suffices; a later WASM execution shell can invoke the same host port. The standalone browser package has no product enablement. The source of the #10213 PR records two laptop Chromium suite runs (2/2 tests each), strict TS typechecking, a failing injected mutation followed by a restored passing run, and repair of a blocked-open race. Those are previously reported results; no new suite ran during this review. No latency, throughput, quota-exhaustion, process-crash or cross-engine benchmark result is present in that PR. Merged evaluation and route · Browser package · Rust port contract

The shared fixture has 25 steps. Five have profile-specific expectations. The browser suite uses the redb expectation for those five because both profiles have definitive local outcomes. It executes the complete script twice and checks against the fixture and a separate reference model. It tests CRUD, ordered key scans, admission/version refusal, multi-store batches and stable request-ID retry. The two commit_fault cases intentionally treat simulated network faults as inert on a local store. The engine probes check late operation refusal, closing/reopening the database handle under the same running browser, schema upgrade, reserved namespace refusal and storage estimates/persistence status. The reported persistence flag was false. Nothing in these probes forced eviction or a quota error or restarted the browser process. Fixture · Browser suite · Probe implementations

Contract fieldProposed active declarationScope
Resource, kind, scopeindexeddb, record-store, browser; contract version 2ID’s own origin and database. The fixture filename remains port-v1.json with fixture version 1.
Required and optional capabilitiesRequired list empty. Optional store.scan, store.txn.multi-record, store.txn.whole-database.Negotiate before mutation; scan returns key order, and ordered=false continues to refer to append-order delivery.
Commitatomic_commit=true, atomic_scope=whole-database, no conditional scopeFull write set supplied in advance. One transaction over all touched stores plus its metadata store. No handle escapes into caller code, no transaction crosses databases/origins or awaits external work.
Outcome and retrydefinitive, retry-as-new-operationLocal completion/abort reports the adapter’s outcome; retries of identical input reuse the stable ID. A closed tab that never observed the outcome must use the original ID. The current marker is a boolean, so the API relies on an operation ID identifying immutable input.
Guaranteesdurable=true, ordered=false, atomic_outbox=false, exactly_once=falseRust defines durability as surviving adapter restart. Retention after user deletion, origin eviction or power failure is a distinct guarantee. No external side-effect delivery claim.
Hard limitsAll three declared maxima nullThe contract declares no finite bound. Browser capacity and host quotas still apply; cap application batches/scan page sizes before using large data sets.

TS descriptor and transaction code · W3C IndexedDB specification · Browser quota and eviction behavior

Exact proposed change

  1. In pkgs/id/tests/fixtures/port-v1.json, replace only the indexeddb report with the object asserted as EXPECTED_REPORT in the browser test, including status: active. Amend the descriptive comment. Add explicit indexeddb members to the five profile-keyed step expectations. In current fixture order these are committed, value:blue, reported:committed,resolved:committed, reported:committed,resolved:committed, and value:epsilon. Keep the redb/libSQL values. All remaining string expectations apply to all profiles.
  2. In pkgs/id/browser/test/indexeddb_conformance.test.ts, replace its reserved-only gate with checks for this fixture’s unique active browser row. Compare the full fixture row to the engine-reported live descriptor and preserve an independent expected shape. For profile-keyed steps, expectFor must look up indexeddb directly and fail if missing. Keep the reference model and two runs. Update header comments.
  3. In pkgs/id/tests/conformance.rs, replace indexeddb_profile_is_reserved_and_claims_nothing and adjust capability_reports_match_the_declared_profiles, which currently panics on any active row outside its two Rust constructors. Enforce an exact, unique active profile-to-verifier mapping for redb, turso-libsql-http and indexeddb. Rust must compare the native profiles in full, reject unknown/duplicate active IDs, and verify the browser row pins the expected browser scope, contract and evidence path. The browser test compares the runtime TS descriptor in full. Do not silently skip every unknown active row or add a Rust facade that pretends to execute IndexedDB. Preserve both existing Rust behavior oracles.
  4. Record the verdict in a dated archive decision, link it from the ID book and #9082, and update pkgs/id/browser/README.md, the pkgs/id/browser/package.json description, and the evaluation-only header in pkgs/id/browser/src/indexeddb_store.ts. Describe the validated engine, entry point and actual retention evidence. In particular, replace the statement that close/reopen proved a browser restart. Keep the existing request-batch interface and browser package isolation. Product integration should gain an explicit adapter choice only when a real feature consumes it.
  5. Cross-link #9110, #5863 and the existing backend migration design. After verification on an owned branch and rereading the latest #9082 comments, update the issue acceptance checkboxes and named dependencies. Close #9082 only if its other criteria, including its component D interface and granular child links, are satisfied. #9110 is a broader coordination issue with its own hook/Postgres/transport slices; #9082 completion alone does not close it. Rust guards · #9082 acceptance mapping · #9110 disposition

Deployment and recovery

A native node can use redb. A hosted deployment can use Turso/libSQL according to placement; #5681 explicitly retains D1 in its assigned roles. The underlying record port negotiates atomic/scan/retry capabilities. The higher serverless #5863 journal/materialization contract additionally defines signed append, fork refusal, range completeness, watermarks, and snapshot/delta rebuild. Passing the record profile establishes none of those higher semantics on its own. Browser apps can use the new local profile for replicated content and drafts. A draft with no known peer/export is the user’s sole copy, so expose that fact and offer a local export or replication to a user-selected peer. A hosted backstop is optional. Foreign IndexedDB ingestion (#5804) and read-only foreign libSQL adapters have different ownership and permissions and remain separate. Serverless contract · Placement decision · Foreign data decision

A redb-to-hosted migration needs a complete exported signed prefix and snapshot, a fenced source writer, a verified destination replay, matching signed heads and state, then one signed placement-generation cutover. Preserve the source read-only until the verification period ends. Rolling back after new destination writes requires reverse replay and validation. A record-store capability declaration contains neither a write fence nor a migration implementation. Migration decision

Verification and follow-on ownership

ScopeTest or observationOracle
Profile adoption PRDispatch the root id integration test target conformance plus store_adapter_profiles. Run the browser package’s existing npm test and npm run typecheck in a runner actually equipped with Node, TypeScript and Chromium.Exact active profile mapping; all 25 steps consumed twice; live descriptor = new fixture = independent expected shape; reproducible final state. A missing engine or toolchain is an environment failure.
Transaction atomicityIn a test-only driver abort a real multi-store transaction after its first provisional write. Read both stores, then retry identical operation ID. Concurrent tabs submit identical write batches with the same operation ID.Abort leaves neither data nor dedupe marker; retry applies once. Concurrent identical submissions leave one effect. A reused id with different content must either receive a documented typed conflict in a strengthened contract or be disallowed at the immutable operation-ID boundary.
Browser process durability and upgradeRetain an isolated test profile across full browser shutdown/relaunch; repeat with two tabs blocking an upgrade and a late successful open.Committed records and dedupe IDs survive normal relaunch; blocked upgrade returns a typed, recoverable result; no leaked connection; prior data preserved. Distinguish abrupt interruption from clean restart.
Quota and evacuationUse a controlled storage limit to trigger a real QuotaExceededError. Exercise known-persisted and best-effort origins; simulate whole-origin data removal and offline startup.Failure leaves no half-batch/false saved status, exhausted write is recoverable, and missing local state is surfaced. Verified peer/export replay restores what was replicated. The UI identifies the fate of unsynced local drafts honestly. Persistence permission cannot protect against explicit deletion.
Additional enginesRun the same engine-neutral vectors in Gecko and WebKit, record exact engine versions, persistence modes and outcomes. Implement a driver per engine; existing suite is CDP-specific.Each supported engine gets its own evidence record. Unsupported capabilities produce typed refusal. A positive Chromium result does not automatically enroll another engine.
Performance envelope for a real consumerMeasure p50/p95/p99 commit and read latency, memory and wall time for full scans; vary record size, namespace count, batch size and concurrent tabs. Set workload and budget from the consumer before measuring.Publish fixtures, machine/browser, sample sizes, data integrity and runtime spread. Keep conformance distinct from a speed or scale claim; the current scan materializes keys and values for the whole namespace.

Ownership snapshot. The captured REST issue objects list no named assignees on #9082 or #9110. All ten #9082 comments and both #9110 comments were read. #9082’s latest captured note on November 23 at 11:26:44 UTC explicitly hands the verdict back to #9082 after #10213 closed; the historical claims were for the child slices. The earlier note mentioning assignment to Drew predates both the current empty assignee field and this explicit handoff. Neither issue carried an item-specific approval hold in that snapshot. A REST search of PR titles containing IndexedDB found the merged prototype and closed earlier work. A separate REST Search API query for open PRs mentioning 9082 in title/body returned zero. Both searches can miss a differently titled, unreferenced PR. This recommendation remains unpublished. Before any claim/mutation, search open PRs mentioning #9082 in title/body as well as title variations, reread current comments, and honor any intervening owner. Handoff · #9110 issue