GeezerVison is showing github.com — feat(id): share EventStoreBackend with TenantStore by dezren39 · Pull Request #14642 · developing-today/code
Conversation
dezren39
commented
Nov 24, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Closes #12801
Summary
TenantBackend<T> owns the TenantStore transaction behind EventStoreStorage (RowRead / RowWrite). The shared EventStore<B> implements EventStoreBackend for both native and tenant storage.
- Ingest, sync, invariant checks, fork/waiting state, bodies and event lookups use the same event-store semantics.
id-sync continues to use SharedEventStore<S: EventStoreBackend>; there is no hosted-only branch in callers.
- The merge includes current main through
410291eebdaf. The remaining main commits after the tested head 8dc3bcda324 changed no files under pkgs/id.
Evidence
- Current PR head
43602e837aaa; current base 410291eebdaf.
- Remote Fleet run 45879046271 passed
cd pkgs/id && cargo check -p id-store && cargo test -p id-store on tested head 8dc3bcda324. The paired native/TenantStore store_traits suite passed 12/12.
- Laptop verification through
fleet-build-lock passed cargo check -p id-store && cargo test -p id-store on the same tested head; the command exited 0.
- The final main merge adds no
pkgs/id changes after that tested head.
Merge Danger
Two-way storage change. TenantBackend owns the row transaction and commits or rolls it back with the same change semantics as the native backend. Uncertain tenant-session outcomes remain explicit errors; the paired conformance suite covers observable equivalence.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…w layer (E6 of #9083, refs #12801)
The pipeline-protocol codec (POST /v2/pipeline: baton sessions,
hrana value encoding, statement errors), an HTTPS transport carrying
the tenant's scoped token (never stored, redacted from Debug), and
TenantStore: the native event store's 17 tables mirrored as SQL rows
with redb's table semantics — byte-ordered keys, last write wins,
multimap sets in value order, ordered range and prefix scans, and
explicit transactions over the baton session.
Conformance is proven at the row layer this slice owns: one op script
runs against both the adapter (over an in-process SQLite endpoint
speaking the same protocol bytes) and real redb tables, requiring
identical observable results.
Not yet an EventStoreBackend: the ingest semantics live in id-events'
EventStore, written directly against redb transactions; porting them
onto this row layer without forking the semantics is the remaining
E6 work. No caller above store_traits changes.
- scan/range_clauses bound to RangeBounds<Vec<u8>> so prefix and
bounded scans typecheck; call sites pass owned bounds
- add .as_slice() to redb byte-literal call sites in tests
- close() sends the close request before marking the session
closed (round_trip refuses closed sessions, so close always failed)
- conformance test reopens its read txn after the remove instead
of comparing against a stale pre-remove snapshot
…r' into oc-code-04/12801-takeover
#12801)
The row-store conformance test calls get() on a redb 5 read-only
multimap table; the trait providing it was not in scope, so the lib
test target did not compile. Fixes the test build only.
…r' into code-f/23653-tenant-backend-seam
Introduce storage-only RowWrite (get/put/multi_put) with native redb and
tenant Torudo/SQLite adapters. Port existing store_event, store_body,
store_chain and store_fork onto it so native ingest and TenantStore share
one persistence implementation. Tenant writes are explicit transactions;
dropping without commit rolls back, failing commit closes the session.
Add an opt-in SQLite pipeline fixture under id-events tests comparing
persisted rows against the native redb oracle, plus a partial-rollback
case. Mirror the missing native compacted table in the tenant schema.
coderabbitai
Bot
commented
Nov 24, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

Walkthrough
-
The change adds a Turso-backed tenant store and shared row transaction interfaces. EventStore now supports native and tenant backends through a common storage abstraction. Persistence and integration tests compare behavior across both backends.
Changes: Tenant persistence and shared event store
| Layer / File(s) |
Summary |
Row transactions and Turso tenant store pkgs/id/crates/id-store/src/event_rows.rs, pkgs/id/crates/id-store/src/turso.rs, pkgs/id/crates/id-store/src/event_types.rs, pkgs/id/crates/id-store/src/lib.rs, pkgs/id/crates/id-store/Cargo.toml, pkgs/id/src/lib.rs |
Adds row read/write interfaces, transaction lifecycle handling, redb adapters, and a tenant transaction guard. Adds a Turso pipeline transport and SQL-backed TenantStore with schema and format checks, table validation, and single-value and multimap operations. |
Backend-generic EventStore operations pkgs/id/crates/id-events/src/event_store/backend.rs, pkgs/id/crates/id-events/src/event_store/mod.rs, pkgs/id/crates/id-events/src/event_store/{resolve,claims,compaction,anchors,chat,documents,sync,threads,writer_set}.rs |
Adds EventStoreStorage implementations for redb and tenant storage. Generalizes EventStore over its backend and routes shared reads, writes, resolution, synchronization, and persistence helpers through row operations. |
Row-based ingestion and recovery pkgs/id/crates/id-events/src/event_store/{ingest,waiting_rows}.rs |
Moves ingest decisions, waiting-row operations, expiry, and device-operation recovery to row-based transaction APIs. Recovery scans stored events in pages of 256 before scanning waiting rows. |
Backend parity tests and verification records pkgs/id/crates/id-events/src/event_store/persistence_tests.rs, pkgs/id/crates/id-store/tests/store_traits.rs, .github/test-suite-registry.json, doc/2026-11-24T22-25-00Z_refactor_e6_persistence_helpers/*, doc/2026-11-25T00-45-16Z_architecture_shared_event_transactions/*, pkgs/id/crates/id-events/Cargo.toml |
Adds native-redb versus tenant-SQLite comparisons, transaction and failure tests, and paired EventStoreBackend integration tests. Adds the targeted test registry entry and records design and verification status in documents. |
Estimated code review effort: 4 (Complex) | ~60 minutes
Change: Feature
Sequence Diagram(s)
sequenceDiagram
participant EventStore
participant TenantBackend
participant TenantStore
participant HttpTransport
EventStore->>TenantBackend: with_write operation
TenantBackend->>TenantStore: begin transaction
TenantBackend->>TenantStore: run row operations
TenantStore->>HttpTransport: send pipeline request
TenantBackend->>TenantStore: commit or rollback
Loading
Possibly related issues
- Issue 13145: The issue describes running
EventStoreBackend and store_traits conformance over tenant storage. This change adds TenantBackend and native-versus-tenant parity tests.
Suggested reviewers: claude
Pre-merge checks: 2
-
| Check name |
Status |
Explanation |
| Description Check |
 |
Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check |
 |
The title "feat(id): share EventStoreBackend with TenantStore" matches the main change. The PR makes the event store generic over a new EventStoreStorage trait, adds TenantBackend, and routes the Turs… |
Full details: Title check
-
Explanation
The title "feat(id): share EventStoreBackend with TenantStore" matches the main change. The PR makes the event store generic over a new EventStoreStorage trait, adds TenantBackend, and routes the Turso TenantStore through the shared EventStoreBackend implementation. The title is short, specific, and states the primary change. It omits the row-transaction and Turso adapter parts, which the title does not need to cover.
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning Some tools did not complete. Review the errors below.
Clippy (1.99.1)
-
Clippy execution timed out
Clippy (1.99.1) exceeded its 180-second time budget. Findings from completed work are retained; remaining checks are incomplete.
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
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…ackend-seam
# Conflicts:
# doc/README.md
|
Verification checkpoint for head 418677ea7b86901ac746e3a370a8a370fe61767c: Fleet run 45532509993 checked out the exact SHA and reports the targeted test command step successful (Turso row parity, persistence tests, recovery tests). GitHub Actions is still in post-command cleanup, so there is no terminal workflow conclusion or complete transcript yet. The preceding run #45531905747 failed before checkout because its dispatch ref was mistyped. Architecture note updated; full backend parity and laptop verification remain outstanding. Draft PR remains open.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
# Conflicts:
# doc/README.md
# pkgs/id/crates/id-store/src/lib.rs
…ackend-seam
# Conflicts:
# pkgs/id/crates/id-events/src/event_store/ingest.rs
dezren39
changed the title
refactor(id-store): share persistence helpers across native and tenant rows
feat(id): share EventStoreBackend with TenantStore
Nov 26, 2026
…ackend-seam
# Conflicts:
# pkgs/id/crates/id-events/src/event_store/mod.rs
# pkgs/id/crates/id-events/src/event_store/threads.rs
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 26, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|