Repository navigation
engine upgrade: bring the fleet to main's head in one command - #233
Merged
Merged
Conversation
Task t62 (plan p53). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012F3VVBf6JkXJCACGLzAGuG
…r host's order Task t62 (plan p53), review round 1's optional findings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012F3VVBf6JkXJCACGLzAGuG
# Conflicts: # docs/architecture.md # docs/project-brief.md # docs/project-structure.md
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
engine upgrade [--dry-run]brings every host inhosts.toml, the caller included, to the head ofmain. The run: preflight; read the target once; stop the server's systemd unit; back up with the binary the server ran; install the engine and the caller's plugins (through the newharness.Setup.PluginUpdate); set up the server's host with the new binary; start the server (it starts on every exit once the stop was tried, an interrupt included); set up the rest; then report per host and exit 1 while anything is open. Server task t62, plan p53.Gates
./dev test(every required lane)internal/upgrade/upgrade_test.go: order on a three-host fleet (remote server host, and the caller as server host); target read once; every setup runs the new~/.local/bin/engine; every refusal names its cause and changes nothing;--dry-run; interrupts before and after the stop.internal/upgrade/failures_test.go: O3 (a failed server-host setup, install, backup or stop, a broken or wrong installed binary, the server host lost after the stop: each still starts the unit; a failed or silent start namesjournalctl); O5 (an unreachable host and an open setup leave the others set up and exit 1); plugin-update failures stay open.internal/cli/upgrade_test.go:cli.Rundry-run runs only reads; a busy task exits 1; bad flags exit 2 with the usage.internal/harness/claude/setup_test.go,internal/harness/codex/pluginupdate_test.go: each adapter's exact plugin-update commands.engine upgrade, is the plan's post-merge step for the operator.Rulings
Low-risk decisions
Ruling (risk: low): preflight also refuses when the unit is not
active, so a backup can never race a server running outside the unit (documented in operator-setup.md).Ruling (risk: low):
--dry-runruns the read-only preflight and the target read, then prints the numbered steps.Ruling (risk: low): after the start, the run polls the server's task list 30 times, 1s apart (injected Sleep).
Ruling (risk: low): an interrupt (SIGINT/SIGTERM) ends the run early but still starts a stopped server; the caller's install is checked by running the new binary before any setup uses it.
Ruling (risk: low): the replace of the running binary is justified by a cited reason in
internal/upgrade/fleet.go(cmd/go renames, or removes then creates), not a real-process test.No
reviewrulings.Review
hostEnginewith the report's commit reader: setup's version also reads the Go toolchain and returns another type. The duplicate is about ten lines.ENGINE_SERVER_URLcould point the task check at another server: every engine CLI honours it on purpose, and the engine sessions that set it are refused anyway because their own task is running.binfor Codex, so the path is near unreachable.internal/upgrade/plan.go(execute: start-on-every-exit logic),internal/upgrade/preflight.go(refusals),internal/harness/setup.go(the interface change).Deviations
docs/project-structure.mdgets no row forinternal/upgrade: main's trim, merged here, groups the product packages into one row, "one per component or command", which covers it.docs/architecture.mdnames it in the adapter sentence.🤖 Generated with Claude Code
https://claude.ai/code/session_012F3VVBf6JkXJCACGLzAGuG