@rightkit/release 0.6.78 → 0.6.80

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.
@@ -543,16 +543,16 @@
543
543
  ]
544
544
  },
545
545
  "limitsMs": {
546
- "case1": 126000,
547
- "case2": 34000,
548
- "case3": 60000,
549
- "case4": 31000,
550
- "case5": 38000,
551
- "case6": 62000,
552
- "case7": 60000,
553
- "realBuild": null
546
+ "case1": 168000,
547
+ "case2": 49000,
548
+ "case3": 111000,
549
+ "case4": 46000,
550
+ "case5": 74000,
551
+ "case6": 96000,
552
+ "case7": 78000,
553
+ "realBuild": 421000
554
554
  },
555
- "limitsRule": "NN11 limits the gate's own time: a run's wall time less the time its broker jobs were in flight (the broker is shared with every other build on the host; Adrian, 2026-11-25, option b). Each limit is the worst own time of three full runs on the installed pair (accept-0675b, accept-0675c, accept-0677, 2026-11-25) x 1.25, and at least that time + 15 s, so a run under normal working load passes. One limit per case covers each of its unkilled runs; null means not yet measured, and NN11 fails while it is null.",
555
+ "limitsRule": "NN11 limits the gate's own time: a run's wall time less the time its broker jobs were in flight (the broker is shared with every other build on the host; Adrian, 2026-11-25, option b). Each limit is the worst own time of four full runs on the installed pairs of 2026-11-25 (accept-0675b, accept-0675c, accept-0677, accept-0678) x 1.5, and at least that time + 30 s: under the host's normal load the gate's own time of the same case moved up to 3x between runs (case 5 run 2: 9 s to 44 s, most of it before the gate's first line), so the limit catches a stall, not that spread. One limit per case covers each of its unkilled runs; the real build's limit is its worst own time of its two runs with a complete record (accept-0678: 281 s, accept-final2: 72 s) x 1.5, at least + 30 s; null means not yet measured, and NN11 fails while it is null.",
556
556
  "corrections": {
557
557
  "approved": "Adrian, 2026-11-24: \"Approve, keep going\" (to: C1, C4, the sidecar-build half of C2, and C3 tightened to an exact command list). Reviewed first by Gemini, which rejected C3 as first worded (\"in one command or split by target\" lets a gate always split) and the rk-sidecar half of C2.",
558
558
  "previousSha256": "e41bba2b2331adc866ed602f3ab3ecda27adb615d296e981f9a2310479b06bdc",
@@ -69,7 +69,10 @@ export function receiptsNameTheCommit(run, { skipNeverRan = false } = {}) {
69
69
  if (!j.verified) { fails.push(`${jobName(j)}: its receipt does not verify (${(j.problems ?? []).join("; ") || "no reason given"})`); continue; }
70
70
  if (j.gate?.commit !== run.commit) fails.push(`${jobName(j)} is signed for commit ${String(j.gate?.commit).slice(0, 12)}, not the selected ${String(run.commit).slice(0, 12)}`);
71
71
  if (!run.tree || j.gate?.tree !== run.tree) fails.push(`${jobName(j)} is signed for tree ${String(j.gate?.tree).slice(0, 12)}, not the selected commit's ${String(run.tree).slice(0, 12)}`);
72
- if (j.gate?.snapshotUnchanged !== true) fails.push(`${jobName(j)}: the broker did not sign that the snapshot was unchanged`);
72
+ // In the kill case a job the kill cancelled (owner lost) never reached its post-checks, so the broker cannot sign the snapshot unchanged; its commit and
73
+ // tree are still held above, and its outputs are never admitted. Seen when the kill landed after submission (final run, 2026-11-25).
74
+ const killedUnder = skipNeverRan && j.status === "CANCELLED" && j.postChecksRan === false && j.reaped === true;
75
+ if (j.gate?.snapshotUnchanged !== true && !killedUnder) fails.push(`${jobName(j)}: the broker did not sign that the snapshot was unchanged`);
73
76
  }
74
77
  return fails;
75
78
  }
@@ -114,7 +114,11 @@ export function exportWindowsProcesses(from, to, { run = execFileSync } = {}) {
114
114
  : { id: 4689, time: e.time, pid: hex(e.data.ProcessId), exe: e.data.ProcessName, exit: hex(e.data.Status) });
115
115
  const bad = events.filter((e) => !Number.isInteger(e.pid) || !Number.isFinite(Date.parse(e.time)) || (e.id === 4688 && !Number.isInteger(e.ppid)));
116
116
  if (bad.length) problems.push(`${bad.length} event(s) have no usable process id, parent or time`);
117
- if (events.some((e) => e.id === 4688 && (e.commandLine === null || e.commandLine === undefined))) problems.push("start events carry no command line (ProcessCreationIncludeCmdLine_Enabled is off)");
117
+ // A program started from a file always carries its command line when ProcessCreationIncludeCmdLine_Enabled is on. A process the kernel makes with no image
118
+ // file (vmmemWSL, vmmem, Registry, MemCompression: an image name with no path) never carries one, whoever started it: one such start on the host
119
+ // (WSL's memory process, started by another session) made the 0.6.78 real build's whole record "incomplete" (2026-11-25).
120
+ const noLine = events.filter((e) => e.id === 4688 && (e.commandLine === null || e.commandLine === undefined) && /[\\/]/.test(String(e.exe ?? "")));
121
+ if (noLine.length) problems.push(`${noLine.length} start event(s) of programs carry no command line (ProcessCreationIncludeCmdLine_Enabled is off?; first: ${noLine[0].exe})`);
118
122
  return { kind: "windows-security", from, to, newest: raw?.newest ?? null, continuous: raw?.continuous === true, events, problems };
119
123
  }
120
124
 
@@ -30,6 +30,9 @@ import { enumerateRows } from "./acceptance-rows.mjs";
30
30
  import os from "node:os";
31
31
  import { fileURLToPath } from "node:url";
32
32
  import { kindOf } from "./acceptance-launch.mjs";
33
+ // A file's last path element on any host: receipts carry the building host's paths (a Dell job names D:\...\b-1.exe), and path.basename on
34
+ // macOS or Linux does not split a backslash.
35
+ const fileName = (file) => String(file).split(/[\\/]/).pop();
33
36
 
34
37
  export const CONTRACT_FILE = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..", "..", "docs", "GATE-CONTRACT.md");
35
38
  const BEGIN = "<!-- acceptance-lines:begin -->"; const END = "<!-- acceptance-lines:end -->";
@@ -344,6 +347,8 @@ function jobOf(r) {
344
347
  file: r.file, verified: r.verified?.ok === true, problems: r.verified?.problems ?? [], jobId: p?.jobId ?? null, argv, cwd: typeof req?.workspace === "string" ? req.workspace : null,
345
348
  sub: argv ? cargoVerb(argv) : null, args: argv ? argv.slice(1) : [], gate: p?.gate ?? null, started, ended: timeOf(p?.terminalAt), submitted: Number.isFinite(started) ? started - waits : NaN, queueMs: Number.isFinite(t.queue) ? t.queue : null,
346
349
  testExecutables: p?.testExecutables, testExecutablesReason: p?.testExecutablesReason,
350
+ // The signed outcome: status, whether the post-checks ran, and whether the tree was reaped.
351
+ status: typeof p?.result?.status === "string" ? p.result.status : null, postChecksRan: p?.result?.postChecks?.ran ?? null, reaped: p?.result?.reap?.reaped === true,
347
352
  };
348
353
  }
349
354
 
@@ -413,7 +418,7 @@ function nn01(ctx) {
413
418
  if (!ctx.tree) return result(NOT_MEASURED, `git cannot say which tree commit ${short(ctx.commit)} is`);
414
419
  // Every broker job is signed as this commit's tree, built from a snapshot the broker confirmed unchanged.
415
420
  for (const j of ctx.jobs) {
416
- if (!j.verified) { (ctx.verifierPinned ? fails : gaps).push(`broker job ${j.jobId ?? path.basename(j.file)}: its receipt ${ctx.verifierPinned ? `does not verify (${j.problems.join("; ") || "no reason given"})` : "cannot be verified: no broker key is pinned"}`); continue; }
421
+ if (!j.verified) { (ctx.verifierPinned ? fails : gaps).push(`broker job ${j.jobId ?? fileName(j.file)}: its receipt ${ctx.verifierPinned ? `does not verify (${j.problems.join("; ") || "no reason given"})` : "cannot be verified: no broker key is pinned"}`); continue; }
417
422
  if (j.gate?.commit !== ctx.commit) fails.push(`broker job ${j.jobId} built commit ${short(j.gate?.commit)}, not the selected ${short(ctx.commit)}`);
418
423
  if (j.gate?.tree !== ctx.tree) fails.push(`broker job ${j.jobId} built tree ${short(j.gate?.tree)}, not the selected commit's ${short(ctx.tree)}`);
419
424
  if (j.gate?.snapshotUnchanged === false) fails.push(`broker job ${j.jobId}: the broker found the snapshot changed`);
@@ -726,7 +731,7 @@ function nn10(ctx) {
726
731
  if (!tests.length) return decide(fails, gaps, "the broker built no test and no cargo test ran outside it");
727
732
  let programs = 0; const claims = new Map();
728
733
  for (const j of tests) {
729
- const what = `broker job ${j.jobId ?? path.basename(j.file)}`;
734
+ const what = `broker job ${j.jobId ?? fileName(j.file)}`;
730
735
  if (!j.verified) { (ctx.verifierPinned ? fails : gaps).push(`${what}: its receipt ${ctx.verifierPinned ? "does not verify" : "cannot be verified: no broker key is pinned"}`); continue; }
731
736
  if (!Array.isArray(j.testExecutables) && typeof j.testExecutablesReason === "string") { gaps.push(`${what}: the receipt gives a reason string and no program list, which is not proof the broker only compiled and produced nothing`); continue; }
732
737
  if (!Array.isArray(j.testExecutables) && typeof j.testExecutablesReason !== "string") { gaps.push(`${what}: the signed receipt carries no manifest of test programs (no testExecutables), so that the broker only compiled is not shown`); continue; }
@@ -736,26 +741,26 @@ function nn10(ctx) {
736
741
  const file = typeof exe === "string" ? exe : exe?.path; const digest = typeof exe === "object" ? exe?.sha256 : null;
737
742
  if (typeof file !== "string") { fails.push(`${what}: the receipt lists a test program with no path`); continue; }
738
743
  const ran = ctx.procs.filter((p) => dirKey(p.exe) === dirKey(file));
739
- if (!ran.length) { (ctx.processGaps.length ? gaps : fails).push(`${what}: the broker built ${path.basename(file)} and the gate never ran it`); continue; }
740
- if (ran.length > 1) fails.push(`${what}: the gate ran ${path.basename(file)} ${ran.length} times`);
744
+ if (!ran.length) { (ctx.processGaps.length ? gaps : fails).push(`${what}: the broker built ${fileName(file)} and the gate never ran it`); continue; }
745
+ if (ran.length > 1) fails.push(`${what}: the gate ran ${fileName(file)} ${ran.length} times`);
741
746
  // One launch is credited to one receipt only: a program two receipts both list cannot have run for both.
742
747
  const claimed = claims.get(dirKey(file));
743
- if (claimed && claimed !== j.jobId) { fails.push(`${what}: ${path.basename(file)} is also listed by broker job ${claimed}, and its launch is credited to that receipt only`); continue; }
748
+ if (claimed && claimed !== j.jobId) { fails.push(`${what}: ${fileName(file)} is also listed by broker job ${claimed}, and its launch is credited to that receipt only`); continue; }
744
749
  claims.set(dirKey(file), j.jobId);
745
750
  // Execution after production: a launch before the broker finished the build ran something else.
746
- if (!Number.isFinite(j.ended)) gaps.push(`${what}: the receipt gives no end time, so that ${path.basename(file)} ran after it was built is not shown`);
747
- else if (ran.some((p) => p.start === j.ended)) gaps.push(`${what}: ${path.basename(file)} started at the very moment the build ended, so which came first is not shown`);
748
- if (Number.isFinite(j.ended) && ran.some((p) => p.start < j.ended)) fails.push(`${what}: ${path.basename(file)} was started before the broker finished building it (job ended ${new Date(j.ended).toISOString()})`);
751
+ if (!Number.isFinite(j.ended)) gaps.push(`${what}: the receipt gives no end time, so that ${fileName(file)} ran after it was built is not shown`);
752
+ else if (ran.some((p) => p.start === j.ended)) gaps.push(`${what}: ${fileName(file)} started at the very moment the build ended, so which came first is not shown`);
753
+ if (Number.isFinite(j.ended) && ran.some((p) => p.start < j.ended)) fails.push(`${what}: ${fileName(file)} was started before the broker finished building it (job ended ${new Date(j.ended).toISOString()})`);
749
754
  // The image at execution: the file's digest now equals the signed digest, and the file was last written before the launch and not since, so what ran is what the broker built.
750
755
  const img = typeof ctx.digestOf === "function" ? ctx.digestOf(file) : null;
751
756
  const now = img && typeof img === "object" ? img.sha256 : img; const written = img && typeof img === "object" ? img.mtimeMs : null;
752
- if (typeof digest !== "string") gaps.push(`${what}: the receipt gives no digest for ${path.basename(file)}`);
753
- else if (now === null || now === undefined) gaps.push(`${what}: ${path.basename(file)} cannot be read now to compare with the digest the broker signed`);
754
- else if (now !== digest) fails.push(`${what}: ${path.basename(file)} is not the program the broker built (digest ${short(now)}, signed ${short(digest)})`);
755
- else if (!Number.isFinite(written)) gaps.push(`${what}: when ${path.basename(file)} was last written is not shown, so that the image that ran is the one the broker built is not shown`);
756
- else if (written > Math.min(...ran.map((p) => p.start))) fails.push(`${what}: ${path.basename(file)} was written after the gate started it, so the image that ran is not the image now`);
757
+ if (typeof digest !== "string") gaps.push(`${what}: the receipt gives no digest for ${fileName(file)}`);
758
+ else if (now === null || now === undefined) gaps.push(`${what}: ${fileName(file)} cannot be read now to compare with the digest the broker signed`);
759
+ else if (now !== digest) fails.push(`${what}: ${fileName(file)} is not the program the broker built (digest ${short(now)}, signed ${short(digest)})`);
760
+ else if (!Number.isFinite(written)) gaps.push(`${what}: when ${fileName(file)} was last written is not shown, so that the image that ran is the one the broker built is not shown`);
761
+ else if (written > Math.min(...ran.map((p) => p.start))) fails.push(`${what}: ${fileName(file)} was written after the gate started it, so the image that ran is not the image now`);
757
762
  // No digest of the bytes that ran, taken when they ran, exists outside the gate: a digest read afterwards and a write time do not identify them.
758
- gaps.push(`${what}: the image of ${path.basename(file)} at the moment it ran is not shown by any record outside the gate (a digest taken after the run and a write time do not identify the bytes that ran)`);
763
+ gaps.push(`${what}: the image of ${fileName(file)} at the moment it ran is not shown by any record outside the gate (a digest taken after the run and a write time do not identify the bytes that ran)`);
759
764
  }
760
765
  }
761
766
  return decide(fails, gaps, `${tests.length} test build(s) by the broker, compile only and signed; the gate ran the ${programs} program(s) they list, each the one the broker built`);
@@ -1117,7 +1122,7 @@ export function judgeRun({ lines, launch = null, processes = null, witness = nul
1117
1122
  }
1118
1123
  const ctx = {
1119
1124
  launch, witnessTo: witness?.to ?? null, commit: launch?.commit ?? null, tree: g.tree, blobOf: g.blobOf, diskBlobs, cacheStore, snapshotStat,
1120
- sendGaps: sends.filter((d) => !claimed.has(d)).map((d) => `a broker send (cargo ${d.args.slice(1, 4).join(" ")}) has no signed job that matches its command, folder and lifetime, so what it built is not shown`), rustStarts, sends, vjobs: jobs.filter((j) => j.verified), foreignGaps: foreign.map((j) => `broker job ${j.jobId ?? path.basename(j.file)} is not shown to be this run's: no send of the run's own process tree has its command and folder`), jobGaps: [...foreign.map((j) => `broker job ${j.jobId ?? path.basename(j.file)} is not shown to be this run's: no send of the run's own process tree has its command and folder`), ...jobs.filter((j) => j.verified && !j.cwd).map((j) => `broker job ${j.jobId ?? path.basename(j.file)} is signed with no workspace, so which workspace and crate it built is not shown`), ...jobs.filter((j) => !j.verified).map((j) => `broker job ${j.jobId ?? path.basename(j.file)} is not credited: its receipt ${verifierPinned ? `does not verify (${j.problems.join("; ") || "no reason given"})` : "cannot be verified, no broker key is pinned"}`)],
1125
+ sendGaps: sends.filter((d) => !claimed.has(d)).map((d) => `a broker send (cargo ${d.args.slice(1, 4).join(" ")}) has no signed job that matches its command, folder and lifetime, so what it built is not shown`), rustStarts, sends, vjobs: jobs.filter((j) => j.verified), foreignGaps: foreign.map((j) => `broker job ${j.jobId ?? fileName(j.file)} is not shown to be this run's: no send of the run's own process tree has its command and folder`), jobGaps: [...foreign.map((j) => `broker job ${j.jobId ?? fileName(j.file)} is not shown to be this run's: no send of the run's own process tree has its command and folder`), ...jobs.filter((j) => j.verified && !j.cwd).map((j) => `broker job ${j.jobId ?? fileName(j.file)} is signed with no workspace, so which workspace and crate it built is not shown`), ...jobs.filter((j) => !j.verified).map((j) => `broker job ${j.jobId ?? fileName(j.file)} is not credited: its receipt ${verifierPinned ? `does not verify (${j.problems.join("; ") || "no reason given"})` : "cannot be verified, no broker key is pinned"}`)],
1121
1126
  inventory: inventory ? new Map(inventory) : null, inventoryUncovered, readiness, prior,
1122
1127
  baselineGap: !launch?.baseline?.commit ? "the launcher has no earlier launched run to take a baseline commit from, so what changed since cannot be shown" : launch.baseline.exit !== 0 ? "the previous launched run did not end cleanly, so its state is not a baseline" : typeof g.priorBlobOf !== "function" ? "git cannot show the baseline commit's tree" : null, exit: Number.isFinite(end) && Number.isInteger(launch?.exit) ? launch.exit : null,
1123
1128
  root: tree.root, procs: tree.procs, processGaps: tree.gaps, starts: startsAll,
@@ -12,7 +12,7 @@ import { createHash } from "node:crypto";
12
12
  import { execFileSync } from "node:child_process";
13
13
  import { fileURLToPath } from "node:url";
14
14
  import { ACCEPTANCE_RESULT_SCHEMA, judgeFileHashes } from "./acceptance-admission.mjs";
15
- import { CONTRACT_FILE } from "./acceptance-lines.mjs";
15
+ import { CONTRACT_FILE, readAcceptanceLines } from "./acceptance-lines.mjs";
16
16
 
17
17
  const here = path.dirname(fileURLToPath(import.meta.url));
18
18
  const sha256 = (bytes) => createHash("sha256").update(bytes).digest("hex");
@@ -43,8 +43,65 @@ export function buildAcceptanceResult({ launch, verdict, contractText, judgeFile
43
43
  };
44
44
  }
45
45
 
46
+ /**
47
+ * The record from an acceptance-run.mjs output folder (rightkit.acceptance-run/1, `<out>/verdict.json`), the run that accepts a gate today: the seven fixture
48
+ * cases, NN13 and the real build, judged together. The thirteen lines are that verdict's, each with the contract's sentence; `pass` needs the whole verdict
49
+ * to pass, the real build included; the judge files are the ones the run recorded; the commit is the real build's (a checkout of the release commit),
50
+ * and the launch facts (host, gate, times) are the real build's own. `claims` must be the real build's (claimsOfRealBuild).
51
+ */
52
+ export function buildFromAcceptanceRun({ run, launch, contractLines, contractText, tree, claims }) {
53
+ const lines = run?.verdict?.lines ?? []; const byId = new Map(lines.map((l) => [l.id, l]));
54
+ const realOk = run?.realBuild && Array.isArray(run.verdict?.realBuild) && run.verdict.realBuild.length > 0 && run.verdict.realBuild.every((l) => l.verdict === "pass");
55
+ const base = buildAcceptanceResult({ launch: { ...launch, commit: run?.realBuild?.commit ?? null }, verdict: { lines: contractLines.map((c) => ({ id: c.id, text: c.text, verdict: byId.get(c.id)?.verdict ?? "not run" })), pass: run?.verdict?.pass === true && realOk === true }, contractText, judgeFiles: run?.judgeFiles ?? {}, tree, claims });
56
+ return { ...base, casesSha256: run?.casesSha256 ?? null, realBuild: { repository: run?.realBuild?.repository ?? null, lines: (run?.verdict?.realBuild ?? []).map((l) => ({ id: l.id, verdict: l.verdict })) } };
57
+ }
58
+
59
+ /** The real build's broker claims: receipts written during its run (absent from its `before/receipts.txt`) whose signed gate commit is the real build's commit. */
60
+ export function claimsOfRealBuild({ receiptsDir, before, commit, read = (f) => fs.readFileSync(f, "utf8"), list = (d) => fs.readdirSync(d) }) {
61
+ const claims = [];
62
+ for (const name of list(receiptsDir)) {
63
+ if (!name.endsWith(".json") || before.has(name)) continue;
64
+ let doc; try { doc = JSON.parse(read(path.join(receiptsDir, name))); } catch { continue; }
65
+ if (doc?.provenance?.payload?.gate?.commit !== commit) continue; // a fixture case's job, or another repository's on the shared broker
66
+ const c = claimOf(doc); if (c) claims.push(c);
67
+ }
68
+ return claims;
69
+ }
70
+
71
+ function mainAcceptanceRun(argv, out) {
72
+ const opt = (name) => { const i = argv.indexOf(name); return i < 0 ? null : argv[i + 1]; };
73
+ const acceptDir = opt("--acceptance"); const receiptsDir = opt("--receipts"); const outDir = opt("--out");
74
+ if (!acceptDir || !receiptsDir || !outDir) { out("usage: acceptance-result.mjs --acceptance <acceptance-run.mjs output folder> --receipts <broker receipts dir> --out <result dir>"); return 2; }
75
+ const run = JSON.parse(fs.readFileSync(path.join(acceptDir, "verdict.json"), "utf8"));
76
+ if (run?.schema !== "rightkit.acceptance-run/1") { out(`acceptance-result REFUSED: ${path.join(acceptDir, "verdict.json")} is not a rightkit.acceptance-run/1 record`); return 1; }
77
+ if (!run.realBuild?.commit || !run.realBuild?.repository) { out("acceptance-result REFUSED: the acceptance run has no real build; a gate release is judged with it"); return 1; }
78
+ const realDir = path.join(acceptDir, "real-build");
79
+ const launch = JSON.parse(fs.readFileSync(path.join(realDir, "launch.json"), "utf8"));
80
+ let before = new Set(); try { before = new Set(fs.readFileSync(path.join(realDir, "before", "receipts.txt"), "utf8").split(/\r?\n/).filter(Boolean)); } catch { /* none */ }
81
+ const claims = claimsOfRealBuild({ receiptsDir, before, commit: run.realBuild.commit });
82
+ const tree = String(execFileSync("git", ["-C", run.realBuild.repository, "rev-parse", `${run.realBuild.commit}^{tree}`], { encoding: "utf8", windowsHide: true })).trim();
83
+ const contractText = String(fs.readFileSync(CONTRACT_FILE));
84
+ const result = buildFromAcceptanceRun({ run, launch, contractLines: readAcceptanceLines(contractText), contractText, tree, claims });
85
+ return writeResult({ result, claims, launch, outDir, out });
86
+ }
87
+
88
+ function writeResult({ result, claims, launch, outDir, out }) {
89
+ fs.mkdirSync(path.join(outDir, "job-claims"), { recursive: true });
90
+ for (const c of claims) fs.writeFileSync(path.join(outDir, "job-claims", `${c.id}.json`), c.bytes);
91
+ const gatePath = launch.gate?.path; const sealed = result.gate.sealedSha256;
92
+ if (gatePath && sealed) {
93
+ const m = SEALED_FOLDER.exec(String(gatePath)); const folder = String(gatePath).slice(0, m.index + m[0].length - 1); const beside = `${folder}.manifest.txt`;
94
+ fs.mkdirSync(path.join(outDir, "gate-seal"), { recursive: true });
95
+ for (const [from, to] of [[beside, "manifest.txt"], [path.join(folder, "trusted-gate-source.json"), "trusted-gate-source.json"]]) { try { fs.copyFileSync(from, path.join(outDir, "gate-seal", to)); } catch { /* the admission names what is missing */ } }
96
+ }
97
+ fs.writeFileSync(path.join(outDir, "acceptance-result.json"), `${JSON.stringify(result, null, 2)}\n`);
98
+ out(`acceptance-result written: ${path.join(outDir, "acceptance-result.json")} (${result.lines.filter((l) => l.verdict === "pass").length} of ${result.lines.length} lines pass, ${claims.length} broker claim(s), pass ${result.pass})`);
99
+ return 0;
100
+ }
101
+
46
102
  /** `node acceptance-result.mjs ...` (see the head of this file). Exit 0 when the result is written, whether or not the run passed: the verdict is in the record. */
47
103
  export function main(argv = process.argv.slice(2), { out = console.log } = {}) {
104
+ if (argv.includes("--acceptance")) return mainAcceptanceRun(argv, out);
48
105
  const opt = (name) => { const i = argv.indexOf(name); return i < 0 ? null : argv[i + 1]; };
49
106
  const runDir = opt("--run"); const repo = opt("--repo"); const receiptsDir = opt("--receipts"); const outDir = opt("--out");
50
107
  if (!runDir || !repo || !receiptsDir || !outDir) { out("usage: acceptance-result.mjs --run <run dir> --repo <dir> --receipts <broker receipts dir> --out <result dir> [acceptance-lines.mjs options]"); return 2; }
Binary file
@@ -2358,8 +2358,13 @@ async function runStages(o, args, root, git, io) {
2358
2358
  if (ok && ds) ok = await stageSidecarsOnce({ o, ds, root, git, configs: sidecarConfigs, appDir, cli, commonDir, commit, tree, stage, executor });
2359
2359
  else for (const config of ok ? sidecarConfigs : []) if (!await rightRelease(stage, ["stage-sidecar", "--config", path.join(root, config)])) { ok = false; break; }
2360
2360
  if (ok && admissionAfterStaging) {
2361
- if (ds.carriedOutputs?.size) ok = await admissionDryRun("after the sidecars were staged, before the app compiles");
2362
- else o.out(`${tag} [compile] release admission dry-run skipped here: no broker receipt names the app's Cargo target yet; the package stage's build runs the same admission rows at its start`);
2361
+ // Every Cargo workspace of the app must have a receipt naming its target: an app of several workspaces (CodeRight: engine, src-tauri, qa-e2e) whose
2362
+ // sidecar staging compiled only one still has no target for the others, and the dry-run refused it with RK_SPLIT_TARGET_UNRESOLVED (Mac, 2026-11-26).
2363
+ let appWorkspaces = [];
2364
+ try { appWorkspaces = Object.entries(await snapshotCargoWorkspaces({ git, ds, root })).filter(([dir]) => appDir === "." || dir === appDir || dir.startsWith(`${appDir}/`)).map(([, checkout]) => checkout); } catch { appWorkspaces = []; }
2365
+ const uncovered = appWorkspaces.filter((w) => !ds.carriedOutputs?.has(w));
2366
+ if (ds.carriedOutputs?.size && uncovered.length === 0) ok = await admissionDryRun("after the sidecars were staged, before the app compiles");
2367
+ else o.out(`${tag} [compile] release admission dry-run skipped here: no broker receipt names the Cargo target of ${uncovered.length ? uncovered.map((w) => path.relative(root, w).replaceAll("\\", "/") || ".").join(", ") : "the app"} yet; the package stage's build runs the same admission rows at its start`);
2363
2368
  }
2364
2369
  let compiledDirs = []; let compiledBins = null; let qualifyOwed = []; let limitedEvidence = [];
2365
2370
  const reportOutputs = (dirs, bins = null) => { compiledDirs = [...dirs]; compiledBins = bins; };
@@ -3430,6 +3435,9 @@ async function runUnitSnapshot(o, args, root, git, io, option) {
3430
3435
  try { consumerScope = [...new Set((JSON.parse(fs.readFileSync(path.join(ds.path, "ci", "gate.config.json"), "utf8")).rust?.[match[2]]?.consumerRows ?? []).map((row) => path.posix.dirname(String(row.manifestPath))))]; }
3431
3436
  catch { consumerScope = []; }
3432
3437
  }
3438
+ // The gate package's package stage on the Mac builds and signs its swap helper from crates/rightkit-fs (local-publish.mjs prepareSwapHelper), so that
3439
+ // Cargo workspace is bound beside the package's own (0.6.80 on the Mac: RK_CARGO_UNBOUND_WORKSPACE "resolved (none)" for the helper build).
3440
+ if (selector === "npm:@rightkit/release" && o.platform === "darwin") consumerScope = [...new Set([...consumerScope, "crates/rightkit-fs"])];
3433
3441
  const bound = option("--to") === "check" || privateUnit.private ? { env: {}, cleanup() {} } : await bindUnitCargo({ o, git, root, ds, executor, which, scopeDirs: [path.posix.dirname(manifest)], extraWorkspaces: consumerScope, ...(toolRun ? { onlyWorkspaces: [path.posix.dirname(manifest)] } : {}) });
3434
3442
  if (bound.refusal) { o.err(`${tag} BLOCKED: RK_SNAPSHOT_OUTPUT_UNPINNED: ${bound.refusal}; nothing ran`); return 1; }
3435
3443
  if (bound.note) o.out(`${tag} ${bound.note}`);
@@ -149,7 +149,11 @@ export function generateCargoNotices({ appRoot, config, flags = {}, check = fals
149
149
  if (entry.manifestPath !== undefined && !exists(path.resolve(appRoot, entry.manifestPath))) fail(`legal.cargoNotices.manifestPath ${entry.manifestPath}${where} does not exist`);
150
150
  }
151
151
  const outputs = options.manifests.map((entry) => {
152
- const result = run(cargoAboutArgs(options, entry), { cwd: appRoot, env, encoding: "utf8", maxBuffer: 256 * 1024 * 1024 });
152
+ // Absolute paths: the managed runner hands the command to the broker, which runs it with no working directory of the app's (rightkit#1718),
153
+ // so an app-relative --config or template would be read from wherever cargo happens to start.
154
+ const absolute = { ...options, template: path.resolve(appRoot, options.template) };
155
+ const absoluteEntry = { ...entry, ...(entry.config !== undefined ? { config: path.resolve(appRoot, entry.config) } : {}), ...(entry.manifestPath !== undefined ? { manifestPath: path.resolve(appRoot, entry.manifestPath) } : {}) };
156
+ const result = run(cargoAboutArgs(absolute, absoluteEntry), { cwd: appRoot, env, encoding: "utf8", maxBuffer: 256 * 1024 * 1024 });
153
157
  const where = entry.label ? ` for ${entry.label}` : "";
154
158
  if (result?.error) fail(`cargo about could not start${where} (${result.error.message}); install cargo-about on the build host`);
155
159
  if (result?.status !== 0) fail(`cargo about${where} exited ${result?.status ?? "without status"}${result?.stderr ? `:\n${String(result.stderr).trim()}` : ""}`);
File without changes
@@ -192,7 +192,7 @@ export function main(argv = process.argv.slice(2), { out = console.log } = {}) {
192
192
  const f = result.facts;
193
193
  // --record <file>: the record a credentialed upload step reads (scripts/ci/upload.mjs gateAdmissionProblem). Written only here, only when admitted.
194
194
  if (opt("--record")) fs.writeFileSync(opt("--record"), `${JSON.stringify({ schema: "rightkit.gate-release-admission/1", ok: true, unit: GATE_PACKAGE, version: f.version, archiveSha256: f.archiveSha256, commit: opt("--commit"), host: f.host, sealedSha256: f.sealedSha256, jobsVerified: f.jobsVerified, signedSteps: f.signedSteps, nnBasis: f.nnBasis }, null, 2)}\n`);
195
- out(`gate-release-admission OK: host ${f.host}, sealed gate ${f.sealedSha256}, archive ${f.archiveSha256}; ${f.jobsVerified} of ${f.jobsListed} listed broker job(s) verified, in step(s) ${f.signedSteps.join(", ")}; sealed launch(es) proven from signed claims: ${f.launchesProven.join(", ")}`);
195
+ out(`gate-release-admission OK: host ${f.host}, sealed gate ${f.sealedSha256}, archive ${f.archiveSha256}; ${f.jobsVerified} of ${f.jobsListed} listed broker job(s) verified, in step(s) ${(f.signedSteps ?? []).join(", ") || "none named"}; sealed launch(es) proven from signed claims: ${(f.launchesProven ?? []).join(", ") || "none named (an acceptance result: its claims are the release commit's real build)"}`);
196
196
  out(` every other assertion of the verdict rests on: ${f.nnBasis ?? "not stated"} (the signed claims prove those launches ran on that host's broker for this gate, with that command, result and commit; they do not re-derive the rest)`);
197
197
  return 0;
198
198
  }
package/local-publish.mjs CHANGED
@@ -675,11 +675,11 @@ function assertLocalHost(deps, workspaceRoot, kind, { qualifyOnly = false, unit
675
675
  const platform = deps.platform ?? process.platform;
676
676
  if (!(deps.localBuildGranted ?? localBuildGranted)(workspaceRoot)) refuse(`--local needs the local-build grant: a committed ${LOCAL_BUILD_FILE} (allow "build-test-publish") naming this repository at ${workspaceRoot}`);
677
677
  if (!Object.hasOwn(LOCAL_HOST_POLICIES, platform)) refuse(`--local runs on the Mac (host policy: darwin-only), Windows (host policy: win32-only) or a Linux direct origin (linux-direct); this host is ${platform}`);
678
- // The npm upload reads the registry token from the macOS Keychain: Mac only.
679
- // A Linux direct origin only qualifies (no token; the upload is publish.yml, GB-29), so it may qualify every npm package, @rightkit/release
680
- // included: its Developer-ID-signed helper is built and signed hosted (publish.yml build-swap/sign-swap), never on the origin.
681
- const linuxNpmQualify = platform === "linux" && qualifyOnly;
682
- if (kind === "npm" && platform !== "darwin" && !linuxNpmQualify) refuse(`publish npm --local needs the macOS Keychain npm token and runs on the Mac only; Windows publishes crates (publish cargo --local); this host is ${platform}`);
678
+ // A qualification reads no registry token (the upload is publish.yml), so the Mac, Windows and a Linux direct origin all qualify every npm
679
+ // package, @rightkit/release included: off the Mac its Developer-ID-signed helper is built and signed hosted (publish.yml build-swap/sign-swap)
680
+ // and is left out of the content digest (pack-digest exclusionsFor). Host uploads are retired (host-upload-refusal.mjs), so --local without
681
+ // --qualify-only stays refused off the Mac as before; the direct npm upload is `right-release publish-local npm` (publish-local-npm.mjs).
682
+ if (kind === "npm" && platform !== "darwin" && !qualifyOnly) refuse(`publish npm --local uploads only through publish-local npm; on ${platform} it qualifies (--qualify-only, the gate's unit stages)`);
683
683
  return platform;
684
684
  }
685
685
 
@@ -973,8 +973,9 @@ async function* publishUnitStages(parsed, deps, batch) {
973
973
  const cleanup = () => fs.rmSync(scratch, { recursive: true, force: true });
974
974
  try {
975
975
  let artifactFile; const packCommands = [];
976
- if (kind === "npm" && unit === SWAP_HELPER_PACKAGE && platform !== "linux") {
977
- // A Linux direct origin skips this: it packs without the helper and the hosted sign-swap job binds the sealed one.
976
+ if (kind === "npm" && unit === SWAP_HELPER_PACKAGE && platform === "darwin") {
977
+ // Windows and a Linux direct origin skip this (only the Mac can Developer-ID sign): they pack without the helper and the hosted
978
+ // sign-swap job binds the sealed one.
978
979
  // #258: the package ships a Developer-ID-signed bin/darwin/rightkit-swap; build, sign and verify it before packing (fails closed). The
979
980
  // helper and its signing receipt are written into the unit's own directory of the snapshot (packages/release/bin/darwin, both ignored by
980
981
  // packages/release/.gitignore): declared stage outputs of this stage, recorded by the gate's stage-output ledger (stage-ledger.mjs) like
@@ -686,6 +686,126 @@
686
686
  "M3": "ViewRight has no supervised app engine or restart-surviving app jobs. Document work stays local, and rightkit-ocr owns its worker.",
687
687
  "M7": "ViewRight has no product local service. rightkit-daemon supplies roots under M6, the shell owns single-instance handoff, and opt-in control belongs to rightkit-qa."
688
688
  }
689
+ },
690
+ "pulse": {
691
+ "issue": "bogusyogi/pulse#643",
692
+ "source": "Pulse's .rightkit/ownership-exceptions.json entries that still apply after the RightKit port (bogusyogi/pulse#643), each tracked by its RightKit issue and approved by Adrian 2026-11-07",
693
+ "profile": "desktop",
694
+ "note": "Expiring ownership exceptions ratified for Pulse. Each expires 2026-11-30; the code moves into RightKit through the named issue or the entry is renewed with a fresh approval.",
695
+ "exceptions": [
696
+ {
697
+ "capability": "dependency-allowlist",
698
+ "package": "RightKit dependency allowlist",
699
+ "path": "engine/Cargo.toml",
700
+ "issue": "bogusyogi/rightkit#846",
701
+ "expires": "2026-11-30",
702
+ "approvedBy": "Adrian D'Souza, 2026-11-07: \"for now, you can test with ownership exception but eventually we do the whole port\""
703
+ },
704
+ {
705
+ "capability": "os-credential-store",
706
+ "package": "RightKitSwift",
707
+ "path": "ios/Sources/Approvals/ApprovalKey.swift",
708
+ "issue": "bogusyogi/rightkit#1038",
709
+ "expires": "2026-11-30",
710
+ "approvedBy": "Adrian D'Souza, 2026-11-07: \"for now, you can test with ownership exception but eventually we do the whole port\""
711
+ },
712
+ {
713
+ "capability": "os-credential-store",
714
+ "package": "RightKitSwift",
715
+ "path": "mac/Notch/Sources/Agent/ChatUnlockPanel.swift",
716
+ "issue": "bogusyogi/rightkit#1038",
717
+ "expires": "2026-11-30",
718
+ "approvedBy": "Adrian D'Souza, 2026-11-07: \"for now, you can test with ownership exception but eventually we do the whole port\""
719
+ },
720
+ {
721
+ "capability": "theme-ui",
722
+ "package": "@rightkit/theme",
723
+ "path": "mac/Notch/Sources/Launcher/ClipboardStripView.swift",
724
+ "issue": "bogusyogi/rightkit#847",
725
+ "expires": "2026-11-30",
726
+ "approvedBy": "Adrian D'Souza, 2026-11-07: \"for now, you can test with ownership exception but eventually we do the whole port\""
727
+ },
728
+ {
729
+ "capability": "dependency-allowlist",
730
+ "package": "RightKit dependency allowlist",
731
+ "path": "membrane/engine/crates/membrane-runtime/Cargo.toml",
732
+ "issue": "bogusyogi/rightkit#846",
733
+ "expires": "2026-11-30",
734
+ "approvedBy": "Adrian D'Souza, 2026-11-07: \"for now, you can test with ownership exception but eventually we do the whole port\""
735
+ },
736
+ {
737
+ "capability": "search",
738
+ "package": "rightkit-search",
739
+ "path": "membrane/engine/crates/membrane-runtime/src/ledger/query.rs",
740
+ "issue": "bogusyogi/rightkit#851",
741
+ "expires": "2026-11-30",
742
+ "approvedBy": "Adrian D'Souza, 2026-11-07: \"for now, you can test with ownership exception but eventually we do the whole port\""
743
+ },
744
+ {
745
+ "capability": "dependency-allowlist",
746
+ "package": "RightKit dependency allowlist",
747
+ "path": "membrane/engine/crates/membrane/Cargo.toml",
748
+ "issue": "bogusyogi/rightkit#846",
749
+ "expires": "2026-11-30",
750
+ "approvedBy": "Adrian D'Souza, 2026-11-07: \"for now, you can test with ownership exception but eventually we do the whole port\""
751
+ },
752
+ {
753
+ "capability": "dependency-allowlist",
754
+ "package": "RightKit dependency allowlist",
755
+ "path": "rightkit-mesh-ffi/Cargo.toml",
756
+ "issue": "bogusyogi/rightkit#849",
757
+ "expires": "2026-11-30",
758
+ "approvedBy": "Adrian D'Souza, 2026-11-07: \"for now, you can test with ownership exception but eventually we do the whole port\""
759
+ },
760
+ {
761
+ "capability": "dependency-allowlist",
762
+ "package": "RightKit dependency allowlist",
763
+ "path": "rightkit-mesh-ffi/ios-netwatch/Cargo.toml",
764
+ "issue": "bogusyogi/rightkit#849",
765
+ "expires": "2026-11-30",
766
+ "approvedBy": "Adrian D'Souza, 2026-11-07: \"for now, you can test with ownership exception but eventually we do the whole port\""
767
+ },
768
+ {
769
+ "capability": "qa-evidence",
770
+ "package": "@rightkit/qa",
771
+ "path": "scripts/qa/win-installed/link-uia.mjs",
772
+ "issue": "bogusyogi/rightkit#1046",
773
+ "expires": "2026-11-30",
774
+ "approvedBy": "Adrian D'Souza, 2026-11-07: \"for now, you can test with ownership exception but eventually we do the whole port\""
775
+ },
776
+ {
777
+ "capability": "local-services",
778
+ "package": "rightkit-daemon",
779
+ "path": "swift/RightKitHub/Sources/RightKitEngineClient/AttachedTransport.swift",
780
+ "issue": "bogusyogi/rightkit#852",
781
+ "expires": "2026-11-30",
782
+ "approvedBy": "Adrian D'Souza, 2026-11-07: \"for now, you can test with ownership exception but eventually we do the whole port\""
783
+ },
784
+ {
785
+ "capability": "windows-native-overlay-renderer",
786
+ "package": "rightkit-overlay-win",
787
+ "path": "windows/src/clip_strip.rs",
788
+ "issue": "bogusyogi/rightkit#914",
789
+ "expires": "2026-11-30",
790
+ "approvedBy": "Adrian D'Souza, 2026-11-07: \"for now, you can test with ownership exception but eventually we do the whole port\""
791
+ },
792
+ {
793
+ "capability": "theme-ui",
794
+ "package": "@rightkit/theme",
795
+ "path": "windows/src/clip_strip/draw.rs",
796
+ "issue": "bogusyogi/rightkit#847",
797
+ "expires": "2026-11-30",
798
+ "approvedBy": "Adrian D'Souza, 2026-11-07: \"for now, you can test with ownership exception but eventually we do the whole port\""
799
+ },
800
+ {
801
+ "capability": "windows-native-overlay-renderer",
802
+ "package": "rightkit-overlay-win",
803
+ "path": "windows/src/shot.rs",
804
+ "issue": "bogusyogi/rightkit#914",
805
+ "expires": "2026-11-30",
806
+ "approvedBy": "Adrian D'Souza, 2026-11-07: \"for now, you can test with ownership exception but eventually we do the whole port\""
807
+ }
808
+ ]
689
809
  }
690
810
  },
691
811
  "amendments": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rightkit/release",
3
- "version": "0.6.78",
3
+ "version": "0.6.80",
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",
@@ -90,13 +90,6 @@
90
90
  "!provenance-real-receipt.fixture.json"
91
91
  ],
92
92
  "sideEffects": false,
93
- "scripts": {
94
- "test": "node --test acceptance-admission.test.mjs acceptance-lines.test.mjs acceptance-cases.test.mjs rule-verdict-cache.test.mjs class-b-dispatch.test.mjs remember-reads.test.mjs sidecar-source.test.mjs caller-levers.test.mjs class-a-cache-history.test.mjs gate-fixed-levers.test.mjs broker-toolchain.test.mjs snapshot-changes.test.mjs gate-serve-changes.test.mjs gate-serve-helper.test.mjs resident-answers.test.mjs probe-memo-kept.test.mjs class-a-lanes.test.mjs feature-partition-targets.test.mjs class-b-target-groups.test.mjs unit-list-lock.test.mjs cargo-profile-check.test.mjs cargo-home-real-path.test.mjs class-a-cache-admission.test.mjs class-b-cache-admission.test.mjs shellcheck-cache-inputs.test.mjs implicit-features.test.mjs test-group-failure-cache.test.mjs sealed-listing-store.test.mjs gate/gate.test.mjs package-files.test.mjs host-gate.test.mjs publish-local-cargo.test.mjs affected-units.test.mjs batch-workspace.test.mjs unit-list-plan.test.mjs compile-inputs.test.mjs snapshot-dependency-reuse.test.mjs publisher-requirement-scan.test.mjs node-check-cache.test.mjs preparation-diagnostics.test.mjs gate-coverage-timing.test.mjs ci-compile-admission.test.mjs qualification-verify.test.mjs test-run-output.test.mjs feature-partition.test.mjs feature-sets.test.mjs gate-seam.test.mjs serial-row.test.mjs seam-repairs.test.mjs snapshot-lock.test.mjs lock-identity.test.mjs stamp-relay.test.mjs install-tauri-authenticode.test.mjs gate-stage-binding.test.mjs tool-output.test.mjs publication-gate.test.mjs gate-release-admission.test.mjs cache-key-explain.test.mjs external-inputs.test.mjs built-bins.test.mjs probe-memo.test.mjs gate-serve-ask.test.mjs double-pass.test.mjs tool-version-memo.test.mjs workspace-manifests.test.mjs test-failure-cache.test.mjs served-metadata.test.mjs windows-pnpm-identity.test.mjs",
95
- "test:registry-parity": "node registry-parity.mjs --allow-unpublished",
96
- "test:signer:windows": "node sign-release-manifest.integration.mjs",
97
- "prepublishOnly": "pnpm test:signer:windows && pnpm test:registry-parity",
98
- "verify:standalone": "node standalone-clone-verify.mjs"
99
- },
100
93
  "publishConfig": {
101
94
  "registry": "https://registry.npmjs.org/",
102
95
  "access": "public"
@@ -106,9 +99,14 @@
106
99
  "url": "git+https://github.com/bogusyogi/rightkit.git",
107
100
  "directory": "packages/release"
108
101
  },
109
- "packageManager": "pnpm@12.16.1",
110
102
  "dependencies": {
111
103
  "@rightkit/outdated": "0.3.0",
112
104
  "smol-toml": "1.9.1"
105
+ },
106
+ "scripts": {
107
+ "test": "node --test acceptance-admission.test.mjs acceptance-lines.test.mjs acceptance-cases.test.mjs rule-verdict-cache.test.mjs class-b-dispatch.test.mjs remember-reads.test.mjs sidecar-source.test.mjs caller-levers.test.mjs class-a-cache-history.test.mjs gate-fixed-levers.test.mjs broker-toolchain.test.mjs snapshot-changes.test.mjs gate-serve-changes.test.mjs gate-serve-helper.test.mjs resident-answers.test.mjs probe-memo-kept.test.mjs class-a-lanes.test.mjs feature-partition-targets.test.mjs class-b-target-groups.test.mjs unit-list-lock.test.mjs cargo-profile-check.test.mjs cargo-home-real-path.test.mjs class-a-cache-admission.test.mjs class-b-cache-admission.test.mjs shellcheck-cache-inputs.test.mjs implicit-features.test.mjs test-group-failure-cache.test.mjs sealed-listing-store.test.mjs gate/gate.test.mjs package-files.test.mjs host-gate.test.mjs publish-local-cargo.test.mjs publish-local-npm.test.mjs shell-contract-hub-window.test.mjs cargo-license-notices-paths.test.mjs affected-units.test.mjs batch-workspace.test.mjs unit-list-plan.test.mjs compile-inputs.test.mjs snapshot-dependency-reuse.test.mjs publisher-requirement-scan.test.mjs node-check-cache.test.mjs preparation-diagnostics.test.mjs gate-coverage-timing.test.mjs ci-compile-admission.test.mjs qualification-verify.test.mjs test-run-output.test.mjs feature-partition.test.mjs feature-sets.test.mjs gate-seam.test.mjs serial-row.test.mjs seam-repairs.test.mjs snapshot-lock.test.mjs lock-identity.test.mjs stamp-relay.test.mjs install-tauri-authenticode.test.mjs gate-stage-binding.test.mjs tool-output.test.mjs publication-gate.test.mjs gate-release-admission.test.mjs cache-key-explain.test.mjs external-inputs.test.mjs built-bins.test.mjs probe-memo.test.mjs gate-serve-ask.test.mjs double-pass.test.mjs tool-version-memo.test.mjs workspace-manifests.test.mjs test-failure-cache.test.mjs served-metadata.test.mjs windows-pnpm-identity.test.mjs",
108
+ "test:registry-parity": "node registry-parity.mjs --allow-unpublished",
109
+ "test:signer:windows": "node sign-release-manifest.integration.mjs",
110
+ "verify:standalone": "node standalone-clone-verify.mjs"
113
111
  }
114
- }
112
+ }
package/publish-cargo.mjs CHANGED
@@ -16,8 +16,12 @@ import { formatPreflight, PREFLIGHT_FAIL } from "./preflight.mjs";
16
16
  import { cargoManifestState } from "./cargo-manifest-text.mjs";
17
17
 
18
18
  const FORBIDDEN_PACKAGE_PATH = /(^|\/)(?:\.env(?:\.[^/]*)?|target(?:\/.*)?|node_modules(?:\/.*)?|[^/]+\.(?:p8|p12|pem|key))$/i;
19
+ // A PEM private key is its header followed by key data: a line of base64, after a line break or after an escaped "\n" inside a string literal (a key
20
+ // pasted into code or JSON). The header alone is a format marker, as in code that checks an uploaded key's shape (rightkit-remote-gateway push_key.rs:
21
+ // valid_p8 compares the text with the BEGIN/END markers); it holds no key and is not flagged, so no exemption record is needed for it.
22
+ export const PEM_PRIVATE_KEY = /-----BEGIN (?:[A-Z0-9]+ )*PRIVATE KEY(?: BLOCK)?-----(?:\r?\n|(?:\\r)?\\n)[A-Za-z0-9+/=]{40,}/;
19
23
  export const SECRET_PATTERNS = [
20
- /-----BEGIN (?:RSA |EC |OPENSSH )?PRIVATE KEY-----/,
24
+ PEM_PRIVATE_KEY,
21
25
  /\bAKIA[0-9A-Z]{16}\b/,
22
26
  /\bgh[pousr]_[A-Za-z0-9_]{20,}\b/,
23
27
  /\bnpm_[A-Za-z0-9]{30,}\b/,
@@ -166,11 +170,11 @@ const RECORD_KEYS = Object.freeze(["path", "sha256", "kind", "note"]);
166
170
  const RECORD_NOTE_PLACEHOLDER = "<what it holds and why it is safe>";
167
171
  const ENV_TEMPLATE = /(^|\/)\.env(?:\.[^/]*)?\.(?:example|sample|template)$/i;
168
172
  // Labels of SECRET_PATTERNS, index for index.
169
- const SECRET_PATTERN_LABELS = Object.freeze(["a PEM private key header", "an AWS access key id (AKIA)", "a GitHub token (gh*_)", "an npm token (npm_)"]);
173
+ const SECRET_PATTERN_LABELS = Object.freeze(["a PEM private key", "an AWS access key id (AKIA)", "a GitHub token (gh*_)", "an npm token (npm_)"]);
170
174
  // Credential shapes that are never a placeholder, matched in env templates besides SECRET_PATTERNS. Every expression is linear:
171
175
  // each quantified class is followed by a delimiter it cannot match or by the end of the match.
172
176
  const TEMPLATE_SHAPES = Object.freeze([
173
- [/-----BEGIN (?:[A-Z0-9]+ )*PRIVATE KEY(?: BLOCK)?-----/, "a PEM private key header"],
177
+ [PEM_PRIVATE_KEY, "a PEM private key"],
174
178
  [/github_pat_[A-Za-z0-9_]{22,}/, "a GitHub fine-grained token (github_pat_)"],
175
179
  [/sk_live_[A-Za-z0-9]{16,}/, "a Stripe live key (sk_live_)"],
176
180
  [/xox[abprs]-[A-Za-z0-9-]{10,}/, "a Slack token (xox*-)"],