Repository navigation
feat(ops): P1b — the frontdoor flips to source-side sequencing; the ring retires (#1813) - #1816
Merged
aarontrowbridge merged 2 commits intoOct 17, 2026
Conversation
…1803 P1b) The #1264 ring retires (HISTORY_MAX 512 / REPLAY_CAP 64 / the reassembly-keyed replay). P1a's engine stamps <epoch>:<seq> ids and serves cursor resumption from its shared replay buffer, so the frontdoor forwards ids verbatim, forwards the member's cursor (Last-Event-ID header or ?lastEventID query) on resume dials per pool shard, and migrates the resumed member back to the shared fan-out once every dial has observed exactly the shared upstreams' positions (atomic under the group lock — no loss, no dupes by construction). _parse_frames stays (SPLIT-byte reassembly); _frame_id survives only as the snapshot's lastEventID scalar. Also fixes the latent stall-drop deadlock: the fan-out closed stalled members while holding the group lock (non-reentrant) — closes now happen outside the lock.
…or (#1813) The P1 acceptance finally run live: two real engines (bun, this branch's materialized tree, scratch XDG/ports — the hub's engines untouched), the real frontdoor sharded over them, a member through the door, the FRONTDOOR itself killed mid-absence (the middle-hop death the ring could never survive), events landing on the engine while every hop is down, and the member's cursor forwarded through the resume dials: the engine serves the gap EXACTLY (epoch:seq mechanically checked — no loss, no dupes), the fresh-load member's transcript equals the resumed one, and the resumed member migrates back to the shared fan-out. The foreign-epoch reset frame is pinned on the <epoch>:<seq> carrier (the native EventSource header).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #1813. Part of #1803 (P1b).
The frontdoor is now a dumb pipe between the engine's epoch:seq sequencing and the members: id lines pass through verbatim, the member's Last-Event-ID (both carriers) forwards to the engine upstream, and the engine's shared replay serves reconnects — the 512-frame ring (~8s of history at flood rates) and the 64-frame unknown-id cap are gone, retired with a module-surface test proving the machinery left.
The E2E acceptance — the P1a spec's, finally run live: two real engines, the real frontdoor sharded over them, the FRONTDOOR ITSELF dying mid-absence (member + both upstream links together); events land while every hop is down; the resume serves exactly the 5-event gap (each once, ordered, all seqs past the cursor), and the fresh-load member's transcript is identical. Passed 3/3 + the director's own re-run (cursor ztAH605t:6 → gap seqs [7,8,9,10,11], fresh-load identical).
The resume design: a dedicated cursor-carrying RESUME DIAL per upstream migrates atomically back to the shared fan-out when every dial's position equals the shared upstream's — lossless by construction, no dupes. Also fixed en route: a latent deadlock — the stall-drop path called _drop under the non-reentrant group lock (any member queue overflow could wedge the whole fan-out; pinned by a test that wedges pre-fix).
Frontdoor suite 63 OK (+7 net-new passthrough/retirement tests — the ring had NO direct tests to retire, so this is added coverage); the deadman/keepalive/_fin_close families untouched and green; drift PASS. The E2E's honest deviation (session events, not literal mid-turn tokens — the replay mechanics are event-type-agnostic) is recorded in the notes.