Skip to main content

everruns_engine/
lib.rs

1//! Deterministic, sans-I/O turn planning for Everruns execution hosts.
2//!
3//! Given a serializable [`TurnState`], parsed [`ActivityOutcome`], and
4//! host-resolved [`HostFacts`], its pure functions return the next [`TurnPlan`]
5//! and [`TurnLifecycleEffect`]s. Framework applications use `everruns`; this
6//! focused crate lets runtime, worker, durable, and custom hosts in the
7//! [Everruns](https://everruns.com) ecosystem share one turn model.
8//!
9//! The engine performs no I/O: no stores, sockets, process execution, event
10//! emission, or `Utc::now()`. Hosts resolve those facts, pass `now` in, call the
11//! planner, and perform the returned effects. This makes the loop testable as
12//! table tests over values, and lets an in-process host and a durable host share
13//! one implementation of turn semantics.
14//!
15//! # Example
16//!
17//! ```
18//! use everruns_engine::{TurnPlan, TurnState};
19//!
20//! fn accepts_plan(_state: &TurnState, _plan: &TurnPlan) {}
21//! # let _ = accepts_plan;
22//! ```
23
24mod turn;
25
26pub use turn::{
27    ActOutcome, ActPlan, ActSchedulingFacts, ActivityOutcome, HostFacts, TurnLifecycleEffect,
28    TurnPlan, TurnState, plan_after_act, plan_after_process_input, plan_after_reason,
29    plan_next_turn, reason_schedules_act,
30};