@rightkit/release 0.6.35 → 0.6.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -64,7 +64,6 @@ export const SCAN_CLASS = Object.freeze({ A: "A", B: "B" });
64
64
  export const UNOBSERVED_NESTED_CARGO_NOTE = "cargo calls that a build script makes through $CARGO are unobserved: cargo hands build scripts its own path, not the gate's wrapper, so they are not in the cargo ledger; they inherit the parent's bound CARGO_TARGET_DIR, and the per-scan sentinel and the after-compile snapshot verify are the backstops";
65
65
 
66
66
  /** The ledger token of the gate's own tool version probes (they reach the cargo wrapper like any scan does). */
67
- const BUILD_HELPERS_COMMAND = fileURLToPath(new URL("./build-helpers-command.mjs", import.meta.url));
68
67
  const PROBE_LEDGER_TOKEN = scanTokenOf("tool-probe");
69
68
 
70
69
  /** Scan id prefixes (the text before the first ":") that belong to each class. */
@@ -1251,12 +1250,8 @@ export function planScans({
1251
1250
  }
1252
1251
  if (rustTouched) {
1253
1252
  for (const ws of touchedWs) add({ id: `cargo-metadata${wsIdSuffix(ws)}`, class: A, ...cargoReadIn(ws, ...metadataArgs()) });
1254
- // rightkit#1450 (Adrian, 2026-11-02): every build script and proc macro of the workspace must have been traced once on this host, writing only
1255
- // inside its build directories; an untraced or out-of-bounds unit refuses Class A, naming it. Runs the gate's own command, directly (GC-A11).
1256
- // It runs in its workspace (cwd), so a unit's scope keeps it only for the Cargo workspaces of its own closure (app-closure CARGO_WORKSPACE_SCAN),
1257
- // like metadata, deny and audit: an npm-only unit traces nothing.
1258
- // Build helpers are vetted only on broker hosts (Mac, Dell); a Linux host or CI runner is a throwaway container (Adrian, 2026-11-03).
1259
- if (platform === "darwin" || platform === "win32") for (const ws of touchedWs) add({ id: `build-helpers${wsIdSuffix(ws)}`, class: A, tool: "node", args: [BUILD_HELPERS_COMMAND, "check", "--manifest-path", "Cargo.toml"], ...(ws !== "." ? { cwd: ws } : {}), root: "content" });
1253
+ // The build-helper trace check (rightkit#1450) is removed from Class A (Adrian, 2026-11-03): the Mac tracer misattributed writes and
1254
+ // its sessions filled the disk (rightkit#1494), and apps waited on traces for hours. No host blocks on build-helper traces.
1260
1255
  // Locked package listings are observations in RustRight (#1216). They run through the selected executor
1261
1256
  // from the checked Cargo inputs, just like metadata; an executor refusal remains a failed scan.
1262
1257
  for (const name of crateNames.filter((n) => rustMap?.get(n).publish !== false)) add({ id: rustScanId.packageList(name), class: A, ...cargoReadIn(wsOf(name), "package", "-p", crateOf(name), "--list", "--allow-dirty", "--locked") });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rightkit/release",
3
- "version": "0.6.35",
3
+ "version": "0.6.36",
4
4
  "description": "Portable release CLI/SDK with fail-closed public GitHub Releases and private R2 + RightApps distribution.",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "type": "module",
@@ -9,8 +9,10 @@
9
9
  // 2. the gate's Class A for the package passes on that commit (`rightkit-gate --to check --unit npm:<name> --commit <sha>`, this
10
10
  // package's own gate, so a release publishes through the gate it ships);
11
11
  // 3. the version is not on npm yet.
12
- // The package folder is exported from the commit (git archive) and packed there; npm provenance is off (rightkit#1472). After publishing,
13
- // the registry's shasum must equal the packed tarball's, or the command fails.
12
+ // The commit's whole tree is exported (git archive), its dependencies are installed there offline from the commit's own lockfile and the
13
+ // checkout's pnpm store (a package whose prepack builds needs its devDependencies, rightkit#1493), and the package is packed there; the
14
+ // checkout and the gate's snapshot are never written. npm provenance is off (rightkit#1472). After publishing, the registry's shasum must
15
+ // equal the packed tarball's, or the command fails.
14
16
  import crypto from "node:crypto";
15
17
  import { spawnSync } from "node:child_process";
16
18
  import fs from "node:fs";
@@ -24,6 +26,16 @@ const GATE = fileURLToPath(new URL("./bin/rightkit-gate.mjs", import.meta.url));
24
26
 
25
27
  function fail(message) { throw new Error(message); }
26
28
 
29
+ /** The pnpm store the checkout installed from (`storeDir` in its node_modules/.modules.yaml, e.g. /Volumes/D/.pnpm-store/v11), as a `--store-dir` value (its parent). */
30
+ export function checkoutStoreDir(repo, readFile = (f) => fs.readFileSync(f, "utf8")) {
31
+ let text;
32
+ try { text = readFile(path.join(repo, "node_modules", ".modules.yaml")); } catch { fail(`${repo}/node_modules/.modules.yaml is missing: install the checkout once so its pnpm store is known`); }
33
+ const m = /"?storeDir"?\s*:\s*"?([^"\r\n]+)"?/.exec(text);
34
+ if (!m) fail(`${repo}/node_modules/.modules.yaml names no storeDir`);
35
+ const storeDir = m[1].trim();
36
+ return /^v\d+$/.test(path.basename(storeDir)) ? path.dirname(storeDir) : storeDir;
37
+ }
38
+
27
39
  export function parseArgs(argv) {
28
40
  const out = { kind: argv[0], pkg: null, commit: null, repo: process.cwd() };
29
41
  for (let i = 1; i < argv.length; i += 1) {
@@ -61,13 +73,23 @@ export function publishLocalNpm(argv, { run = spawnSync, log = console.log, plat
61
73
  const classA = run(process.execPath, [GATE, "--to", "check", "--unit", `npm:${o.pkg}`, "--commit", commit], { cwd: o.repo, stdio: ["ignore", "inherit", "inherit"] });
62
74
  if (classA.status !== 0) fail(`Class A failed for npm:${o.pkg} on ${commit} (exit ${classA.status}); nothing published`);
63
75
 
64
- const work = fs.mkdtempSync(path.join(os.tmpdir(), "rk-publish-local-"));
76
+ // The agent volume, not the internal drive: the export holds a full install (workspace rule: run output under /Volumes/D/scratch).
77
+ const scratchRoot = fs.existsSync("/Volumes/D/scratch") ? "/Volumes/D/scratch" : os.tmpdir();
78
+ const work = fs.mkdtempSync(path.join(scratchRoot, "rk-publish-local-"));
65
79
  try {
66
- const archive = run("git", ["archive", "--format=tar", commit, dir], { cwd: o.repo, maxBuffer: 1 << 30 });
67
- if (archive.status !== 0) fail(`git archive ${commit} ${dir} failed`);
68
- const tarIn = run("tar", ["-x", "-C", work], { input: archive.stdout });
69
- if (tarIn.status !== 0) fail("unpacking the commit's package folder failed");
70
- const pkgDir = path.join(work, dir);
80
+ const tree = path.join(work, "tree");
81
+ fs.mkdirSync(tree);
82
+ const archive = run("git", ["archive", "--format=tar", commit], { cwd: o.repo, maxBuffer: 1 << 30 });
83
+ if (archive.status !== 0) fail(`git archive ${commit} failed`);
84
+ const tarIn = run("tar", ["-x", "-C", tree], { input: archive.stdout });
85
+ if (tarIn.status !== 0) fail("unpacking the commit's tree failed");
86
+ // The package and its workspace dependencies, from the commit's lockfile only, offline from the store; no dependency's install scripts run.
87
+ const install = run("pnpm", ["install", "--frozen-lockfile", "--offline", "--ignore-scripts", "--ignore-pnpmfile", "--store-dir", checkoutStoreDir(o.repo), "--filter", `${o.pkg}...`], { cwd: tree, encoding: "utf8", maxBuffer: 1 << 28 });
88
+ if (install.status !== 0) fail(`pnpm install (offline, frozen lockfile) for ${o.pkg} failed: ${String(install.stderr || install.stdout || "").trim().split(/\r?\n/).slice(-3).join(" | ")}`);
89
+ // Workspace dependencies resolve through their dist/ (gitignored, so not in the export): build them first, in dependency order.
90
+ const deps = run("pnpm", ["-r", "--filter", `${o.pkg}^...`, "run", "--if-present", "build"], { cwd: tree, encoding: "utf8", maxBuffer: 1 << 28 });
91
+ if (deps.status !== 0) fail(`building ${o.pkg}'s workspace dependencies failed: ${String(deps.stderr || deps.stdout || "").trim().split(/\r?\n/).slice(-3).join(" | ")}`);
92
+ const pkgDir = path.join(tree, dir);
71
93
  const packed = run("pnpm", ["pack", "--pack-destination", work], { cwd: pkgDir, encoding: "utf8" });
72
94
  if (packed.status !== 0) fail(`pnpm pack failed: ${String(packed.stderr ?? packed.stdout ?? "").trim().split(/\r?\n/).slice(-3).join(" | ")}`);
73
95
  const tgz = fs.readdirSync(work).find((f) => f.endsWith(".tgz"));
@@ -49,7 +49,7 @@
49
49
  "@rightkit/qa": "0.6.2",
50
50
  "@rightkit/qa-chrome": "0.1.12",
51
51
  "@rightkit/react-shell": "0.7.2",
52
- "@rightkit/release": "0.6.35",
52
+ "@rightkit/release": "0.6.36",
53
53
  "@rightkit/settings-ui": "0.7.0",
54
54
  "@rightkit/social-ui": "0.1.0",
55
55
  "@rightkit/system-ui": "0.1.0",