1# @ajax/mesh-fleet-doc
23The fleet's desired state (`mfd_doc`): the programs that should be loaded (catalog dir, image hash, run
4state, reset generation, the previous image for a rollback, the scheduling needs, the scheduler's
5placement, a migration in flight, the operator's pin, why it is where it is), the lockstep groups
6(program, ordered members, epoch, cycle, state, on-loss policy), the placement requests and the
7scheduler's switches (paused, autoreform, cordon). `mfd_encode` / `mfd_decode` are the Rust's text
8document, one line per item, byte for byte; the leader sends it whole.
910Programs and placement requests are kept sorted by name (the Rust's `BTreeMap` order); groups keep
11their order.
1213## Ported from
1415[alpha-rust-mesh](https://github.com/rsafier/alpha-rust-mesh) `crates/mesh-host/src/fleet.rs`:
16`ProgSpec` (`here`), `CycleOp`, `GroupState`, `OnLoss`, `Group` (`mask`, `rank`, `order`), `Doc`
17(`id`, `group_of`, `encode`, `decode`), `can_run`.
1819## Tests
2021`tests/doc.c`: the document part of the Rust's `document_round_trips` (with every scheduler field),
22the exact text, decode errors in the Rust's words and order, ranks, `here`, `can_run`.
2324## Licence
2526MIT. See the repository's LICENSE.