SPEC §23: the Event Feed Connector contract
PR 1 of the Event Feed Connector program (#606 filed the registry entry; this specifies the Layer-2 connector contract ahead of the generated layer). SPEC.md only — no code, no Smithy/openapi surface.
What §23 specifies
- The 11-state / 26-transition state machine with reason-level disconnect dispatch (never
reconnect:false-flag dispatch) and the four-row disconnect matrix, including theremote/reconnect:true server-initiated-disconnect row: revocation is not wire-distinguishable — re-mint, and a genuinely revoked user's failing mint is the detection path (threshold-3authorization_failedon one shared counter). - Present-class entry sequencing against a defined ownership cut, with the conjunctive save-ordering invariant —
save(P)only after all retained pre-cut events are accepted AND every pre-cut loss condition is explicitly accepted — and its explicitly stated exclusion (crash before the first usable checkpoint). No global delivery-completeness claim is made anywhere; the entry-boundary semantics follow BC3's resolvedsince=nowcontract (an in-flight lower id that commits after entry falls permanently behind the cursor; the live buffer is its only carrier). - The semantic-signal handler contract:
BufferOverflow/FeedGapas distinct types, synchronousAccept | Terminatedispositions, no handler ⇒ typed terminal (buffer_overflow/feed_gap— a 410 never silently auto-continues), and a registered handler invoked exactly once per signal before its disposition takes effect. - Continuation/resume-URL validation:
nextand 410resumeURLs pass §8's same-origin algorithm + downgrade rejection before any authenticated poll; failure is the typed terminalinvalid_continuationwith zero requests to the hostile URL. The mint's cableurlis exempt by credential class (the ticket rides in the URL; noAuthorizationheader) under its own invariants. - One pinned poll-retry algorithm: server-directed
Retry-Afterwaited exactly and exempt from local caps (§7's rule), else full-jitter on a separate consecutive-poll-failure index with defined reset semantics; the reconnect lane keeps Retry-After-as-floor with the same cap exemption. - Delivered-id dedupe (never position ordering); five seam contracts with seam-call-count semantics (one seam call = one fully-governed generated call — no second retry layer); six kebab-case timer kinds + the normative virtual-advance algorithm; srv1 checkpoint identity
{origin, account_id, consumer_namespace, filter_key}with the published five-vector table; the per-language options table; security invariants.
Companion edits
- §22 narrows its WebSocket and synchronous-first bullets to carve out this one sanctioned lane.
- Appendix A gains the
EVENT_FEED_*block plus a preamble amendment sanctioning contract-first rows — and correcting the preamble's stale row tally (13 → 14; the 14th row arrived with #592 under that PR's own verification). - Appendix F records the per-SDK tier-2 scenario-lane divergences with their compensating tier-3 tests.
- Deliberately no §19/§21/Appendix-D rows for the parallel fixture families (
conformance/event-feed/,conformance/event-feed-digest/): those tables enumerateconformance/tests/operation-dispatch content only, and the existing parallel families (oauth, oauth-token) follow the same pattern — inventory lives in the family README and §23's Verification subsection. The tier-1event-feed-poll.jsontakes its rows when it lands with the generated layer.
Provenance posture
Everything BC3-derived is verified at BC3 branch head 8be5c67de5 (lineage ee19670c02) and classified in §23's Provenance block: class-1 wire literals freeze when BC3 regenerates transcripts at its merge-time gate (the remote reason string is source-verified — its one missing capture frame is requested); class-2 semantic behavior (entry-boundary semantics, the safety bound, the frozen-head next predicate, 409/410/400 recovery semantics, the srv1 algorithm, ticket statelessness/TTL, heartbeat cadence, and more) is re-verified row-by-row at that gate; the SDK-owned contract is normative as written. Branch SHAs are verification records, never the provenance pin — doc-constants-check is untouched and passes.
Verification
- Full
make checkgreen on exactly this head (c8a450bd4), run uninterrupted:REAL_EXIT=0, "All checks passed". - The §23 text went through three adversarial verification rounds (a five-lens review, a fix-verification pass, and a final three-region review), with every finding — including the state-inventory accounting for the
invalid_continuationedge and the poll-retry floor-vs-exact reconciliation — resolved in this text. - Spec-train census at open: no other open PR touches SPEC.md/COORDINATION.md/Makefile/openapi.json/smithy/api-gaps/conformance.
The conformance fixture family (including the hostile-continuation pair and the handler-invocation observability mechanics) and the Go reference connector follow as PR 2 and PR 3; fixture freezing and Layer-1 absorption stay gated on BC3's merge-time gate.
Summary by cubic
Defines §23: a cross‑language Event Feed Connector contract for BC3’s account‑wide event feed — the 11‑state/26‑transition machine, reason‑level disconnects, present‑class entry with a bounded ownership cut, semantic signals, retry/backoff, continuation validation, checkpoint identity, and bounded memory with a transport‑enforced frame cap. Liveness resets on frame receipt; protocol‑fatal disconnects are terminal; invalid frames are recoverable socket failures.
- Refactors
- Staleness suspension is now evaluated at firing time (timer stays armed in all socket‑open states); Appendix F notes the TypeScript divergence: the global
WebSockethas no read limit, soEVENT_FEED_MAX_FRAME_BYTESis enforced at message receipt; true bounded reads are available via an injectedtransport. - Seam calls are now cancellable and are cancelled on close() and any attempt teardown (mid‑walk socket failure, staleness, terminal):
mint_stream_ticketandpolltake a cancellation channel and must return promptly, never racing back into a disposed attempt. - Clock governs only connector‑owned delays; §7 retry/backoff inside generated operations stays inside seams. Conformance counts seam calls, not wire attempts.
- close() and cancellation now unblock in‑progress
write_frame; write failures take the current state's socket‑failure path. - Capacity options validate positive.
dedupeCapacitycannot be 0 (no dedupe‑disabled mode).
- Staleness suspension is now evaluated at firing time (timer stays armed in all socket‑open states); Appendix F notes the TypeScript divergence: the global