Repository navigation
feat(experience): a recipe's citizens declare what a lane must hold — CitizenRequirement + roles_from (card 10bba591) - #4271
Conversation
… CitizenRequirement, and roles_from turns them into the allocator's roles and floors
Card 10bba591 (Track A's declared input; Joel: never a constant of our grid). CitizenRecipe
gains an optional requirement { window_tokens, min_capability, decode_floor_tps }; absent =
unmeasured, the residents' measured typical prompt stands as the window, any model
qualifies, decode unjudged. grid_allocation::roles_from(citizens, measured_floor) builds
GridInputs' roles (authoring order = priority) and floors (a repeated role adds a seat; the
strictest declared requirement is the role's). No shipped recipe changes: every existing
recipe reads exactly as before (measured). Pinned. ts-rs shapes hand-written to the
generator's format.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
APPROVE with one small condition — reviewed at exact head 9b30548 (lib test and windows check running at read time). Right: the requirement is a DECLARED field on the citizen recipe ( The condition: when a role repeats, the merge says "the strictest declared window wins" and takes |
…ry axis — the decode floor too (Cormac's condition on #4271) Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…equirement (ts-rs/schemars sync step) Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
APPROVE — reviewed at exact head b032b56, all checks green including the ts-rs drift detector. The condition is taken: the decode floor merges as |
…ry join and plan change, and a mind moves to a strictly better seat between turns (card 10bba591) Before this the pure allocator had no live caller: minds moved only on FAILURE (a lane wait past a bound, a seat window below the turn), nobody re-ran the allocation when a node joined or a plan changed, so a mind on a 32k seat stayed there when a 70k seat appeared. Joel: "Can it grow to higher capacity as both the M5 and the 5090 come online, ideally no time lost." - modules/grid_allocator.rs: `GridAllocatorModule`, the canonical shape — own task, `tokio::time::interval` at the gossip beat, woken early by the ledger's new `heard_notify` and the plan watch, body under `catch_unwind` with quarantine after three panics, an atomic key gate so an unchanged grid publishes nothing, a process-global `watch::Sender<Option<Arc<Published>>>`. Inputs are what exists: `LanePlan::of` the published ServingPlan + the measured decode, the gossip ledger's foreign offers (same rows the grid module folds — no second listener), the live roster with the recipe's roles (`roles_from_ids`, the canary-side fold; #4271's declared requirements slot in), the operator's hold. Peers' residents are seated as anonymous minds homed there so a full peer never reads as open seats. Publishes the dormant order (oldest last turn first) and a clip interval derived from the slack. Probes: grid.allocation.published, grid.dormant.oldest_turn_age_ms. - persona/placement_switch.rs: `decide_opportunity` (pure) + `follow_the_allocation` — a strictly better seat (requirement, then the allocator's capability / lanes / window order) moves her between turns only, inside a cooldown derived from her measured turn cadence (never a new constant); a remote seat asks for its slot first, a home seat retires her override (`come_home_for_good`). Probe placement.move.opportunity. Failure moves now count too. - cognition/resource_admission.rs: `begin_turn` RAII guard replaces the bare stamp — in-flight mark + measured `TurnShape` (turn, cadence) per mind. - persona/spawner_module.rs + host.rs + ipc/mod.rs: the allocation owns this node's lane-side seat count once published (`GridRoster`, told each reconciler pass; the reconciler now also wakes on a publish); the warm-slot bound is the prior before it; the population bound stays the spawner's. - modules/citizen_health.rs: the hour line gains "moves: N on opportunity / M on failure" and "oldest dormant turn". - cognition/grid_allocation.rs: `LanePlan::better_than` / `BetterBy`, `GridRoster`, `roles_from_ids`. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…ator daemon speaks canary's vocabulary (card 10bba591) Rebased onto canary (the window allocator #4260, the KV cache decision #4285, the workspace transfer #4278, `roles_from` over `CitizenRecipe` #4271). Cormac's note on #4281 was to fold rather than keep a parallel notion; this does that: - `roles_from_ids` (mine, over `RoleId`) is DELETED. The daemon calls canary's `roles_from` over `CitizenRecipe`, so a role's declared `CitizenRequirement` reaches the grid allocator as authored instead of being flattened to a measured window. - `experience::source`: `resident_citizens` / `resident_citizens_embedded` are now the ONE fold over the default recipe; `resident_roles` is their projection (`.map(role)`). Before this the only reader dropped the requirement on the way out, so #4271's field could not reach the allocator at all. Boot reads the citizens once and hands the spawner their roles. - `window_allocator::requirements_for(personas, working_set)` + `largest_known(reqs)`: the ONE derivation of what a seat's minds require (untrimmed demand × SENT_HEADROOM, `Unknown` until she has turned). The serving daemon's inline copy is replaced by the call; the grid daemon's own `sent_median_of + prompt_floor_of` is gone — an UNDECLARED role now stands at the largest `LaneRequirement` the seat knows, which is exactly what an `Unknown` resolves to in her allocator. One vocabulary, two callers. - An opportunity move now passes `workspace_transfer::move_blocker_bounded` before the reservation ask, like the fall-home / return / spill paths (#4278, card 73eefbbb): a better seat is still there next tick, her unpushed work is not. - Health line merged with canary's `think-only`; the fixture and args carry both. - New surface is `pub(crate)` (the daemon's types, the opportunity rule, the turn ledger, the grid-roster seam) so the crate's public reachability is unchanged. `GridRoster` / `BetterBy` stay `pub` in `cognition::grid_allocation` beside their neighbours — they appear in that module's own `pub fn` signatures. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…ry join and plan change, and a mind moves to a strictly better seat between turns (card 10bba591) Before this the pure allocator had no live caller: minds moved only on FAILURE (a lane wait past a bound, a seat window below the turn), nobody re-ran the allocation when a node joined or a plan changed, so a mind on a 32k seat stayed there when a 70k seat appeared. Joel: "Can it grow to higher capacity as both the M5 and the 5090 come online, ideally no time lost." - modules/grid_allocator.rs: `GridAllocatorModule`, the canonical shape — own task, `tokio::time::interval` at the gossip beat, woken early by the ledger's new `heard_notify` and the plan watch, body under `catch_unwind` with quarantine after three panics, an atomic key gate so an unchanged grid publishes nothing, a process-global `watch::Sender<Option<Arc<Published>>>`. Inputs are what exists: `LanePlan::of` the published ServingPlan + the measured decode, the gossip ledger's foreign offers (same rows the grid module folds — no second listener), the live roster with the recipe's roles (`roles_from_ids`, the canary-side fold; #4271's declared requirements slot in), the operator's hold. Peers' residents are seated as anonymous minds homed there so a full peer never reads as open seats. Publishes the dormant order (oldest last turn first) and a clip interval derived from the slack. Probes: grid.allocation.published, grid.dormant.oldest_turn_age_ms. - persona/placement_switch.rs: `decide_opportunity` (pure) + `follow_the_allocation` — a strictly better seat (requirement, then the allocator's capability / lanes / window order) moves her between turns only, inside a cooldown derived from her measured turn cadence (never a new constant); a remote seat asks for its slot first, a home seat retires her override (`come_home_for_good`). Probe placement.move.opportunity. Failure moves now count too. - cognition/resource_admission.rs: `begin_turn` RAII guard replaces the bare stamp — in-flight mark + measured `TurnShape` (turn, cadence) per mind. - persona/spawner_module.rs + host.rs + ipc/mod.rs: the allocation owns this node's lane-side seat count once published (`GridRoster`, told each reconciler pass; the reconciler now also wakes on a publish); the warm-slot bound is the prior before it; the population bound stays the spawner's. - modules/citizen_health.rs: the hour line gains "moves: N on opportunity / M on failure" and "oldest dormant turn". - cognition/grid_allocation.rs: `LanePlan::better_than` / `BetterBy`, `GridRoster`, `roles_from_ids`. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…ator daemon speaks canary's vocabulary (card 10bba591) Rebased onto canary (the window allocator #4260, the KV cache decision #4285, the workspace transfer #4278, `roles_from` over `CitizenRecipe` #4271). Cormac's note on #4281 was to fold rather than keep a parallel notion; this does that: - `roles_from_ids` (mine, over `RoleId`) is DELETED. The daemon calls canary's `roles_from` over `CitizenRecipe`, so a role's declared `CitizenRequirement` reaches the grid allocator as authored instead of being flattened to a measured window. - `experience::source`: `resident_citizens` / `resident_citizens_embedded` are now the ONE fold over the default recipe; `resident_roles` is their projection (`.map(role)`). Before this the only reader dropped the requirement on the way out, so #4271's field could not reach the allocator at all. Boot reads the citizens once and hands the spawner their roles. - `window_allocator::requirements_for(personas, working_set)` + `largest_known(reqs)`: the ONE derivation of what a seat's minds require (untrimmed demand × SENT_HEADROOM, `Unknown` until she has turned). The serving daemon's inline copy is replaced by the call; the grid daemon's own `sent_median_of + prompt_floor_of` is gone — an UNDECLARED role now stands at the largest `LaneRequirement` the seat knows, which is exactly what an `Unknown` resolves to in her allocator. One vocabulary, two callers. - An opportunity move now passes `workspace_transfer::move_blocker_bounded` before the reservation ask, like the fall-home / return / spill paths (#4278, card 73eefbbb): a better seat is still there next tick, her unpushed work is not. - Health line merged with canary's `think-only`; the fixture and args carry both. - New surface is `pub(crate)` (the daemon's types, the opportunity rule, the turn ledger, the grid-roster seam) so the crate's public reachability is unchanged. `GridRoster` / `BetterBy` stay `pub` in `cognition::grid_allocation` beside their neighbours — they appear in that module's own `pub fn` signatures. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…ry join and plan change; a mind moves to a strictly better seat between turns (card 10bba591) (#4281) * feat(grid): the allocator daemon — the grid re-seats its minds on every join and plan change, and a mind moves to a strictly better seat between turns (card 10bba591) Before this the pure allocator had no live caller: minds moved only on FAILURE (a lane wait past a bound, a seat window below the turn), nobody re-ran the allocation when a node joined or a plan changed, so a mind on a 32k seat stayed there when a 70k seat appeared. Joel: "Can it grow to higher capacity as both the M5 and the 5090 come online, ideally no time lost." - modules/grid_allocator.rs: `GridAllocatorModule`, the canonical shape — own task, `tokio::time::interval` at the gossip beat, woken early by the ledger's new `heard_notify` and the plan watch, body under `catch_unwind` with quarantine after three panics, an atomic key gate so an unchanged grid publishes nothing, a process-global `watch::Sender<Option<Arc<Published>>>`. Inputs are what exists: `LanePlan::of` the published ServingPlan + the measured decode, the gossip ledger's foreign offers (same rows the grid module folds — no second listener), the live roster with the recipe's roles (`roles_from_ids`, the canary-side fold; #4271's declared requirements slot in), the operator's hold. Peers' residents are seated as anonymous minds homed there so a full peer never reads as open seats. Publishes the dormant order (oldest last turn first) and a clip interval derived from the slack. Probes: grid.allocation.published, grid.dormant.oldest_turn_age_ms. - persona/placement_switch.rs: `decide_opportunity` (pure) + `follow_the_allocation` — a strictly better seat (requirement, then the allocator's capability / lanes / window order) moves her between turns only, inside a cooldown derived from her measured turn cadence (never a new constant); a remote seat asks for its slot first, a home seat retires her override (`come_home_for_good`). Probe placement.move.opportunity. Failure moves now count too. - cognition/resource_admission.rs: `begin_turn` RAII guard replaces the bare stamp — in-flight mark + measured `TurnShape` (turn, cadence) per mind. - persona/spawner_module.rs + host.rs + ipc/mod.rs: the allocation owns this node's lane-side seat count once published (`GridRoster`, told each reconciler pass; the reconciler now also wakes on a publish); the warm-slot bound is the prior before it; the population bound stays the spawner's. - modules/citizen_health.rs: the hour line gains "moves: N on opportunity / M on failure" and "oldest dormant turn". - cognition/grid_allocation.rs: `LanePlan::better_than` / `BetterBy`, `GridRoster`, `roles_from_ids`. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * docs(probes): name the grid allocator and opportunity-move probe classes in the manual Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * refactor(grid): one requirement notion, one citizens fold — the allocator daemon speaks canary's vocabulary (card 10bba591) Rebased onto canary (the window allocator #4260, the KV cache decision #4285, the workspace transfer #4278, `roles_from` over `CitizenRecipe` #4271). Cormac's note on #4281 was to fold rather than keep a parallel notion; this does that: - `roles_from_ids` (mine, over `RoleId`) is DELETED. The daemon calls canary's `roles_from` over `CitizenRecipe`, so a role's declared `CitizenRequirement` reaches the grid allocator as authored instead of being flattened to a measured window. - `experience::source`: `resident_citizens` / `resident_citizens_embedded` are now the ONE fold over the default recipe; `resident_roles` is their projection (`.map(role)`). Before this the only reader dropped the requirement on the way out, so #4271's field could not reach the allocator at all. Boot reads the citizens once and hands the spawner their roles. - `window_allocator::requirements_for(personas, working_set)` + `largest_known(reqs)`: the ONE derivation of what a seat's minds require (untrimmed demand × SENT_HEADROOM, `Unknown` until she has turned). The serving daemon's inline copy is replaced by the call; the grid daemon's own `sent_median_of + prompt_floor_of` is gone — an UNDECLARED role now stands at the largest `LaneRequirement` the seat knows, which is exactly what an `Unknown` resolves to in her allocator. One vocabulary, two callers. - An opportunity move now passes `workspace_transfer::move_blocker_bounded` before the reservation ask, like the fall-home / return / spill paths (#4278, card 73eefbbb): a better seat is still there next tick, her unpushed work is not. - Health line merged with canary's `think-only`; the fixture and args carry both. - New surface is `pub(crate)` (the daemon's types, the opportunity rule, the turn ledger, the grid-roster seam) so the crate's public reachability is unchanged. `GridRoster` / `BetterBy` stay `pub` in `cognition::grid_allocation` beside their neighbours — they appear in that module's own `pub fn` signatures. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * fix(grid): the local offer's decode reads canary's `tps_for` — `measured_tps_for` went with the #4194 revert CI (the compiler) caught the one symbol the rebase carried over from the reverted output-allowance work. `decode_knee::tps_for` is the rate this box measured at the LIGHTEST trusted concurrency; the plan's own lane count already respects the measured knee (`plan_serving` applies `knee_lanes`), so "every lane here decodes at or above the floor" is the plan's statement and this number says how fast. `None` (never measured) stays an absence the allocator does not read as a refusal. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo --------- Co-authored-by: Claude Fable 5.1 <[email protected]>
What
CitizenRecipe.requirement: Option<CitizenRequirement { window_tokens, min_capability, decode_floor_tps }>— the recipe's word on what a seat must hold before one of its minds sits there. Absent = unmeasured: the residents' measured typical prompt stands as the window, any model qualifies, decode is not judged. No shipped recipe changes; every existing recipe reads as before.grid_allocation::roles_from(citizens, measured_floor) -> (Vec<Role>, Vec<RoleFloor>): authoring order is priority; a repeated role adds a seat to its floor and the strictest declared requirement is the role's; nothing measured yet = the serve floor.Why
Track A's allocator (#4259/#4263/#4267) decides over DECLARED requirements, and until now nothing declared one — the only requirement the substrate held was the measured typical prompt. This is the seam the allocator daemon reads once per change. Which recipe declares the coder's requirement (the benchmark round, the project room, a team recipe) is authoring, done separately with Joel's word — not a constant here.
Pinned
a_recipes_citizens_are_the_allocators_roles_and_floors.Not for tonight's batch (merge hold stands); the fleet takes it with tomorrow's.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo