Skip to content

fix(update): relocate dirty checkouts from the shell installer - #147677

Open
RomneyDa wants to merge 8 commits into
fix/update-dirty-relocationfrom
fix/update-installer-relocation
Open

RomneyDa wants to merge 8 commits into
fix/update-dirty-relocationfrom
fix/update-installer-relocation

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

Depends on #147629. Windows npm launcher support is separate in #147653.

Dirty development checkouts installed by the official shell installer can update through its verified ~/.local/bin/openclaw wrapper. The existing npm transaction publishes a fresh checkout while preserving local edits and retaining the original wrapper for rollback.

Admission verifies the Node runtime, built checkout, wrapper and destination, then rechecks before activation. Rollback only removes a package after this update has published it and verified its identity. A failed publication or a competing replacement stays untouched; copy fallback retains ownership even if later source cleanup fails. Existing installed-package restoration stays intact.

Validation: both foreign-destination regressions failed before the fix. All 188 package/filesystem/recovery tests and 11 installer CLI scenarios passed, along with types, lint, the full changed gate and fresh independent P2 review. The canonical build passed before the publication repair, which adds no imports. The rebase onto current main is patch-identical; final combined-head verification passed all 188 package-owner tests, 22 POSIX npm/installer CLI scenarios, types and scoped lint. CI has no reported failures; the remaining Linux checks are queued for unassigned Blacksmith 32-vCPU runners.

Support is limited to the maintained installer’s literal-path wrapper. Custom prefixes, shell expansions and ANSI-C quoted paths remain untouched, with manual installation guidance documented. Older installed updaters retain their own behavior. This PR does not claim a complete managed-service rollback campaign.

@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@RomneyDa
RomneyDa marked this pull request as ready for review September 14, 2026 01:39
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes size: M maintainer Maintainer-authored PR labels Sep 14, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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. labels Sep 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 5, 2026, 11:35 AM ET / 15:35 UTC (Revision 6).

ClawSweeper review

What this changes

The branch updates dirty development installations into a fresh checkout, preserves local edits, and adds installer-wrapper and Windows npm launcher admission and rollback checks.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep open: this protected, member-authored PR still provides useful installer support absent from main. The previously reported P1 launcher regression remains on the unchanged head, and the stack currently has merge conflicts.

Priority: P2
Reviewed head: 2f7ec3ae1c342b18f91efce6b61bfb0b18a95920

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful transaction and preservation work remains blocked by the reproducible launcher-contract defect and scoped upgrade qualification.
Proof confidence 🌊 off-meta tidepool Not applicable: The MEMBER-authored PR is exempt from ordinary external-contributor proof. Focused installer fixtures support admission and filesystem recovery, and sibling native Windows evidence covers Windows launchers; neither resolves POSIX pinned-Node behavior or the separately required installed-driver/service upgrade qualification. No stored-data format changes were identified.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The MEMBER-authored PR is exempt from ordinary external-contributor proof. Focused installer fixtures support admission and filesystem recovery, and sibling native Windows evidence covers Windows launchers; neither resolves POSIX pinned-Node behavior or the separately required installed-driver/service upgrade qualification. No stored-data format changes were identified.
Evidence reviewed 10 items Pinned introduction and review continuity: Reviewed the supplied merge-base-to-head introduction. Comparing the earlier reviewed head 16cd95f with the current head shows no change in the installer admission or package-swap modules; the previous pinned-Node finding remains applicable.
Installer runtime contract: The shell installer resolves an absolute Node executable, verifies the built entry with it, and writes that executable into the canonical wrapper. The new admission accepts this absolute executable when it resolves to process.execPath.
Replacement loses pinned Node: Installer recovery retains the wrapper and runtime verifier but no Node executable for replacement publication. Activation copies the staged npm launcher, whose package entry starts with #!/usr/bin/env node. Doctor instead uses the explicitly resolved Node runner, so its success does not establish that the new launcher works under the original shell PATH.
Findings 1 actionable finding [P1] Preserve the installer's pinned Node when replacing its launcher
Security None None.

How this fits together

The updater discovers the invoked installation, stages and validates replacement code, then changes its launcher through the package transaction. That launcher determines which checkout and Node runtime future CLI invocations use.

flowchart TD
  A[Invoked installation] --> B[Check launcher and checkout]
  B --> C[Stage fresh checkout]
  C --> D[Validate replacement]
  D --> E[Publish package and launcher]
  E --> F[Future CLI and Gateway]
  E --> G[Retained rollback installation]
Loading

Before merge

  • Preserve the installer's pinned Node when replacing its launcher (P1) - Admission accepts an absolute Node matching process.execPath, but the recovery value does not carry that executable into replacement publication. The swap copies npm's launcher, which invokes openclaw.mjs through #!/usr/bin/env node. If the supported Node is absent from the original PATH, the old installer wrapper works and Doctor can pass using an explicit Node runner, while the next openclaw invocation fails. Preserve the verified runtime in the replacement and exercise it without that Node on PATH. This previously reported blocker remains unchanged.
  • Resolve merge risk (P1) - The published-updater-to-candidate installer transition and rollback remain unqualified for the supported managed-service topology; private historical acceptance does not establish compatibility of this public head.
  • Complete next step (P2) - Preserve the installer's verified Node in the replacement launcher, resolve stack conflicts, and qualify the published-driver installer activation and rollback path.

Findings

  • [P1] Preserve the installer's pinned Node when replacing its launcher — src/infra/package-update-npm-root.ts:45-49
Agent review details

Security

None.

PR surface

Source +449, Tests +798, Docs +23, Config 0, Other +1. Total +1271 across 25 files.

View PR surface stats
Area Files Added Removed Net
Source 16 590 141 +449
Tests 6 816 18 +798
Docs 1 23 0 +23
Config 1 1 1 0
Generated 0 0 0 0
Other 1 2 1 +1
Total 25 1432 161 +1271

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Qualify the installer transition (recommended)
    Preserve the pinned Node runtime and record the published-driver transition, launcher invocation, and activation rollback with the managed service when configured.
  2. Hold the installer slice
    Keep this PR open while the assigned update-recovery owner completes the dependent stack and installer acceptance.

Technical review

Best possible solution:

Keep one package transaction owner while preserving the installer's verified Node executable through replacement, subsequent updates, and rollback.

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

Yes, source establishes a concrete patch failure path: use a canonical installer wrapper whose absolute supported Node is absent from PATH, then relocate it and invoke the replacement launcher. This read-only review did not execute that scenario.

Is this the best way to solve the issue?

No, the transaction reuse is appropriate, but publication must retain the runtime choice accepted during installer admission; copying npm's launcher alone does not preserve that contract.

Full review comments:

  • [P1] Preserve the installer's pinned Node when replacing its launcher — src/infra/package-update-npm-root.ts:45-49
    Admission accepts an absolute Node matching process.execPath, but the recovery value does not carry that executable into replacement publication. The swap copies npm's launcher, which invokes openclaw.mjs through #!/usr/bin/env node. If the supported Node is absent from the original PATH, the old installer wrapper works and Doctor can pass using an explicit Node runner, while the next openclaw invocation fails. Preserve the verified runtime in the replacement and exercise it without that Node on PATH. This previously reported blocker remains unchanged.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against fb84dd57fd57.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This improves a bounded development-installation update workflow; check state alone does not justify escalation.
  • merge-risk: 🚨 compatibility: Replacing the canonical wrapper can discard an existing installation's verified Node selection, and the installed-driver transition remains unqualified.
  • merge-risk: 🚨 availability: An accepted installer setup can finish activation with a replacement launcher that cannot start under its original shell PATH.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: The MEMBER-authored PR is exempt from ordinary external-contributor proof. Focused installer fixtures support admission and filesystem recovery, and sibling native Windows evidence covers Windows launchers; neither resolves POSIX pinned-Node behavior or the separately required installed-driver/service upgrade qualification. No stored-data format changes were identified.

Evidence

What I checked:

  • Pinned introduction and review continuity: Reviewed the supplied merge-base-to-head introduction. Comparing the earlier reviewed head 16cd95f with the current head shows no change in the installer admission or package-swap modules; the previous pinned-Node finding remains applicable. (src/infra/package-update-npm-root.ts:80, 2f7ec3ae1c34)
  • Installer runtime contract: The shell installer resolves an absolute Node executable, verifies the built entry with it, and writes that executable into the canonical wrapper. The new admission accepts this absolute executable when it resolves to process.execPath. (scripts/install.sh:3473, 2f7ec3ae1c34)
  • Replacement loses pinned Node: Installer recovery retains the wrapper and runtime verifier but no Node executable for replacement publication. Activation copies the staged npm launcher, whose package entry starts with #!/usr/bin/env node. Doctor instead uses the explicitly resolved Node runner, so its success does not establish that the new launcher works under the original shell PATH. (src/infra/package-update-npm-root.ts:45, 2f7ec3ae1c34)
  • Current main still lacks relocation admission: At fetched main, switching to a Git installation is still conditioned on the existing installation not being Git; the target resolver has no dirty-checkout relocation admission. The central installer contribution therefore remains distinct. (src/cli/update-cli/update-command-target.ts:303, fb84dd57fd57)
  • Latest-release comparison: The v2026.9.8 target resolver also lacks dirty Git relocation and retains the non-Git-only switch condition. No shipped implementation of this installer path was established. (src/cli/update-cli/update-command-target.ts:284, fc23bc864e45)
  • Protected stack and active assignment: The captured association is MEMBER and the PR carries maintainer. Live GitHub confirms the exact reviewed head, assignment to fuller-stack-dev, and dirty mergeability. Its prerequisite fix(update): preserve dirty checkouts by installing dev separately #147629 remains open and unmerged. (2f7ec3ae1c34)

Likely related people:

  • RomneyDa: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • fuller-stack-dev: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Preserve the verified Node executable and invoke the replacement with that Node absent from the original PATH.
  • Record the published-updater installer transition and rollback, including the managed service when configured.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (5 earlier review cycles)
  • reviewed 2026-09-14T01:50:42.608Z sha 39205f2 :: blocked before merge. :: [P1] Preserve destinations this transaction failed to publish
  • reviewed 2026-09-14T02:35:52.235Z sha 16cd95f :: blocked before merge. :: [P1] Preserve the installer's pinned Node when replacing its launcher
  • reviewed 2026-09-14T02:54:20.692Z sha 16cd95f :: blocked before merge. :: [P1] Preserve the installer's pinned Node when replacing its launcher
  • reviewed 2026-09-14T05:36:54.030Z sha 2f7ec3a :: blocked before merge. :: [P1] Preserve the installer's pinned Node when replacing its launcher
  • reviewed 2026-09-25T12:16:46.952Z sha 2f7ec3a :: blocked before merge. :: [P1] Preserve the installer's pinned Node when replacing its launcher

@RomneyDa
RomneyDa force-pushed the fix/update-dirty-relocation branch from 85454fe to 51f8892 Compare September 14, 2026 02:23
@RomneyDa
RomneyDa force-pushed the fix/update-installer-relocation branch from 39205f2 to 16cd95f Compare September 14, 2026 02:23
* test(update): exercise Windows npm relocation ownership

* fix(update): relocate Windows npm Git installations safely
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. label Sep 25, 2026
@RomneyDa
RomneyDa force-pushed the fix/update-dirty-relocation branch 3 times, most recently from bfde7be to 01270f2 Compare September 30, 2026 05:22

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL 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