Expand description
Deterministic, sans-I/O turn planning for Everruns execution hosts.
Given a serializable TurnState, parsed ActivityOutcome, and
host-resolved HostFacts, its pure functions return the next TurnPlan
and TurnLifecycleEffects. Framework applications use everruns; this
focused crate lets runtime, worker, durable, and custom hosts in the
Everruns ecosystem share one turn model.
The engine performs no I/O: no stores, sockets, process execution, event
emission, or Utc::now(). Hosts resolve those facts, pass now in, call the
planner, and perform the returned effects. This makes the loop testable as
table tests over values, and lets an in-process host and a durable host share
one implementation of turn semantics.
§Example
use everruns_engine::{TurnPlan, TurnState};
fn accepts_plan(_state: &TurnState, _plan: &TurnPlan) {}Structs§
- ActOutcome
- Parsed
actactivity output the planner decides over. - ActPlan
- Engine-owned act scheduling payload.
- ActScheduling
Facts - Session facts the host pre-resolves for the reason→act scheduling case.
- Host
Facts - Host-resolved facts the engine needs but cannot fetch itself.
- Turn
State - Host-owned state carried across turn phases.
Enums§
- Activity
Outcome - Typed, parsed activity output the engine plans the next step from.
- Turn
Lifecycle Effect - A lifecycle side effect the engine decided must be recorded, described as data rather than performed.
- Turn
Plan - Generic next-step decision for a host turn.
Functions§
- plan_
after_ act - Plan the next step after an
actactivity finishes. - plan_
after_ process_ input - Plan the reason step that follows a completed
process_inputactivity. - plan_
after_ reason - Plan the next step after a
reasonactivity finishes. - plan_
next_ turn - Plan the next host step after an activity finishes.
- reason_
schedules_ act - Does this reason outcome schedule an act phase?