@rightkit/release 0.6.74 → 0.6.75

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.
@@ -2291,7 +2291,8 @@ export function defaultSpawn(command, args, options = {}) {
2291
2291
  const key = readMemoKey(command, args, options);
2292
2292
  if (READ_MEMO.has(key)) return { ...READ_MEMO.get(key) };
2293
2293
  const r = rawSpawn(command, args, options);
2294
- if (r && r.status === 0 && !r.error) READ_MEMO.set(key, { status: 0, signal: null, stdout: r.stdout, stderr: r.stderr });
2294
+ // As the asynchronous path: a path missing from a commit named by its full id (status 128) is kept too (NN08, 0.6.74 local case 1).
2295
+ if (r && !r.error && (r.status === 0 || (r.status === 128 && absentAtCommit(command, args ?? []) && /does not exist in|exists on disk, but not in/.test(String(r.stderr ?? ""))))) READ_MEMO.set(key, { status: r.status, signal: null, stdout: r.stdout, stderr: r.stderr });
2295
2296
  return r;
2296
2297
  }
2297
2298
  return rawSpawn(command, args, options);
@@ -3444,7 +3445,7 @@ export async function runScans(plan, options = {}) {
3444
3445
  // share it, so one gate process starts `pnpm --version` once for both (NN08, 0.6.73 case 1).
3445
3446
  const probeOnce = tool !== "pnpm" ? rawProbe : async (ms) => {
3446
3447
  let started = null;
3447
- const { version, kept } = await pnpmVersionAnswerAsync({ cwd, env: probeEnv, remember: deps.spawn === defaultSpawnAsync, run: async () => { started = await rawProbe(ms); return started && !started.error && started.status === 0 ? String(started.stdout ?? "").trim() : null; } });
3448
+ const { version, kept } = await pnpmVersionAnswerAsync({ cwd, env: probeEnv, remember: startsRealPrograms(deps.spawn), run: async () => { started = await rawProbe(ms); return started && !started.error && started.status === 0 ? String(started.stdout ?? "").trim() : null; } });
3448
3449
  return kept ? { status: 0, signal: null, stdout: `${version}
3449
3450
  `, stderr: "" } : started;
3450
3451
  };
@@ -5092,5 +5093,11 @@ export function scanDeferrals(result) {
5092
5093
 
5093
5094
  /** `git show <full commit id>:<path>`: a missing path there is missing for ever (NN08). Same rule as probe-memo.mjs absentAtCommit. */
5094
5095
  function absentAtCommit(cmd, argv) {
5095
- return /(^|[\/])git(\.exe)?$/i.test(String(cmd)) && argv.length === 2 && argv[0] === "show" && /^[0-9a-f]{40}:[^:]+$/.test(String(argv[1]));
5096
+ return /(^|[\\/])git(\.exe)?$/i.test(String(cmd)) && argv.length === 2 && argv[0] === "show" && /^[0-9a-f]{40}:[^:]+$/.test(String(argv[1]));
5097
+ }
5098
+
5099
+ /** Whether `spawn` is the real asynchronous spawn, or a wrapper (snapshot-metadata.mjs directReadSpawn) whose `underlying` chain ends in it. Test fakes are neither. */
5100
+ export function startsRealPrograms(spawn) {
5101
+ for (let s = spawn, n = 0; typeof s === "function" && n < 8; s = s.underlying, n += 1) if (s === defaultSpawnAsync) return true;
5102
+ return false;
5096
5103
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rightkit/release",
3
- "version": "0.6.74",
3
+ "version": "0.6.75",
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",
package/probe-memo.mjs CHANGED
@@ -282,5 +282,5 @@ export function installProbeMemo({ storeDir = null } = {}) {
282
282
  }
283
283
 
284
284
  export function absentAtCommit(cmd, argv) {
285
- return /(^|[\/])git(.exe)?$/i.test(String(cmd)) && argv.length === 2 && argv[0] === "show" && /^[0-9a-f]{40}:[^:]+$/.test(String(argv[1]));
285
+ return /(^|[\\/])git(\.exe)?$/i.test(String(cmd)) && argv.length === 2 && argv[0] === "show" && /^[0-9a-f]{40}:[^:]+$/.test(String(argv[1]));
286
286
  }
@@ -49,7 +49,7 @@
49
49
  "@rightkit/qa": "0.7.0",
50
50
  "@rightkit/qa-chrome": "0.1.12",
51
51
  "@rightkit/react-shell": "0.7.7",
52
- "@rightkit/release": "0.6.72",
52
+ "@rightkit/release": "0.6.75",
53
53
  "@rightkit/send-ui": "0.1.0",
54
54
  "@rightkit/settings-ui": "0.7.5",
55
55
  "@rightkit/social-ui": "0.2.1",
@@ -274,7 +274,9 @@ export const carriedReadOnlyScan = (words, options) => carriedScanRefusal(words,
274
274
  export function directReadSpawn({ spawn, cargoCommand, snapshotRoot, directPath, pathKey = "PATH", tmpRoot, env, err = () => {}, memo = null, isAsync = false, served = null }) {
275
275
  const prefix = cargoCommand.slice(1);
276
276
  const refused = (code, message) => { err(`rightkit-gate: ${code}: ${message}`); return { status: CARGO_REFUSAL_STATUS, signal: null, error: null, stdout: "", stderr: `rightkit-gate: ${code}: ${message}\n` }; };
277
- return (cmd, args, opts = {}) => {
277
+ // Anything but cargo in the snapshot goes to `spawn` untouched; `underlying` names it, so a caller can tell this wrapper still starts real programs
278
+ // (NN08: the scan's pnpm version probe kept no answer behind this wrapper, 0.6.74 case 1).
279
+ const wrapped = (cmd, args, opts = {}) => {
278
280
  const cargo = cmd === cargoCommand[0] && prefix.every((w, i) => args[i] === w);
279
281
  if (!cargo || typeof opts.cwd !== "string" || !within(real(opts.cwd), real(snapshotRoot))) return spawn(cmd, args, opts);
280
282
  // A seam request (reset plan section 3: RUSTRIGHT_GATE_COMMIT set) is a class B compile the broker admits; it runs in the snapshot by design and is never a
@@ -302,4 +304,6 @@ export function directReadSpawn({ spawn, cargoCommand, snapshotRoot, directPath,
302
304
  cleanup();
303
305
  return remember(r);
304
306
  };
307
+ wrapped.underlying = spawn;
308
+ return wrapped;
305
309
  }