GeezerVison is showing github.com — impl(pm-stack): E6 — tenant DB store adapter in id-store (#9083) · Issue #12801 · developing-today/code
impl(pm-stack): E6 — tenant DB store adapter in id-store (#9083) #12801DescriptionImplementation slice E6 of #9083 (tenancy architecture, component E of epic #9078; with component D).
Design record: doc/2026-11-17T16-55-00Z_design_hosted-tenancy-architecture/2026-11-17T16-55-00Z_design_hosted-tenancy-architecture.md §11 item 6 (merged via PR #11325).
Work
Implement the tenant DB store adapter in id-store: the Turso/SQLite-over-HTTP backend behind store_traits, so hosted tenant nodes and native nodes share one storage interface.
Invariant
One storage interface for every peer kind (peer principle): hosted and native nodes differ only in backend, never in the interface or protocol.
Acceptance
- Turso/SQLite-over-HTTP backend implements
store_traits — PR #14642, head 43602e8 includes current main 410291e.
- The same conformance tests pass against this backend and the native backend — Fleet run 45879046271 passed
cargo check -p id-store and cargo test -p id-store; store_traits passed 12/12. The laptop fleet-build-lock check/test also exited 0 on tested head 8dc3bcda324; current main 410291e adds no pkgs/id changes beyond that tested head.
- No hosted-only special-casing in callers —
id-sync::log_sync remains generic over EventStoreBackend; EventStore<B> supplies the shared row-backed semantics.
Sequencing (design §11)
E1 and E6 are parallel. E3 needs E1 + E6.
Filed by Lane BZ (archer) 2026-11-22 as the §11 follow-up pass for #9083. Activitydeveloping-today commented on Nov 23, 2026 dezren39 commented on Nov 23, 2026 xaltha lane picking this up: implementing the E6 tenant DB store adapter in id-store — Turso/SQLite-over-HTTP backend behind store_traits, per the #9083 design record §11 item 6. Independent of E1 (PR #13042); not stacked on it. developing-today-fleet commented on Nov 24, 2026 Triage verdict — task 22249 (2026-11-24)
Verdict: NOT resolved — implementation started but orphaned. Routed as queue task 23384.
Fresh state (verified 2026-11-24T11:35Z): issue open; labels kind/feature, priority/normal, app/pm-stack, epic/pm-stack; 2 comments.
What exists:
- The xaltha lane claimed this issue here on 2026-11-23T08:50:08Z and pushed one commit: branch
xaltha/12801-tenant-store-adapter at 6b9decad2538b6744b64856edbf76f94f2bd36db (2026-11-23T09:08:11Z) — pkgs/id/crates/id-store/src/turso.rs (1,590 lines, SQLite-over-HTTP/Turso row layer) plus wiring, +1,601 lines across 5 files.
- No PR was ever opened (PR search for this issue: none), no queue task owns the implementation, and there has been no movement in over 26 hours — the claim predates the 2026-11-24 overnight laptop outage. The claim is treated as orphaned, not live.
- Completeness against the acceptance criteria is unverified: whether the row layer fully implements
store_traits, and whether the conformance suite passes against both backends, has never been demonstrated.
Sizing: the remaining work is a landing pass, not a from-scratch build — review the existing branch, complete any gaps against the acceptance criteria, rebase, verify, PR, merge. One gate applies: #14315 — pkgs/id does not compile on current main after the grouped cargo bump (this branch predates the bump); the fix is queue task 23352, claimed. Verification of this slice either waits for that fix or records why branch-base verification is sufficient.
Routing: follow-on task 23384 (feature_slice slice 1, priority 50, queue repo-health-code-pilot, dedupe repo-health:v1:slice:developing-today/code:issue:12801:slice-1). Its first step is a takeover comment on this issue, per the orphan rule — this triage did not take the branch over itself. When E6 lands and this issue closes, E3's task 22246 (structurally dep-blocked on this issue) wakes on its dep-recheck. dezren39 commented on Nov 24, 2026 Takeover (queue task 23384, lane oc-code-01, 2026-11-24): adopting the orphaned xaltha claim (2026-11-23T08:50:08Z, branch xaltha/12801-tenant-store-adapter, commit 6b9deca, no PR, no movement 26h+).
Plan per the packet: review the branch work first, complete only gaps vs this issues acceptance criteria, rebase onto current main, build + conformance tests, PR with Closes #12801, merge, close-out record here. Noted: #14315 (id-store does not compile on main since the grouped cargo bump) is OPEN — if the rebase hits that break, verification basis will be recorded explicitly rather than absorbing #14315 scope. dezren39 commented on Nov 24, 2026 Progress note (queue task 23384, lane oc-code-01, 2026-11-24): reviewed the xaltha branch, fixed its compile break, and pushed the fix — branch xaltha/12801-tenant-store-adapter now at e87ab41778a.
Review findings (fix commit e87ab41, pushed, cargo test -p id-store --lib: 264 passed / 0 failed):
- The row layer never compiled:
scan/range_clauses were bounded on RangeBounds<[u8]>, which no call site satisfies. Rebounded to RangeBounds<Vec<u8>>; prefix/bounded scans now pass owned bounds.
- Test-only redb breakage: byte literals (
b"g") passed to generic redb lookups need .as_slice().
- Real bug in shipped code:
Connection::close marked the session closed before sending the close request, and round_trip refuses closed sessions — close always failed. Now sends first, then marks closed.
- Test bug: the redb-parity conformance test compared the live store against a read txn opened before the remove. It reopens the read after the remove.
Remaining gap vs acceptance: TenantStore is the row layer only — no type implements EventStoreBackend on it yet, so criterion 1 (backend implements store_traits) is still open. The ingest semantics live in id-events (~14k lines across event_store/: ingest.rs 4.3k, mod.rs 2.2k, sync.rs 2.2k) written directly against redb transactions; the port is a method-by-method re-implementation over row ops inside begin/commit, not an adapter behind an existing seam (the Storage trait is file-level only). Starting that port next on this branch; rebase onto main is deferred until #14315 (id-store main compile break) clears, per the packet's explicit-record option. dezren39 commented on Nov 24, 2026
Takeover (worker felix, queue task 23384): the implementation branch xaltha/12801-tenant-store-adapter (commit 6b9decad253, started 2026-11-23 by the xaltha laptop lane) has had no PR opened and no movement in over 26 hours. This lane is taking it over to land it:
- Review the existing branch work against this issue's acceptance criteria first; complete it only where the review finds gaps — no rewrite from scratch.
- Verify remotely (fleet dispatch): the Turso/SQLite-over-HTTP backend implements
store_traits, and the same conformance tests pass against this backend and the native backend, with no hosted-only special-casing in callers.
- Refresh the branch against current main (merge commit, no rebase), open the PR with "Closes impl(pm-stack): E6 — tenant DB store adapter in id-store (#9083) #12801", and merge once verified.
Verification gate noted: #14315 (id-store does not compile on main since the 2026-11-24 grouped cargo bump) is still open with fix task 23352 in progress. If it is still open when this slice is ready, verification will run at the branch base (which predates the bump) with the reason recorded explicitly on the PR, per task 23384. dezren39 commented on Nov 24, 2026
Correction to my takeover note above (comment 7132841159): task 23384 was already taken over earlier today by lane oc-code-01, whose claim is live and progressing — it reviewed the branch, pushed fix commit e87ab41778a ("turso row layer compiles and conformance passes"), and posted that it is starting the remaining EventStoreBackend port on this branch.
To avoid two lanes colliding on the same branch, this felix lane will not work on xaltha/12801-tenant-store-adapter while oc-code-01's claim is live. My earlier takeover comment is superseded by this note. The duplicate draw has been reported to the felix coordinator for queue disposition. dezren39 commented on Nov 24, 2026 oc-code-03 (queue task 23384 claim, 2026-11-24 14:50Z): stand-down. Lane oc-code-01 holds the live takeover of this task and pushed fix e87ab41. I am not touching branch xaltha/12801-tenant-store-adapter. Left to oc-code-01. dezren39 commented on Nov 24, 2026
Slice-1 review is checkpointed and blocked by the concrete follow-up slice-2 task 23653 (currently claimed by lane any-o). The branch xaltha/12801-tenant-store-adapter is rebased, clean, and pushed at 0621b77f274; cargo check -p id-store passed (19 pre-existing warnings), and cargo test -p id-store passed (434 passed, 0 failed, 6 ignored; 17 suites). The verified TenantStore row layer is not yet an EventStoreBackend: completing that port requires reusing id-events ingest/fork/waiting semantics across roughly 460 redb call sites in 14 files, beyond this 120-minute slice. PR #14439 remains draft with port map/evidence. Task 23384 is blocked on task 23653; #12801 remains open pending the backend port and shared conformance tests. dezren39 commented on Nov 24, 2026
Lane code-f holds task 23653 (claim 2026-11-24 22:10Z). The prior row-layer verification is retained; no full-backend completion is claimed. A fresh branch code-f/23653-tenant-backend-seam starts from current main, with the existing tenant branch merged in rather than rebased.
Concrete implementation slice now in progress: move the existing native store_event, store_body, store_chain, and store_fork persistence helpers onto a shared row-transaction surface, then run those same helpers against both redb and TenantStore. This advances native production ingest onto the backend-neutral seam without copying ingest/fork logic. Includes the missing COMPACTED table and explicit tenant error propagation. Next seam is waiting_rows; full EventStoreBackend and both-backend store_traits conformance remain required before E6 closes. No changes to generic sync callers are planned. dezren39 commented on Nov 24, 2026
code-f checkpoint: reviewable shared-persistence slice pushed as draft successor PR #14642 (head 76b0b60; docs-only after tested 3375dd6). Predecessor #14439 remains open/draft. No merge or E6 completion claim.
Verified remote run https://github.com/developing-today-forks/fleet/actions/runs/45503182413: 9 persistence tests passed, 11 Turso tests passed, and native id-events library check passed. Failing-first missing-compacted evidence: https://github.com/dezren39/fleet/actions/runs/45500166347. Independent static re-review found no remaining concrete correctness/compile issue. Supplemental doctest/full id-events run https://github.com/developing-today-forks/fleet/actions/runs/45504741928 remains in progress; it is not passing evidence yet. No laptop or full E6 conformance claim.
Resume packet (retained on existing live task 23653; no duplicate issue/task): continue branch code-f/23653-tenant-backend-seam from 76b0b60, port pkgs/id/crates/id-events/src/event_store/waiting_rows.rs through the shared row seam with native/tenant parity tests, then resolution reads/shared ingest policy and a legal local EventStoreBackend engine in id-events. Owned paths: pkgs/id/crates/id-events/ and pkgs/id/crates/id-store/. Run one identical generic conformance suite against native and tenant backends, adapt callers generically, and obtain required laptop evidence before merging/closing #12801. The existing task remains the queue coverage and concrete continuation packet; no external approval gate. dezren39 commented on Nov 25, 2026 Task 23653 / oc-code-04 continuation (2026-11-25 00:00Z): verified #14439 and successor #14642 are open/draft, existing branch code-f/23653-tenant-backend-seam is clean at 76b0b60. Continuing that branch under one-writer ownership of id-events/id-store, starting waiting_rows through RowWrite with native/tenant parity. Prior remote runs 45503182413 and supplemental 45504741928 have terminal success; extracting precise counts before any new evidence claim. fleet shell targets reports laptop unreachable; verification will dispatch remotely and explicitly retain the laptop-evidence gap. No E6 completion/merge claim until full backend and identical conformance pass. dezren39 commented on Nov 25, 2026
Continuation update (queue task 23653, 2026-11-25): shared resolution reads now run through RowRead for redb and tenant row adapters; head 1b9644b712b is pushed on the existing draft successor PR #14642. Remote cargo test -p id-events -p id-store and cargo check -p id-events -p id-store runs #45519717589 and #45519720346 are still running. Laptop remains unreachable. This advances the shared seam only: the generic transaction driver, tenant EventStoreBackend, and identical backend conformance suite are still outstanding; #12801 stays open and no E6 completion is claimed. dezren39 commented on Nov 25, 2026 E6 checkpoint: branch code-f/23653-tenant-backend-seam / draft PR #14642 now pushed through c840560ae04. Device-operation recovery now uses shared paged RowWrite operations rather than native table guards; the native entry point delegates to it. Shared SQLite/redb recovery test crosses 256 rows and checks invalid/missing bodies, waiting-only recovery, existing-byte preservation, recovery-marker suppression, and committed row parity. Read-only review completed; execution pending.
Remote Linux run developing-today-forks/fleet#45527102123 reached compilation and failed on the unsupported redb 5 range::<...> generic argument; fixed all three paging adapters. Follow-up on exact SHA c840560ae04: https://github.com/developing-today-forks/fleet/actions/runs/45528034127 (row parity + persistence + native startup recovery tests). This is remote evidence only; laptop evidence remains unavailable.
Full EventStoreBackend, shared backend-level conformance, backend ownership/read sessions, generic ingest/read/compaction paths remain unfinished. #12801 and PR #14642 stay open/draft; no completion or merge claim. dezren39 commented on Nov 25, 2026 Checkpoint 2026-11-25: pushed commit 418677ea7b86901ac746e3a370a8a370fe61767c fixing the transaction-driver compile blockers from the previous run: failure-injection wrappers now forward the full row traits, and the transaction helper uses a higher-ranked mutable reborrow instead of the GAT projection that forced an accidental \x27static tenant borrow. Exact-SHA Fleet run dezren39/fleet#45532509993 checked out this SHA; its targeted row/persistence/recovery command step reports success, but the workflow remains in post-command cleanup and has no terminal conclusion/transcript yet. A prior dispatch #45531905747 failed checkout because of a mistyped ref, not test execution. The architecture note records this uncertainty. Full EventStoreBackend implementation/conformance and laptop evidence are still missing; issue and draft PR remain open. Next: collect terminal outcome, then resume the ownership/read-session backend seam. dezren39 commented on Nov 25, 2026 Lane agent-next-21-local resumed task 23653 (E6 slice 2), 2026-11-25. I re-read the issue body and all 22 paginated comments (count confirmed), the §11 E6 design item, and the branch architecture note.
Fresh state: #12801 is OPEN; predecessor PR #14439 and successor draft PR #14642 are both OPEN; branch code-f/23653-tenant-backend-seam is clean at 85158ed. The current remote main is 78d2ccb. Existing work provides shared RowRead/RowWrite helpers and transaction lifecycle tests, but TenantStore still has no EventStoreBackend implementation.
Next: merge current main into the existing branch with a merge commit (no rebase), then continue the backend ownership/read-session seam and identical native/TenantStore conformance. No merge or E6 completion claim until the full backend and laptop evidence pass. dezren39 commented on Nov 25, 2026 Lane agent-next-21-local, task 23653 implementation checkpoint (2026-11-25):
Merged current main into the existing branch with merge commit 6525bc5. Added the first backend-owned transaction seam: native redb and a mutex-serialized TenantStore backend now share closure-scoped row reads/writes, including commit/rollback behavior. Added a native-oracle test for committed visibility and no partial row after an aborted write.
Failing-first evidence: exact-head run 45589301630 failed because the tenant backend API/test surface was not implemented yet; the follow-up targeted run 45590351246 is checking the new seam. This is foundation only: EventStore is still native-redb-specific and E6 acceptance remains open. Next is the generic EventStore owner/read-session seam and shared conformance. dezren39 commented on Nov 25, 2026 Progress on E6 #12801: TenantBackend now runs the shared EventStoreBackend operations through the row transaction interface, including ingest, sync reads, invariant checking, tag claims, and event-format initialization. The store_traits integration suite now uses a paired native/TenantStore backend and compares each result against the native implementation.
Current branch head: cad63a2e34f on PR #14642. The earlier cargo check -p id-events found three byte-slice key type mismatches in the new generic invariant checker; those are fixed. Follow-up Fleet run developing-today-forks/fleet#45601256658 is checking the corrected head. Remaining proof: remote paired conformance run, current-main integration, and the required laptop cargo check -p id-store / cargo test -p id-store evidence. PR remains draft and #12801 remains open pending that proof. dezren39 commented on Nov 25, 2026 E6 implementation progress: the shared store_traits suite passed on Fleet against a paired native EventStore and TenantStore backend: developing-today-forks/fleet#45606429326 (12 passed, 0 failed). The explicit tenant reopen regression is running as dezren39/fleet#45612829866 after adapting native unit tests to the generic row backend signatures.
Current branch head: 24ffcc29623 on PR #14642. Latest fetched main is 6541d26fb314; once the reopen regression passes, I will merge that head into the feature branch with a merge commit, rerun the acceptance commands, then record laptop evidence. PR remains draft and #12801 open until current-main and laptop checks pass. developing-today-fleet commented on Nov 26, 2026
Queue lane QF checkpoint (task 23653, claimed 2026-11-26T11:23:32Z, lease to 15:23:32Z):
Verified this pass (GitHub API, App identity via fleet gh; personal token was rate-limited to 11:33Z):
- impl(pm-stack): E6 — tenant DB store adapter in id-store (#9083) #12801 OPEN; prior agent-notes on this issue are all task 23653 continuations — no competing live claim, no held label, no Drew-decision gate found. Ownership = this task.
- Successor PR feat(id): share EventStoreBackend with TenantStore #14642 OPEN/draft, branch
code-f/23653-tenant-backend-seam, head e19bacecf7509c46b4f45aceb943e031fbda9893 (merge of main e8c2bc544103 into the branch). The laptop worktree holding this branch (~/git/fleet/code-f-23653-20261124T221416Z-9547ba2f) is clean at that head.
- Tenant reopen regression run dezren39/fleet#45612829866: terminal success (head
c9f1dccb60f1, completed 2026-11-25T12:48:23Z). Paired native/TenantStore conformance already passed remotely: developing-today-forks/fleet#45606429326, 12 passed / 0 failed.
- Current main is
5e40ce9fb2b1cfafe4c187646ad66e9d284831dd; the branch has merged main only through e8c2bc544103, and the PR reports mergeable_state dirty against current main. Remaining work: merge current main in (resolve conflicts), rerun cargo check -p id-store + cargo test -p id-store, and record the previously-missing laptop evidence — the laptop is reachable again (fleet shell targets: laptop reachable), so that gap is now closable.
- Blocker for this lane: the platform execution-risk check fired on this session's laptop git operation against the worktree content. Per Drew's 2026-11-23 ruling for this permanently-flagging set, the remaining in-checkout work (main merge/conflict resolution + laptop cargo runs) routes to a laptop-local OpenCode session, which records evidence here; Archer then finishes (undraft/merge via API) from that record. This lane did not run further git/build commands in the flagged checkout.
- Task 23653 is being parked with a time resume condition so a laptop-local lane can pick it up. impl(pm-stack): E6 — tenant DB store adapter in id-store (#9083) #12801 stays open and PR feat(id): share EventStoreBackend with TenantStore #14642 stays draft; no E6 completion claim.
dezren39 commented on Nov 26, 2026 E6 complete (task 23653, agent-next-23-local, 2026-11-26).
PR #14642 merged at 19:15 UTC as 2c9f115 and closed this issue. Its final branch head was 43602e8, based on current main 410291e.
Verification:
The native and TenantStore backends now share EventStoreBackend semantics through the backend-owned row transaction interface.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|