@rightkit/release 0.6.72 → 0.6.73

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.
package/advisory-db.mjs CHANGED
@@ -55,7 +55,8 @@ export function ensureAdvisoryDb({ cacheRoot, pin, git = defaultGit, fsImpl = fs
55
55
  const { url, commit } = checkPin(pin);
56
56
  const base = path.join(cacheRoot, "advisory-db");
57
57
  const dest = path.join(base, commit);
58
- const head = (dir) => { const r = git(["rev-parse", "HEAD"], { cwd: dir }); return !r.error && r.status === 0 ? String(r.stdout).trim() : null; };
58
+ // -C names the checkout on the command line, so the process log tells this question from the fixture's own HEAD (NN08, 0.6.72).
59
+ const head = (dir) => { const r = git(["-C", dir, "rev-parse", "HEAD"], { cwd: dir }); return !r.error && r.status === 0 ? String(r.stdout).trim() : null; };
59
60
  if (fsImpl.existsSync(dest)) {
60
61
  if (head(dest) === commit) return dest;
61
62
  // A stale or damaged directory under the pinned name is never trusted; replace it.
@@ -2409,7 +2409,8 @@ export function killProcessTree(child, { platform = process.platform, run = spaw
2409
2409
  */
2410
2410
  export function defaultSpawnAsync(command, args, options = {}) {
2411
2411
  // GC-A27 NN08: the reads rememberReads keeps are answered from the same memory here, and an answer this path gets is kept for both.
2412
- if (isRememberedRead(command, args) && options.input === undefined && options.stdio === undefined && !options.stdoutFile && !options.onSpawn && !options.signal) {
2412
+ // A cancel signal does not change the answer: a remembered one starts nothing to cancel (Class A's version probe always passes one).
2413
+ if (isRememberedRead(command, args) && options.input === undefined && options.stdio === undefined && !options.stdoutFile && !options.onSpawn && !options.signal?.aborted) {
2413
2414
  const key = readMemoKey(command, args, options);
2414
2415
  if (READ_MEMO.has(key)) return Promise.resolve({ ...READ_MEMO.get(key) });
2415
2416
  return rawSpawnAsync(command, args, options).then((r) => { if (r && r.status === 0 && !r.error) READ_MEMO.set(key, { status: 0, signal: null, stdout: r.stdout, stderr: r.stderr }); return r; });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rightkit/release",
3
- "version": "0.6.72",
3
+ "version": "0.6.73",
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
@@ -227,6 +227,13 @@ export function installProbeMemo({ storeDir = null } = {}) {
227
227
  if (answered && !missing && (r.stdout?.length ?? 0) <= KEEP_MAX_BYTES) seenSpawn.set(key, { ...r, stdout: copy(r.stdout), stderr: copy(r.stderr) });
228
228
  return r;
229
229
  }
230
+ // A path missing from a commit named by its full id is missing for ever (NN08: `git show <sha>:package.json` asked twice, status 128, 0.6.72).
231
+ if (absentAtCommit(cmd, argv)) {
232
+ const r = spawnSync.apply(this, arguments);
233
+ if (r && !r.error && r.signal === null && r.status === 128 && /does not exist in|exists on disk, but not in/.test(String(r.stderr ?? ""))) seenSpawn.set(key, { ...r, stdout: copy(r.stdout), stderr: copy(r.stderr) });
234
+ else if (r && !r.error && r.status === 0 && (r.stdout?.length ?? 0) <= KEEP_MAX_BYTES) seenSpawn.set(key, { ...r, stdout: copy(r.stdout), stderr: copy(r.stderr) });
235
+ return r;
236
+ }
230
237
  const question = piped(opts) ? questionKeyOf(cmd, argv, opts) : null;
231
238
  const shared = question ? answers.get(question) : undefined;
232
239
  if (shared) {
@@ -273,3 +280,7 @@ export function installProbeMemo({ storeDir = null } = {}) {
273
280
  module.syncBuiltinESMExports();
274
281
  return stats;
275
282
  }
283
+
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]));
286
+ }