Skip to content

fix(update): canonicalize package activation paths - #163086

Merged
RomneyDa merged 1 commit into
mainfrom
fix/package-activation-canonical-paths
Oct 2, 2026
Merged

RomneyDa merged 1 commit into
mainfrom
fix/package-activation-canonical-paths

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Oct 1, 2026

Copy link
Copy Markdown
Member

What Problem This Solves

The macOS packaged-upgrade release validation reaches npm installs through /var/folders/..., while executor authority is canonicalized to /private/var/folders/.... Package activation compared and recorded the raw alias paths, refusing recovery preparation or later failing its custody check.

User Impact

Global npm updates on macOS no longer fail after several minutes with Package publication recovery requires its original POSIX npm directory. solely because the temporary/install prefix traverses the standard /var alias.

Why This Change Was Made

Canonicalize the complete package-activation boundary once: the live package, stage, launcher source/backup, and bin directory. The activation journal therefore records paths and identities in one namespace while retaining all existing authority, runtime-identity, and custody checks.

This defect was discovered in the 2026.9.8 Full Release Validation Diagnostic Drain. The release backport is included separately in #163074; this PR fixes the unchanged defect on main.

Evidence

  • pnpm test src/infra/package-update-publication-boundary.test.ts --maxWorkers=1 — 9 passed in 13.88s.
  • pnpm tsgo:core — passed.
  • pnpm tsgo:core:test — all shards passed.
  • Focused core oxlint — passed.
  • AutoReview P0/P1 — scoped clean.

The new regression drives the real executor and package-swap boundary through an aliased npm prefix, completes activation retirement, and verifies the installed package changed to the staged version.

Update behavior: no update policy changes. The installed updater continues to run first; candidate-side activation now canonicalizes equivalent POSIX directory aliases before sealing recovery ownership.

@clawsweeper

clawsweeper Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@RomneyDa

RomneyDa commented Oct 1, 2026

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@RomneyDa
RomneyDa marked this pull request as ready for review October 1, 2026 23:24
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 1, 2026
@clawsweeper

clawsweeper Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 1, 2026, 7:28 PM ET / 23:28 UTC.

ClawSweeper review

What this changes

The PR canonicalizes package and launcher paths before preparing update recovery, allowing macOS npm installations reached through directory aliases to activate successfully.

Merge readiness

⛔ Blocked before merge - 2 items remain

This remains a useful, focused repair: fetched main and the latest release still reject equivalent directory aliases. No introduced correctness defect was found, but the required published-updater compatibility proof remains incomplete.

Priority: P1
Reviewed head: 0f1713dd7c6e3425bdd61d665509a613d404959b

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) PR readiness rating was derived from proof quality, review findings, security review, and reviewer confidence.
Proof confidence 🌊 off-meta tidepool Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
Evidence reviewed 8 items Pinned introduction: The merge-base-to-head patch changes activation preparation and adds an alias regression. The verified test merge contains the same two-file change against its main parent, without removing base-only work.
Repair still needed on main: Fetched main retains the raw live-root comparison and raw bin-directory canonicality refusal. Comparing this specific file against the pinned head shows the proposed canonicalization is still absent.
Latest-release comparison: The v2026.9.7 activation preparer also compares the raw live root against canonical executor authority and rejects an aliased bin directory; this release does not contain the repair.
Findings None None.
Security None None.

How this fits together

Package activation replaces an installed npm package and its launchers using a staged candidate. Its recovery journal records directory identities and custody so interrupted publication can resume or roll back under the original update owner.

flowchart TD
  A[Installed npm package] --> C[Canonical activation paths]
  B[Staged package and launchers] --> C
  C --> D[Validate update ownership and identities]
  D --> E[Record recovery journal and custody]
  E --> F[Publish package and launchers]
  F --> G[Verify and retire backups]
Loading

Before merge

  • Resolve merge risk (P1) - Compatibility with the installed published updater remains unverified for the repaired macOS /var alias path; the synthetic boundary regression does not cover the complete upgrade handoff.
  • Complete next step (P2) - Add the repository-required after-fix macOS published-driver × candidate evidence for the /var alias upgrade.
Agent review details

Security

None.

PR surface

Source +6, Tests +32. Total +38 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 28 22 +6
Tests 1 33 1 +32
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 61 23 +38

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Establish published-updater compatibility (recommended)
    Attach an after-fix macOS published-driver × candidate result through /var showing the candidate becomes live and recovery custody retires successfully.

Technical review

Best possible solution:

Keep canonicalization in the existing activation owner and establish that a published macOS updater completes activation and retirement through the standard directory alias.

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

Yes, source establishes the trigger: executor admission canonicalizes an aliased npm root while current activation preparation compares its raw spelling. This review did not execute the regression.

Is this the best way to solve the issue?

Yes, reusing the executor's existing canonicalization helper at journal preparation is a narrow repair that preserves the downstream custody and identity checks.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P1: Release validation exposed a real macOS npm update failure, and the same refusal remains on fetched main.
  • add merge-risk: 🚨 compatibility: The candidate changes update recovery preparation, but the required installed-updater compatibility cell has not been demonstrated.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.

Label justifications:

  • P1: Release validation exposed a real macOS npm update failure, and the same refusal remains on fetched main.
  • merge-risk: 🚨 compatibility: The candidate changes update recovery preparation, but the required installed-updater compatibility cell has not been demonstrated.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.

Evidence

What I checked:

  • Pinned introduction: The merge-base-to-head patch changes activation preparation and adds an alias regression. The verified test merge contains the same two-file change against its main parent, without removing base-only work. (src/infra/package-update-activation-prepare.ts:111, 0f1713dd7c6e)
  • Repair still needed on main: Fetched main retains the raw live-root comparison and raw bin-directory canonicality refusal. Comparing this specific file against the pinned head shows the proposed canonicalization is still absent. (src/infra/package-update-activation-prepare.ts:110, 1bc8f9d62ffc)
  • Latest-release comparison: The v2026.9.7 activation preparer also compares the raw live root against canonical executor authority and rejects an aliased bin directory; this release does not contain the repair. (src/infra/package-update-activation-prepare.ts, c074824a27c9)
  • Existing canonicalization owner: Executor admission already uses resolveUpdateInstallRoot, which resolves existing paths with native realpath. Activation now consumes that same interpretation while preserving captured authority, runtime checks, inode identities, and custody validation. (src/infra/update-install-root.ts:5, 0f1713dd7c6e)
  • Regression coverage and its limits: The new case enters the real update executor through an aliased npm prefix, invokes package swapping, completes retirement, and asserts the staged version became live. Its shared fixture substitutes inert sealed-helper bytes and a synthetic capability worker, so the reported nine passing tests do not establish a published-updater-to-candidate macOS run. (src/infra/package-update-publication-boundary.test.ts:48, 0f1713dd7c6e)
  • Applicable upgrade-proof requirement: Root policy expressly requires a published-driver × candidate cell for update changes. The captured PR body reports the original macOS release-validation failure and focused after-fix tests, but no successful after-fix cell. REST discussion inspection found acknowledgments and a re-review request rather than additional runtime evidence. The captured body identity is 0426962394766bee17dfa9ca2eb1b1fc91ad4e1aa2c286c0779889f2c975aedd. (AGENTS.md, 0f1713dd7c6e)

Likely related people:

  • Peter Steinberger: Raw commit a4a78b7 adds src/infra/package-update-activation-prepare.ts:121 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: a4a78b738e38; files: src/infra/package-update-activation-prepare.ts)

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.

@RomneyDa
RomneyDa merged commit b2b6188 into main Oct 2, 2026
188 checks passed
@RomneyDa
RomneyDa deleted the fix/package-activation-canonical-paths branch October 2, 2026 01:05
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant