Skip to content
Agents: this page is Markdown at /effect-handbook/reference/review-checklists.md · llms.txt · reading guide View raw

Review Checklists ​

Use this page three ways: in a design review, read a section before code exists and treat every "not decided yet" as an open design question; in a code review, answer each question from the diff alone; as a coding-agent self-check, run the relevant sections over generated code before proposing it. Every question is phrased so that yes is the safe answer — a "no" or "cannot tell from the diff" is a finding, and the link leads to the section that owns the rule and its evidence.

The items are deliberately short; the owning pages carry the reasoning, the probed behavior, and the examples. For symptoms rather than rules, start from Troubleshooting & Anti-Patterns; for choosing between primitives, from Choosing Effect Primitives.

Effect construction and running ​

  • Is every constructor chosen by how the wrapped code fails — Effect.try / Effect.tryPromise for code that can throw or reject, Effect.sync / Effect.promise only for code that cannot? Creating effects
  • Is every argument to Effect.succeed and Effect.fail a value that is safe to compute while the program is being built — no clock reads, counters, or side effects? Creating effects
  • Does every Effect.tryPromise / Effect.promise thunk declare the signal parameter and pass it to the foreign API? Cancellable adapters for promises and callbacks
  • Does each adapter's catch recognize the failures its contract allows and turn everything else into a defect, instead of mapping every rejection to one retryable error? Cancellable adapters for promises and callbacks
  • Is the diff free of runners (runPromise, runSync, runFork, a second ManagedRuntime) inside services, handlers, and domain functions? Running effects at an owned edge
  • Where a host can represent cancellation, does the edge use runPromiseExit (or runFork) with { signal } rather than collapsing every outcome into a rejection? Running effects at an owned edge
  • Is every Effect that is constructed also returned, yielded, or composed — none built inside a callback and dropped, none nested by Effect.map? “My Effect never ran”
  • Are callbacks written as lambdas rather than functions passed by name to Effect.forEach, Effect.map, and similar operators? Generated-code anti-pattern index
  • Does branching and looping use ordinary if / for inside Effect.gen (and Effect.when with an Effect<boolean>), with none of the removed Effect.if / unless / loop / zipRight family? Branching and looping
  • Do effect-returning functions use Effect.fn("name"), so they carry a span and a readable stack? Sequencing with gen & fn
  • Is pure, synchronous, dependency-free logic left as plain functions instead of being wrapped in Effect? Decide what to leave out

Errors and recovery ​

  • Is each new unpleasant outcome placed deliberately: ordinary negative answers in A, caller-actionable conditions in E, broken invariants as defects, and interruption left alone? Designing the error model
  • Does every error variant carry the facts its policy needs as fields (retryable, ids, limits) rather than a message to parse? Designing the error model
  • Are missing, conflict, unavailable, timeout, corrupt, and forbidden kept distinct wherever their policies differ — and is "not found" produced only by a query that succeeded and returned nothing? Designing the error model
  • Does each catch* use the narrowest selector that expresses the policy, leaving the undecided variants in E? Selective recovery beyond one tag
  • Is every handler clearly one of recover, translate, compensate, or observe — with no catch that exists only to empty E? Recover at the narrowest owner
  • Does folding (Effect.match, matchEffect) happen only at the terminal boundary that owns the response? Folding both channels at a boundary
  • Is every whole-union classification closed with Match.exhaustive or Match.tagsExhaustive, with no default branch or unexplained Match.orElse? Classifying an error union
  • Where an interruption or a second typed failure can sit next to the one being handled, does recovery go through a guarded Effect.catchCause so the other reasons survive, and is a defect beside a typed failure expected to propagate rather than be recovered? Recovering from a mixed Cause
  • Is the diff free of Effect.orDie, Effect.ignoreCause, and catchCause(() => Effect.void) used only to tidy types? Fallback values and ignoring failures
  • Is every retry classified, bounded in attempts and elapsed time, paced with backoff, and wrapped around the smallest idempotent operation? Retry policy checklist
  • Is it clear whether each timeout bounds one attempt or the whole retried operation? Where the timeout sits relative to retry
  • Do public error values expose only stable tags and safe identifiers — no cause, driver message, SQL text, or Redacted? Designing the error model
  • When several problems must be reported together, are they accumulated as data (Effect.validate, Effect.partition, mode: "result")? Accumulating errors instead of failing fast

Services and Layers ​

Configuration and secrets ​

Resources, scopes, and fibers ​

  • Can the reviewer name, for every new resource, fiber, and runtime, who closes it, what bounds it, and what runs when it loses? Three questions for anything that runs
  • Does every acquired handle have its own acquireRelease, registered in the scope that matches its lifetime? One bracket per resource
  • Is every Scope in a signature discharged by a deliberate choice (Effect.scoped, a Layer, a held scope), never by accident at the entrypoint? Scope left in R means nobody owns it yet
  • Do scoped values stay inside their scope — nothing returned from Effect.scoped that is still borrowed? Scope closed or resource leaked
  • Is all cleanup attached structurally (ensuring, onExit, acquireRelease), so it also runs on failure and interruption? Success-only cleanup
  • Does every finalizer have a time bound and a stated policy for its own failure? When cleanup can fail
  • Is each fork chosen by its owner — forkChild, forkScoped, forkIn, or a FiberSet / FiberMap — and does every forkDetach name who stops it? Choosing a fork by its owner
  • Is work that must outlive its request handed to a Layer-owned, bounded supervisor rather than detached? Bridge into a host that is not Effect
  • Where a forked fiber must be listening before the parent continues, is that guaranteed by startImmediately or a handshake rather than by yieldNow? When a forked fiber starts
  • Does every Deferred and Latch have a completion path on success, failure, and interruption, and a fresh instance per lifecycle generation? Deferred
  • Does a public cancel operation say whether it requests cancellation or awaits cleanup? Requesting cancellation versus awaiting cleanup

Concurrency, queues, and streams ​

  • Is the execution policy written down before the code: bound, order, failure mode, and shutdown behavior? Write the execution policy first
  • Does every traversal over external input have a numeric concurrency, and is a shared limit a Semaphore or Pool owned by one Layer? Put shared limits around the actual bottleneck
  • Does every queue, PubSub, and buffer have a capacity and an overflow strategy chosen as a policy? Queue
  • Wherever dropping, sliding, or offerUnsafe is used, is the loss counted and documented? Make loss observable
  • Is it decided who ends each queue, and does a producer failure reach its consumers (Queue.end, Queue.fail, Queue.into) — with Queue.shutdown reserved for abandoning work? Queue lifecycle
  • Do producers accept Queue.Enqueue and consumers Queue.Dequeue, so only wiring code sees the full queue? Put queue roles in function signatures
  • Do batch consumers avoid relying on takeN / takeBetween with min > 1 on a queue that can end? Consuming: the consumer picks its waiting policy
  • Was the delivery semantics — one taker or every subscriber, late joiners, nobody listening — chosen explicitly? Delivery semantics: Queue or PubSub
  • Is every shared-state transition one Ref.update / modify call over an immutable value, with SynchronizedRef for effectful transitions and Effect.tx for multi-cell atomicity? One transition, one call
  • Is every stream stage bounded, including Stream.callback (bufferSize), mapEffect (concurrency), and framing decoders (frame or line limits)? Where buffering hides
  • Are resources acquired inside the stream (Stream.unwrap, Stream.scoped) so they close on early stop as well as completion? Owning resources inside a stream
  • Is Stream.retry placed directly after the source it reconnects, upstream of any non-idempotent write, and is silence detected with timeoutOrElse rather than timeout? Handling stream failures
  • Is batch size set with grouped / groupedWithin / rechunk rather than inferred from a buffer capacity, and is runCollect used only on sources known to be small? Where buffering hides

Schema boundaries ​

HTTP and RPC boundaries ​

  • Does each handler only translate one decoded request into one use-case Effect — no runner, no SqlClient, no client construction? Handlers are lazy adapters
  • Does all request work stay in the request fiber, so a disconnect or shutdown can interrupt it? Request work stays in the request fiber
  • Is every member of the public error union mapped to a truthful status through an exhaustive matcher, with the implicit 400 declared? Status mapping is part of the contract
  • Is authentication done in middleware with a narrow decoded principal, and authorization checked per operation against actor, action, tenant, and resource? Authentication is not authorization
  • Are body size, multipart limits, CORS origins, redacted headers, proxy trust, and the shutdown window set explicitly? Edge policy checklist
  • Is the listener allocated during Layer acquisition, bound to port 0 in tests, and proven released? Own the listener
  • Does every outbound call have a finite time budget, and are retries limited to replay-safe requests? Retries, time budgets, and cancellation
  • Is the response status checked before the success schema is decoded, and are transport, status, and decode failures kept distinct? Three failure classes
  • Is every user-supplied URL allow-listed, resolved to a public address, and re-validated on each redirect? User-controlled destinations
  • Is each RPC contract change classified as compatible or not, deployed in the right order, and covered by a version-skew test through a real serializer? Evolving a contract
  • Are RpcServer concurrency, disableFatalDefects, streamBufferSize, and every Rpc.fork chosen deliberately? Operational defaults
  • Do retried RPC or HTTP mutations carry one idempotency key per intent that the server records with the mutation? Retried mutations need a ledger
  • Is enforcement done at the server edge, with client middleware treated as a convenience only? Client middleware attaches; only the server edge enforces
  • Do both peers of a framed link agree on serialization, and is a frame-size limit set for untrusted peers? RpcSerialization

SQL and persistence ​

Caching and batching ​

  • Was the waste shape measured first, and does the tool match it: one effect, one repeated key, or many keys at once? Which problem do you have?
  • Are cache keys normalized at ingress and carried as small value classes rather than whole records or raw strings? Keys are logical values
  • Does every cache have a capacity, a TTL, and a separate, deliberately short lifetime for failures? Failure and freshness policy
  • Is known staleness handled with Cache.invalidate / refresh as an event rather than by shortening the TTL? Failure and freshness policy
  • Do cached values that own resources live in a ScopedCache? ScopedCache
  • Does every resolver settle every entry exactly once, join rows to entries by identity, and decide what a missing row means? Resolver obligations
  • Does the resolver deduplicate ids before calling the backend, or use withCache / asCache? Resolver obligations
  • Is a memoized single effect (Effect.cached, cachedWithTTL) constructed once where its owner lives, not per call? Caching a single Effect
  • Are cache and resolver behavior tested with counters and virtual time rather than sleeps? Testing a cache deterministically

Observability signals and export ​

Tests ​

Hosts, startup, and shutdown ​

MCP servers ​

  • On a request-bound host, does the endpoint use layerHttpRequestScoped with sessionless protocols and no subscriptions, rather than depending on long-lived server fibers? McpServer
  • Does every server layer list the protocol revisions it accepts, with at most one stateless revision, and is the Streamable HTTP endpoint deployed with its allowedOrigins, content-type, and accept checks intact? McpServer
  • Is the MCP endpoint an OAuth resource server — bearer token verified in router middleware, tenant and scopes taken from token claims only, per-tool scope checks in handlers, and no client token forwarded downstream? Exposing an Effect Application over MCP
  • Does each tool declare its failure schema, carry honest Readonly / Destructive / Idempotent annotations, use Tool.Strict where unexpected arguments must be rejected, and stay hidden from clients that cannot use it via McpSchema.EnabledWhen? McpServer
  • Does every consequential tool confirm with the user — McpServer.elicit on session protocols, an InputRequired round trip on the stateless protocol — and is any requestState sealed with an HMAC, bound to the caller, and given a TTL before it is trusted on the way back? Exposing an Effect Application over MCP
  • Can a retried tools/call (a broken stream, a resumed round trip) run twice without a second side effect, and is an ErrorReporter wired so undeclared tool failures page someone? McpServer

Upgrading Effect versions ​

  • Were experimental GraphQL and networking contracts re-checked even for a patch upgrade, including generated GraphQL output? GraphQL, Platform & Runtime Hosts
  • Are effect and every @effect/* package pinned to one exact version, with a single installed copy of effect? Incompatible unstable package versions
  • Were the per-package changelogs read for changes that alter bytes on the wire or on disk, and is there a coordinated rollout plan for them? Stability and support
  • Do both peers of every binary RPC, cluster, or EventLog link move to SchemaBinary together, with old journals accounted for? SchemaBinary
  • Do all boolean CLI flags have Flag.withDefault(false), Flag.optional, or a fallback? Flag
  • Were Config, Flag, and Prompt constructors renamed to PascalCase, and Config.mapOrFail to Config.mapEffect? Built-in constructors
  • Were property tests moved to Arbitrary.schema and { arbitrary: { runs } }, opaque filters replaced with constructive checks, and saved failures re-recorded? Arbitrary
  • Were PostgreSQL row Schemas re-checked against the native client's result types, JSON parameters wrapped in sql.json, and multi-statement strings split? Upgrading @effect/sql-pg to the native client
  • Were JSON Schema consumers and snapshots checked against open-by-default output? JsonSchema
  • Is the code free of yield* on Option, Result, fibers, refs, and deferreds? Moving between Option, Result, and Effect
  • Were PersistedQueue retry options moved to make, and are dead-lettered items monitored? PersistedQueue
  • Do Effect diagnostics run in CI so removed APIs and floating Effects fail the build? Effect diagnostics in the editor and in CI

Deeper checklists on other pages ​

These sections go further than a review question can. Use them when a section above turns up more than one "no".

AreaChecklist
Application shape, composition root, policiesAnatomy — Operational checklist
Lifetimes, startup, readiness, shutdownOwning Lifetimes — Operational checklist
Failure, retry, fallback, interruptionFailure — Operational checklist, Retry policy checklist
Bounded workers and structured concurrencyStructured Concurrency — Operational checklist
Streaming ingestionStreaming Ingestion — Operational checklist
Schema boundariesSchema — Operational checklist, Proving the boundary
HTTP edge limitsEdge policy checklist, What each test ring proves
Durability, queues, workflows, clusterDurability Ladder — Operational checklist, Recovery testing and operations
Observability before productionBefore production, Verifying telemetry
TestsTesting — Operational checklist, When green means nothing
Host bridgesHow to test this seam
AI capabilitiesProduction rules for model calls, AI — Operational checklist
Reactive UI statePerformance & correctness checklist
Brownfield adoptionHow to know you are done

Edition 4.1 · audited 2026-11-19 against Effect 4.1.4.