8000 fix: install.sh archives the box state on a 0.7 to 0.8 upgrade, refuses 0.7.x over 0.8 state, and by minimal-foundry[bot] · Pull Request #3848 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
mitodrummer merged 7 commits into
mainfrom
agent/3846-install-sh-archives-the-box-state-on-a-0-7-to-0
Nov 27, 2026
Merged

mitodrummer merged 7 commits into
mainfrom
agent/3846-install-sh-archives-the-box-state-on-a-0-7-to-0

Conversation

@minimal-foundry
Copy link
Copy Markdown
Contributor

Follow-up

Fixes #3846

  • Epic: none; not charged to an epic
  • Size: L; estimated 220 code, 320 tests
  • May touch:
    • scripts/install.sh
    • scripts/install_test.sh
    • docs/specs/07-spec-installer/07-spec-installer.md
Task marker
### D3845 — install.sh archives the box state on a 0.7 to 0.8 upgrade, refuses 0.7.x over 0.8 state, and names the box verbs on the closing card
  kind: task
  size: L
  est: 220 code, 320 tests
  executor: agent
  origin: bug
  layers:
    - installer:
      - scripts/install.sh: adds the 0.7.x detection, the CoW or space-checked sparse state archive after stop_running_daemon, --skip-state-archive, the pre-download 0.7-over-0.8 refusal, and the box rows on the closing card
      - scripts/install_test.sh: adds cases with a stub min version and a stub df for upgrade, no-op 0.8.x upgrade, short space, skip flag, install.toml and index-only refusals, and restored 0.7 state
      - docs/specs/07-spec-installer/07-spec-installer.md: records the state archive, the downgrade refusal, the new flag and env, and the post-upgrade card as requirements with tests
      test: just test-installer case_state_archive_on_upgrade_from_0_7
      test: just test-installer case_state_archive_refuses_short_space
      test: just test-installer case_refuses_0_7_over_0_8_state
  proof: 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, and --version 0.7.3 over 0.8 state exits non-zero with the exact refusal.

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, so just lint-prose did not run on the spec edit.

Tests

line exit tail
just test-installer case_state_archive_on_upgrade_from_0_7 0 == shellcheck --shell=sh == == running install_test.sh under sh == # install.sh tests (SH=sh) ok - sa1: seed install exits 0 ok - an upgrade from 0.7.3 to 0.8.0 exits 0 (R5.7) ok - the upgrade leaves a state copy beside the state directory (R5.7) ok - the state copy is byte-identical to the
just test-installer case_state_archive_refuses_short_space 0 == shellcheck --shell=sh == == running install_test.sh under sh == # install.sh tests (SH=sh) ok - ss1: seed install exits 0 ok - short space refuses the upgrade (R5.7) ok - the refusal says the space is short (R5.7) ok - the refusal says what the state uses and what is free (R5.7) ok - th
just test-installer case_refuses_0_7_over_0_8_state 0 == shellcheck --shell=sh == == running install_test.sh under sh == # install.sh tests (SH=sh) ok - a 0.8.0 install exits 0 ok - 0.7.3 over install.toml from 0.8.0 is refused (R2.6) ok - the refusal downloads nothing (R2.6) ok - the refusal says what was refused (R2.6) ok - the refusal says

Verify

min task run agent-verify passed ([tasks.verify]).

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.
@coderabbitai
coderabbitai Bot commented Nov 27, 2026 •
Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot 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.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Un 8000 available
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 03dfbfa6-cf85-4a34-a425-e77860eb5d55

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@github-actions
github-actions Bot commented Nov 27, 2026 •
Copy link
Copy Markdown
Contributor

Spec lint

docs/specs/07-spec-installer/07-spec-installer.md — 4 finding(s)

docs/specs/07-spec-installer/07-spec-installer.md:1: F004 frontmatter is missing `owner:`, `epic:`, `arch:`, `updated:`
docs/specs/07-spec-installer/07-spec-installer.md:1: S002 missing 6 required section(s): `## Users and stories`, `## Requirements`, `## Non-goals`, `## Design reasoning`, `## Security considerations`, `## Open questions`
docs/specs/07-spec-installer/07-spec-installer.md:37: S003 19 section(s) are not part of the spec format: `## Introduction/Overview`, `## Goals`, `## User Stories`, `## Demoable Units of Work`, `## Non-Goals`, `## Design Considerations`, `## Repository Standards`, `## Open Questions`, `## Technical Considerations`, `## Security Considerations`, `## Verification`, `## Introduction/Overview`, `## Goals`, `## User Stories`, `## Demoable Units of Work`, `## Non-Goals (uninstaller)`, `## Design Considerations (uninstaller)`, `## Security Considerations (uninstaller)`, `## Verification (uninstaller)`
docs/specs/07-spec-installer/07-spec-installer.md:994: S005 `## Context` appears twice; the first is on line 12

Advisory. None of this blocks the merge; the review decides.

Advisory, and never a merge gate. Linter: gominimal/foundry@8acb0663, spec format: How Minimal Writes Specs.

@minimal-foundry
minimal-foundry Bot commented Nov 27, 2026 •
Copy link
Copy Markdown
Contributor Author

Approved: every review thread resolved at 9377d18e9f26.

@mitodrummer resolved the last thread, which releases the approval this review had withheld.

Nothing to do.

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — advisory review

Verdict COMMENT — 3 findings, 3 inline.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

Comment thread scripts/install.sh Resolved
Comment thread scripts/install.sh Resolved
Comment thread scripts/install.sh Resolved
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.
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on the runtime's review findings, pushed as 07a7de7cee6e.

line exit tail
just test-installer case_state_archive_on_upgrade_from_0_7 0 == shellcheck --shell=sh == == running install_test.sh under sh == # install.sh tests (SH=sh) ok - sa1: seed install exits 0 ok - an upgrade from 0.7.3 to 0.8.0 exits 0 (R5.7) ok - the upgrade leaves a state copy beside the state directory (R5.7) ok - the state copy is byte-identical to the
just test-installer case_state_archive_refuses_short_space 0 == shellcheck --shell=sh == == running install_test.sh under sh == # install.sh tests (SH=sh) ok - ss1: seed install exits 0 ok - short space refuses the upgrade (R5.7) ok - the refusal says the space is short (R5.7) ok - the refusal says what the state uses and what is free (R5.7) ok - th
just test-installer case_refuses_0_7_over_0_8_state 0 == shellcheck --shell=sh == == running install_test.sh under sh == # install.sh tests (SH=sh) ok - a 0.8.0 install exits 0 ok - 0.7.3 over install.toml from 0.8.0 is refused (R2.6) ok - the refusal downloads nothing (R2.6) ok - the refusal says what was refused (R2.6) ok - the refusal says

Verify min task run agent-verify passed.

Review threads the coder judged:

  • 👍 valid — scripts/install.sh: The EXIT trap only stops a stale daemon and never restarts one, so setting daemon_stop_ran changes nothing. The message gap is real: a failed copy now prints 'This run stopped the daemon, if one was running. It did not start it again.' A test pins it.
  • 👎 invalid — scripts/install.sh:1252: The two directories are different on purpose. install.toml is the installer's record, and the installer writes it under resolve_prefix state, so installed_key reads it from there. The box index and the copy belong to the runtime, so they use runtime_dir state, which mirrors crates/paths. Each check
  • 👍 valid — scripts/install.sh: The refusal now picks a move target that does not exist: .0.8, then .0.8., then .0.8... The restore line uses the same target. A test pre-creates minimal.0.8, runs the printed mv and checks that the state does not nest.

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.

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@minimal-foundry
Copy link
Copy Markdown
Contributor Author

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).

@agent-137
Copy link
Copy Markdown
Member

/arch-review

@minimal-arch minimal-arch Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

8000
Comment thread scripts/install.sh Resolved
Comment thread scripts/install.sh Resolved
Comment thread scripts/install_test.sh Resolved
@agent-137
Copy link
Copy Markdown
Member

/revise

Fix minimal-arch's two conditions at 07a7de7. Change nothing else.

  • C1. In scripts/install.sh (about line 2141), change the min box attach <box> row's description from open a shell in a running box to open a shell in a box, and start it again if it stopped. The pre-swap stop stopped every 0.7 box, and min box attach resumes a stopped or exited box. In scripts/install_test.sh (about line 4465), change the grep to match the new text.
  • C2. The installer runs from any directory, and min box list shows only the current project's boxes. In scripts/install.sh (about line 2140), name min box list --all, with the description list your boxes in every project. Keep the columns aligned with the other rows.
    • In docs/specs/07-spec-installer/07-spec-installer.md, R10.5 (about line 823), name min box list --all.
    • In scripts/install_test.sh (about line 4463), match the new row.

Answer each of the four minimal-arch threads with "Addressed in ". Keep Fixes #3846 in the body.

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.
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 3 of 10 on a /revise note, pushed as 2ab2b188aeda.

line exit tail
just test-installer case_state_archive_on_upgrade_from_0_7 0 == shellcheck --shell=sh == == running install_test.sh under sh == # install.sh tests (SH=sh) ok - sa1: seed install exits 0 ok - an upgrade from 0.7.3 to 0.8.0 exits 0 (R5.7) ok - the upgrade leaves a state copy beside the state directory (R5.7) ok - the state copy is byte-identical to the
just test-installer case_state_archive_refuses_short_space 0 == shellcheck --shell=sh == == running install_test.sh under sh == # install.sh tests (SH=sh) ok - ss1: seed install exits 0 ok - short space refuses the upgrade (R5.7) ok - the refusal says the space is short (R5.7) ok - the refusal says what the state uses and what is free (R5.7) ok - th
just test-installer case_refuses_0_7_over_0_8_state 0 == shellcheck --shell=sh == == running install_test.sh under sh == # install.sh tests (SH=sh) ok - a 0.8.0 install exits 0 ok - 0.7.3 over install.toml from 0.8.0 is refused (R2.6) ok - the refusal downloads nothing (R2.6) ok - the refusal says what was refused (R2.6) ok - the refusal says

Verify min task run agent-verify passed.

Review threads the coder judged:

  • 👍 valid — scripts/install.sh: Addressed in 2ab2b18
  • 👍 valid — scripts/install.sh: Addressed in 2ab2b18
  • 👍 valid — docs/specs/07-spec-installer/07-spec-installer.md: Addressed in 2ab2b18
  • 👍 valid — scripts/install_test.sh: Addressed in 2ab2b18

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.

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — advisory review

Verdict COMMENT — 1 finding, 1 inline.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

Comment thread scripts/install.sh Resolved
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.
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 4 of 10 on the runtime's review findings, pushed as e884ab8be99d.

line exit tail
just test-installer case_state_archive_on_upgrade_from_0_7 0 == shellcheck --shell=sh == == running install_test.sh under sh == # install.sh tests (SH=sh) ok - sa1: seed install exits 0 ok - an upgrade from 0.7.3 to 0.8.0 exits 0 (R5.7) ok - the upgrade leaves a state copy beside the state directory (R5.7) ok - the state copy is byte-identical to the
just test-installer case_state_archive_refuses_short_space 0 == shellcheck --shell=sh == == running install_test.sh under sh == # install.sh tests (SH=sh) ok - ss1: seed install exits 0 ok - short space refuses the upgrade (R5.7) ok - the refusal says the space is short (R5.7) ok - the refusal says what the state uses and what is free (R5.7) ok - th
just test-installer case_refuses_0_7_over_0_8_state 0 == shellcheck --shell=sh == == running install_test.sh under sh == # install.sh tests (SH=sh) ok - a 0.8.0 install exits 0 ok - 0.7.3 over install.toml from 0.8.0 is refused (R2.6) ok - the refusal downloads nothing (R2.6) ok - the refusal says what was refused (R2.6) ok - the refusal says

Verify min task run agent-verify passed.

Review threads the coder judged:

  • 👍 valid — scripts/install.sh: state_from_0_8 now reads install.toml from $box_state, so the printed mv clears the refusal with a relative XDG_STATE_HOME. A new rd5 test pins it.
  • 👍 valid — scripts/install.sh:1253: The earlier invalid verdict was wrong. The refusal now reads the key from $box_state, and the rd5 case covers a relative XDG_STATE_HOME.

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.

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@norrietaylor norrietaylor left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread scripts/install.sh Resolved
Comment thread scripts/install.sh Resolved
Comment thread scripts/install.sh Resolved
Comment thread scripts/install.sh Resolved
Comment thread scripts/install.sh 10BC8 Resolved
@agent-137
Copy link
Copy Markdown
Member

/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.

  1. High, the R2.6 refusal (scripts/install.sh about line 1276): stop the daemon before the user moves anything.
    • The refusal runs before stop_running_daemon, so a live 0.8 daemon (or VM) keeps running.
    • Its sockets and locks under providers/<host>/ would move with the state. The box store also writes sessions/index.json by absolute path into the restored copy.
    • Fix: the refusal's printed steps start with stopping the 0.8 hosts, before any mv. Use min host list, then min host stop <host> for each host. The 0.8 min is on disk at this point, and the steps must name it by its path when it is not on PATH.
    • Then come the move-aside and restore steps.
    • Add an install_test.sh case where a daemon stub is running at refusal time, asserting the stop step comes first.
  2. Medium, non-semver versions (about line 1295).
    • unstable and nightly resolve to a short commit hash, such as 9b763dd5, so ver_mm fails. Both guards then skip it: no archive on install.sh unstable from 0.7, and no refusal on --version <0.7-era sha> over 0.8 state when the index is absent.
    • Fix: when $VERSION is not X.Y..., take the version from the downloaded min version output, or from the manifest if it carries one.
    • If it still cannot be placed: treat it as 0.8 or later for the archive, because an extra copy is safe. For the refusal, do not refuse on that version alone.
    • Add cases with a sha-named version, both for the upgrade archive and for the refusal.
  3. Medium, a symlinked state directory (about line 1328).
    • cp -a/cp -R copy the link, not the data, and du -sk on the link reports 0.
    • Fix: resolve the state directory first (cd -P, then pwd -P). Run du/df on the resolved path. Copy the contents, as mkdir "$archive_dest" followed by cp -a "$resolved/." "$archive_dest" (with -c/--reflink/--sparse as now). The archive must be a real directory, not a link.
    • Add a test with a symlinked state directory: the archive is a directory whose files match the target's.
  4. Medium, the failed-copy branch is untested and does not say why (about line 1353).
    • Keep cp's stderr. Print its last line after the refusal's first sentence, as cp said: <line>.
    • Add a cp stub that fails every copy. Assert that the partial copy is removed, no executable is replaced, the exit is 1, and the stopped-daemon line prints.
    • Add a case that creates minimal.0.7.3 before the upgrade. Check that a .<t0>-suffixed copy is made and the existing one is left untouched.
  5. Low, the refusal names the first minimal.0.7.* in glob order, not the newest (about line 1278).
    • Pick the newest copy by modification time, and name it. When more than one exists, also say how many other copies there are and where, as one line.
    • Add a case with two copies.

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 Fixes #3846 in the body.

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.
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 5 of 10 on a /revise note, pushed as 9377d18e9f26.

line exit tail
just test-installer case_state_archive_on_upgrade_from_0_7 0 == shellcheck --shell=sh == == running install_test.sh under sh == # install.sh tests (SH=sh) ok - sa1: seed install exits 0 ok - an upgrade from 0.7.3 to 0.8.0 exits 0 (R5.7) ok - the upgrade leaves a state copy beside the state directory (R5.7) ok - the state copy is byte-identical to the
just test-installer case_state_archive_refuses_short_space 0 == shellcheck --shell=sh == == running install_test.sh under sh == # install.sh tests (SH=sh) ok - ss1: seed install exits 0 ok - short space refuses the upgrade (R5.7) ok - the refusal says the space is short (R5.7) ok - the refusal says what the state uses and what is free (R5.7) ok - th
just test-installer case_refuses_0_7_over_0_8_state 0 == shellcheck --shell=sh == == running install_test.sh under sh == # install.sh tests (SH=sh) ok - a 0.8.0 install exits 0 ok - 0.7.3 over install.toml from 0.8.0 is refused (R2.6) ok - the refusal downloads nothing (R2.6) ok - the refusal says what was refused (R2.6) ok - the refusal says

Verify min task run agent-verify passed.

Review threads the coder judged:

  • 👍 valid — scripts/install.sh: Addressed in 59c552a: the refusal now prints '/min host list' and '/min host stop ' before any mv. Case rd6 runs with a host-stop min and a live host, and checks that the stop steps come first.
  • 👍 valid — scripts/install.sh: Addressed in 59c552a: a hash-named version is placed from the shipped min's version output. An unplaceable one gets the copy and is not refused. Cases sa5, sa6, rd8 and rd9 cover it.
  • 👍 valid — scripts/install.sh: Addressed in 59c552a: the state is resolved with cd -P, and its contents are copied into a new directory. du measures the resolved path. Case sa7 checks that the copy is a real directory with the target's files.
  • 👍 valid — scripts/install.sh:1396: Addressed in 59c552a: the refusal prints 'cp said: '. Case ss3 stubs a failing cp, and case sa8 checks the . suffix next to an untouched earlier copy.
  • 👍 valid — scripts/install.sh:1301: Addressed in 59c552a: the refusal names the newest copy by modification time, and one line says how many older copies are beside it. Case rd7 covers two copies.

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]

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@agent-137
Copy link
Copy Markdown
Member

/arch-review

@minimal-arch minimal-arch Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Nov 27, 2026
@mitodrummer
mitodrummer added this pull request to the merge queue Nov 27, 2026
Merged via the queue into main with commit 07c81f7 Nov 27, 2026
43 checks passed
@mitodrummer
mitodrummer deleted the agent/3846-install-sh-archives-the-box-state-on-a-0-7-to-0 branch November 27, 2026 23:33
agent-137 pushed a commit that referenced this pull request Nov 28, 2026
… 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

D3845 — install.sh archives the box state on a 0.7 to 0.8 upgrade, refuses 0.7.x over 0.8 state, and names the box verbs on the closing card

3 participants

0