Account event feed, inbox, and stream tickets: spec operations and generated clients
Summary
Models the account event feed's wire surface, now merged on bc3 master, and regenerates all seven SDKs from it. Three operations on a new EventFeed tag (service eventFeed):
| Operation | Method + path | Notes |
|---|---|---|
PollEvents | GET /{accountId}/events.json | @readonly; since (decimal int64 id, 0, or now), position, and the comma-joined filters types/buckets/creators/performers/exclude_performers/actor_types |
PollInbox | GET /{accountId}/inbox.json | @readonly; since, position, reasons/types/buckets; 403 for every non-agent principal |
CreateStreamTicket | POST /{accountId}/events/stream_ticket.json | bodyless, 200; @idempotent because the mint is a stateless signed capability (safe to retry, not a claim of an identical response) |
Shapes: FeedEvent (with a nullable performed_by_id and a details document, carried verbatim — only for boost.created / card.moved today; a typed projection would drop the explicit nulls a recording-level boost sends and any member a newly cataloged type adds, so the poll lane would disagree with the connector's push lane), PollEventsOutput / PollInboxOutput envelopes (events|items, position, next?), InboxItem, and the mint's {ticket, expires_in, url} with ticket and url marked sensitive (recorded in behavior-model.json's redaction map and rendered as Rust's SensitiveString; no SDK logs response bodies, and the §23 connector never renders either value). Typed error bodies (revised after peer review): FeedRequestError (400 on both poll lanes: error plus an optional reason of invalid_position | invalid_filter from bc3 #13362 — absent means an undifferentiated 400 the consumer surfaces rather than guessing between recovering and stopping), FeedFilterMismatchError (409: position_digest, filters_digest), and two deliberately distinct 410 shapes on two operations: FeedPositionGoneError on PollEvents (epoch_after_id required; resume re-enters at the epoch) and InboxPositionGoneError on PollInbox (resume re-enters at since=0; no epoch) — so no single errors.As arm can silently handle the wrong lane. PollInbox's 403 is BareForbiddenError (bodyless, following BareNotFoundError). CreateStreamTicket keeps @basecampIdempotent(natural: true): Ruby, TypeScript and Go classify retry off that flag, and dropping it fails check-idempotency-parity.
Pagination is deliberately not the Link-header walk: the body envelope's position is the durable cursor and next the continuation URL, so the operations carry no pagination trait and are wired into no SDK's paginator — one call is one page. The operation docs and SPEC §23 "Wire Operations" say so.
Also absorbed from the same bc3 range: the optional performed_by: Person member on Event (recording events) and WebhookEvent (bc3 #13040). Person.personable_type was already an open string in every SDK, so the new Agent / Tombstone values decode without a closed enum to widen.
Contract sources (bc3 master):
- https://github.com/basecamp/bc3/blob/master/doc/api/sections/event_feed.md (bc3 #13049, #13053, #13056, #13058)
- https://github.com/basecamp/bc3/blob/master/doc/api/sections/events.md ("Delegated events", bc3 #13040)
- https://github.com/basecamp/bc3/blob/master/doc/api/sections/webhooks.md (same)
What changed
- Spec:
spec/basecamp.smithy(operations, shapes, error shapes,@sensitiveticket types,performed_by),spec/overlays/tags.smithy;openapi.json,behavior-model.json,url-routes.jsonregenerated. - Generated code, all seven SDKs (
make generate), plus theeventFeedservice wired into the TypeScript, Ruby and Python clients;RESOURCE_TYPE_OVERRIDESgainPollEvents → feed_eventandPollInbox → inbox_itemin the four generators that emit resource types (Pollis not a verb pattern, so inference fell through toresource). - Go wrapper:
AccountClient.EventFeed()→EventFeedServicewithPollEvents/PollInbox/CreateStreamTicket, typed*FeedRequestError(withReason),*FeedFilterMismatchError,*FeedPositionGoneError(feed only) and*InboxPositionGoneError(inbox only), each unwrapping to the canonical*Error, andPollEventsOptionsFromURL/PollInboxOptionsFromURLto follow anextorresumeURL through the generated operation (query-only parse; origin validation stays with the SPEC §23 connector).Event.PerformedByandWebhookEvent.PerformedByon the existing wrappers. - Tests: TypeScript, Ruby, Python and Rust service suites (entry point and comma-joined filters on the wire, envelope decode with a null
performed_by_idand bothdetailsvariants, 400/409/410 mapping, the inbox's agents-only 403, the bodyless mint and its 401); Go wrapper tests for the same plus the typed errors and URL parsers. - Conformance:
conformance/tests/event_feed.json(12 cases, including the 400 with and withoutreason) dispatched from all seven runners with flat per-runner summaries; registered in SPEC §19's categories table and Appendix D. - Gates:
spec/bc3-route-allowlist.ymlwaives the three routes with routes.rb / controller / test evidence (they are documented past the current provenance pin — see out of scope);scripts/check-idempotency-paritycounts +1 idempotent / +3 union;go/grouped-client-inventory.ymllists the three as not grouped; Rustguarantees.rspins moved to 265 operations. detailsper language: Gojson.RawMessage(the bytes, untouched; the wrapper'sFeedEvent.Detailstoo), TypeScriptunknown, PythonAny, Ruby a Hash, KotlinJsonElement, Rustserde_json::Value, Swift the SDK'sJSONValue?— the Swift generator used to render every Smithy document asString?, which cannot decode an object, so it now maps documents toJSONValue(which gainedEncodable);WebhookEvent.detailschanges type with it, noted inMIGRATING.md, and numbers ride asDoublethere.- Docs / registry: SPEC §23 gains a "Wire Operations" subsection describing the generated layer and listing the contract deltas the merged head introduced for the connector to absorb (the srv2 digest scheme, the epoch re-entry, the new filter dimensions and the inbox lane — which #778's §23 text now carries).
spec/api-gaps/event-feed.mdanddelegated-events-performed-by.mdclose asabsorbed-in-sdk. AGENTS/SECURITY/README operation and service counts were rewritten bymake generate.
Verification
Run locally on macOS (every exit code 0 unless noted):
make generate(clean re-run produces no diff)- All 54 static gates of
make check-targetsindividually (smithy-check, behavior-model-check, provenance-check, sync-api-version-check, doc-constants-check, url-routes-check, bc3-route-parity + its self-test, go-check-drift / go-check-wrapper-drift / go-check-generated-drift, check-grouped-client-coverage, auth-routable-check, check-service-inventory-parity, check-operation-assignment-parity, the five per-SDK drift checks, check-bucket-flat-parity, validate-api-gaps, check-deprecation-parity, check-fixture-coverage, kt-check-optional-arrays-and-scalars, go-check-optional-pointers, check-idempotency-parity, check-write-semantics-parity, check-retry-metadata-parity, check-runner-test-reachability, check-replay-decoder-parity, check-readme-env-vars, lint-npm-lockfile-writes, check-projected-examples, the OAuth / event-feed / conformance fixture checks, …) make go-check,make ts-check(1899 tests),make py-check(2094 tests),make rb-check(1745 runs),make rs-check,make kt-check,make swift-check(563 tests)make check-fixture-execution(runsmake conformance: all seven runners execute the 284 cases; the new family passes in every language)
Live canary against a real account with the Go SDK on this branch, using a person-principal token: PollEvents since=now → 200, empty page with a position; PollEvents since=0 with types and exclude_performers=self → 200; a malformed position → the documented 400 (validation, "Unrecognized position…"); PollInbox → 403 forbidden (agents only, as documented); one CreateStreamTicket → 200 with expires_in: 120, a ticket, and a wss:// URL carrying it (nothing beyond lengths was recorded; the URL was not connected to — that is the connector's job).
Out of scope, deliberately
- Connector reconciliation (SPEC §23 layer 2) — the
TicketMinter/PollSourceadapters over these operations, thesrv2rename, the 410 re-entry semantics, and the new filter dimensions land in the event-feed connector PRs; the symbols above are what they bind to. - Provenance repin. The three routes are only documented past the current pin. Advancing the pin drags roughly 25 unrelated bc3 doc drifts (subtasks, card-table templates, templatifications, backlinks, bulk enrollments, the unscoped recording show) into
spec/api-gaps/triage, so this PR follows the existing convention of evidenced route waivers marked "delete at the next repin". - Typed 409/410 members outside Go. The other six SDKs surface the canonical error (
api_error, non-retryable) with the server's message; readingposition_digest/resumeoff a typed value is the connector adapter's concern in each language. TimelineEventalso rendersperformed_byupstream; onlyEventandWebhookEvent(the two the gap registry names) are modeled here.
Release notes: Features (enhancement). The API Compatibility gate flags the new generated Go interface methods (ClientInterface.PollEvents etc.), as it does for every added operation (#836, #833, #827, #847 all carried breaking), and Event/WebhookEvent gain an exported PerformedBy field, which breaks unkeyed Go composite literals — MIGRATING.md carries the note under Unreleased. Applying the breaking label needs triage rights, so a maintainer will have to add it for the gate to pass.