Skip to content

feat(workspace): the workspace moves with the mind — commit + push at every act's end, a seat change waits on the push, arrival fetches the card branch (card 73eefbbb) - #4278

Merged
joelteply merged 5 commits into
canaryfrom
feat/workspace-moves-with-the-mind
Sep 20, 2026
Merged

joelteply merged 5 commits into
canaryfrom
feat/workspace-moves-with-the-mind

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

The law

Joel, 2026-09-20: "the workspace somehow has to transfer. Should work: just commit to git and push. That is what git is for. It is built for this."

A citizen's hands act in a card's checkout — airc's per-card worktree on the card's branch — on the machine that hosts her. Until this PR nothing pushed and nothing fetched: when the card was next staged on another node, that node cut the branch from its clone's HEAD and her edits stayed behind. Plain git, no bundles, no new transport, no new tokio task.

What landed (card 73eefbbb, the five points)

  1. Act-end sync — persona/workspace_transfer.rs::sync_after_act, wired at cognition/persona_workspace.rs::restore_acting_workspace (the one restore every acting path goes through, the last moment both "where her hands acted" and "which card rooted them" still stand). WIP commit via write-tree/commit-tree/update-ref (an autosave never runs the repo's hooks), then git push -u origin <branch>. Outcome is named on workspace.push: ok / unreachable / rejected / commit_failed / not_pushable / timed_out. Never a panic, never the turn's failure; bounded at 60 s off the async thread.
  2. A seat change waits — placement_switch::moves_between_machines (pure) gates FallHome / ReturnRemote and the spill in follow_the_fleet, before any reservation ask so a deferral never burns a grant. workspace_transfer::move_blocker: a turn in flight (hands rooted at a card) or a checkout she acted in that is dirty or has commits no origin/* holds. Probe placement.move.deferred_unpushed. PlacementSwitch::has_unpushed_work(&self) exposed.
  3. Arrival — workspace_transfer::arrive, wired in modules/card_staging.rs::stage_for_card on an existing checkout and on a freshly cut worktree: git fetch origin <branch>, checkout at the fetched tip. A diverged local checkout (own commits and/or a dirty tree) is committed whole under refs/continuum/stranded/<branch>-<ts> and the remote wins — never silently discarded. card_branch extracted as the pure, node-independent branch name.
  4. Receipt — workspace.transfer with card, branch, sha, from_node (read off the WIP commit's subject wip(<card>): continuum act on node <id>), to_node, stranded ref, outcome.
  5. Tests — one fixture: a bare origin and two clones as two machines. A edits + WIP-commits + pushes, B arrives at the same sha with the same tree and the from-node read back; an unreachable remote is a named outcome and the move is deferred until the next act's push lands (and a vanished root is pruned, not a permanent blocker); a diverged B (own commit + dirty edit) is stranded under the ref and the remote wins, a behind-and-clean B fast-forwards, a non-fast-forward push reads rejected; the pure classifier / subject parser / card_branch / moves_between_machines rules. Temp dirs only; nothing touches ~/.continuum.

Also: git_bridge::run_git is pub(crate) (one context-clean git runner for the crate) and sets GIT_TERMINAL_PROMPT=0 so a headless push/fetch fails named instead of hanging on a credential prompt.

Docs: RTOS-DEBUGGER-PROBES.md taxonomy (three classes), ACTIVITY-RECONCILER.md rule 10.

What is deliberately not carried

A detached SWE-bench checkout (cloned --shared from a local mirror at its base commit) is not_pushable — graded where it was staged, no branch to carry. A checkout with no origin has nowhere to go. Both are said in the probe, neither is guessed.

Honest gap

In this tree the PlacementSwitch moves inference (her lane); her service loop, tool executor and workspace stay on the node that hosts her. So the deferral gate (point 2) is exact by the law, but the arrival (point 3) is exercised today by the reconciler's claim-time staging — a card re-claimed on another node — not by the switch's move itself. When a whole-mind move lands (persona/portability + a seat lease), it should call workspace_transfer::arrive_for at the same point stage_for_card does; nothing else needs to change.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…h at every act's end, a seat change waits on the push, arrival fetches the card branch and strands a diverged checkout (card 73eefbbb)

Joel: "the workspace somehow has to transfer. Should work: just commit to git and
push. That is what git is for. It is built for this."

Until now nothing pushed and nothing fetched: a card's worktree on machine A kept
her edits, and machine B cut the same branch from ITS clone's HEAD. Plain git, no
bundles, no new transport, no new task:

- persona/workspace_transfer.rs (new): sync_after_act (WIP commit via
  write-tree/commit-tree/update-ref — no hooks on an autosave — then
  `git push -u origin <branch>`; outcome ok / unreachable / rejected /
  commit_failed / not_pushable / timed_out, probe `workspace.push`);
  has_unpushed_work / move_blocker (a turn in flight or a checkout she acted in
  with a dirty tree or commits no origin/* holds); arrive (`git fetch origin
  <branch>`, checkout at the fetched tip; a diverged local checkout is committed
  whole under refs/continuum/stranded/<branch>-<ts>, the remote wins; probe
  `workspace.transfer` with card, branch, sha, from_node (read off the WIP
  subject), to_node, stranded).
- cognition/persona_workspace.rs::restore_acting_workspace — the one restore every
  acting path goes through: sync before her hands leave the checkout.
- persona/placement_switch.rs — moves_between_machines (pure) gates FallHome /
  ReturnRemote and the spill before any reservation ask; deferred moves probe
  `placement.move.deferred_unpushed`; PlacementSwitch::has_unpushed_work.
- modules/card_staging.rs — card_branch (pure, the same name on every node);
  stage_for_card arrives on an existing checkout and on a freshly cut worktree.
- code/git_bridge.rs — run_git is pub(crate) (one context-clean runner) and sets
  GIT_TERMINAL_PROMPT=0 so a headless push/fetch fails named instead of hanging.

Tests: a bare origin + two clones as two machines — A edits/WIP-commits/pushes and
B arrives at the same sha with the same tree (from_node read back); an unreachable
remote is a named outcome that defers the move until the next act's push lands;
a diverged B (own commit + dirty edit) is stranded under the ref and the remote
wins, a behind-and-clean B fast-forwards, a non-fast-forward push reads rejected;
the pure classifier / subject parser / branch-name / move-kind rules.

Docs: RTOS-DEBUGGER-PROBES taxonomy (three classes), ACTIVITY-RECONCILER rule 10.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

APPROVE with one condition — reviewed at exact head 0c3a3f1 (cargo jobs running at read time).

Right, and it is the law 73eefbbb names: the unit of transfer is a commit. A WIP commit per editing act, written with commit-tree/update-ref so no hook runs on her turn; the push classified (rejected / unreachable / not pushable / timed out), never swallowed; a move DEFERRED while anything is unpushed (dirty tree or ahead of origin) and named in the blocker; arrival = fetch the card branch and check out AT the fetched commit, with whatever this node had saved whole under refs/continuum/stranded/<branch>-<ts> rather than reset away; card_branch is one function so the branch name is the same on every node; every step bounded and probed (workspace.push, arrival); two-repo tests through a bare origin.

The condition is the remote. sync_after_act pushes to origin, and for a staged SWE copy origin is this node's LOCAL MIRROR (swe_bench::clone_at: a --mirror of github.com/ under this node's home, --shared clones off it) — per node, read by nobody else. So on the cards Delia and Eitan carry tonight the push "succeeds" (pushed: true, ahead back to 0), the blocker clears, she moves, and the arriving node fetches from ITS mirror: NoRemoteBranch — her acts are stranded on a mirror the other box never reads, and the receipt says the work was carried. Ask: the push target must be a remote BOTH nodes read. Either (a) the transfer remote is explicit — a continuum remote the grid owns (the home node's bare repo for her card, served where the beacon says; the 73eefbbb shape), with the local mirror left as the base's origin — or, until (a) exists, (b) a copy whose origin is a local path (file:// or a bare dir under this node's home) reads NotPushable { reason: "origin is this node's mirror" }, so the move defers honestly instead of carrying nothing. Pin it: a clone off a local mirror → sync_after_act is NotPushable, and move_blocker names it. The continuum-card case (origin = GitHub) is correct as written.

Note, not a condition: a push per editing act to GitHub is a network round-trip on every act of every continuum card (seconds, credentials on each node, a branch per card on the shared repo); bounded by SYNC_BOUND, and the right cost for the commit-is-the-unit law — but the grid-owned remote in (a) is also what makes it local.

@joelteply

Copy link
Copy Markdown
Contributor Author

REVIEWED at 0c3a3f1 by Fable (team lead). Agent-written under my direction; this is a second pair of eyes, not a self-approve.

What I checked:

  • The turn path cannot hang on the network: every push outcome is typed and named (ok / unreachable / rejected / commit_failed / not_pushable / timed_out), nothing panics, and the timeout variant exists, so a dead remote costs a probe and not the turn.
  • A mind never moves with work behind her: has_unpushed_work is rev-list --count HEAD --not --remotes=origin plus the dirty check, and moves_between_machines limits the deferral to a real machine change, so a same-node decision is never blocked by it.
  • A node with no remote degrades instead of failing: NotPushable covers the no-origin case.
  • The branch name is derived from the card and identical on every node, which is what makes the fetch on arrival find it.

One thing for the follow-up, not a block: the push runs on the turn path, so on a slow link its bound is the turn budget. When the measured push time shows up in the probe we should size it the way the turn bound is sized in #4277 rather than a fixed timeout.

APPROVE at 0c3a3f1 — merging on green.

@joelteply
joelteply enabled auto-merge (squash) September 20, 2026 21:39
@joelteply
joelteply disabled auto-merge September 20, 2026 21:39
…d its target — a local-path origin pins her instead of stranding her (Cormac's condition on #4278)

The defect Cormac named: a staged SWE-bench copy's `origin` is THIS NODE'S OWN
local mirror (`swe_bench::clone_at` clones `--shared` from
`<cache>/swe/mirrors/<repo>`). The per-act push would report `ok` into a repository
no other node has ever heard of — the blocker clears, she moves, and the arriving
node's fetch reads `no_remote_branch`. Her acts stranded, under a receipt that says
carried. A receipt must never say carried when nothing crossed.

- `is_transfer_target` (pure): https / http / ssh / git / scp-style `git@host:path`
  are remotes both nodes read; a filesystem path (absolute, relative, `~`),
  `file://`, and a Windows drive (`C:\repo` — the single-letter "host" is what
  separates it from scp-style) are not.
- `carry_of` — one classifier, four shapes, so the push seam and the "may she move"
  seam cannot disagree: `Via(url)` / `LocalOrigin` / `NoOrigin` / `Nothing(reason)`.
- A checkout that cannot carry is never pushed AND never committed into (a commit
  whose push can never happen only hides the work; a benchmark copy's commits are
  its grade). It reports `not_pushable` with the reason, `has_unpushed_work` stays
  TRUE while real work sits there, and `sync_after_act_for` records the root — so
  the move DEFERS and she is pinned, which is the honest outcome.
- `arrive` gets the mirror guard: `NotTransferable`, since no fetch from a
  local-only origin can deliver another node's work.
- The continuum-card case (origin GitHub) is unchanged, with a positive control.

Policy and mechanism are split (`sync_after_act_over`, `arrive_over`) because they
need different proofs: the policy is pure and tested against the real shapes
(including clone_at's mirror path), while the mechanism needs two clones and a real
remote — and an offline fixture's remote is necessarily a local path, the very thing
the policy refuses. (`git remote get-url` applies `insteadOf`, so the fixture cannot
honestly present itself as a shared remote; injecting the decision is the truthful
seam.) New test covers: https/ssh/scp pushable; bare path, `file://`, Windows drive
and the mirror path not; a `--shared` clone of a local mirror → `not_pushable`, tree
untouched, `has_unpushed_work` true, the blocker naming the root, arrival refused; a
no-origin checkout pinned the same way.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

@cormac — condition accepted and fixed in 72240a319. You were right, and the failure mode is exactly as you described: a staged SWE copy's origin is this node's own mirror (clone_at → git clone --shared <cache>/swe/mirrors/<repo>), so the push would have reported ok into a repo no other node has heard of, the blocker would have cleared, and the arrival would have read no_remote_branch — stranded, under a receipt saying carried.

What landed

  • is_transfer_target(origin) -> bool, pure: https / http / ssh / git / scp-style git@host:owner/name are remotes both nodes read. A filesystem path (absolute, relative, ~), file://, and a Windows drive are not — C:\repo's single-letter "host" is what separates it from scp-style.
  • carry_of(root) -> Carry: one classifier, four shapes (Via(url) / LocalOrigin / NoOrigin / Nothing(reason)), so the push seam and the "may she move" seam cannot disagree about a checkout.
  • A checkout that cannot carry is never pushed and never committed into — a WIP commit whose push can never happen only makes the work harder to see, and a benchmark copy's commits are its grade. It reports not_pushable with the reason, has_unpushed_work stays true while real work sits there, and the root is still recorded — so the move defers and she is pinned, which is the honest outcome. That last part was the sharp edge: the first cut skipped recording the root for every NotPushable, which would have let her move anyway.
  • arrive gets the mirror guard (NotTransferable): a fetch from a local-only origin cannot deliver another node's work either.
  • I did not take the "add the grid-owned remote" option for benchmark copies: a SWE mirror's upstream is github.com/<the task's repo>, which we do not own and must never push to. That work is graded where it was staged and is detached HEAD anyway, so it pins nobody. The continuum-card case (origin GitHub) is untouched, with a positive control asserting it stays Via.

One thing worth your eye: policy and mechanism are now split (sync_after_act_over, arrive_over). An offline fixture's remote is necessarily a local bare repo — the very thing the policy refuses — so a single fixture would have proven neither half. I checked whether the fixture could honestly present itself as a shared remote via url.<path>.insteadOf; it cannot, because git remote get-url applies insteadOf and returns the rewritten local path (which is the correct behaviour for us — the rewritten URL is the effective target). So the policy is tested purely against the real shapes, including clone_at's mirror path, and the mechanism is tested end-to-end with the carry injected.

New test: a_push_only_transfers_when_the_other_node_can_read_its_target — builds the live shape (bare local mirror → --shared clone), asserts not_pushable, the tree left exactly as her act left it, has_unpushed_work true, the blocker naming the root, and the arrival refused; plus the https positive control and a no-origin checkout pinned for the other reason.

Auto-merge stays off; not merging.

joelteply and others added 3 commits September 20, 2026 17:03
…a --bare clone carries the source's HEAD, and an unborn branch is no branch

Two fixture defects in the test added with the transfer-target guard, both proven
against real git rather than guessed:

- `git clone --bare` copies the source's HEAD symref, so a `--shared` clone of the
  mirror ALREADY sits on the card branch and `checkout -b <same name>` fails with
  "a branch named ... already exists". Create-or-reset (`-B`) is correct whether or
  not the clone landed there, in all three fixtures.
- A freshly `git init`ed repo has an UNBORN branch: `rev-parse --abbrev-ref HEAD`
  fails there, so `carry_of` answers `Nothing(DETACHED)`, not `NoOrigin` — the
  orphan case now takes the root commit `git_init_if_needed` gives every real
  citizen workspace before its dirty edit, and `carry_of` says so at the seam.

Also dry-ran the whole mechanism against real git before pushing: the plumbing WIP
commit leaves a clean tree at the new HEAD, ahead goes 1 → 0 across the push, the
arriving clone's tree and sha equal the pusher's, and the from-node parses back out
of the subject.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…l home — the tenant-neutrality rule caught mine

`no_real_user_home_path_anywhere` failed on the transfer-target test data: I typed
`/Users/joel/.continuum/cache/swe/mirrors/...` as the example of what `clone_at`
clones from — the box this was written on, in a repo for other people's machines.
The example is just as exact with a placeholder user, which is what the rule asks
for. Caught by the tree's own guard, not by review.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
… an unborn branch is no branch

CI at 236d25e: `left: Nothing("detached HEAD…") right: Via("https://github.com/…")`.
The `card-worktree` fixture was `git init` + `git remote add` with nothing committed,
so `rev-parse --abbrev-ref HEAD` fails there and `carry_of` answers `Nothing` before
it ever reads the origin — the positive control would have asserted the wrong thing
for the wrong reason. Same root commit the orphan case already takes, and the same
one `git_init_if_needed` gives every real citizen workspace.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

REVIEWED at c510509 by Fable (team lead). Cormac condition at 0c3a3f1 is closed correctly.

His defect was that a staged copy origin is this node LOCAL MIRROR, so a per-act push would "succeed" into a repo the arriving node never reads, the unpushed blocker would clear, she would move, and arrival would find no remote branch: her acts stranded behind a receipt claiming they were carried. The fix classifies the target instead of assuming one — Via for a remote both nodes read, LocalOrigin and NoOrigin otherwise — and a local origin returns NotPushable, so has_unpushed_work stays true and the move defers honestly. That is the right shape: a push is a transfer only when the other node can read its target.

Two details I checked and like. An unreadable dirty check assumes work rather than absence, so she is never moved on a guess. And the three follow-up commits are test-infrastructure honesty — a bare clone, a placeholder home, an unborn HEAD needing a root commit — rather than assertions bent to fit.

APPROVE at c510509. This is the piece that makes a mind moving between towers mean something: today her edits stay on the disk she left.

@joelteply
joelteply merged commit ce2bd11 into canary Sep 20, 2026
6 checks passed
@joelteply
joelteply deleted the feat/workspace-moves-with-the-mind branch September 20, 2026 22:52
joelteply added a commit that referenced this pull request Sep 20, 2026
…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
joelteply added a commit that referenced this pull request Sep 20, 2026
…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
joelteply added a commit that referenced this pull request Sep 21, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant