Refuse unattended purge of a non-empty nested Workspace - #175
Merged
Merged
Conversation
`uninstall.sh --purge --yes` and `uninstall.ps1 -Purge -Yes` silently deleted the default Workspace at <install dir>/workspace because the Workspace warning was gated on interactive mode and the summary never listed it. Both adapters now count the Workspace once, list a non-empty nested Workspace (with item count) in the pre-confirmation summary, and refuse unattended purge before any destructive operation unless --delete-workspace / -DeleteWorkspace is passed. Empty or external Workspaces need no flag; the interactive prompt is unchanged. The new flag requires --purge. Also document in the v1.3.0 release notes that the --pids-limit=4096 bound only reaches an existing Box when it is recreated. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
uninstall.sh --purge --yes/uninstall.ps1 -Purge -Yessilently deleted the default Workspace at$INSTALL_DIR/workspace(user project files). The "Recorded Workspace contains N item(s)" warning only ran in interactive mode, and the pre-confirmation summary never listed the Workspace.Change (both adapters, aligned)
- Workspace inside install directory (N item(s)): <path>.--purge --yes(-Purge -Yes) with a non-empty nested Workspace now refuses (exit 1, clear message) before any destructive operation unless--delete-workspace(-DeleteWorkspace) is passed.Continue? [y/N]prompt.--delete-workspacewithout--purgeis rejected (bash exit 64; PowerShellAbort).docs/releases/v1.3.0.mdare updated.The v1.3.0 release notes also say that existing Boxes get the new
--pids-limit=4096bound only once the Box is recreated (sqrbx-rebuild, re-running the installer, ordocker compose up -dfor Compose).Tests
tests/test-lifecycle-ownership.sh: with a non-empty nested Workspace, unattended purge refuses (exit 1), lists the Workspace in the summary, and leaves the Workspace files, Install identity, shell adapter, and rc sentinel in place. The mock runtime records norm,rmi, orvolume rmcall. The test also checks that--delete-workspacewithout--purgeexits 64, that--delete-workspacepurges, and that an empty nested Workspace needs no flag. I confirmed it fails against the olduninstall.sh.tests/test-lifecycle-powershell.ps1: a static assertion plus a behavioral refusal check (summary text, files kept, no destructive runtime calls) and a successful-DeleteWorkspacepurge, using the mock runtime harness. I ran it locally inmcr.microsoft.com/powershellvia podman: it passes, and it fails against the olduninstall.ps1.tests/test-lifecycle-static.sh: greps for the new flag and the new summary line in both adapters.tests/test-*.shpass.🤖 Generated with Claude Code