Skip to content

feat(ops): P1b — the frontdoor flips to source-side sequencing; the ring retires (#1813) - #1816

Merged
aarontrowbridge merged 2 commits into
live-test/stack-e2efrom
opencode/issue-1813-frontdoor-flip
Oct 17, 2026
Merged

aarontrowbridge merged 2 commits into
live-test/stack-e2efrom
opencode/issue-1813-frontdoor-flip

Conversation

@aarontrowbridge

Copy link
Copy Markdown
Member

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.

…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).
@aarontrowbridge
aarontrowbridge merged commit 112f9da into live-test/stack-e2e Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant