Repository navigation
fix: install.sh with a symlinked state directory saves the 0.7 copy beside the link's target and - #3867
Conversation
A box state directory that is a symlink is now resolved once. The 0.7 copy goes beside the link's target, and the free-space check reads that file system. The 0.7-over-0.8 refusal moves the target, so the link stays and points at the restored state. It looks for a saved copy beside the target first, then beside the link, and copies a copy found beside the link back with cp -Rp.
R5.7 puts the 0.7 copy beside the link's target. R2.6 moves the target and keeps the link, and copies back a copy found beside the link.
|
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: no findings at Nothing to do. Verdict APPROVE, posted as a comment: the App cannot review its own pull request; the check and the label carry it. Clobber: not checked in git history. If that was not intentional, restore the earlier change. |
|
/arch-review |
There was a problem hiding this comment.
arch-review: PASS · the full ruling
The design of record does not govern the installer's 0.7 state copy or the restore after a refusal. Only line 168 and line 863 of architecture.md mention the installer, and neither applies. Installer spec 07 is the record, and this change amends R2.6 and R5.7 to match the code. A failed copy still stops the upgrade before any swap. Cases rd10 and rd11 run the printed restore line and then install 0.7.3.
Ruled at 80bb8ed against gominimal/arch@d3d472929d81 by claude-opus-5-5.
Follow-up
Fixes #3866
scripts/install.shscripts/install_test.shdocs/specs/07-spec-installer/07-spec-installer.mdTask marker
Proof
An upgrade from 0.7.3 over xdg-state/minimal -> ../other/minimal now makes other/minimal.0.7.3 and leaves the link unchanged. A return to 0.7.3 is refused, and the refusal says the state is a link to other/minimal. The printed restore line is
mv other/minimal other/minimal.0.8 && mv other/minimal.0.7.3 other/minimal. When that line runs, the link still points at ../other/minimal, which now holds the restored 0.7 state, and 0.7.3 installs. Test case rd10 checks this.Notes from the agent: install.sh resolves box_state_dir once, with cd -P and pwd -P, and only when the state path is itself a symlink. Without a symlink, the paths and the printed text are the same as before. A refusal over a symlinked state prints one new line:
<link> is a link to <target>. The steps below move <target> and keep the link.The refusal looks for a 0.7 copy beside the target first. If it finds none, it looks beside the link (case rd11) and printscp -Rp <copy> <target>in place of the second mv. That copy stays where it is. The target path is physical (pwd -P). Where HOME contains a symlinked component, as /var on macOS does, the target prints without ~. The tests compute the expected paths with pwd -P for this reason. On this box,shis bash and dash is not installed, so the recipe ran each case under one shell only. The dash run is still owed, and the shell-installer CI lane will do it.just lint-prosedid not run because vale is not installed, so the spec edit is not Vale-checked. I also ran state_archive_refuses_short_space, because the df path changed: 24 passed.Commit bodies re-wrapped by the runtime: a prose line over commitlint's 100 is split at a space where no piece is left over it, and code and lines that cannot split are left as written. Every word the coder wrote is kept, in order:
docs(installer): spec the copy and restore for a symlinked stateTests
just test-installer state_archive_on_upgrade_from_0_7just test-installer refuses_0_7_over_0_8_stateVerify
min task run agent-verifypassed ([tasks.verify]).