Repository navigation
Restart resilience acceptance: move a live tmux out of the server's unit, and the upgrade's config rule - #320
Merged
Merged
Conversation
…of the unit The upgrade refuses unless the caller's config.toml sets [server] host; the docs said it ran from any host. A session tmux that started inside the server's unit can be moved into its own scope with no window ended, before an upgrade stops the unit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012F3VVEvpwUs9kd61mNLrbv
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012F3VVEvpwUs9kd61mNLrbv
… in one place Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012F3VVEvpwUs9kd61mNLrbv
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012F3VVEvpwUs9kd61mNLrbv
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012F3VVEvpwUs9kd61mNLrbv
…ck means Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012F3VVEvpwUs9kd61mNLrbv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Acceptance of restart resilience: each objective O1–O13 is checked against the tests that prove it and, where a real run was possible, against a run on the real fleet (devbox, the Linux server host; the Mac, a session host) with throwaway "hold" tasks. Two docs that the runs showed wrong or incomplete are fixed. The diff is docs only: the existing tests already cover every objective (map below), so this PR adds no test.
Gates
./dev test(every required lane)umask 022; CI on this head: gates run, PASSdocs/recovery.mdanddocs/operator-setup.mdonly.0077,TestTrustFolderKeepsEverythingElseandTestEditFileRetriesThenGivesUpOnABusyFilefail on main as well (file modes), so the gate was run underumask 022, as CI's default umask is.Evidence per objective
Update numbers are the engine server's update sequences. Attempts are
a<n>. Hold A, B and C are the throwaway tasks. The run's raw files are kept on devbox in~/.local/state/engine-acceptance/restart-resilience/../dev test)internal/control/vanish_test.goTestTheVanishRule, TestReconcileResumesClaimedDeathsUntilTheCap;internal/controlrun/early_test.goTestASessionThatClaimedItsTaskResumesAfterItsDeathsUntilTheCap;internal/controlrun/hold_test.goTestResumeDispatchesAgainAsAResumeOfTheKeptBranchtmux kill-windowon Hold B (a432, claimed). 3450: endedvanished,crashed(1 of 3); 3451: "the task stays resumable and is dispatched again as a resume"; 3452: resume a434 in the same worktree.internal/control/hostloss_test.go(all, incl. negatives);internal/controlrun/tmuxloss_test.go;internal/remote/ssh_test.goTestSSHRefusesAStatusWithoutATmuxStartTimetmux kill-serveron the Mac (Hold A a431, Hold C a433, plus two non-engine sessions). 3465/3466: bothvanished,host_lost, uncounted, no per-task notice; 3467/3469: resumes a435/a436. A second, unplannedtmux kill-serveron the Mac at 17:29:20Z, run by mistake by the operator's supervisor and recorded by them in 3481, ended the new tmux server with the resumed a435/a436. It was read the same way: 3478/3479,vanished,host_lost, uncounted, resumes a437/a438. It is not row 9's evidence. The operator's inbox holds exactly two host notices, "mac's tmux restarted; 2 tasks will resume": 3464 at 17:26:51 and 3477 at 17:29:25, one per kill, and no per-task death notice (3680, 3685).internal/control/vanish_test.go;internal/control/early_test.go;internal/control/planner_test.go;internal/controlrun/early_test.go(notice with the last two tails)internal/controlcmd/retry_test.go;internal/pane/pane_test.goTestThePromptHooksSynchronousPostIsBoundedWithTheServerDownengine tellsent 10 s into the outage printed one line, "engine server unreachable; retrying until 17:30:13 (request key b376…2def)" (its start plus 90 s), and landed at 17:29:30 as 3480.internal/controlrun/outage_test.go;internal/control/outage_test.gointernal/setup/unit_test.gointernal/session/tmuxscope_test.go;internal/hostops/tmuxunit_test.gosystemctl --user restartat 17:39:16Z, and the 19:12 upgrade.internal/upgrade/upgrade_test.go;internal/control/upgrade_test.go;internal/controlrun/upgrade_test.go;internal/harness/codex/retain_test.gorunningwith no live session, awaiting its resume, which reached devbox at 19:16:25: O10). No window died: the planner's window closed at 19:16, after the server returned, because it finished (3578). Afterfinish, every throwaway task reached done by 19:27:44Z (dinoderek/engine-acceptance#1–#4, the last the plan's closing task), and the throwaway plan is done. The start and end marks were refused, because the upgrade ran with an execution credential (the operator chose that, 3261).internal/control/unreachable_test.go;internal/controlrun/unreachable_test.gointernal/controlcmd/move_test.go,hostpause_test.go;internal/control/move_test.go,hostpause_test.go;internal/controlrun/move_test.gomoved("… its old session there may still push. Its window is released when the host answers"). Resume a440 on devbox (3507). After the block was lifted at 18:05:41, the Mac's old windows were released by 18:06:11, with the worktrees kept and clean. Hold C's resume, a452, waited, as devbox's 3 slots were full and the Mac paused, and was dispatched on devbox at 19:16:25, as the other plan's planner window closed (the slot cause is inferred, not read).engine host resume macat 19:20, run with the operator credential as the operator directed in 3521, returned"paused": false.internal/control/limitask_test.go;internal/reconcile/limitchoice_test.go;internal/controlrun/limitask_test.gointernal/watch/watch_test.go,main_test.go;internal/serverops/serverops_test.go{"failures":8,"alerted":true}, then{"failures":0,"alerted":false}once the server answered. The operator confirmed on Telegram one alert listingengine server statusandengine server restart, then one recovery message (3680, 3685).internal/controlrun/quiet_test.go;internal/reconcile/quiet_test.go;internal/hostops/activity_test.gokill -STOPon Hold B at 17:47:21Z did not hold (ps readSsl+right after, and the session posted 3499 at 17:47:25), so no quiet stretch arose. The operator then skipped the live run (3521, 3524).internal/session/adopt_integration_test.goTestCreateWorktreeRemovesAStaleIndexLockOnAdoptPreparation (approved in 3253). devbox's tmux server (pid 2506755) and its pipe-pane loggers had started inside
engine-server.serviceunder the old build. They were moved into a transient scope withbusctl … StartTransientUnit … PIDs, which killed nothing (3255).docs/recovery.mdnow documents this step.Not run. The host reboot (row 12): the operator skipped it (3515, 3517) because devbox's root is on LUKS, so an unattended reboot may stop at the passphrase prompt with the server down. The reboot path rests on rows 8–11: a host with no tmux server read as one loss, and the unit coming back. An isolated engine instance was not used: the session tmux uses the default socket and every state path is under HOME, so an instance would need a separate HOME, which loses the harness and
ghsign-ins, and it would not exercise the real unit or the second host.Rulings
Ruling (risk: low): no new test; every objective already has its proof in
./dev test(table above).Ruling (risk: low): the docs name
busctl … StartTransientUnitwithPIDsfor moving a live tmux out of the unit; it ends no window, unlike thetmux kill-serverthat thetmux_unitreason names.Operator answers followed: 3253 (moving devbox's tmux), 3261 (deploy with config edit and an execution credential), 3436 (operator-credential reads), 3446/3447/3458/3460 (rows 1 and 8), 3506 (the fleet question's "move"), 3680/3685 (the Telegram messages, host notices and fleet question confirmed), the pane authorization 3462 (unit stops, the cut-off, SIGSTOP), 3515 (skip the reboot), 3521/3524 (O13 tests-only, then row 13; 3521 also directed
engine host resume macwith the operator credential).Review
buildskill review mode. Round 1: CHANGES_REQUESTED (PR body: an ID-like label, the unconfirmed Telegram delivery, an uncited answer; all fixed). Round 2: CHANGES_REQUESTED (the Telegram delivery had no operator decision; the operator confirmed it, 3680/3685). Round 3: APPROVED, with one optional fix applied (check the unit withsystemd-cgls, sincetmux_unitreads the server pid alone). Round 4: CHANGES_REQUESTED (the second Mac kill was uncited by name; fixed above with 3481), with optional fixes applied (name theunitandpidto move, a restart ends the windows too, §1 points at §2, the Deviations line on the pane authorization). Round 5: CHANGES_REQUESTED (the Gates row cited the run on the previous head; it now cites the run on this head; and the O8 row overstated Hold C, reworded). Round 6: CHANGES_REQUESTED (the host resume was a state change with the operator credential, uncredited; it now cites 3521; and Hold C's later resume is stated), with its optional fixes applied (psshows each pid's parent; what to do ontmux_unit_error). Round 7, on this head: APPROVED, no must-fix; its optional citation of the 16:56 upgrade (3412) applied to this body.engine-tmux.scope(round 4): with modefaila clash refuses and ends nothing, and one move per unit is the case. "Runs inside" for "started inside" in recovery.md step 1 (round 5): both are true of the case it names, so the head was left as reviewed. Round 7's optional wording (a pid source for thetmux_unit_errorcase; "changes nothing" beside--dry-run): left, keeping the approved head.docs/recovery.md§2 "Run" step 1 (the busctl line must match systemd's StartTransientUnit signature, and the claim that it ends nothing);docs/operator-setup.md"Upgrading" (each refusal it names must be one ofinternal/upgrade/preflight.go's; the list is not complete).Deviations
~/.config/engine/config.toml[server]changed fromurltohost = "devbox"so the upgrade could run (3261). This is host config, not repo.~/.ssh/configon devbox (17:43:01–18:05:41Z) blocked ssh to the Mac for the cut-off, under the operator's pane authorization (3462). It was deleted after.engine askbefore each destructive run. Rows 1 and 8 had one each (3446/3447, 3458/3460). Rows 9–11, the cut-off and the SIGSTOP ran under one pane authorization from the operator instead (3462), after the permission hard stop it answered.tmux_unitis reported; the Mac's setup stays OPEN at the Codex daemon step after each upgrade; thetmux_unitreason text (internal/hostops/tmuxunit.go) still recommendstmux kill-server, not the move; under umask0077two file-mode tests fail.Harness and model: Claude Code, claude-opus-5-5.
🤖 Generated with Claude Code
https://claude.ai/code/session_012F3VVEvpwUs9kd61mNLrbv