Expand description
§areev-run-core — the pure scheduler of areev run
Sans-IO by construction (governed-agents proposal §4): this crate cannot
observe the world. It exports step() — a pure function from
(plan, env, state, events) to (commands, state) — and the vocabulary
around it. The driver crate (areev-run) owns the store, the clock, the
executors, and the journal; it materializes journal lookups into
EventIns and performs Commands. Replay IS this function: feed the
journaled events back in and assert the same commands come out.
Purity is enforced mechanically, not aspirationally: the dependency tree
carries no clock/rand/net crate (CI checks cargo tree), and this
crate’s clippy.toml disallows SystemTime::now/Instant::now.
Scheduler state uses Vec/BTreeMap exclusively — hash-iteration order
is the classic silent replay-divergence source and has no business here.
Re-exports§
pub use error::BudgetAxis;pub use error::Result;pub use error::RunError;pub use plan::PlanEdge;pub use plan::PlanGraph;pub use state::DecideInFlight;pub use state::EdgeRes;pub use state::FoldInFlight;pub use state::NodeState;pub use state::PendingAsk;pub use state::Phase;pub use state::SchedulerState;pub use state::Spent;pub use step::bound_tool_content;pub use step::flow_key;pub use step::step;pub use step::DecideEnv;pub use step::StepEnv;pub use step::StepOutcome;pub use step::DEFAULT_MAX_EFFECTS_PER_ATTEMPT;pub use types::Ask;pub use types::Budgets;pub use types::Command;pub use types::DecisionRecord;pub use types::EdgeOutcome;pub use types::EffectKind;pub use types::EffectOutcome;pub use types::EventIn;pub use types::DynamicDispatch;pub use types::DynamicTool;pub use types::FailCause;pub use types::FoldRecord;pub use types::JournalKey;pub use types::LlmNodeConfig;pub use types::NodeExecutor;pub use types::OfferedTool;pub use types::RunOutcome;pub use types::DECIDE_TOOL;pub use types::DECIDE_URI;pub use types::INBOX;pub use types::PARKED_ASKS;
Modules§
- cond
- The frozen v1 condition grammar (governed-agents §6.4):
- error
- The
RUNerror domain (governed-agents §6.9). Codes are append-only from day one, same rule as every other domain (ERROR_CODES.md): never renumber, never reuse. The code is the leading token ofDisplay, andcode()returns it — both pinned by tests below and by the workspace uniqueness/format tests. - plan
- The validated plan graph — load-time validation V1–V6’s pure parts (governed-agents §6.1) over an OMS §8.4 Workflow grain, plus the derived structure the scheduler walks: indexed nodes and edges, adjacency in declaration order, and the Tarjan condensation V5 needs.
- state
SchedulerState— everything a checkpoint carries (§5.4). Rebuilt-from on resume with nothing inferred from wall-clock or environment; every collection is aVecorBTreeMapso iteration order is content order, never hash order (§4’s determinism rule).- step
- The sans-IO step function (governed-agents §4): apply the driver’s events, progress the BSP machine as far as pure reasoning allows, return the commands the driver must perform. Same plan + same env + same events in the same order ⇒ byte-identical state and commands — that is the property the DST harness and the three CI gates exercise.
- types
- The step-function protocol: journal keys, events in, commands out (governed-agents §5.1/§6). The driver owns every effect; this vocabulary is how the pure core describes what it wants done and learns what happened.
Constants§
- SCHEDULER_
EPOCH - The scheduler’s replay generation (#288).