Repository navigation
fix(update): canonicalize package activation paths - #163086
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: blocked before merge. Reviewed October 1, 2026, 7:28 PM ET / 23:28 UTC. ClawSweeper reviewWhat this changesThe 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 Review scores
Verification
How this fits togetherPackage 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]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +6, Tests +32. Total +38 across 2 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest 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. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
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/varalias.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.8Full Release Validation Diagnostic Drain. The release backport is included separately in #163074; this PR fixes the unchanged defect onmain.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.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.