flybrain/services/flysim/crates/fly-session/src/lib.rs
dev 4effc6020c session: the publication boundary, observer isolation and the repair path
publishing-v1 over the same bus: a declared delivery policy per topic, named
publication outcomes, the bounded event batch, application-owned state and cues,
a read-only descriptor query service and a fake multi-agent consumer.

The session publishes the contract types rather than an ad-hoc payload, so a
descriptor says what the workers attested to and a snapshot is checked against it
before it is published and again when it is read: every frame comes from the
boundary its declared delay implies, every handle is the artifact its reference
names, and an observer's refusal takes no world step and fences no epoch.

AgentInitializeResult gains graph (datasetDigest, indexDigest, neuronCount,
rateRoles, supportedStimuli), without which no AgentDescriptor field in
publishing-v1 section 3 had a source. Dated amendments to workers-v1 section 2,
publishing-v1 section 2 and state-media-v1 section 3.
2026-09-22 17:41:07 +00:00

50 lines
1.9 KiB
Rust

//! `fly-session`: the lockstep session coordinator and a synthetic composition over Flybus.
//!
//! This crate is the SESSION-01 slice of the session-framework implementation guide: the
//! sequential transaction of [`step-v1`], driven over the [`flybus`] router, with small fake
//! workers standing in for a brain and an emulator.
//!
//! ```text
//! Coordinator ── Agent.Prepare ──> agent workers (fake model + fixed readout stub)
//! ── Environment.Advance ──> environment (a counter arena, no emulator)
//! ── task.evaluate_transition (once)
//! ── Agent.Commit ──> agent workers
//! ── committed snapshot ──> session.<id>.snapshots
//! ```
//!
//! Every arrow is a Flybus RPC to an incarnation-pinned service, with domain request ids and
//! the result caches of `ipc-v1` section 5 in front of every mutation. Nothing here contains a
//! public controller API, an implicit best-effort retry, a real emulator or a real brain.
//!
//! The domain types come from the CONTRACT-01 crate [`fly_session_types`]; [`types`] is a
//! facade over it plus the few session-side additions a coordinator needs.
//!
//! [`step-v1`]: https://example.invalid/step-v1
pub mod agent;
pub mod cli;
pub mod clock;
pub mod coordinator;
pub mod dedup;
pub mod environment;
pub mod harness;
pub mod launcher;
pub mod measure;
pub mod media;
pub mod metrics;
pub mod phase;
pub mod publish;
pub mod rpc;
pub mod task;
pub mod worker;
// CONTRACT-01 owns the domain types; `types` is a facade over its crate plus the few
// session-side additions a coordinator needs.
pub mod types;
pub use fly_session_types;
pub use coordinator::{
Coordinator, Deadlines, DispatchOrder, Injections, ResolutionEnd, SessionFailure, StepReport,
};
pub use launcher::{ExecutionMode, Launcher, ReapOutcome, ThreadBudget, Via};
pub use phase::{Phase, PhaseMachine};