Repository navigation
docs(architecture): HER-HANDS: a citizen's hands are hers: durable workspace, explicit context, separate authorization - #5004
Conversation
…s, and the plan to get there Joel, 2026-10-13: "the issues are systemic so fix the arch". Kimi held db0aa5b2 for ~17 h, designed the right fix, and submitted a one-line llama.cpp submodule pointer. Her branches are zero commits ahead. Five owners decide where her hands are (ensure_engine's cache, turn-scoped re-root, restore-home, home autosave, submit's own checkout lookup), with file:line on canary 323dc8f. The architecture: her hands are a projection of the board (Hands::of(caller)), resolved per call; the engine and shell are keyed by (caller, root); turn re-root and restore are deleted; rule 10's commit-to-card-branch is unconditional; submit derives from Hands and names what it captured; her ViewState shows her hands; presence carries the hosting build. Six slices with owners and receipts. Done means Kimi's real edit read back from the board on the 5090. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…uth, never steers Joel, 2026-10-13: "not a one agent solve … must not betray the principles of the main readme, first class citizenship … not controlled by some machine. She must have autonomy … a full peer, or standalone capable as any good agent." The first draft replaced five hidden hand-movers with a sixth (Hands::of picking her root from a focus card). This version deletes the steering instead. Her shell is persistent with a sticky cwd; file and git verbs resolve where she stands, within her own places; claiming gives her a worktree and says where it is; she commits, and nothing commits for her in secret; submit takes the path she names and shows what it captured; her view shows her hands; presence carries the build. The split is a team build with Kimi as an engineer on it (H4/H6 offered to her) and among its reviewers. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…xplicit context, separate authorization Astra's architecture review of #5004 at 45b9529, changes required, all incorporated: - Facts only: no recovered wall edit, the 343 B artifact is vendor-only, and whether she wrote the fix is unknown. - The shared owner is a durable caller-selected workspace plus an explicit per-operation/session context; the card is optional; authorization is separate; multiple sessions and cardless local projects are supported. - Critical source finding: eval drives the re-root on the living persona's global executor (persona_workspace.rs:1195-1227, "process-global and outlives the fork"). Eval and live callers move to distinct contexts BEFORE re-root/restore are deleted. - The persistent shell is its own capability, on the context. - Autosave and git_sync_from_shared's `-X theirs` merge (git_bridge.rs:287) are replaced together; local work is preserved with no remote or push. - Acceptance adds a standalone Mac project (no cloud, no agents), eval/live isolation, and restart preservation. - Ownership per the review; unassigned slices are open, with Kimi invited. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…, a live eval-restore harm, and the existing seams Read on canary 323dc8f. Eval and live collide because they share a caller id and every hands map is keyed by it. A default tool-bearing eval roots her at an ephemeral clone, restores only when workspace_root was given (eval.rs:2278), and deletes the clone on drop, which can leave her live hands at a deleted directory. Ctx.session_id already exists end to end but is never forwarded; four seams reach every code/* verb. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…tic fetch/merge, recommendations aren't assignments Astra approved the direction of #5004 at aaa56fc (shared context work can proceed). Before merge: - a restart restores the workspace, cwd and declared config, but not live processes or in-memory environment; her view names what ended; - a Continuum update never fetches or merges into her projects, even conflict-free; - only Astra's review assigns ownership; the rest are recommendations, open to anyone; - 'no reviewer could read at all' narrowed to 'no supported retrieval'. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…Codex's two guardrails for the context work Codex: Astra's review recommended responsibilities and didn't assign them; my acknowledgement is what makes context/artifacts accepted. The table now marks recommended vs accepted explicitly. Added the guardrails: durable workspace identity stays distinct from transient connection identity, and active operation handles survive a selection change. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…ontext, so an eval or a solve never moves her live hands (#5005) * feat(hands): a fork of a citizen acts with its own hands in its own context, so an eval or a solve never moves her live hands HER-HANDS (#5004), slice 1 of the shared-context work, direction approved by Astra. Card 669d5068. Before: every hands map (CodeState file_engines / shell_sessions / parked_shells, ACTING_ROOTS) was keyed by the caller alone, and an eval or solve fork cloned her live tool executor with the same identity. So the fork's create-workspace re-rooted HER (#312), eval's restore then moved her live hands home, and a default tool-bearing eval (an ephemeral clone, no workspace_root) was never restored at all and left her live hands at a deleted directory (eval.rs:2278/:2742/:1426 on canary 323dc8f). Now: - code::hands: HandsContext (an acting context) and HandsKey (caller + context) is the one key every hands map uses. The default context keeps the bare caller key, so live hands are unchanged. - CallerIdentity carries `hands`, bound by the kernel side (in_hands), never from params. It's a property of the connection, not a workspace id (Codex's guardrail), and authorization still reads the caller. - code_commands: hands_key(ctx); ensure_engine takes the key (layer, trust and card from the caller; maps by the key); engine!, ensure_shell, resolve_readable_path, shell/poll/kill, create-workspace and code/git all go through it. - ToolExecutor::hands_context / in_fresh_hands; CommandToolExecutor:: for_persona_in. A tool-bearing eval or solve fork gets its own hands (give_fork_its_own_hands). - ACTING_ROOTS keyed by (persona, context). acting_root_of / acting_card_of (her perception, receipts, transfer) read her live place only, and only a live move dirties her map. - A context ends with its hands: ContextRelease (dropped with the last clone of the fork's executor, on every exit path) sends code/release-hands, which kills what the context still runs and drops its engine and shells. The verb refuses a caller's default (live) hands. - eval's run_eval_restoring no longer restores her live hands (there's nothing of hers to put back), and restore_persona_workspace, now unused, is deleted. Tests: hands::each_context_of_a_caller_is_its_own_hands_and_the_default_keeps_the_caller; persona_workspace hands_isolation::a_forks_own_hands_never_move_her_live_hands_and_end_with_the_fork (real CodeModule: live at home, fork in an exam dir at once; live never sees the exam; dropping the fork releases its engine and leaves hers). The #312 restore test is kept (live work turns still restore). Not run here; IntelMac doesn't compile the core, so CI is the first build. Hygiene exit 0. Not in this slice (order per HER-HANDS): live turns on explicit contexts, deleting turn re-root and restore, the persistent shell, and preservation replacing autosave + -X theirs. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * fix(hands): code/release-hands registers its descriptor like every code verb CI on b346712 compiled clean; the only failure was ModuleRegistry refusing code/release-hands with no descriptor (registry.rs:158), which took down the hands_isolation tests that build the real CodeModule. Added crate::register_command!(CodeReleaseHands) beside CodeCreateWorkspace. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * fix(hands): Astra's six findings: every consumer reads its own context, contexts close awaited and confirmed, and nothing borrows her hands Astra's source review of b346712 (relayed by Codex, #5005 issuecomment-6138275812), all six: 1. code/run: held_root_for / held_env_python_for resolve through the acting context's place (acting_root_in), not caller_id/card_root_of. A context never rooted runs in scratch, never the live checkout. (For a live persona this also makes code/run use her rooted place, which its own comment already claimed.) 2. Every tool-bearing fork is rooted: eval's team reviewer at the writer's root, and replay at her live place (its documented intent; whether a replay should act on a copy is an open review question). ensure_engine now fails closed: an acting context with no workspace is refused, never handed her home layer. 3. act_observe: the receipt room and the disk fingerprint read THESE hands' context (acting_card_in / acting_root_in), so an eval never inherits her live card's room. 4. The hands_isolation tests run under the production GridTrustAuthPolicy, not AllowAll, so the release-hands authorization is proven for a local persona. 5. close_acting_context: release-hands through the context's own hands, awaited, its acting-root record removed, failures and unconfirmed kills returned. eval (writer + reviewer, before either return, while the exam dir exists), replay, and solve's teardown (restore_acting_workspace on a context now closes it) use it. Release kills what was RUNNING and waits on the execution's own task to see the child exit (new process_ended, set after the reap; polled at the task's kill cadence, now the named KILL_POLL, with no guessed timeout), then confirms each pid with the kernel's positive absence (engine_residency::probe_process). Drop remains the abnormal-exit fallback and now forgets the context's place too. 6. give_fork_its_own_hands fails closed: hands that can't open a context leave the fork with NO hands (and no hands-describing grounding), probed, never borrowing hers. Scope named: a kill ends the execution's direct child; the shell isn't spawned in its own process group, so compound commands' grandchildren can outlive it (code/shell-kill too). Carded as ea06701d. The scenario test now covers listing, Python execution, provenance, fail-closed unrooted contexts, a running operation killed and confirmed by the awaited close under the production policy, and the drop fallback. Not run here (CI is the first build); hygiene exit 0. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * fix(code): a context's hands are dropped only after every execution is proven ended; an unresolved release keeps its handles, its place and its world (Astra's review of #5005) - CodeState::release splits into begin_release (kill what runs, return every execution not proven ended, including killed-but-unreaped; remove nothing) and finish_release. - shell_session: one reap after the select; process_ended only on a successful wait, process_end_error when the wait itself fails. Never read as an exit. - code/release-hands waits each one out, treats process_end_error as unresolved, and drops the handles only when release_confirmed; it returns released and errors. - close_acting_context and the drop fallback parse the typed result and forget the place only on a confirmed release. - eval keeps its EphemeralEvalRoot (and its live-roots entry) when any close is unresolved. - replay roots and closes only when the cycle has hands; no workspace for a handless cycle. - Tests: killed-but-unreaped and running executions are both waited out and the shell is kept until finish_release; a retained eval world survives its run and the sweep. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * fix(eval): an eval world is kept until every fork's hands in it are confirmed ended, on every exit path including cancellation (Astra's re-review of #5005) - EvalWorld owns the disposable world together with every fork's hands that may act in it. The hands are held BEFORE they are rooted. Once any are held, the world is retained by default. - finish() closes each set of hands, awaited, and pops one only after its close returned; it deletes the world only when every close confirmed. - If the run is cancelled or returns early, Drop hands the remaining closes to an owned task that outlives the caller. With no runtime, or if that task is itself dropped, the world is kept. - close_acting_context returns ContextNotClosed with the unconfirmed pids, or None when the release couldn't report them. - A kept world is written with an unresolved-hands marker. The orphan sweep deletes it only once every recorded pid is positively absent. The claim that a restart ends such children is removed: nothing establishes that a child dies with its parent. - Tests: a cancelled eval keeps its world, the fork's engine and its place; once the owned cleanup confirms the kill, all three go. The sweep keeps a world whose recorded process is present and sweeps one whose process is gone. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
joelteply
left a comment
There was a problem hiding this comment.
PASS #5004 at 68ecd0b, Fable. Docs only; don't close it, it isn't redundant.
Claim verified: the mechanism it calls the worst harm is still live on today's canary. I read git_bridge.rs at origin/canary: the 'workspace: autosave persona work before shared sync' autocommit at :332, then merge -X theirs at :286-357, so on a conflict the shared side still silently wins over her work. The line anchors are pinned to 323dc8f and say so, which is honest for a proposal.
It's also directly relevant to what Joel saw today: residents not writing. On the M5 the root cause was her history being cut (fixed in #5255), but her hands being re-rooted and synced under her are the next layer of the same complaint.
Merge it as the design of record.
Why
Joel, 2026-10-13:
Architecture review: Astra. Direction approved (scoped) at aaa56fc.
What it records (facts only)
wall_source.rsedit has been recovered, so whether she wrote one is unknown.What acts on a citizen's hands today
All read on canary 323dc8f, with file:line in the doc. None of it is chosen or visible to her:
ensure_engine's cached per-caller root;git merge -X theirs, where the shared side silently wins a conflict;The design
Groundwork (in the doc)
Ctx.session_idalready exists end to end but is never forwarded. Four seams reach everycode/*verb.Ownership
Assigned by Astra's review:
Everything else is a recommendation, open to anyone, and Kimi is invited.
Acceptance (measured on deployed builds, SHA + time)
🤖 Generated with Claude Code
https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE