You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Nothing tests the bootstrap loaders' kept-tree swap sequence #1767
The #1756 change gave host-setup/bootstrap.sh and bootstrap.ps1 a kept tree with a staging, swap, and retire sequence. The sequence runs in this order:
It extracts to a .new sibling.
It swaps the tree in immediately before the skills step, with the old tree moved aside to .old first and removed last.
It removes a leftover .new or .old on exit.
Nothing executes that sequence in CI. scripts/tests/test_bootstrap.py checks the loaders statically, and scripts/tests/test_skills_install.py covers only the Python installer. A change that reorders the steps would pass every check. Examples: swapping before an earlier stand-up step, or removing the old tree before the new one is in place.
What follows
The property this sequence exists for goes unchecked: a failed stand-up leaves the plugin loading the previous tree.
Options
Add a test that runs bootstrap.sh in a scratch HOME. Give it a stub curl that serves a local tarball, and stub tools that fail at a chosen step. Then assert on the tree left behind. Add the same test for bootstrap.ps1 under pwsh.
Extract the swap into a function each loader can be asked to run on its own, and test that function.
Found by the local strict review on the #1756 change.
Copilot raised this again as two previously-missed findings on promotion PR #1774, at host-setup/bootstrap.ps1:299 and host-setup/bootstrap.sh:179. I filed that as #1780 by mistake, and it is closed as a duplicate of this issue.
Note from the windows lane, for whoever works this next. What now exercises the kept-tree swap sequence is in tests/test_bootstrap.py, by option 2's shape, each loader's own functions driven against a scratch directory:
TestKeptTreeHandling (bash, Linux) and TestPowerShellKeptTreeHandling (pwsh, both platforms) inject a failure at each rename and removal of swap_in/Invoke-SwapIn and of the cleanup, then assert which tree is left on disk.
The PowerShell class also runs Get-Tree → Invoke-SwapIn → Invoke-Cleanup with a stubbed download and extract, including a failed extract.
Test That the Directory the Skills Installer Registers Outlives the Run #2554, merged to develop, adds one case per loader that runs fetch → install_skills/Invoke-SkillsInstall → cleanup. Each asserts that the directory the installer registers is the kept tree and outlives the run. Running the installer ahead of the swap fails both cases.
What none of them does is option 1's end-to-end run of main with a stub curl and a scratch HOME, so whether that is still owed is this issue's call.
Activity
Promote the Bootstrap's Kept Skills Tree to Main (#1774)
ptr727 commentedon Sep 24, 2026
Copilot raised this again as two previously-missed findings on promotion PR #1774, at
host-setup/bootstrap.ps1:299andhost-setup/bootstrap.sh:179. I filed that as #1780 by mistake, and it is closed as a duplicate of this issue.ptr727 commentedon Oct 8, 2026
Note from the
windowslane, for whoever works this next. What now exercises the kept-tree swap sequence is intests/test_bootstrap.py, by option 2's shape, each loader's own functions driven against a scratch directory:TestKeptTreeHandling(bash, Linux) andTestPowerShellKeptTreeHandling(pwsh, both platforms) inject a failure at each rename and removal ofswap_in/Invoke-SwapInand of the cleanup, then assert which tree is left on disk.Get-Tree→Invoke-SwapIn→Invoke-Cleanupwith a stubbed download and extract, including a failed extract.install_skills/Invoke-SkillsInstall→ cleanup. Each asserts that the directory the installer registers is the kept tree and outlives the run. Running the installer ahead of the swap fails both cases.What none of them does is option 1's end-to-end run of
mainwith a stubcurland a scratch HOME, so whether that is still owed is this issue's call.ptr727 commentedon Oct 8, 2026
Claimed for the
wsllane (#2478), worked on this WSL2 Debian host.feature/wsl-1767tests/test_bootstrap.py, andhost-setup/bootstrap.shonly if the end-to-end run needs a seamAny other group needing one of these files waits for this branch to merge.
Run bootstrap.sh's Whole Main Flow Against a Stub Download and Stub T…