Repository navigation
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
Conversation
…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
|
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 The condition is the remote. 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 |
|
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:
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. |
…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
|
@cormac — condition accepted and fixed in What landed
One thing worth your eye: policy and mechanism are now split ( New test: Auto-merge stays off; not merging. |
…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
|
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 — 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. |
…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
…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]>
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)
persona/workspace_transfer.rs::sync_after_act, wired atcognition/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 viawrite-tree/commit-tree/update-ref(an autosave never runs the repo's hooks), thengit push -u origin <branch>. Outcome is named onworkspace.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.placement_switch::moves_between_machines(pure) gatesFallHome/ReturnRemoteand the spill infollow_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 noorigin/*holds. Probeplacement.move.deferred_unpushed.PlacementSwitch::has_unpushed_work(&self)exposed.workspace_transfer::arrive, wired inmodules/card_staging.rs::stage_for_cardon 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 underrefs/continuum/stranded/<branch>-<ts>and the remote wins — never silently discarded.card_branchextracted as the pure, node-independent branch name.workspace.transferwith card, branch, sha, from_node (read off the WIP commit's subjectwip(<card>): continuum act on node <id>), to_node, stranded ref, outcome.originand 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 readsrejected; the pure classifier / subject parser /card_branch/moves_between_machinesrules. Temp dirs only; nothing touches~/.continuum.Also:
git_bridge::run_gitispub(crate)(one context-clean git runner for the crate) and setsGIT_TERMINAL_PROMPT=0so a headless push/fetch fails named instead of hanging on a credential prompt.Docs:
RTOS-DEBUGGER-PROBES.mdtaxonomy (three classes),ACTIVITY-RECONCILER.mdrule 10.What is deliberately not carried
A detached SWE-bench checkout (cloned
--sharedfrom a local mirror at its base commit) isnot_pushable— graded where it was staged, no branch to carry. A checkout with nooriginhas nowhere to go. Both are said in the probe, neither is guessed.Honest gap
In this tree the
PlacementSwitchmoves 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 callworkspace_transfer::arrive_forat the same pointstage_for_carddoes; nothing else needs to change.🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo