Skip to main content

turnframe_tasks/
lib.rs

1//! Small, typed model tasks: the engine that runs every model call of a turn.
2//!
3//! A [`ModelTask`] states what one call needs and what it may answer. The
4//! [`TaskEngine`] resolves its instructions, applies its kind's [`TaskProfile`],
5//! reserves the call against the turn's [`Budget`], checks the answer, repairs,
6//! votes and escalates, and writes one [`TaskRecord`](turnframe_core::replay::TaskRecord)
7//! per call into the [`TaskScope`] the turn owns.
8//!
9//! | Module | What it decides |
10//! | --- | --- |
11//! | [`task`] | the task trait, identifiers and structural errors |
12//! | [`profile`] | per-kind settings and their defaults |
13//! | [`budget`] | what a turn may spend, and which bound stopped it |
14//! | [`instructions`] | which instruction text a call runs under |
15//! | [`engine`] | running a task: repair, votes, escalation, records |
16//! | [`testing`] | a provider that answers each task by its id |
17
18#![forbid(unsafe_code)]
19#![cfg_attr(test, allow(clippy::unwrap_used, clippy::expect_used, clippy::panic))]
20
21pub mod budget;
22pub mod engine;
23pub mod instructions;
24pub mod profile;
25mod signals;
26pub mod task;
27pub mod testing;
28
29pub use budget::{Budget, BudgetBound, BudgetTracker};
30pub use engine::{
31    RecordPolicy, TASK_LABEL, TURN_LABEL, TaskCall, TaskEngine, TaskEngineBuilder, TaskFailure,
32    TaskOutcome, TaskScope,
33};
34pub use profile::{Disagreement, ProfileChange, ProfileChanges, TaskProfile, TaskProfiles};
35pub use task::{ModelTask, StructuralError, TaskId, TaskKind};