dev commit fde0a61e1de4f5b31ddb4d7c44dbb4a6b1e3c51a, inspected September 12, 2026. Source links below pin that revision. This is a representative assessment across current feature families, not a production configuration, load, or disaster-recovery certification. Runtime/provider behavior and capacity remain to be verified in deployment. The durable workflow contract defines the target invariants; this page distinguishes current evidence from recommendations.
Findings that change the architecture decision
- There is no shared transactional outbox in this baseline. The API README explicitly says so. Producers include both detached and awaited publications; neither makes a separate business DB commit atomic with Pub/Sub. The old Go outbox service-account names in Terraform do not establish a running TypeScript outbox.
- Pub/Sub and some useful consumer patterns already exist. Availability fan-out awaits child publication, uses stable per-device identities, and records terminal outcomes. This is a foundation to preserve, not a reason to replace the broker.
- Consumer guarantees differ. Invitation and crew-offer consumers can seal completion after caught delivery failures. Checklist push deliberately favors avoiding duplicates after an expired claim, accepting possible loss. An outbox alone does not change those policies.
- The earlier Twilio PR #1703 discussion described pending close/delete/participant queues and chat-push subscribers. Those artifacts are absent from this baseline. This assessment evaluates current direct Twilio operations, not that proposed branch. Reassess the relevant row when that work lands.
- Some durable domain state is already mature: payment instructions and provider keys, prerequisite webhook queues, import previews/jobs, CRM ingestion claims, and targeted reconciliation sweeps. Reuse them rather than flattening every workflow into
ProcessedEvent.
Messaging, staffing, and chat
External integrations and business workflows
Specific provider policies continue to govern. Stripe’s normal SCA response and Cleo’s fail-closed org/user revocation sequence are intentional constraints, not incidental synchronous code to delete. Preserve financial instruction and provider identity guards; provider acceptance, execution, and settlement are different milestones.
CheckAI, MCP, and time-driven work
Ordinary CRUD/read paths, validation, auth, capacity decisions and transactional local invariants do not benefit from a broker simply because it is available. Optional telemetry/demo delivery may retain explicit best-effort semantics. Long-running approvals, waits and cancellation need persisted workflow checkpoints; a series of subscriptions is not itself resumable execution.
Lifecycle, intake, storage, and scheduled consequences
These producers and workflows need distinct recovery contracts even where they share notification, import or payment infrastructure.Assessed boundaries that do not automatically need a broker
- Calendar feeds and entitlements: feed rendering validates current token/access; subscription sessions must return usable Checkout/portal URLs, and entitlement enforcement belongs on the request path. Asynchronous billing/profile consequences must not delay revocation or authorize stale access. Some subscription-webhook helper exports lack a production caller in this baseline; routed behavior remains the Stripe webhook assessed above.
- Availability autoclose: the existing sweep makes guarded local state transitions. Keep the timer and local transaction; it has no required provider worker merely because other expiry flows send notifications.
- Workspace/audit exports and generated PDFs: workspace ZIP export, streaming audit export, and call-sheet PDF are implemented synchronous paths; workspace and audit exports enforce explicit limits. Larger/bulk/repeated jobs can benefit from durable artifact generation, checkpoints and shared admission control. Preserve snapshot/filter, tenant/role and cancellation semantics, and define expiry/download authorization for stored artifacts; an interrupted download is not a lost business mutation.
- AI normalization and Wrapped statistics: normalization returns a review-required draft without committing business data; Wrapped computes DB aggregates. Keep bounded synchronous behavior until measured latency or read load justifies job UX or a materialized projection with an explicit freshness/rebuild contract.
- Team notification inbox: the inbox is an authenticated read/enrichment surface. No api-events runtime writer was found for its message table in this baseline. A desired send-to-inbox history feature needs a defined producer; do not claim current direct sends already populate it durably.
Broker and runtime evidence
The Terraform events module configures subscription backoff of 10 seconds to 10 minutes, a default approximately five delivery attempts before dead lettering, seven-day source retention and fourteen-day DLQ topic retention in defaults. Alert configuration pages Slack on Cleo, Brevo, scheduled-maintenance, availability, invitation, and crew-offer DLQs. Remaining fan-out keys (checklist assignment, event assignment, event chat, Twilio reconcile, Resend lifecycle, Slack channel sync, lead discovery) still have no equivalent policy. Topic retention is not a staffed replay process. Encore handlers also declare retry and acknowledgement settings. The effective SDK/provider behavior, permission grants, subscriptions, retention and replay must be tested together. Configuration committed to Git is not proof it is applied in production; the attempt limit is approximate by Pub/Sub design. The Cloud Run configuration keeps CPU allocated for background pull loops and one or two warm instances according to HA configuration. Its default maximum is five instances. HTTP and consumers share the api-events deployment. This supplies a running consumer but does not prove backlog-aware autoscaling, sufficient provider/DB capacity, per-tenant fairness, or isolation from long integration work. No throughput or latency measurements were taken for this assessment.Recommended end-goal
Keep PostgreSQL, Encore and Pub/Sub. Establish one reusable, tested durable handoff and recovery capability, with domain-specific semantics:- Transaction owners record required work. An indexed outbox stores immutable versioned events beside the state change. Existing operation ledgers remain authoritative for payments, imports and desired-state work. Verified webhook ingress may publish directly if confirmed broker acceptance is the only handoff required.
- Relays and consumers have explicit ownership. Stable event IDs, bounded claims, generation-safe completion, repeatable partial fan-out, and measured dispatch/completion age. Consumption that emits more required work preserves durability at that boundary too.
- Workers isolate resource use. Separate execution by provider/workload when needed, with global/provider limits, tenant fairness and bounded DB connections. Scale using measured throughput and oldest-work age. Start with a small deployment and indexed polling; CDC or more services require evidence, not a branding preference.
- Domains preserve their meaning. Notifications replay a delivery decision; reconciliation follows current desired state; financial/document commands execute an immutable authorized instruction; long jobs/sagas persist steps and outcomes. Authorization and approval survive delayed execution.
- Recovery is a product of operations. Every required workflow has an owner, alertable unfinished state, retention policy, replay/runbook, and a tested unknown-outcome path. Scheduled reminders, settlement polling and drift repair remain where they add independent coverage.
Sequenced implementation roadmap
This PR records architecture and guidance only. Runtime outbox tables, relays, topic/subscription changes and feature migrations are separate implementation work. B-for-all-four Twilio operations is a possible intermediate layout, not a required milestone; keeping both a full database queue and a broker should have a stated operational benefit.