Repository navigation
fix: install.sh archives the box state on a 0.7 to 0.8 upgrade, refuses 0.7.x over 0.8 state, and - #3848
Conversation
An upgrade from 0.7 to 0.8 or later copies the state directory beside itself after the pre-swap daemon stop: a copy-on-write clone first, else a space-checked copy that keeps sparse files sparse. --skip-state-archive or MINIMAL_INSTALL_SKIP_STATE_ARCHIVE skips it. A 0.7 install over state that 0.8 wrote is refused before any download, and the closing card after an upgrade from 0.7 names min box list, attach and rm.
Records R2.6 (the refusal of a 0.7 install over 0.8 state), R5.7 (the state copy on an upgrade from 0.7 and --skip-state-archive) and R10.5 (the min box rows on the card), with the tests that pin them.
|
Important Review skippedBot user detected. Ask an organization administrator to verify that this bot has an active assigned CodeRabbit review seat. See the seat-assignment guide. After the seat is confirmed, request a review again.
|
Spec lint
Advisory. None of this blocks the merge; the review decides. Advisory, and never a merge gate. Linter: |
|
Approved: every review thread resolved at @mitodrummer resolved the last thread, which releases the approval this review had withheld. Nothing to do. |
The printed mv on a 0.7-over-0.8 refusal no longer names a path that exists, so the state cannot nest inside it. A failed state copy now says that the daemon the pre-swap stop ended was not started again.
|
Round 1 of 10 on the runtime's review findings, pushed as
Verify Review threads the coder judged:
An upgrade from a stub 0.7.3 to 0.8 leaves a byte-identical state copy beside the state directory and prints the three min box rows. --version 0.7.3 over 0.8 state exits non-zero with the exact refusal, and its printed mv now never names a path that exists. A refused state copy also says that the daemon this run stopped was not started again. Notes from the agent: Revise round 1. Thread 1: the EXIT trap never restarts a daemon (stop_stale_daemon only stops one), so the premise is partly wrong. The real gap was the message, so the refusal now adds 'This run stopped the daemon, if one was running. It did not start it again.' Thread 3: the refusal picks .0.8, then .0.8., then .0.8.., and a new test checks a taken target. Thread 2 is invalid and nothing changed for it. just lint-prose did not run: vale is not installed on this box. |
There was a problem hiding this comment.
minimal-review — approval withheld
Verdict COMMENT — APPROVE withheld: 3 unresolved threads — minimal-foundry[bot] scripts/install.sh, minimal-foundry[bot] scripts/install.sh:1252, minimal-foundry[bot] scripts/install.sh. No findings.
Panel: 3 of 3 personas ran (correctness, security, supply-chain).
|
Round 2 of 10 on a failed check suite: the coder changed nothing. Revise round 2: no code change. The failed checks are the macOS e2e job (exit 100) and its aggregator ci-macos-success, which only reports the e2e failure. This branch changes only scripts/install.sh, scripts/install_test.sh and the installer spec. The macOS lane ran because of the scripts/** path filter. On macOS, session-e2e.sh never runs install.sh: fresh_install_range_lands_on_macos uses min finalize-install. The cases that do run install.sh are native Linux only, and their mock bucket version is v1. ver_mm rejects v1, so the new 0.7 and 0.8 checks do nothing for it. The excerpt shows the reap-step port check and the install-action helper text only as script source, with no failing line from this change. I read the failure as a runner or infrastructure flake on the self-hosted Mac. A re-run of the e2e job is the next step. I could not run the macOS e2e on this Linux box. The installer suite passes in full here (dash was not installed, so its dash pass was skipped). |
|
/arch-review |
There was a problem hiding this comment.
arch-review: CONDITIONS · 2 conditions · the full ruling
The state copy and the 0.7 refusal conform. The design does not govern the installer, and both guards refuse before a download or a swap. Two rows of the new closing card describe the min box verbs incorrectly. Line 489 of the design says that min box attach also starts a stopped box. After this upgrade every 0.7 box is stopped, so open a shell in a running box is wrong (C1). Line 509 says that min box list shows only the current project. The installer runs from any directory, so the row must name min box list --all (C2).
Ruled at 07a7de7 against gominimal/arch@4f2eb87d5d12 by claude-opus-5-5.
|
/revise Fix minimal-arch's two conditions at 07a7de7. Change nothing else.
Answer each of the four minimal-arch threads with "Addressed in ". Keep |
The pre-swap stop stops every 0.7 box, so attach describes the resume. The installer runs outside a project, so the list row names --all.
|
Round 3 of 10 on a /revise note, pushed as
Verify Review threads the coder judged:
An upgrade from a stub 0.7.3 to 0.8 leaves a byte-identical state copy beside the state directory. The closing card prints the rows min box list --all, min box attach and min box rm . --version 0.7.3 over 0.8 state exits non-zero with the exact refusal. Notes from the agent: Round 3 changed only C1 and C2, as the note asked. The test-installer runs skipped the dash pass because dash is not on this box. |
With a relative XDG_STATE_HOME, install.toml lives outside the box state directory that the refusal's mv moves, so the refusal repeated after the user followed it. The refusal now reads the key from the box state directory.
|
Round 4 of 10 on the runtime's review findings, pushed as
Verify Review threads the coder judged:
An upgrade from a stub 0.7.3 to 0.8 leaves a byte-identical state copy beside the state directory and prints the three min box rows. --version 0.7.3 over 0.8 state exits non-zero with the exact refusal. With a relative XDG_STATE_HOME, the mv that the refusal prints now clears the refusal, and 0.7.3 then installs. Notes from the agent: Revise round 4. The refusal now reads the install.toml key from the box state directory (runtime_dir state), not from the installer's state directory. installed_key takes the directory as an argument. The 0.7 upgrade detection still reads the key from $state_dir, because that is where the installer writes install.toml. A new rd5 block in case_refuses_0_7_over_0_8_state sets a relative XDG_STATE_HOME. It failed on the previous head (want 0, got 1) and passes now. Spec R2.6 now says the key counts when install.toml is in the state directory, and its test line names the relative case. The earlier round judged this same finding (PRRT_kwDOPdfcxM685N-H's sibling PRRT_kwDOPdfcxM685N-N) invalid. That verdict was wrong, and this round changes it. just lint-prose did not run: vale is not installed on this box. |
There was a problem hiding this comment.
minimal-review — approval withheld
Verdict COMMENT — APPROVE withheld: 8 unresolved threads — minimal-foundry[bot] scripts/install.sh, minimal-foundry[bot] scripts/install.sh:1253, minimal-foundry[bot] scripts/install.sh, minimal-arch[bot] scripts/install.sh, minimal-arch[bot] scripts/install.sh, …. No findings.
Panel: 3 of 3 personas ran (correctness, security, supply-chain).
There was a problem hiding this comment.
The overall shape is sound: the archive runs after the pre-swap stop and before the first executable swap, a re-run within 0.8 is idempotent, and the earlier threads (the stopped-daemon line, a move target that does not exist yet, the relative XDG_STATE_HOME key) are addressed. Some data-loss paths remain. The R2.6 refusal has the user move the state directory while the 0.8 daemon is still running. That orphans the daemon, and it can write a 0.8 index into the restored 0.7 copy. Both version guards also skip sha-named nightly versions, which is what unstable resolves to. A symlinked state directory is "archived" as a symlink to the same data. Finally, the failed-copy refusal branch and the archive-name collision suffix have no tests. Details are inline.
Generated by Claude Code
|
/revise Fix norrietaylor's five review threads at e884ab8. This PR introduced each of them, so fix each here. Do not track any of them. Change nothing else.
Answer each of norrietaylor's threads with "Addressed in " and one sentence on what changed. Update spec 07 where R2.6 or R5.7 describe the steps or the text. Keep |
The 0.7-over-0.8 refusal now prints the host stop steps before the move, with the min on disk named by its path, and names the newest saved copy by modification time with a count of the others. A version named by a commit hash is placed from the shipped min's version output, and only when the answer matters. A version that cannot be placed gets the state copy and is not refused. The state copy resolves a symlinked state directory and copies its contents into a real directory. A failed copy prints cp's last error line.
|
Round 5 of 10 on a /revise note, pushed as
Verify Review threads the coder judged:
An upgrade from a stub 0.7.3 to 0.8 (also to a hash-named 0.8 build, and through a symlinked state directory) leaves a byte-identical state copy beside the state directory and prints the three min box rows. --version 0.7.3 over 0.8 state exits non-zero, and the refusal first tells the person to stop every host with the min on disk, then to move the state aside, then names the newest saved 0.7 copy. Notes from the agent: Round 5 addresses all five threads. (1) The refusal is now refuse_over_0_8_state. When a min is on disk, it prints a stop step before the mv: '/min' host list and '/min' host stop , or '/min' stop for a min without host stop. It prints min by itself when the bin dir is on PATH. The installer itself stops nothing. (2) A non-X.Y version is placed from the shipped min's 'min version'. The probe runs only when the state is from 0.8 or the min on disk is from 0.7. A min on disk with the manifest hash is asked directly, and otherwise the shipped min is downloaded to the temp dir and checked against its hash. A first version downloaded min on every rerun of the 'v1' test version and broke five rerun-download tests, so the probe is now gated. A version placed this way is refused after the manifest fetch, before any component download. The upgrade decision moved from before the manifest fetch to after it. (3) The archive resolves the state with cd -P and pwd -P, does mkdir and then copies '/.'. du reads the resolved dir. df still reads the parent of the state path, because the copy lands there. (4) cp stderr goes to a temp file, and the refusal prints 'cp said: ' after its first sentence. The cp stub that fails every copy fails only copies into minimal.0.7.*, because the mock download also uses cp. (5) The newest copy is picked with test -nt, and one line counts the others. New printed lines: 'Stop every Minimal host first, so that no daemon writes to the state while it moves.', 'List the hosts, then stop…[truncated] |
There was a problem hiding this comment.
minimal-review — approval withheld
Verdict COMMENT — APPROVE withheld: 13 unresolved threads — minimal-foundry[bot] scripts/install.sh, minimal-foundry[bot] scripts/install.sh:1253, minimal-foundry[bot] scripts/install.sh, minimal-arch[bot] scripts/install.sh, minimal-arch[bot] scripts/install.sh, …. No findings.
Panel: 3 of 3 personas ran (correctness, security, supply-chain).
|
/arch-review |
There was a problem hiding this comment.
arch-review: PASS · the full ruling
C1 and C2 from the ruling at 07a7de7c are met. The card now names min box list --all and says that attach starts a stopped box again. This matches the min box lines 489 and 509 of the architecture. The new R2.6 refusal steps use min host list and min host stop <host>. Section line 576 says that host stop is how a local daemon stops. The rest of the compare is installer mechanics, and the design is silent on them. Nothing in the compare moves a trust boundary.
Ruled at 9377d18 against gominimal/arch@bf831998f150 by claude-opus-5-5.
There was a problem hiding this comment.
minimal-review — approved
Verdict APPROVE — every review thread is resolved; @mitodrummer closed the last one. The review of 9377d18e9f26 withheld this approval on the threads open then. Posted as a comment: the App cannot approve its own pull request; the check and the label carry it.
… 0.7 The guide's hand-written restore drew a new edge case at each review: a symlinked state, a full disk, a leftover restore directory. #3848's installer already refuses 0.7 over 0.8 state and prints the stop, the move aside to a free name, and the rename of the newest copy beside the state directory. The guide now has the reader put a hand copy beside the state directory as a new directory, run the 0.7 install, and follow the commands it prints. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016CYvTvep9ZaSf5pJMB2hQA
Follow-up
Fixes #3846
scripts/install.shscripts/install_test.shdocs/specs/07-spec-installer/07-spec-installer.mdTask marker
Proof
The test case_state_archive_on_upgrade_from_0_7 upgrades a stub min that reports 0.7.3 to 0.8.0. It leaves ~/xdg-state/minimal.0.7.3 beside the state directory, and diff -r shows that copy is byte-identical to the state before the run. The closing card prints the rows for min box list, min box attach and min box rm . In case_refuses_0_7_over_0_8_state, --version 0.7.3 over 0.8 state exits 1 before any download and prints the exact refusal 'install: refused to install Minimal 0.7.3 over the box state in ~/xdg-state/minimal.' with its reason and an mv command.
Notes from the agent: The task named no spec section (spec.md was empty), so I made these design choices. (1) A 0.7 install is detected from
<bin>/min version('Client: minimal X.Y.Z', leading v allowed). The installer skips that call when install.toml already has a key of 0.8 or later. (2) The state is from 0.8 when the install.toml key is >= 0.8, or when sessions/index.json has a format_version >= 1. I took that from crates/boxes/src/store.rs INDEX_FORMAT_VERSION. (3) The copy goes to .<0.7 version>, with a timestamp suffix when that path exists. (4) The new card rows are min box list, min box attach and min box rm . The plan did not name the three verbs. (5) The space check refuses when the free space is not more than the size, and the refusal names --skip-state-archive. It does not name the env var, which R5.7 documents instead. When du or df output does not parse, the installer still tries the copy, and a failed copy refuses. The test harness gained EXTRA_BIN and SKIP_ARCHIVE inputs to run(). Its dispatch now also takes a case name with the case_ prefix, because the test: lines use that form and the old dispatch rejected it as unknown. dash is not installed on this box, so the recipe ran the suite under sh only. vale is not installed either, sojust lint-prosedid not run on the spec edit.Tests
just test-installer case_state_archive_on_upgrade_from_0_7just test-installer case_state_archive_refuses_short_spacejust test-installer case_refuses_0_7_over_0_8_stateVerify
min task run agent-verifypassed ([tasks.verify]).