phoxal_api/lib.rs
1//! The framework-owned wire-contract catalogue: every payload that crosses a
2//! Phoxal process boundary and the semantic endpoint that carries it, grouped
3//! into families.
4//!
5//! Payload structs, enums, implementations, and tests are ordinary Rust items
6//! in family-first modules. A sibling [`phoxal_api_fragment!`] declares only
7//! that module's endpoints. Payloads own serde shape, construction invariants,
8//! and domain behavior; they do not know their topic or delivery policy.
9//! [`phoxal_api_tree!`] materializes deterministic descriptors and typed topic
10//! builders, then re-exports the authored payloads through each family.
11//!
12//! A **family** is the first path segment of every fragment and the leading
13//! segment of every key it declares: it names a semantic contract namespace,
14//! not a revision. There are three:
15//!
16//! - [`robot`] - the robot domain a participant authors against. `phoxal::api`
17//! re-exports this family and only this one.
18//! - [`runtime`] - facts a running Phoxal process emits about itself: its log
19//! events, its bus and step telemetry, and the authoritative simulation
20//! clock. Any process publishes here; the family names no collector.
21//! - [`supervisor`] - the wire vocabulary a supervisor speaks. `phoxald`, the
22//! CLI's supervisor daemon, owns supervisor state and behavior; this crate
23//! owns only what an answer looks like.
24//!
25//! Compatibility is owned entirely by the framework train version each
26//! participant binary embeds, compared for exact equality, so no key,
27//! descriptor, or body carries a per-API version. The one exception is
28//! [`supervisor::connect`], the frozen bootstrap two binaries exchange before
29//! they know whether their trains agree.
30//!
31//! Endpoint semantics are fixed by the declaration: `State`, `Sample`, `Event`,
32//! `Stream`, `Setpoint`, or bounded query. Source identity, robot/capture time,
33//! ordered positions, loss, gaps, and terminal evidence remain bus metadata and
34//! never become generated fields in a domain payload.
35
36mod api;
37pub use api::generated::*;
38pub use phoxal_macros::{phoxal_api_fragment, phoxal_api_fragment_group, phoxal_api_tree};