everruns_engine/lib.rs
1//! The turn engine: the sans-IO turn planner for the Everruns agentic runtime.
2//!
3//! `everruns-engine` owns the authoritative, deterministic turn-planning brain
4//! for the Sans-IO Turn State epic
5//! (`knowledge/foundations/sans-io-turn-state.md`). Given a serializable
6//! [`TurnState`], a parsed [`ActivityOutcome`], and any host-resolved
7//! [`HostFacts`], its pure functions return the next [`TurnPlan`] together with
8//! the [`TurnLifecycleEffect`]s the host must perform.
9//!
10//! The engine performs no I/O: no stores, sockets, process execution, event
11//! emission, or `Utc::now()`. Hosts resolve those facts, pass `now` in, call the
12//! planner, and perform the returned effects. This makes the loop testable as
13//! table tests over values, and lets an in-process host and a durable host share
14//! one implementation of turn semantics.
15//!
16//! The dependency direction is strictly `engine -> core`; the engine never
17//! depends on runtime/server/worker/platform/durable.
18
19mod turn;
20
21pub use turn::{
22 ActOutcome, ActPlan, ActSchedulingFacts, ActivityOutcome, HostFacts, TurnLifecycleEffect,
23 TurnPlan, TurnState, plan_after_act, plan_after_process_input, plan_after_reason,
24 plan_next_turn, reason_schedules_act,
25};