Skip to main content

Module fleet_composition

Module fleet_composition 

Source
Expand description

Setup-time Fleet composition: a suggestion schema with no runtime authority.

Deliberately not re-exported from the crate root. Nothing consumes it yet — the UI lane that turns a proposal into a saved Fleet has not landed — and a crate-root export would advertise a public API that no call path reaches. Kept pub mod so the lane that wires it can address it by path (codewhale_workflow::fleet_composition::…) without a second review of the schema itself. Setup-time Fleet composition: a suggestion schema, and nothing else.

The same Reasoning Router service an operator attaches to a Fleet may later assist Fleet setup, by proposing which configured provider/model should take which role. That is a fundamentally different act from what the runtime router does, and this module exists to keep the two from ever being confused:

Runtime routerSetup-time composition
Inputone frozen worker routean explicit, redacted model pool + role list
Outputa reasoning tiera suggested provider/model per role
Authorityapplies immediatelynone — a human must review and save

Three properties make this safe to have in the tree at all:

  1. It is pure. No clock, no filesystem, no network, no config. It maps an input value to an output value.
  2. It cannot save or launch. There is no path from a crate::fleet_composition::FleetCompositionProposal to an crate::ExactFleet, a snapshot, or a spawn. Turning a proposal into a saved Fleet is a separate, explicit act that belongs to the saved-Fleet UI lane.
  3. It cannot invent a model. Every suggestion must name a model that is already in the operator’s explicitly configured pool; anything else is rejected, not silently substituted.

Every proposal is born crate::fleet_composition::RatificationState::Unratified and there is no method here that ratifies one. Ratification is a human act recorded elsewhere; this module can only ever describe a suggestion.

§The seam

Runtime must not call anything in this module, and nothing here reads a crate::FleetSnapshot or mutates a saved Fleet. If a future lane wires composition into a UI, the wiring belongs on the UI side of this boundary: parse → propose → show the human → human saves a Fleet file → the ordinary exact-Fleet path takes over from there.

Structs§

CompositionRole
A role the operator wants filled.
ConfiguredModel
One entry in the operator’s explicitly configured model pool.
FleetCompositionProposal
A composition proposal: suggestions plus the fact that nobody has agreed.
FleetCompositionRequest
The complete, explicit input to a composition request.
RoleSuggestion
One suggested role → provider/model assignment.

Enums§

CompositionError
RatificationState
Whether a proposal has been reviewed and accepted by a human.

Constants§

COMPOSITION_ADVISORY
The advisory every proposal carries.