Skip to main content

Module effect

Module effect 

Source
Expand description

Effects: the things a step can ask the runtime to do for it.

A crate::filter::Filter computes. A step decides, and the deciding needs the world: a model call, a tool, another graph. Rather than let a step reach out and do that itself, it describes what it wants and hands the description back. The runtime performs it.

That indirection buys three things that are otherwise each a project of their own:

  • Durability. Every performed effect is journaled by (node, turn, effect hash). Replaying a run re-polls the step and serves recorded results instead of re-calling the model. This is the record-once-replay discipline of durable-execution engines, on top of the content-addressed store Soma already has.
  • A sync trait over async work. The step never awaits; the driver does. No coloured functions, and the Python bridge stays a plain call.
  • Testability. A fake effect handler is a match — no network, no mocking framework.

Re-exports§

pub use crate::tool::ToolSpec;

Structs§

LlmRequest
A model call.
LlmResponse
A model’s reply.
NodeSpec
A node to create while the run is in flight.
Usage
Token accounting for one call.

Enums§

Effect
Something the runtime does on a step’s behalf.
EffectResult
What came back from performing an effect.
GraphEffectMode
What to do with a graph run as an effect.
JoinPolicy
How spawned work is recombined.
StopReason
Why the model stopped.
SuspendReason
Why a run stopped and what would restart it.

Traits§

EffectHandler
Performs one kind of effect.