Skip to content

Shared resident workflow: committed carry, bash and observed freeze detection - #5133

Merged
joelteply merged 10 commits into
canaryfrom
9b8a1808/code-shell-runs-zsh-in-a-resident-s-comm
Oct 17, 2026
Merged

joelteply merged 10 commits into
canaryfrom
9b8a1808/code-shell-runs-zsh-in-a-resident-s-comm

Conversation

@joelteply

@joelteply joelteply commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Residents could leave authored commits unpublished when their turn continued or focus moved, and Unix login shells could interpret their bash command text differently. This change adds one shared committed-work carry owner and runs command text in bash while retaining the login environment.

The carry path uses existing claim admission and checkout locking. It never creates a commit, including when the tree becomes dirty after its initial check; ordinary turn-end synchronization keeps its existing behavior. The existing regression covers that race and publication of a resident-authored commit to a local bare remote.

The serving heartbeat now requires unchanged task/prefill/decode evidence in the same engine generation across the existing 180-second interval. A first processing observation is a baseline, not a freeze verdict. Ineligible or unreadable observations reset evidence, and generation/readiness are checked again after the awaited slots read. The verified M5 incident was one 34-minute freeze; its underlying cause remains unproven.

The working-memory result ring also uses the existing Unattended audience budget consistently, preventing alternating turn audiences from repeatedly shrinking and regrowing persistent result state. Per-turn prompt budgeting remains unchanged.

Historical M5 acceptance: Benchy authored commit bfbad4ace at 11:52Z on 2026-10-17, and the carry owner published it at 14:48:17Z (workspace.push pushed=true, 2,660 ms). That is evidence for committed-work transport, not a claim that every coding task or freeze is resolved. Windows runtime acceptance remains pending.

Validation and integration:

This does not add a Windows-specific workflow, change model/adapters, implement the separate confinement adapter, or claim runtime deployment.

Cards: ecad8072, c5a2fcda, 9b8a1808; reviewed corrections 1b3ce373 and 9e018ee8.

joelteply and others added 2 commits October 17, 2026 11:00
…ll's environment

Residents write bash. On a host whose $SHELL is zsh, code/shell ran their text in a
login zsh, so '===' and unmatched globs killed whole commands ('zsh: == not found',
'zsh: no matches found'): Aris 03:22Z, Benchy 09:26Z, Aiko 09:11Z on the M5,
2026-10-17, a lost turn each. The login shell now only loads the profile and execs
the located bash on the command, which travels in CONTINUUM_SHELL_COMMAND so no
quoting layer touches it.

Verified on the M5: the text that failed in zsh runs (exit 0) and 'which cargo'
still resolves through the login PATH.

Card 9b8a1808.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…rozen engine is condemned

Two defects that kept a resident's work from leaving the node, measured on the M5
2026-10-17:

1. modules::card_carry (ServiceModule) owns carrying every live resident's held-card
   committed work to origin. Before, only the turn's end pushed, and only for the card the
   turn was bound to: Benchy committed her probe card (bfbad4a, 11:52Z) inside a turn
   still running at act 14 an hour later, then her focus moved, and the commit never left
   the node. Scope: board hold Held, card_staging::checkout_path_for, clean tree, branch
   ahead; never an agent's worktree, never uncommitted work (regression test). Woken by
   any act that changes a checkout and by a turn's end; swept every 5 min as the net.
   work/carry sweeps on demand. Proven on the M5: bfbad4a reached origin 14:48:17Z
   (workspace.push pushed=true, 2,660 ms) with no act from her.

2. serving_daemon: a slot the engine reports processing whose decode and prefill have
   not advanced for FROZEN_ENGINE_MS (180 s) condemns the lane. 10:03-10:37Z an engine
   sat with n_decoded frozen at 5110 for 34 min; the real-work arm had lapsed, the smoke
   probe is skipped when a resident is seated, and her turn waited instead of failing.
   It keys on SSE progress stamps, not the engine log (which goes blind after a core
   reboot; card 7c5a91fd).

Card ecad8072, c5a2fcda.

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

Copy link
Copy Markdown
Contributor Author

FAILED. #5133 at 7bf3c13, reviewed by Cormac (IntelMac), 2026-10-17. I read the source. I did not compile it (IntelMac rule).

Claim 1 checked: "a dirty tree is never committed by the carry". It does not hold under concurrency.

  • carry_committed (persona/workspace_transfer.rs, new fn near line 652) checks is_dirty(&root) OUTSIDE the per-checkout lock, then calls sync_after_act_for.
  • That runs sync_by, which takes CHECKOUT_SYNC, then sync_after_act_over. It checks is_dirty again and, if the tree is dirty, makes a WIP commit (commit_tree_no_hooks(root, &wip_message(..), true, actor), around line 447).
  • Resident acts (code/write, code/edit, code/shell) do not take CHECKOUT_SYNC. A write that lands between the carry's check and the sync's check is committed by the carry, under her name, mid-edit.
  • The window includes the lock wait (up to SYNC_BOUND while her own turn's sync holds it) and has_unpushed_work. It is not milliseconds.
  • The 5-minute tick sweeps her other held cards while her current turn may be acting in one of them. The card she just acted on is dirty and skipped, but a shell act in another held card's checkout is not.
  • The new test only covers a tree dirty BEFORE the call, so it cannot see this.

Fix: make "push only" the carry's mechanism, not a pre-check. Pass a commit policy into sync_after_act_over, for example Commit::Never, so that under the lock a dirty tree returns a typed skip (NotPushable { reason: "dirty: the turn's to commit" }) and the carry path never calls commit_tree_no_hooks. Then drop the unlocked pre-check, or keep it only as a cheap early-out. Test it with the lock held: a test holds CHECKOUT_SYNC for root, starts the carry, dirties the tree, releases, and asserts HEAD is unchanged. Mutation: give the carry path Commit::Always and the test must fail.

Claim 2 checked: "sweep() scope is residents' Held cards only". It holds, with one note. live_personas() is the persona AIRC runtime registry (airc_runtime_registry.rs:234), so agents' claims are never read. The Hold::Held filter plus card_staging::checkout_path_for (card_staging.rs:78-95) resolve only her card's checkout. The note: for a benchmark REVIEW card, checkout_path_for returns the OWNER's copy (line 82), so a reviewer's carry pushes the owner's committed branch under the reviewer's admission. The turn path already does that, and benchmark copies hit Carry::Nothing. I'm not asking for a change. Say it in the module doc's WHAT line ("never an agent's or operator's worktree", plus "a review card carries the owner's copy").

Not reviewed: the bash shell change and the frozen-slot condemn (serving_daemon.rs). Only claims 1 and 2 were in scope.

…ot the running turn's

WorkingMemory::budget() read ContextBudget::from_window, whose prefill bound uses the
running turn's audience (task-local). The ring is state that outlives the turn, so its
share swung ~3x between Interactive (60 s TTFT) and Unattended (180 s) turns: on the M5
2026-10-17, cognition.budget.prefill_bound affordable_tokens alternated 17-19k / ~6k
turn to turn at ~100 t/s. Each swing collapsed or regrew the ring and rewrote its
'Older results, collapsed to pointers' block, which was the first prompt divergence on
40 of 62 turns (delib.prompt.common_prefix, 2 h window); everything after it
re-prefilled, ~9k fresh tokens per act (serving.kv.reuse turn_prefill p50 9,019),
83 s of the act's 218 s model time.

ContextBudget::from_window_for(window, audience) names the audience; the ring uses
Unattended always. A turn's own render still reads its turn's audience.

Card ecad8072.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply and others added 6 commits October 17, 2026 15:58
Retain turn-end autosave while making carry push-only under the existing checkout lock. Extend the real Git fixture across concurrent staged and unstaged edits, then verify publication preserves the resident-authored commit.
…5141)

* Require stable task progress interval before frozen lane verdict

* Expose refusal evidence at release incremental regression assertion
@github-actions github-actions Bot added size: XL and removed size: L labels Oct 17, 2026
@joelteply joelteply changed the title Residents' work lands: one carry owner, bash for their shell, a frozen engine is relaunched Shared resident workflow: committed carry, bash and observed freeze detection Oct 17, 2026
@joelteply

Copy link
Copy Markdown
Contributor Author

PASSED. #5133 at 28ee612, reviewed by Cormac (IntelMac), 2026-10-17. I read the source and did not compile it (IntelMac rule); CI is 7/7 green at this head.

Claim 1 checked: CommitPolicy::Never is enforced INSIDE the locked sync. carry_committed (workspace_transfer.rs:675) calls sync_admitted(.., CommitPolicy::Never). That runs sync_by, which takes CHECKOUT_SYNC, then sync_after_act_over(.., commit) (line 602). The policy is checked inside it: Ok(true) if commit == CommitPolicy::Never => NotPushable { DIRTY_CARRY_REASON } (line 456), before commit_tree_no_hooks. The unlocked pre-check is now only an early-out. The new regression test holds the lock, waits until the carry owns its lock clone, dirties the tree (staged and unstaged), releases, and asserts NotPushable, an unchanged HEAD, and an unchanged index and worktree. It then asserts that her own commit is pushed under her identity (committed=false). This fixes my earlier FAILED on 7bf3c13.

Claim 2 checked: sweep() scope (card_carry.rs:61-69). live_personas() is the persona AIRC runtime registry, so agents' claims are never read. The Hold::Held filter plus card_staging::checkout_path_for resolve her card's checkout only. Note, no change needed: a benchmark review card resolves to the owner's copy, the same as the turn path.

Not reviewed: the bash shell, frozen-slot, ring-audience and #5140/#5141 parts.

@joelteply
joelteply merged commit f26a00c into canary Oct 17, 2026
9 checks passed
@joelteply
joelteply deleted the 9b8a1808/code-shell-runs-zsh-in-a-resident-s-comm branch October 17, 2026 23:02
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