Repository navigation
Description
Problem
The event-store's result for an after dependency can depend on arrival order when that dependency names an event above a later fork point. ingest.rs says applied state depends on the event set, and that stored-but-unapplied events remain present as voids (pkgs/id/crates/id-events/src/event_store/ingest.rs:29-41). But its “Known limit: a rival refused as frozen” section documents that a post-fork arrival is refused (not stored), while the same event arriving before the fork is retained voided (:82-90). Since an after hash is satisfied by a stored voided event (:57-60), the dependency is present in one order and absent in the other.
This can strand an otherwise identical dependent event: one replica can accept it after the event is retained as voided; another can keep it waiting after the post-fork event is refused. This is a source-traced consistency/availability gap, not a claim of a reported production incident.
Existing focused tests pin the two sides separately: test_an_after_hash_naming_a_voided_event_is_applied (ingest.rs:2281-99) and test_an_event_released_into_a_frozen_chain_leaves_no_row (:3765-98). The current batch property compares batch and per-event paths for one arrival order (:86-90), so it does not catch this cross-order difference.
Expected improvement
Define one order-independent rule for the presence/availability of authenticated events above a fork point, then cover it with an order/API matrix. At minimum, compare these same events in both orders: a chain through sequence 2, a conflicting sequence-1 event, and a different author's event whose after names sequence 2. Assert the dependent event has the same final disposition and the same dependency-presence result whether the fork arrives before or after sequence 2; include batch and per-event ingestion where supported.
Verification
On e8da4a4ae111601dbca602fd6bacfd3ea17f8693, cargo test -p id-events test_an_after_hash_naming_a_voided_event_is_applied and cargo test -p id-events test_an_event_released_into_a_frozen_chain_leaves_no_row both pass (1 test each). These tests verify the two existing behaviors; no full end-to-end order-matrix reproduction was added in this creator pass.
Activity
developing-today commentedon Nov 19, 2026
CODE-4386
dezren39 commentedon Nov 21, 2026
Issue-sweep verification on fresh main
5eeb88064f: the reported order dependence still reproduces. I ran a temporaryid-eventsunit probe (removed afterward) using the same signed event set in two orders:afternames x2 → Accepted (x2 is retained voided, so the dependency is present).Frozen), then the same y0 → Waiting (x2 was never stored, so the dependency is absent).The probe passed with both outcomes asserted (command:
~/tools/fleet-build-lock cargo test --manifest-path pkgs/id/Cargo.toml -p id-events --lib zz_probe_frozen_rival_arrival_order -- --nocapture), confirming the exact order dependence the issue describes.Disposition: blocked on the protocol semantics choice, not fixed. The current docs explicitly say a stored voided event satisfies
after, while a frozen arrival is refused without storage. Making the rule order-independent requires choosing one of two invariants: (a) an authenticated post-fork event is retained as voided even when it arrives after the fork (changes theRefusal::Frozencontract and has waiting-cap/resource implications), or (b) a voided event no longer satisfiesafter(changes the existing Phase 1 contract pinned bytest_an_after_hash_naming_a_voided_event_is_applied). I did not make a product change without settling that invariant; please choose the intended rule, then the order/API matrix in this issue can drive the implementation. The temporary probe and worktree were removed; no source diff remains.dezren39 commentedon Nov 22, 2026
Decided: Preserve Phase 1 dependency presence: retain a valid post-fork event as voided evidence, never apply it, so
afterdependencies can resolve independent of arrival order.Why:
ingest.rsexplicitly says stored voided events remain present forafterand for detecting later conflicts (lines 37–60); making voided events unavailable would reverse that existing contract, while retaining a frozen arrival extends the same rule to the missing arrival order.Undo: Revert the post-fork retention rule and its order-matrix tests, then restore
Refusal::Frozenfor such arrivals if a later protocol decision selects the narrower dependency rule.By: issue-sweep agent
dezren39 commentedon Nov 23, 2026
Pickup — xaltha lane taking this slice now.
Implementing the decision record already posted on this issue: preserve Phase 1 dependency presence — retain a valid post-fork event as voided evidence (stored, never applied) so
afterdependencies resolve independent of arrival order, instead of refusing the post-fork arrival asRefusal::Frozenwithout storage.Plan: narrow change in
pkgs/id/crates/id-events/src/event_store/ingest.rs, an order-matrix regression test (same signed event set in both arrival orders, per-event and batch paths where supported) that fails before and passes after, verified on the laptop. PR to follow.fix(id-events): keep post-fork events as voided evidence (#12050)
test(id-events): count post-fork sync arrivals as voided, not refused (…
test(id): crash workload's post-fork event is kept as voided evidence (…
dezren39 commentedon Nov 23, 2026
Progress (xaltha): implemented per the decision record above — option (a), preserve Phase 1 dependency presence.
PR: #13184 (OPEN, base main, head
xaltha/12050-frozen-rival@1ea1e5f50, "Closes #12050")Change: a proof at an event's own seq still governs it (merge / Frozen / Fork as before); an event above the fork point with no own-seq proof now falls through to the normal conflicts/backlink/deps path and is stored as voided evidence when it links — never applied. Scope boundary: an event at a fork proof's own seq that displaces neither header is still refused Frozen (the position holds one event per (author, seq), so it cannot be retained); the issue's matrix covers above-point events.
Verification — remote dispatch (fleet-run workflow, GitHub-hosted runners):
cargo test -p id-events --lib): 356 passed, 0 failed, 2 ignored — https://github.com/developing-today-forks/fleet/actions/runs/45150413759decide_inFrozen block restored): exactly the 4 touched tests fail — the new arrival-order matrix test, the frozen-chain evidence test, the released-into-frozen test, and the sync tally test — https://github.com/developing-today-forks/fleet/actions/runs/45152219509