bye npm #20148
Mergedjuliusmarmingemerged 6 commits into
main fromrefs/pull/20148/headmerged by juliusmarminge View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XXL
juliusmarminge added labelsmacroscope-review
- scripts/npm-launcher/runtime.cjs line 159OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +139,21 @@139+ const tar =140+ platform === "win32"141+ ? path.join(142+ process.env.SystemRoot || process.env.windir || "C:\\Windows",143+ "System32",144+ "tar.exe",145+ )146+ : "tar";147+ const extracted = spawnSync(tar, ["-xf", archivePath, "-C", staging, "--strip-components=1"], {148+ stdio: ["ignore", "ignore", "inherit"],149+ });150+ if (extracted.error || extracted.status !== 0) {151+ throw new LauncherError(152+ `could not extract ${archive}${extracted.error ? `: ${extracted.error.message}` : ""}`,153+ );154+ }155+ fs.rmSync(archivePath, { force: true });156+ // Written last: tar writes the executable before the native packages, so157+ // its presence alone does not mean the install is complete.158+ fs.writeFileSync(path.join(staging, ".install-complete"), `${version}\n`);159+ fs.rmSync(paths.versionDir, { recursive: true, force: true });
juliusmarminge changed the title
- scripts/npm-launcher/t3.mjs lines 99 to 100OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -0,0 +80,21 @@80+81+ // Extract beside the final folder and rename it into place, so an82+ // interrupted download never leaves a half-installed version behind.83+ fs.mkdirSync(path.dirname(dir), { recursive: true });84+ const staging = fs.mkdtempSync(`${dir}.staging-`);85+ try {86+ const file = path.join(staging, archive);87+ if ((await download(`${base}/v${version}/${archive}`, file)) !== line[1].toLowerCase()) {88+ throw new Error(`checksum mismatch for ${archive}`);89+ }90+ // Windows' own tar.exe reads zip; a Git-for-Windows tar on PATH cannot.91+ const tar =92+ process.platform === "win32" ? `${process.env.SystemRoot}\\System32\\tar.exe` : "tar";93+ const extract = spawnSync(tar, ["-xf", file, "-C", staging, "--strip-components=1"], {94+ stdio: "inherit",95+ });96+ if (extract.status !== 0) throw new Error(`could not extract ${archive}`);97+ fs.rmSync(file);98+ fs.writeFileSync(path.join(staging, ".install-complete"), `${version}\n`);99+ fs.rmSync(dir, { recursive: true, force: true });100+ fs.renameSync(staging, dir);
juliusmarminge merged this6b450c7
juliusmarminge closed this
Sign in to join this conversation.


Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Baseline:
d35882e· PR result:2fdc4e6· Source CI: successScenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.