Expand description
Shared application state for the HTTP control plane.
AppState is Clone-able (all inner handles are Arc/optional) and is
threaded through axum handlers via with_state. The in-memory registry
is a projection cache over JetStream — it is intentionally not the
source of truth (CHATROOM.md Session 16). On startup a future version
will replay cellos.events.> to rebuild this map; for now it is
populated by writes from POST /v1/formations.
Structs§
- AppState
- Cell
Record - Projected view of an execution cell. Fields are kept minimal — the
authoritative cell state is in JetStream; this is just a cache for
GET /v1/cellslist latency. - Formation
Record - Projected view of a formation. The full submitted document is retained so GET /v1/formations/{id} can echo the original spec — clients build their own state machines from this plus the WebSocket event stream.
Enums§
- Apply
Outcome - Whether
apply_event_payloadchanged the projection. Distinguishing the two lets the replay path log meaningful “applied vs skipped” counts and lets tests assert that unknown events are tolerated. - Formation
Status - Lifecycle status of a formation. Mirrors the projector’s state machine
(CHATROOM Session 16 §state-machine-table). Only
PENDINGis emitted directly on POST; all other transitions are driven by CloudEvents observed on JetStream.
Type Aliases§
- ApiToken
- Required bearer token, validated against
Authorization: Bearer <token>. WhenNonethe server refuses to start (seemain.rs).