Context and requirements
The requirements part of an Effect type names the services that the work needs. Sam describes this requirements channel as a way to model permissions before execution, which he calls a static effect. He connects that idea to Alchemy inferring which identity and access management (IAM) policy a program needs. Happy Path 116, 11:54.¶
Michael describes an Effect by its output, predictable failures, and requirements. Happy Path 81, 49:15.¶
See Effect basics17 and infrastructure as effects10.¶
Read why dependency injection matters14.¶
Sources
- #116 Infrastructure as Effects with Sam Goodwin - YouTube. Sam Goodwin. Requirements-channel discussion; used for static infrastructure permissions. Accessed 2026-10-01.
- #81 TypeScript & Effects with Michael Arnaldi - YouTube. Michael Arnaldi. Effect type explanation; used for output, failure, and service requirements. Accessed 2026-10-01.
Last changed 2026-10-07 in e73c9d9. Source on GitHub. Change log.
Linked from
- Agent guide. An Effect stack so pure (aspirational) Kit Langton will blush.
Context and requirements — Effect requirements make a computation’s needed services visible in its type.
- Change log. What changed in the files served here, newest first.
Context and requirements — edited: feat(learn): cards that teach, with compiled snippets and instant onboarding
- Dependency injection is the reason to choose Effect. Effect tracks service requirements in types and supplies replaceable implementations through Layers.
Read context and requirements.¶
- Effect basics. An Effect describes work, expected failures, and required services before a runtime executes it.
Read service construction, Layer composition, and context and requirements.¶
- Full agent guide. An Effect stack so pure (aspirational) Kit Langton will blush.
- Infrastructure as effects. Sam Goodwin relates application operations to infrastructure requirements in one typed program.
Effect tracks required services in its type.
- Learn rat-stack from your own agent. Turn on learn mode: your own agent explains rat-stack ideas during real work and keeps progress local.
The first path starts with context and requirements, then how a service captures its dependencies.
- Rat Stack lore | rat-stack. Short, source-grounded notes on the ideas and decisions behind rat-stack.
Context and requirements — Effect requirements make a computation’s needed services visible in its type.
- Source change history (log.md). The generated change log as Markdown.
Context and requirements — edited: feat(learn): cards that teach, with compiled snippets and instant onboarding
Unlinked mentions (27)
- A service captures its construction dependencies → A context holds supplied service implementations.¶
- add-a-capability → MCP (Model Context Protocol) adds a doThing tool with the same schemas and flags.¶
- Agent rules for rat-stack (AGENTS.md) → Name the failure, keep its source context, say how to fix it, and fail at the boundary.
- Code snippets quote a pinned source → This preserves the preceding source context for multiline comments and strings.¶
- Dependency injection is the reason to choose Effect → Shared Layer identity reuses construction within the same memoization context.¶
- Devtools → MCP means Model Context Protocol, which lets an agent discover and call tools.¶
- Effect + Alchemy peer patterns → The guidance makes app, product-package, and vendor-neutral-library ownership explicit; it also says services capture implementation dependencies and keep request context invocation-scoped.
- Effect 4 study: September 2026 → Two things learned on the way: the machine context must be declared via types<Ctx>() or schemas.context, otherwise createMachine’s function-form context falls back to MachineContext and the output type collapses to any; and ErrorFrom of a machine is unknown, so join needs orDie (or an explicit catch) to keep a typed…
- Effect basics → A context holds supplied service implementations.¶
- Effect Meetup SF 2023: Why Effect? → A Remix demo contrasts manually added logs, metrics, and traces and nested error handling with Effect context, Schema, spans, metrics, and retry policies.
- gardener → json, and turn useful unlinked mentions into explicit source links after checking their context; leave incidental matches alone.¶
- Handle expected failures without hiding defects → Its tag identifies the error type; its fields retain context.
- Happy Path 116: Infrastructure as effects → The program carries resource requirements in its context.
- Hosted agent interfaces → Those values can belong to the first request’s runtime context.
- Interest signup → MCP means Model Context Protocol, which lets an agent discover and call tools.¶
- Layer composition makes dependencies explicit → Sharing follows Layer identity within a build context that remembers which Layer values it has already constructed.
- learn → Omit context to follow the ordered learning path.
- Learn mode presents concepts at useful depths → Selection follows deck order when context is absent.
- MCP is another surface → The Model Context Protocol lets an agent client discover and call tools.
- Production-grade TypeScript → He demonstrates Effect context, Schema, spans, metrics, and retry policies in a Remix application.
- Purpose and boundaries of rat-stack (VISION.md) → Context.
- Run Effect at the integration boundary → Later calls reuse the built service context.
- Sam Goodwin → Its infrastructure context is the cloud environment and dependencies in which it runs.
- Schema projections: 2026-09-18 history → Tool annotations already exist as Context references: Tool.Readonly, Tool.Destructive, Tool.Idempotent, Tool.OpenWorld.
- Structure an Effect codebase by domain → Declare expected failures with useful context.
- Trace operations where they mean something → Add only context safe for that operation’s telemetry.¶
- write-a-wiki-page → The remaining context describes the requested source.¶