Repository navigation
feat(core): epoch:seq engine-side sequencing — the P1a port of #1803 (#1806) - #1807
Merged
aarontrowbridge merged 1 commit intoOct 17, 2026
Merged
Conversation
…y buffer, and reset contract (#1806, P1a of #1803) PORTS, NOT REBASES — the first ported commit of the #1803 list, applied onto this lane's diverged engine (which carries the #1798 bounded fan-out, the SSE-TICK telemetry, and the #1264 lastEventID lineage — all preserved): - bus/global.ts: per-process epoch, strictly monotonic seq, pre-dispatch taps (nested emits stay strictly ordered), the mirror window for sync copies — main's GlobalBus, ported verbatim. - bus/global-replay.ts: one shared replay buffer per bus, byte+age bounded (32MB/5min defaults, env-tunable), cursor resume, explicit reset frames (main's #1776 semantics). - handlers/global.ts + handlers/event.ts: both routes emit stamped frames through the shared bounded writer (sse-bounded-writer.ts — the #1798 phase-C write path extracted, now shared); unservable cursors get the reset (the lane's state.resync sentinel on the instance route), and the payload-id vocabulary is untouched (no client change rides with the port). - control-plane/workspace.ts: the sync-copy consumer half (the base's workspace sync loop requires sync frames). - 38 new tests: stamping monotonicity, eviction, cursor resume, reset on foreign-epoch/ahead/evicted/ancient cursors, reset-across-restart, liveness-through-the-port (SSE-TICK flowing, no SELF-STALL), the header carrier on both routes, the legacy payload-id cursor path. Excluded per the doctrine: main's 06eac85 (patch bodies off the wire — that is P3) and the frontdoor flip (P1b follows green on this slice). Verification (director-run, fresh materialized tree): scoped 38/0; test/server 717 pass / 2 fail (the pre-existing environmental corpse pair, proven at base); test/session 599/5 (the exact known baseline); typecheck 0 errors; drift gate PASS (980 files).
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
5 tasks
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 #1806. Part of #1803 (P1a — the engine half of port P1, first and alone).
The port, not a merge: main's #1776 sequencing architecture applied onto this lane's diverged engine. The global bus stamps every frame
<epoch>:<seq>(per-process epoch, strictly monotonic, pre-dispatch tap ordering, the sync-copy mirror window); one shared replay buffer per bus (byte+age bounded, 32MB/5min defaults, env-tunable) serves cursor resume; unservable cursors get an explicit reset frame — the lane'sstate.resyncsentinel on the instance route — never a silent gap; an engine restart changes the epoch and the reset holds across it.What the port composes with rather than replaces: the #1798 bounded fan-out (SSE-DROP on stalled writes), the Phase A SSE-TICK telemetry, the #1264 lastEventID cursor path (the new ids are wire-compatible — the legacy payload-id cursor keeps being served, no client change rides with this port).
Deliberately excluded per the doctrine: main's 06eac85 (patch bodies off the wire = P3) and the frontdoor (P1b — the ring flip follows green on this slice; the frontdoor is untouched here).
Verification (director-run on a fresh materialized tree): scoped port battery 38/0; test/server 717 pass / 2 fail (the pre-existing environmental corpse pair, byte-identical at base); test/session 599/5 (the exact known baseline); typecheck 0 errors; drift gate PASS (980 files). The implementer's EXHAUSTED return was finished by the director: the final sweep (the session/server/typecheck/drift gates) + one test-file typing fix (Stream.runIntoQueue → the sibling-proven runForEach idiom) + this commit.
Per the live-test doctrine: this port rides the deploy ritual (provenance + lockstep + the panel render gate) before it is merge-ready — the lossless-resume E2E (kill mid-turn, reconnect, transcript equals fresh load) is P1b's acceptance against the sharded hub.