Skip to content

improve(setup): keep WSL operations inside the app-owned directory - #1006

Merged
shanselman merged 11 commits into
openclaw:mainfrom
calebeden:calebeden-harden-setup-distro-paths
Jul 21, 2026
Merged

shanselman merged 11 commits into
openclaw:mainfrom
calebeden:calebeden-harden-setup-distro-paths

Conversation

@calebeden

@calebeden calebeden commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor
Additional instructions

MUST: Keep Allow edits from maintainers enabled for this PR so maintainers can help update the branch when needed.

What problem this solves

Standalone SetupEngine accepted custom WSL distro names when deriving cleanup and install paths. A traversal value such as ..\.. could resolve outside %LOCALAPPDATA%\OpenClawTray\wsl, where cleanup performs recursive deletion.

No known user incident prompted this change. The packaged application supplies its fixed distro name, so the exposed path is primarily the repository/developer SetupEngine flow.

Contract

All WSL distro install paths now go through DistroInstallPathPolicy.

  • New creation: 1–64 ASCII letters, digits, periods, underscores, or hyphens; first and last characters must be alphanumeric.
  • Legacy teardown: spaces and Unicode are accepted only when the name is one safe Windows path segment resolving to one unambiguous immediate child of the app-owned LocalDataDir\wsl root.
  • Rejected: traversal, rooted paths, separators, reserved-device/short-path aliases, case or Unicode-normalization collisions, non-directory roots, and reparse points at the local-data root, WSL root, or managed child.
  • Deletion: ownership is revalidated before every retry. The VHD directory is preserved unless WSL confirms the distro is absent or targeted unregister succeeds/reports it absent.

Setup validates the creation grammar before stale cleanup, so it cannot delete a legacy install and then discover that the same name cannot be recreated. To replace a legacy install, run SetupEngine with --uninstall --confirm-destructive and the same legacy name, then install with a supported name.

The remaining same-user filesystem check-to-use race is an explicit residual risk; the available WSL and directory APIs do not provide a handle-based atomic install/delete boundary.

Main merges and conflict decisions

Current main was merged normally throughout landing preparation:

  • b7231a3dce639b8b14e2021d486829fe8facbe62 in 57426b8fbc84124614468e605e7f3260ac546a2e
  • 93b645c93d880c16b4e91c9f255d472c98452468 in 0c8e9c7695bcf46e277cb20e515c4c06ae23b361
  • 1810e357aa0d0639099b347f31c746ba7d31512a in 309cef0bbcc3755ea6404428e0f78823a765f6e3
  • ddad64031116f62fa00fdd392d61717f23393ab0 in final merge 63d457f92b0fffc8e5e64e479c67f668dda7ce9c

The first three merges were clean. The final merge had one conflict in a current-main integration test that both sides repaired concurrently. Resolution took main's stronger contract: a concrete executable with wildcard arguments (marker + " *"). The resolved test passed locally, and the file has no diff against current main. No setup, cancellation, or credential conflict occurred.

Behavioral coverage

Tests use real Windows filesystem behavior, including junctions and a case-sensitive directory. They cover:

  • 64-character creation accepted and 65 rejected;
  • legacy space and Unicode names rejected for creation but accepted for teardown;
  • setup rejection before stale cleanup or command execution;
  • legacy uninstall/rollback followed by supported-name replacement;
  • rooted/traversal/separator/reserved-device/alias rejection;
  • case and Unicode-normalization collisions;
  • root, ancestor, and managed-child reparse points;
  • retry-time replacement of wsl\ with a junction while an outside sentinel remains intact;
  • VHD preservation when unregister fails;
  • empty managed-root cleanup when the distro is already absent;
  • unsafe uninstall rejection before rollback or tray-artifact cleanup.

A required independent Claude Opus rubber-duck review found no blocking correctness or security issue and independently ran 59 focused containment/rollback tests successfully.

Change type

  • Bug fix
  • Docs or instructions
  • Tests or validation
  • Security hardening

Scope

  • Setup or onboarding
  • Permissions, privacy, or security
  • Tests, CI, or docs

Validation

Validated at PR head 63d457f92b0fffc8e5e64e479c67f668dda7ce9c with OPENCLAW_REPO_ROOT set to this isolated worktree:

  • .\build.ps1 — passed; Shared, CLI, WinNode CLI, SetupEngine, and WinUI built
  • dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore — 3,021 passed, 31 skipped, 0 failed
  • dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore — 1,834 passed, 0 skipped, 0 failed
  • dotnet test .\tests\OpenClaw.SetupEngine.Tests\OpenClaw.SetupEngine.Tests.csproj --no-restore — 697 passed, 0 skipped, 0 failed
  • Focused strict-creation/safe-teardown slice — 46 passed, 0 skipped, 0 failed
  • Focused SystemExecApprovals_GetThenSet_PersistsRule integration test after conflict resolution — 1 passed, 0 failed
  • .\scripts\validate-wsl-gateway.ps1 -Scenario PreflightOnly -NoBuild — passed
  • git diff --check — passed
  • Connection tests were not run because this PR has no OpenClaw.Connection diff against current main.

Final-head CI run 29788066538 passed:

  • test — passed in 11m24s
  • e2etests (setup-connect) — passed in 9m36s
  • e2etests (revocation-recovery) — passed in 8m37s
  • e2etests (network-recovery) — passed in 8m27s
  • build (win-x64) — passed in 6m34s
  • build (win-arm64) — passed in 6m56s
  • repository hygiene and advanced setup gate — passed
  • CodeQL workflow completed with security jobs skipped by repository policy

Real behavior proof

Proof head: 63d457f92b0fffc8e5e64e479c67f668dda7ce9c.

The final-head GitHub setup E2E shard passed the real disposable WSL setup/connect path. Revocation-recovery and network-recovery also passed on the same head. Together they cover production SetupEngine provisioning, gateway startup, tray/node connection, recovery, and teardown on disposable WSL distros.

A separate local Windows x64 run also created three uniquely named disposable WSL2 distros under isolated app-owned local-data roots. Its logs showed successful path validation, direct WSL creation, WSL configuration, lockdown validation, CLI installation, gateway configuration, and service installation. That host then failed gateway health, so the local run was not counted as a pass. Setup rollback plus production CLI teardown nevertheless removed every disposable registration and isolated temp directory; post-run wsl --list --quiet contained no OpenClawE2E-* distro.

The local repeated-uninstall error was traced to windows-node-context inspecting a distro already removed by setup rollback; the containment/VHD rollback step safely treated the distro as absent and left no managed files behind.

Supporting earlier Dev Box captures

These captures predate the compatibility follow-up and are retained only as supporting evidence. They are not presented as current-head proof. All four URLs were rechecked after this update and returned HTTP 200.

Build identification Valid install Valid uninstall Unsafe name rejection

Not verified / blocked: the local host could not reach gateway-ready state, but the same final-head setup-connect path passed in GitHub CI. No merge-blocking proof gap remains.

Security impact

No permissions, secrets handling, network calls, or data-access scope are added. Existing wsl --install --location, targeted WSL teardown, and recursive cleanup inputs are constrained to validated app-owned paths. Teardown accepts broader legacy names only after proving the same canonical immediate-child boundary, and destructive file cleanup is gated on WSL registration state.

Compatibility and migration

Existing safe legacy names remain uninstallable; new/recreated names use the stricter grammar. No automatic migration is required. Replacement steps are --uninstall --confirm-destructive with the existing name, followed by setup with a supported name.

Review conversations

  • Addressed the maintainer and ClawSweeper legacy-compatibility finding.
  • Added authentic migration, uninstall, rollback, collision, reparse, and fail-closed deletion tests.
  • Latest ClawSweeper rerun remained stale at its review started placeholder for a prior head and is not treated as approval.

calebeden and others added 2 commits July 16, 2026 19:07
Validate distro names and canonical install paths before setup cleanup, installation, and rollback filesystem operations. Reject reparse-point ancestors and revalidate ownership before each recursive-delete retry.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: f19f98b7-f377-4da5-a7ce-0f1ae34153cf
Preserve the finalized WSL quoting ownership rows from openclaw#1001 and append the WSL distro install-path policy row.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: f19f98b7-f377-4da5-a7ce-0f1ae34153cf
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. labels Jul 17, 2026
@clawsweeper

clawsweeper Bot commented Jul 17, 2026 •

Copy link
Copy Markdown

Codex review: found issues before merge. Reviewed July 17, 2026, 8:53 PM ET / July 18, 2026, 00:53 UTC.

Summary
The PR adds a centralized WSL distro install-path policy, routes setup cleanup and rollback deletion through it, documents the new ownership boundary, and adds traversal/reparse-point regression tests.

Reproducibility: yes. for the reported unsafe-path behavior: the new tests and current-head Dev Box proof exercise traversal rejection before distro-targeting and recursive-delete operations. The compatibility regression is source-reproducible because the new policy rejects any configured name outside its ASCII allowlist before cleanup begins.

Review metrics: 2 noteworthy metrics.

  • Patch surface: 4 files affected; 455 added, 22 removed. Most of the change is a new deletion-boundary policy plus focused setup regression coverage, so the compatibility contract deserves explicit review.
  • Behavior proof: 4 current-head terminal captures. The supplied Dev Box proof covers valid install, valid uninstall, and unsafe-name rejection on the proposed head.

Merge readiness
Overall: 🦐 gold shrimp
Proof: 🦞 diamond lobster ✨ media proof bonus
Patch quality: 🦐 gold shrimp
Result: needs maintainer review before merge.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Resolve the P1 compatibility finding by preserving safe legacy names or obtaining an explicit maintainer decision with upgrade coverage.

Risk before merge

  • [P1] Existing developer or repository workflows using a safe custom WSL distro name that falls outside the new ASCII 1–64-character grammar can fail before cleanup, setup, or guarded deletion proceeds, without a migration or explicit compatibility decision.
  • [P1] The policy improves containment but still documents an unavoidable same-user filesystem check-to-use race; maintainers should accept that residual boundary explicitly rather than treating the validation as atomic deletion protection.

Maintainer options:

  1. Retain containment without a broad name break (recommended)
    Revise the policy to preserve safe existing custom names while retaining canonical-root, immediate-child, reparse-point, and retry-time ownership validation.
  2. Accept and document the restriction
    Approve the new name contract only with clear upgrade behavior and tests showing how existing unsupported custom names are recovered without unsafe cleanup.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Preserve safe legacy custom distro names while rejecting only paths that cannot be proven to be an immediate non-reparse child of the app-owned WSL root; add regression coverage for a previously safe non-ASCII or otherwise legacy-compatible name.

Next step before merge

  • [P2] A maintainer must choose the supported custom-distro-name compatibility contract before any narrow repair can be safely applied.

Maintainer decision needed

  • Question: Should standalone SetupEngine continue accepting existing safe custom WSL distro names, or should the project intentionally restrict all such names to the new ASCII 1–64-character grammar?
  • Rationale: The path-safety objective is clear, but the PR changes an existing developer-facing configuration contract and can strand legacy cleanup or setup flows; source inspection and tests cannot choose that compatibility policy safely.
  • Likely owner: calebeden — They authored the present policy and can clarify the intended SetupEngine compatibility boundary, although a project owner must make the final product decision.
  • Options:
    • Preserve safe custom names (recommended): Keep canonical containment and reparse-point protections while allowing existing names that resolve to a safe immediate child of the app-owned WSL root.
    • Approve the narrower contract: Accept the ASCII-only restriction as an intentional breaking change and add explicit upgrade, cleanup, and compatibility coverage for prior custom names.

Security
Cleared: No new dependency, permission, secret, network, or supply-chain exposure was found; the patch narrows existing WSL install and recursive-cleanup path handling, subject to the documented non-atomic same-user filesystem race.

Review findings

  • [P1] Preserve safe existing custom distro names — src/OpenClaw.SetupEngine/DistroInstallPathPolicy.cs:19
Review details

Best possible solution:

Preserve already-safe custom distro names through canonical immediate-child containment and reparse-point checks, rejecting only names or paths that resolve outside the app-owned root; adopt the narrower name grammar only if maintainers explicitly choose that compatibility break and document an upgrade path.

Do we have a high-confidence way to reproduce the issue?

Yes for the reported unsafe-path behavior: the new tests and current-head Dev Box proof exercise traversal rejection before distro-targeting and recursive-delete operations. The compatibility regression is source-reproducible because the new policy rejects any configured name outside its ASCII allowlist before cleanup begins.

Is this the best way to solve the issue?

No, not yet: centralized canonical containment and reparse validation are the right safety mechanism, but an unconditional broad name allowlist is not the narrowest solution until maintainers approve breaking existing safe custom-name workflows.

Full review comments:

  • [P1] Preserve safe existing custom distro names — src/OpenClaw.SetupEngine/DistroInstallPathPolicy.cs:19
    The new allowlist rejects every configured distro name outside its new ASCII 1–64-character grammar before cleanup/setup runs. The PR acknowledges this as a compatibility break, but it provides neither a migration nor maintainer-approved contract change; retain path containment checks while preserving safe legacy names, or obtain an explicit decision and upgrade path before merge.
    Confidence: 0.95

Overall correctness: patch is incorrect
Overall confidence: 0.95

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 4518dd87ed2b.

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides current-head Dev Box terminal screenshots covering a successful isolated install, uninstall, and unsafe-name rejection with the outside sentinel preserved; this is appropriate direct proof for native setup and filesystem behavior.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR body provides current-head Dev Box terminal screenshots covering a successful isolated install, uninstall, and unsafe-name rejection with the outside sentinel preserved; this is appropriate direct proof for native setup and filesystem behavior.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (screenshot): The PR body provides current-head Dev Box terminal screenshots covering a successful isolated install, uninstall, and unsafe-name rejection with the outside sentinel preserved; this is appropriate direct proof for native setup and filesystem behavior.
  • remove status: 📣 needs proof: Current PR status label is status: ⏳ waiting on author.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P2: This is meaningful setup and filesystem-boundary hardening, but the stated exposure is the standalone developer SetupEngine path and no user incident is reported.
  • merge-risk: 🚨 compatibility: The policy intentionally rejects previously possible custom distro-name configurations without a migration or approved compatibility contract.
  • merge-risk: 🚨 security-boundary: The diff changes the validation boundary protecting recursive cleanup and WSL install locations, where an incorrect policy could affect destructive-path safety.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (screenshot): The PR body provides current-head Dev Box terminal screenshots covering a successful isolated install, uninstall, and unsafe-name rejection with the outside sentinel preserved; this is appropriate direct proof for native setup and filesystem behavior.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides current-head Dev Box terminal screenshots covering a successful isolated install, uninstall, and unsafe-name rejection with the outside sentinel preserved; this is appropriate direct proof for native setup and filesystem behavior.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR body provides current-head Dev Box terminal screenshots covering a successful isolated install, uninstall, and unsafe-name rejection with the outside sentinel preserved; this is appropriate direct proof for native setup and filesystem behavior.
Evidence reviewed

What I checked:

  • Restrictive policy: The new policy rejects every custom distro name outside a 1–64-character ASCII allowlist before cleanup or setup operations can use the existing configuration, despite the PR explicitly describing this as intentionally backward incompatible. (src/OpenClaw.SetupEngine/DistroInstallPathPolicy.cs:19, 63e5a9b9cb39)
  • Destructive-path coverage: Cleanup now obtains its WSL directory through the policy before listing, unregistering, or deleting the configured distro path, so a previously accepted custom name can become unable to complete its existing cleanup workflow. (src/OpenClaw.SetupEngine/SetupSteps.cs:243, 63e5a9b9cb39)
  • Regression coverage: The branch adds focused policy and cleanup tests for missing names, traversal, path separators, canonical immediate-child containment, reparse points, and retry-time path substitution. (tests/OpenClaw.SetupEngine.Tests/SetupStepsTests.cs:52, 63e5a9b9cb39)
  • Prior-review continuity: The only prior blocking finding was to preserve safe existing custom distro names; the PR head remains 63e5a9b and the new policy still enforces the same breaking name restriction. (src/OpenClaw.SetupEngine/DistroInstallPathPolicy.cs:19, 63e5a9b9cb39)
  • Current-head behavior proof: The PR body supplies four linked Dev Box terminal captures for the exact head: build identification, valid install, valid uninstall, and traversal rejection with the external sentinel preserved and no destructive distro operations logged. (63e5a9b9cb39)
  • Current-main status: The PR is open, unmerged, and cleanly mergeable against its base; the provided current-main SHA is 4518dd8, so the branch hardening is not an implemented-on-main close candidate. (4518dd87ed2b)

Likely related people:

  • calebeden: Authored the two commits introducing the proposed path-policy boundary and the associated setup regression tests; no independent current-main area owner could be established from the available review context. (role: recent setup-path contributor; confidence: low; commits: e2c7889befba, 63e5a9b9cb39; files: src/OpenClaw.SetupEngine/DistroInstallPathPolicy.cs, src/OpenClaw.SetupEngine/SetupSteps.cs, tests/OpenClaw.SetupEngine.Tests/SetupStepsTests.cs)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (4 earlier review cycles)
  • reviewed 2026-07-17T03:08:45.297Z sha 63e5a9b :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-17T03:49:10.119Z sha 63e5a9b :: needs real behavior proof before merge. :: [P1] Preserve safe existing custom distro names
  • reviewed 2026-07-17T04:29:54.013Z sha 63e5a9b :: needs real behavior proof before merge. :: [P1] Preserve safe existing custom distro names
  • reviewed 2026-07-18T00:12:57.437Z sha 63e5a9b :: needs real behavior proof before merge. :: [P1] Preserve safe existing custom distro names

@calebeden
calebeden marked this pull request as draft July 17, 2026 03:50
@calebeden

Copy link
Copy Markdown
Contributor Author

Marking as draft until I can further test this tomorrow

@calebeden
calebeden marked this pull request as ready for review July 18, 2026 00:14
@calebeden

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 18, 2026 •

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 18, 2026
@shanselman

Copy link
Copy Markdown
Collaborator

GitHub Copilot maintainer-assistant review — automated feedback, not written personally by Scott.

Reviewed head: 63e5a9b9cb3939b2e462c708d702c22e66ca8018

The containment policy is well designed: canonical immediate-child checks, tight distro-name allowlisting, reparse-point ancestor rejection, retry-time revalidation, and real junction-based TOCTOU tests are strong. There is no existing repository path-policy utility that should replace this owner.

The remaining merge blocker is compatibility for existing custom distro names. Previously accepted names containing spaces or non-ASCII characters can now fail before replacement, cleanup, rollback, or uninstall filesystem work. That can strand an existing managed installation even though the new-install policy is safer.

Please choose and prove a migration contract:

  1. Preferably allow legacy existing distro records to be safely located/cleaned using canonical containment checks while enforcing the stricter name allowlist only for newly created distros; or
  2. Provide a guided migration/recovery path with actionable errors and tests for legacy names such as OpenClaw Gateway and a non-ASCII example.

Add integration-style tests for replacement and uninstall/rollback of a legacy custom-name distro, proving nothing outside the app-owned root is touched. Also add boundary coverage for exactly 64 vs 65 characters and a rollback test asserting invalid/traversal names fail closed without deleting external paths.

The first-use TOCTOU limitation is documented and acceptable for this PR, but the legacy-name upgrade/uninstall path needs a concrete supported behavior before merge.

Separate strict new-install naming from safe legacy teardown so existing managed distros can be removed without weakening path containment.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f19f98b7-f377-4da5-a7ce-0f1ae34153cf
@calebeden

Copy link
Copy Markdown
Contributor Author

Caleb Eden + GitHub Copilot pair-programming follow-up

@shanselman Thanks for flagging the legacy-installation compatibility gap. We implemented a strict-creation, safe-teardown contract at 992338b7.

New distro creation retains the 1–64 character ASCII grammar. Uninstall and rollback accept older names containing spaces or Unicode only when the name is one unambiguous Windows path segment whose canonical path is an immediate child of the app-owned LocalDataDir\wsl root. The existing reparse-point, containment, and retry-time validation remains unchanged.

Setup now validates the creation contract before stale cleanup, so it cannot delete a legacy installation and then discover that its name cannot be recreated. The actionable recovery path is to rerun SetupEngine with --uninstall --confirm-destructive and the same legacy name, then reinstall with a supported name. Unsafe uninstall names fail before rollback, distro-targeting commands, recursive deletion, or tray-artifact cleanup.

Added coverage for:

  • OpenClaw Gateway and a non-ASCII legacy name through uninstall/rollback and supported-name replacement;
  • exactly 64 creation characters accepted and 65 rejected;
  • traversal rollback rejected before commands or deletion while preserving an outside sentinel;
  • setup rejection before stale cleanup;
  • reserved Windows device aliases, including superscript COM/LPT variants.

Validation is green: full build; Shared tests with 2,864 passed and 31 skipped; Tray tests with 1,717 passed; SetupEngine tests with 471 passed; and 42 focused contract tests. A final Claude Opus + GPT Codex review found no actionable issues.

calebeden and others added 8 commits July 20, 2026 12:11
Resolve the combined SetupEngine preflight flow by retaining distro path validation ahead of cleanup and incorporating the new Tailscale setup steps.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f19f98b7-f377-4da5-a7ce-0f1ae34153cf
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 675e4cf9-9a9b-4a46-b00f-ba5a78916e0a
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 675e4cf9-9a9b-4a46-b00f-ba5a78916e0a
Resolve the concurrent exec-approval integration-test repair in favor of main's concrete-executable plus wildcard-arguments contract.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 675e4cf9-9a9b-4a46-b00f-ba5a78916e0a
@shanselman

Copy link
Copy Markdown
Collaborator

GitHub Copilot maintainer-assistant validation note — automated, not written personally by Scott.

Final reviewed head: 3cc8e9e1349d6fc60ede8064cc69b055f0bdf121.

The containment/setup proof originally stamped at 63d457f9 remains applicable: 63d457f9..3cc8e9e1 changes no setup/path-policy implementation files. At the final head, repository hygiene, test, setup-connect E2E, revocation-recovery E2E, network-recovery E2E, and x64/ARM64 builds all passed. Paired final review found no blocking issue (91%/93% confidence).

@shanselman
shanselman merged commit d0fca93 into openclaw:main Jul 21, 2026
12 checks passed
@calebeden
calebeden deleted the calebeden-harden-setup-distro-paths branch July 21, 2026 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P2 Normal priority bug or improvement with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants