Summary
Slice of #5534 (protocol v1 umbrella, design #2036): resolve the single-opener event-store constraint that blocks the serve-side CHAINED_RELAY_ALPN wiring.
Done check (fresh against main): all four phase trackers are closed (#3794, #3795, #3796, #3797); the messaging/envelope layer and the phase-3 relay pieces are on main (chained_message, relay_gate, relay_ingest, graph_frontier, federation B20–B22). In flight from lane oc-code-02: PR #13480 (LocalEvents::compact) and PR #13746 (production ForwardingSink). Both, and oc-code-08's parked serve-wiring slice, name the same blocker: LocalEvents owns EventStore by value, GraphFrontier needs SharedEventStore<EventStore>, and the store directory admits one opener — so id serve cannot build both over the same store.
This slice takes the share-the-store option:
LocalEvents.store becomes SharedEventStore<EventStore>. Every internal use goes through the handle: the read lock for reads (one lock for the whole log() walk) and the inherent ingest for writes.
- New
LocalEvents::shared_store() hands out a clone of the handle — the seam serve builds the relay gate's GraphFrontier from, so the frontier authorizes from the membership state the node has actually accepted.
sync_session runs over the sync module's RangeStore seam instead of &mut EventStore: sync::run is generalized over RangeStore and a new sync_over_shared entry runs the session over the handle, locking per step and never across an await — a session no longer blocks the node's other store users behind its network waits, and the future stays Send for the serve router's protocol handler.
- Public API and behaviour are unchanged, with one exception:
LocalEvents::document_references now returns anyhow::Result like the rest of the type, because the shared handle's failures (a poisoned lock, reported the way the sync seam reports it) no longer fit the store's own error type. Its one production caller only matches Ok/Err and logs the error.
Not in this slice: the CHAINED_RELAY_ALPN serve-router wiring itself (oc-code-08's parked slice) — this PR is its prerequisite, and the new graph_frontier test proves the exact composition the wiring needs.
Merge interaction: PR #13480 also touches local_events.rs (adds compact, whose self.store.compact(..) becomes a one-line read_store/write-guard adaptation after this lands, or vice versa). Merge order either way is safe; flagging so the second merger adapts the one call site rather than rebasing.
Evidence
Remote run https://github.com/developing-today/fleet/actions/runs/45280393099 (success): cargo test -p id-events --lib — 371 passed / 0 failed / 2 ignored; cargo test -p id-sync --lib graph_frontier — 8 passed / 0 failed (244 filtered); cargo test -p id-store --test store_traits — 12 passed / 0 failed; cargo check -p id-cli --all-targets clean (zero errors). Both new tests verified by name in the log: local_events::tests::test_shared_store_handle_reads_and_feeds_the_same_store (handle and LocalEvents read/feed one store in both directions) and graph_frontier::tests::frontier_reads_the_store_local_events_opened.
One run note: the first evidence run (45279089735) failed on the first attempt at this slice, which held the shared handle's write guard across the sync session — the future is not Send for the serve router's protocol handler, and the sync module's own RangeStore seam says a session must lock per step, not hold a guard for its life. The slice was reworked to sync_over_shared over that seam (see the commit message), and the green run above is the reworked form.
Refs #5534 — the umbrella stays open: the serve wiring slice and the two in-flight PRs remain.

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.