Declared effect capabilities materialized at runtime.
Each node's [effects] block becomes a %Bloccs.Effects.Capabilities{}
struct injected into the per-message context. The struct's fields refuse
out-of-scope calls — that's the runtime half of the "declared capabilities"
guarantee. The compile-time half lives in Bloccs.Node (AST warning).
Mock backends are the default (tests stay hermetic); real HTTP
(Bloccs.Effects.HTTP.Req) and DB (Bloccs.Effects.DB.Ecto) adapters are
opt-in via config, with :req / Ecto as optional deps. See
Bloccs.Effects.HTTP and Bloccs.Effects.DB for the behaviours.
Summary
Functions
Build a capability struct from a parsed node manifest.
Raise Bloccs.Effects.Denied with a useful message.
Functions
@spec bind( Bloccs.Manifest.Node.t(), keyword() ) :: Bloccs.Effects.Capabilities.t()
Build a capability struct from a parsed node manifest.
The backend module for each axis is resolved by layering, lowest precedence first:
- Built-in defaults — mock HTTP/DB, real wall-clock/RNG. Safe for tests.
- App config —
config :bloccs, :effect_backends, http: ..., db: .... This is how production selects the real adapters (HTTP.Req,DB.Ecto) without touching node source. - Per-call
:backends— a keyword override, mainly for tests that want a specific backend inline.
Backend-specific configuration (e.g. the Ecto repo) is read by the backend itself from its own config key — see each adapter's docs.
Raise Bloccs.Effects.Denied with a useful message.