Effect coordinates scheduled execution and outbound webhook, push, RevenueCat and email transports. It also powers the diagnostic probe. Zod remains the contract validator, oRPC the request layer, Better Auth the identity system and Drizzle the database interface.
One execution boundary
Jobs return Effect; the cron entry runs the composed program once. Promise consumers call thin facades through runEdge. Convert typed errors once with catchTags where the program meets HTTP, persisted outcomes or an external result union. Do not catch interruption manually.
Use tryPromise when a rejection must enter the typed error channel. Use drained for promises that own database state: it requests cancellation and waits for settlement before closing the pool. Scope cleanup can outlive an Effect deadline when external I/O does not settle; the query timeout is part of the shutdown design.
Retries and deadlines
| Policy | Production value |
|---|---|
| Whole scheduled tick | 25 seconds |
| Import admission budget | 15 seconds |
| Import source GET | 10 seconds |
| Job pool query timeout | 2 seconds |
| Job pool SQL statement timeout | 5 seconds |
idempotentRead retries eligible reads twice with jitter and a budget. A short Retry-After can be honored inside the round; a longer delay returns to persistent policy. A webhook POST or email send is not retried inside that round.
Stable API boundary
Read the installed Effect AGENTS.md and source before editing Effect code. Only APIs marked stable are approved. Native PersistedQueue failed the workerd lost-acknowledgement shutdown gate; production imports use stable Queue/Stream/Schedule plus Drizzle leases. Do not replace that queue or bump its pins without repeating ADR-0006's fault gate.
TanStack AI owns its Promise/SSE lifecycle under the narrow exception in ADR-0007. Adding Layers or shared services is a new architectural decision, not a prerequisite for a small transport.