8000 fix: install.sh with a symlinked state directory saves the 0.7 copy beside the link's target and by minimal-foundry[bot] · Pull Request #3867 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

fix: install.sh with a symlinked state directory saves the 0.7 copy beside the link's target and - #3867

Merged
mitodrummer merged 2 commits into
mainfrom
agent/3866-install-sh-with-a-symlinked-state-directory-save
Nov 28, 2026
Merged

mitodrummer merged 2 commits into
mainfrom
agent/3866-install-sh-with-a-symlinked-state-directory-save

Conversation

@minimal-foundry
Copy link
Copy Markdown
Contributor

Follow-up

Fixes #3866

  • Epic: none; not charged to an epic
  • Size: S; estimated 70 code, 90 tests
  • May touch:
    • scripts/install.sh
    • scripts/install_test.sh
    • docs/specs/07-spec-installer/07-spec-installer.md
Task marker
### D3862 — install.sh with a symlinked state directory saves the 0.7 copy beside the link's target and restores onto that target, and keeps the link
  kind: task
  size: S
  est: 70 code, 90 tests
  executor: agent
  origin: bug
  layers:
    - installer:
      - scripts/install.sh: Resolve box_state once with cd -P and pwd -P. Put archive_dest and the df -Pk check beside the target. In refuse_over_0_8_state, move the target and search beside the target first, then beside the link, with a cp for a copy found beside the link.
      - scripts/install_test.sh: Update case sa7 to expect the target.0.7.3 copy with the link unchanged. Add refusal cases for a symlinked state, and a case for a pre-#3848 archive beside the link.
      - docs/specs/07-spec-installer/07-spec-installer.md: State the R5.7 archive location and the R2.6 restore line for a symlinked state directory.
      test: just test-installer state_archive_on_upgrade_from_0_7
      test: just test-installer refuses_0_7_over_0_8_state
  proof: An upgrade from 0.7.3 over minimal -> other/minimal makes other/minimal.0.7.3, and the printed restore line moves other/minimal and leaves the link pointing at the restored 0.7 state.

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 prints cp -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, sh is 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-prose did 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 state

Tests

line exit tail
just test-installer 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 refuses_0_7_over_0_8_state 0 mes the stop by the min on disk (R2.6) ok - the refusal says the next step (R2.6) ok - the refusal prints the move (R2.6) ok - with no saved copy the refusal names none (R2.6) ok - the refusal replaces nothing (R2.6) ok - 0.7.3 is refused with the move target taken (R2.6) ok - the printe

Verify

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

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.
@coderabbitai
coderabbitai Bot commented Nov 28, 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: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1cc20b91-f3dd-4b72-91ad-1fc9243f5a2a

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
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:1008: 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 28, 2026 •
Copy link
Copy Markdown
Contributor Author

Approved: no findings at 80bb8ed2afe2.

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.

@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 — No findings.

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

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Nov 28, 2026
@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

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.

@mitodrummer mitodrummer 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.

Approved.

@mitodrummer
mitodrummer added this pull request to the merge queue Nov 28, 2026
Merged via the queue into main with commit d3bafd0 Nov 28, 2026
43 checks passed
@mitodrummer
mitodrummer deleted the agent/3866-install-sh-with-a-symlinked-state-directory-save branch November 28, 2026 04:47
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.

D3862 — install.sh with a symlinked state directory saves the 0.7 copy beside the link's target and restores onto that target, and keeps the link

3 participants

0