@rightkit/release 0.6.79 → 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.
@@ -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 -->";
@@ -415,7 +418,7 @@ function nn01(ctx) {
415
418
  if (!ctx.tree) return result(NOT_MEASURED, `git cannot say which tree commit ${short(ctx.commit)} is`);
416
419
  // Every broker job is signed as this commit's tree, built from a snapshot the broker confirmed unchanged.
417
420
  for (const j of ctx.jobs) {
418
- 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; }
419
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)}`);
420
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)}`);
421
424
  if (j.gate?.snapshotUnchanged === false) fails.push(`broker job ${j.jobId}: the broker found the snapshot changed`);
@@ -728,7 +731,7 @@ function nn10(ctx) {
728
731
  if (!tests.length) return decide(fails, gaps, "the broker built no test and no cargo test ran outside it");
729
732
  let programs = 0; const claims = new Map();
730
733
  for (const j of tests) {
731
- const what = `broker job ${j.jobId ?? path.basename(j.file)}`;
734
+ const what = `broker job ${j.jobId ?? fileName(j.file)}`;
732
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; }
733
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; }
734
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; }
@@ -738,26 +741,26 @@ function nn10(ctx) {
738
741
  const file = typeof exe === "string" ? exe : exe?.path; const digest = typeof exe === "object" ? exe?.sha256 : null;
739
742
  if (typeof file !== "string") { fails.push(`${what}: the receipt lists a test program with no path`); continue; }
740
743
  const ran = ctx.procs.filter((p) => dirKey(p.exe) === dirKey(file));
741
- if (!ran.length) { (ctx.processGaps.length ? gaps : fails).push(`${what}: the broker built ${path.basename(file)} and the gate never ran it`); continue; }
742
- 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`);
743
746
  // One launch is credited to one receipt only: a program two receipts both list cannot have run for both.
744
747
  const claimed = claims.get(dirKey(file));
745
- 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; }
746
749
  claims.set(dirKey(file), j.jobId);
747
750
  // Execution after production: a launch before the broker finished the build ran something else.
748
- 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`);
749
- 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`);
750
- 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()})`);
751
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.
752
755
  const img = typeof ctx.digestOf === "function" ? ctx.digestOf(file) : null;
753
756
  const now = img && typeof img === "object" ? img.sha256 : img; const written = img && typeof img === "object" ? img.mtimeMs : null;
754
- if (typeof digest !== "string") gaps.push(`${what}: the receipt gives no digest for ${path.basename(file)}`);
755
- else if (now === null || now === undefined) gaps.push(`${what}: ${path.basename(file)} cannot be read now to compare with the digest the broker signed`);
756
- else if (now !== digest) fails.push(`${what}: ${path.basename(file)} is not the program the broker built (digest ${short(now)}, signed ${short(digest)})`);
757
- 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`);
758
- 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`);
759
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.
760
- 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)`);
761
764
  }
762
765
  }
763
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`);
@@ -1119,7 +1122,7 @@ export function judgeRun({ lines, launch = null, processes = null, witness = nul
1119
1122
  }
1120
1123
  const ctx = {
1121
1124
  launch, witnessTo: witness?.to ?? null, commit: launch?.commit ?? null, tree: g.tree, blobOf: g.blobOf, diskBlobs, cacheStore, snapshotStat,
1122
- 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"}`)],
1123
1126
  inventory: inventory ? new Map(inventory) : null, inventoryUncovered, readiness, prior,
1124
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,
1125
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.79",
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*-)"],
@@ -1,8 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  // `right-release publish-local npm --package @rightkit/<name> --commit <sha>`: the local npm route (Adrian, 2026-11-03, rightkit#1471:
3
3
  // "i want you to publish it from local. the npm and crates are both local. we will do a provenance skip fuck your ci. feel free to push
4
- // but no ci"). Mac only: the token is the granular @rightkit token with 2FA bypass in the Keychain item npm-rightkit-publish, read inside
5
- // this process, never printed, never on a command line, never left on disk.
4
+ // but no ci"). On the Mac the token is the granular @rightkit token with 2FA bypass in the Keychain item npm-rightkit-publish, read inside
5
+ // this process, never printed, never on a command line, never left on disk. On Windows (Adrian, 2026-11-25: npm is signed in on the Dell
6
+ // too; publishing is local on the Mac and the Dell) npm publishes with the account's own npm sign-in, the .npmrc in the account's profile
7
+ // folder (os.userInfo().homedir, not $HOME, which an agent profile can move); this process never reads it. Elsewhere it is refused.
8
+ // `--archive <tgz>` publishes that exact packed file instead of packing the commit (it must be the commit's package and version): the
9
+ // gate package is published as the archive its acceptance run admitted (GATE-CONTRACT NN31), with its Mac-signed helper inside.
6
10
  //
7
11
  // It publishes exactly the bytes of one commit, and only after:
8
12
  // 1. the commit is on origin/main (pushed; [skip ci] is fine);
@@ -55,9 +59,10 @@ export function checkoutStoreDir(repo, readFile = (f) => fs.readFileSync(f, "utf
55
59
  }
56
60
 
57
61
  export function parseArgs(argv) {
58
- const out = { kind: argv[0], pkg: null, commit: null, repo: process.cwd() };
62
+ const out = { kind: argv[0], pkg: null, commit: null, repo: process.cwd(), archive: null };
59
63
  for (let i = 1; i < argv.length; i += 1) {
60
64
  if (argv[i] === "--package") out.pkg = argv[++i];
65
+ else if (argv[i] === "--archive") out.archive = path.resolve(argv[++i] ?? fail("--archive <packed .tgz> needs a file"));
61
66
  else if (argv[i] === "--commit") out.commit = argv[++i];
62
67
  else if (argv[i] === "--repo") out.repo = path.resolve(argv[++i]);
63
68
  else fail(`unknown option ${argv[i]}`);
@@ -68,9 +73,23 @@ export function parseArgs(argv) {
68
73
  return out;
69
74
  }
70
75
 
71
- export function publishLocalNpm(argv, { run = spawnSync, log = console.log, platform = process.platform, readToken = () => readKeychainToken(run), verifyTries = 20, verifyDelaySeconds = 15 } = {}) {
76
+ /** The account's own npm config on Windows: <profile folder>/.npmrc, where `npm login` on that account writes its sign-in. */
77
+ export const accountNpmrc = () => path.join(os.userInfo().homedir, ".npmrc");
78
+
79
+ /** npm and pnpm are .cmd shims on Windows, which Node starts only through cmd.exe; elsewhere they run as they are. Arguments here are
80
+ * validated names, versions, hex shas and paths this process made, so cmd.exe sees no caller text. */
81
+ export function toolCommand(command, args, platform = process.platform, comspec = process.env.ComSpec || "cmd.exe") {
82
+ if (platform === "win32" && (command === "npm" || command === "pnpm")) return [comspec, ["/d", "/s", "/c", command, ...args]];
83
+ return [command, args];
84
+ }
85
+
86
+ export function publishLocalNpm(argv, { run = spawnSync, log = console.log, platform = process.platform, readToken = () => readKeychainToken(run), npmrc = accountNpmrc, exists = fs.existsSync, verifyTries = 20, verifyDelaySeconds = 15 } = {}) {
72
87
  const o = parseArgs(argv);
73
- if (platform !== "darwin") fail(`publish-local npm runs on the Mac (the token is the Keychain item ${NPM_KEYCHAIN_SERVICE}); this host is ${platform}`);
88
+ if (platform !== "darwin" && platform !== "win32") fail(`publish-local npm runs on the Mac (the token is the Keychain item ${NPM_KEYCHAIN_SERVICE}) or Windows (the account's own npm sign-in); this host is ${platform}`);
89
+ const userNpmrc = platform === "win32" ? npmrc() : null;
90
+ if (userNpmrc && !exists(userNpmrc)) fail(`publish-local npm on Windows publishes with this account's npm sign-in, and ${userNpmrc} does not exist: run npm login on this account once`);
91
+ const tool = (command, args, options) => { const [c, a] = toolCommand(command, args, platform); return run(c, a, options); };
92
+ const pause = (seconds) => (platform === "win32" ? Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, seconds * 1000) : run("sleep", [String(seconds)]));
74
93
  const git = (args) => {
75
94
  const r = run("git", args, { cwd: o.repo, encoding: "utf8", maxBuffer: 1 << 26 });
76
95
  if (r.status !== 0) fail(`git ${args.join(" ")} failed: ${String(r.stderr ?? "").trim()}`);
@@ -93,39 +112,60 @@ export function publishLocalNpm(argv, { run = spawnSync, log = console.log, plat
93
112
  if (classA.status !== 0) fail(`Class A failed for npm:${o.pkg} on ${commit} (exit ${classA.status}); nothing published`);
94
113
 
95
114
  // The agent volume, not the internal drive: the export holds a full install (workspace rule: run output under /Volumes/D/scratch).
96
- const scratchRoot = fs.existsSync("/Volumes/D/scratch") ? "/Volumes/D/scratch" : os.tmpdir();
115
+ const scratchRoot = ["/Volumes/D/scratch", "D:\\scratch"].find((d) => fs.existsSync(d)) ?? os.tmpdir();
97
116
  const work = fs.mkdtempSync(path.join(scratchRoot, "rk-publish-local-"));
98
117
  try {
99
- const tree = path.join(work, "tree");
100
- fs.mkdirSync(tree);
101
- const archive = run("git", ["archive", "--format=tar", commit], { cwd: o.repo, maxBuffer: 1 << 30 });
102
- if (archive.status !== 0) fail(`git archive ${commit} failed`);
103
- const tarIn = run("tar", ["-x", "-C", tree], { input: archive.stdout });
104
- if (tarIn.status !== 0) fail("unpacking the commit's tree failed");
105
- // The package and its workspace dependencies, from the commit's lockfile only, offline from the store; no dependency's install scripts run.
106
- 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 });
107
- 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(" | ")}`);
108
- // Workspace dependencies resolve through their dist/ (gitignored, so not in the export): build them first, in dependency order.
109
- const deps = run("pnpm", ["-r", "--filter", `${o.pkg}^...`, "run", "--if-present", "build"], { cwd: tree, encoding: "utf8", maxBuffer: 1 << 28 });
110
- if (deps.status !== 0) fail(`building ${o.pkg}'s workspace dependencies failed: ${String(deps.stderr || deps.stdout || "").trim().split(/\r?\n/).slice(-3).join(" | ")}`);
111
- const pkgDir = path.join(tree, dir);
112
- const packed = run("pnpm", ["pack", "--pack-destination", work], { cwd: pkgDir, encoding: "utf8" });
113
- if (packed.status !== 0) fail(`pnpm pack failed: ${String(packed.stderr ?? packed.stdout ?? "").trim().split(/\r?\n/).slice(-3).join(" | ")}`);
114
- const tgz = fs.readdirSync(work).find((f) => f.endsWith(".tgz"));
115
- if (!tgz) fail("pnpm pack wrote no tarball");
116
- const bytes = fs.readFileSync(path.join(work, tgz));
118
+ let tgzFile;
119
+ if (o.archive) {
120
+ // The exact file given: it must be this commit's package at this version (its own package/package.json says so).
121
+ if (!fs.existsSync(o.archive)) fail(`--archive ${o.archive} does not exist`);
122
+ tgzFile = path.join(work, path.basename(o.archive));
123
+ fs.copyFileSync(o.archive, tgzFile, fs.constants.COPYFILE_EXCL);
124
+ const inner = run("tar", ["-xzOf", tgzFile, "package/package.json"], { encoding: "utf8", maxBuffer: 1 << 24 });
125
+ let packedManifest = null;
126
+ try { packedManifest = inner.status === 0 ? JSON.parse(String(inner.stdout ?? "")) : null; } catch { packedManifest = null; }
127
+ if (!packedManifest) fail(`--archive ${o.archive} has no readable package/package.json`);
128
+ if (packedManifest.name !== o.pkg || packedManifest.version !== version) fail(`--archive ${o.archive} is ${packedManifest.name}@${packedManifest.version}, not ${o.pkg}@${version} of ${commit.slice(0, 12)}`);
129
+ } else {
130
+ const tree = path.join(work, "tree");
131
+ fs.mkdirSync(tree);
132
+ const archive = run("git", ["archive", "--format=tar", commit], { cwd: o.repo, maxBuffer: 1 << 30 });
133
+ if (archive.status !== 0) fail(`git archive ${commit} failed`);
134
+ const tarIn = run("tar", ["-x", "-f", "-", "-C", tree], { input: archive.stdout });
135
+ if (tarIn.status !== 0) fail("unpacking the commit's tree failed");
136
+ // The package and its workspace dependencies, from the commit's lockfile only, offline from the store; no dependency's install scripts run.
137
+ const install = tool("pnpm", ["install", "--frozen-lockfile", "--offline", "--ignore-scripts", "--ignore-pnpmfile", "--store-dir", checkoutStoreDir(o.repo), "--filter", `${o.pkg}...`], { cwd: tree, encoding: "utf8", maxBuffer: 1 << 28 });
138
+ 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(" | ")}`);
139
+ // Workspace dependencies resolve through their dist/ (gitignored, so not in the export): build them first, in dependency order.
140
+ const deps = tool("pnpm", ["-r", "--filter", `${o.pkg}^...`, "run", "--if-present", "build"], { cwd: tree, encoding: "utf8", maxBuffer: 1 << 28 });
141
+ if (deps.status !== 0) fail(`building ${o.pkg}'s workspace dependencies failed: ${String(deps.stderr || deps.stdout || "").trim().split(/\r?\n/).slice(-3).join(" | ")}`);
142
+ const pkgDir = path.join(tree, dir);
143
+ const packed = tool("pnpm", ["pack", "--pack-destination", work], { cwd: pkgDir, encoding: "utf8" });
144
+ if (packed.status !== 0) fail(`pnpm pack failed: ${String(packed.stderr ?? packed.stdout ?? "").trim().split(/\r?\n/).slice(-3).join(" | ")}`);
145
+ const tgz = fs.readdirSync(work).find((f) => f.endsWith(".tgz"));
146
+ if (!tgz) fail("pnpm pack wrote no tarball");
147
+ tgzFile = path.join(work, tgz);
148
+ }
149
+ const bytes = fs.readFileSync(tgzFile);
117
150
  const sha1 = crypto.createHash("sha1").update(bytes).digest("hex");
118
- log(`publish-local: packed ${tgz} sha1 ${sha1}`);
151
+ log(`publish-local: ${o.archive ? "given" : "packed"} ${path.basename(tgzFile)} sha1 ${sha1}`);
119
152
 
120
- // GATE-CONTRACT NN31: the gate package is published only with a passing contract-test receipt for this exact file. Before the token is read.
121
- try { gateReleaseGuard({ name: o.pkg, archiveFile: path.join(work, tgz), commit }); } catch (error) { fail(error.message); }
122
- const token = readToken();
123
- const userconfig = path.join(work, "npmrc");
124
- fs.writeFileSync(userconfig, "//registry.npmjs.org/:_authToken=${RIGHTKIT_NPM_TOKEN}\n", { mode: 0o600 });
125
- const redact = (text) => String(text ?? "").split(token).join("<redacted>");
126
- const pub = run("npm", ["publish", path.join(work, tgz), "--access", "public", "--provenance=false", "--registry", REGISTRY, "--userconfig", userconfig],
127
- { encoding: "utf8", env: { ...process.env, RIGHTKIT_NPM_TOKEN: token } });
128
- if (pub.status !== 0) fail(`npm publish failed:\n${redact(`${pub.stdout ?? ""}${pub.stderr ?? ""}`).trim()}`);
153
+ // GATE-CONTRACT NN31: the gate package is published only with a passing contract-test receipt for this exact file. Before any credential is used.
154
+ try { gateReleaseGuard({ name: o.pkg, archiveFile: tgzFile, commit }); } catch (error) { fail(error.message); }
155
+ const publishArgs = ["publish", tgzFile, "--access", "public", "--provenance=false", "--registry", REGISTRY];
156
+ let pub;
157
+ if (userNpmrc) {
158
+ // Windows: npm reads the account's own sign-in from that file itself; this process neither reads it nor passes a token.
159
+ pub = tool("npm", [...publishArgs, "--userconfig", userNpmrc], { encoding: "utf8" });
160
+ if (pub.status !== 0) fail(`npm publish failed:\n${`${pub.stdout ?? ""}${pub.stderr ?? ""}`.trim()}`);
161
+ } else {
162
+ const token = readToken();
163
+ const userconfig = path.join(work, "npmrc");
164
+ fs.writeFileSync(userconfig, "//registry.npmjs.org/:_authToken=${RIGHTKIT_NPM_TOKEN}\n", { mode: 0o600 });
165
+ const redact = (text) => String(text ?? "").split(token).join("<redacted>");
166
+ pub = tool("npm", [...publishArgs, "--userconfig", userconfig], { encoding: "utf8", env: { ...process.env, RIGHTKIT_NPM_TOKEN: token } });
167
+ if (pub.status !== 0) fail(`npm publish failed:\n${redact(`${pub.stdout ?? ""}${pub.stderr ?? ""}`).trim()}`);
168
+ }
129
169
 
130
170
  // The registry may take a moment to serve a new version. Every try asks the registry directly, logs its status when it has no answer, and the
131
171
  // command fails only after the whole wait (verifyTries x verifyDelaySeconds); a served version with another shasum fails at once.
@@ -137,7 +177,7 @@ export function publishLocalNpm(argv, { run = spawnSync, log = console.log, plat
137
177
  else {
138
178
  last = doc.error ?? `HTTP ${doc.status} without dist.shasum`;
139
179
  log(`publish-local: registry try ${i}/${verifyTries} for ${o.pkg}@${version}: ${last}${i < verifyTries ? `; retrying in ${verifyDelaySeconds}s` : ""}`);
140
- if (i < verifyTries) run("sleep", [String(verifyDelaySeconds)]);
180
+ if (i < verifyTries) pause(verifyDelaySeconds);
141
181
  }
142
182
  }
143
183
  if (!shasum) fail(`registry never served ${o.pkg}@${version} after ${verifyTries} tries ${verifyDelaySeconds}s apart (last: ${last}); the publish itself succeeded, so check ${REGISTRY}${o.pkg.replace("/", "%2f")}/${version} before publishing again`);
@@ -20,7 +20,7 @@
20
20
  "@rightkit/agent-ui-settings": "0.1.1",
21
21
  "@rightkit/agent-ui-web": "0.1.0",
22
22
  "@rightkit/agent-ui-workbench": "0.1.1",
23
- "@rightkit/app-update": "0.4.5",
23
+ "@rightkit/app-update": "0.4.6",
24
24
  "@rightkit/ax": "0.3.2",
25
25
  "@rightkit/blender-worker": "0.1.1",
26
26
  "@rightkit/ci": "0.3.2",
@@ -35,26 +35,26 @@
35
35
  "@rightkit/issues-tracker": "0.1.0",
36
36
  "@rightkit/legal": "0.6.3",
37
37
  "@rightkit/legal-ui": "0.4.2",
38
- "@rightkit/library-ui": "0.2.4",
39
- "@rightkit/license": "0.3.4",
40
- "@rightkit/logs": "0.1.6",
38
+ "@rightkit/library-ui": "0.2.5",
39
+ "@rightkit/license": "0.3.5",
40
+ "@rightkit/logs": "0.1.7",
41
41
  "@rightkit/mail-ui": "0.2.2",
42
42
  "@rightkit/markdown-editor": "0.2.0",
43
43
  "@rightkit/media-gen-ui": "0.2.1",
44
44
  "@rightkit/media-ui": "0.3.6",
45
- "@rightkit/onboarding": "0.6.8",
45
+ "@rightkit/onboarding": "0.6.9",
46
46
  "@rightkit/outdated": "0.3.1",
47
47
  "@rightkit/pdf-ui": "0.3.1",
48
- "@rightkit/platform-ui": "0.4.4",
48
+ "@rightkit/platform-ui": "0.4.5",
49
49
  "@rightkit/qa": "0.7.0",
50
50
  "@rightkit/qa-chrome": "0.1.12",
51
- "@rightkit/react-shell": "0.7.8",
52
- "@rightkit/release": "0.6.79",
51
+ "@rightkit/react-shell": "0.7.9",
52
+ "@rightkit/release": "0.6.80",
53
53
  "@rightkit/send-ui": "0.1.0",
54
- "@rightkit/settings-ui": "0.7.5",
54
+ "@rightkit/settings-ui": "0.7.6",
55
55
  "@rightkit/social-ui": "0.2.1",
56
56
  "@rightkit/system-ui": "0.2.2",
57
- "@rightkit/tauri": "0.4.4",
57
+ "@rightkit/tauri": "0.4.5",
58
58
  "@rightkit/tauri-shell": "0.1.4",
59
59
  "@rightkit/terminal-ui": "0.1.0",
60
60
  "@rightkit/theme": "0.3.4",
@@ -190,7 +190,8 @@
190
190
  ],
191
191
  "@rightkit/logs": [
192
192
  "0.1.4",
193
- "0.1.5"
193
+ "0.1.5",
194
+ "0.1.6"
194
195
  ],
195
196
  "@rightkit/mail-ui": [
196
197
  "0.2.1"
@@ -439,7 +440,9 @@
439
440
  "0.6.60",
440
441
  "0.6.61",
441
442
  "0.6.75",
442
- "0.6.77"
443
+ "0.6.77",
444
+ "0.6.78",
445
+ "0.6.79"
443
446
  ],
444
447
  "@rightkit/settings-ui": [
445
448
  "0.1.0",
@@ -557,28 +560,28 @@
557
560
  "rightkit-agent-server": "0.2.0",
558
561
  "rightkit-agent-skills": "0.1.0",
559
562
  "rightkit-agent-task-contract": "0.1.2",
560
- "rightkit-agent-task-journal": "0.1.0",
563
+ "rightkit-agent-task-journal": "0.1.1",
561
564
  "rightkit-agent-telemetry": "0.1.0",
562
565
  "rightkit-agent-tools": "0.4.4",
563
566
  "rightkit-agent-transcript": "0.1.3",
564
567
  "rightkit-agents": "0.2.8",
565
- "rightkit-ai-accounts": "0.1.2",
568
+ "rightkit-ai-accounts": "0.1.3",
566
569
  "rightkit-ai-keys": "0.1.1",
567
570
  "rightkit-android": "0.3.2",
568
- "rightkit-app-host": "0.1.2",
571
+ "rightkit-app-host": "0.1.3",
569
572
  "rightkit-app-icon": "0.1.0",
570
573
  "rightkit-app-lock": "0.1.0",
571
- "rightkit-app-manager": "0.2.3",
572
- "rightkit-app-settings": "0.4.2",
574
+ "rightkit-app-manager": "0.2.5",
575
+ "rightkit-app-settings": "0.4.4",
573
576
  "rightkit-app-update": "0.2.0",
574
577
  "rightkit-apple-ops": "0.2.0",
575
578
  "rightkit-approvals": "0.2.2",
576
579
  "rightkit-asr": "0.5.2",
577
580
  "rightkit-assist": "0.1.1",
578
- "rightkit-audio": "0.4.2",
581
+ "rightkit-audio": "0.4.3",
579
582
  "rightkit-autoedit": "0.2.0",
580
583
  "rightkit-automation": "0.7.6",
581
- "rightkit-autostart": "0.1.0",
584
+ "rightkit-autostart": "0.1.1",
582
585
  "rightkit-bench": "0.2.1",
583
586
  "rightkit-bot-messaging": "0.3.1",
584
587
  "rightkit-browser": "0.3.12",
@@ -586,8 +589,8 @@
586
589
  "rightkit-captions": "0.1.1",
587
590
  "rightkit-catalog": "0.1.0",
588
591
  "rightkit-channel-memory": "0.2.3",
589
- "rightkit-chat-bridge": "0.2.1",
590
- "rightkit-child-process": "0.5.16",
592
+ "rightkit-chat-bridge": "0.2.2",
593
+ "rightkit-child-process": "0.5.17",
591
594
  "rightkit-clipboard": "0.1.0",
592
595
  "rightkit-clipboard-history": "0.4.0",
593
596
  "rightkit-code-audit-commands": "0.2.0",
@@ -609,32 +612,32 @@
609
612
  "rightkit-context-runtime": "0.1.5",
610
613
  "rightkit-contracts": "0.1.11",
611
614
  "rightkit-contrast": "0.1.0",
612
- "rightkit-crash": "0.4.2",
613
- "rightkit-credentials": "0.5.9",
615
+ "rightkit-crash": "0.4.3",
616
+ "rightkit-credentials": "0.5.10",
614
617
  "rightkit-crypto": "0.1.4",
615
- "rightkit-daemon": "0.9.2",
618
+ "rightkit-daemon": "0.9.3",
616
619
  "rightkit-daemon-remote": "0.1.0",
617
- "rightkit-db": "0.5.10",
620
+ "rightkit-db": "0.5.11",
618
621
  "rightkit-decimal": "0.1.0",
619
622
  "rightkit-deep-link": "0.1.1",
620
- "rightkit-desktop-tweaks": "0.3.0",
623
+ "rightkit-desktop-tweaks": "0.3.1",
621
624
  "rightkit-device": "0.5.2",
622
625
  "rightkit-device-link": "0.1.0",
623
- "rightkit-device-link-core": "0.1.0",
626
+ "rightkit-device-link-core": "0.1.1",
624
627
  "rightkit-device-link-types": "0.1.2",
625
628
  "rightkit-dictation-app-runtime": "0.3.1",
626
629
  "rightkit-dictation-command-host": "0.3.3",
627
- "rightkit-dictation-core": "0.3.6",
630
+ "rightkit-dictation-core": "0.3.7",
628
631
  "rightkit-dictation-engine": "0.2.1",
629
632
  "rightkit-dictation-ffi": "0.2.1",
630
633
  "rightkit-dictation-inference": "0.2.4",
631
- "rightkit-dictation-models": "0.3.2",
634
+ "rightkit-dictation-models": "0.3.3",
632
635
  "rightkit-dictation-pill": "0.1.1",
633
636
  "rightkit-dictation-runtime": "0.2.7",
634
- "rightkit-dictation-tauri": "0.3.2",
637
+ "rightkit-dictation-tauri": "0.3.3",
635
638
  "rightkit-dictation-telemetry": "0.2.3",
636
639
  "rightkit-dictation-text-pipeline": "0.2.7",
637
- "rightkit-disk-cleanup": "0.2.0",
640
+ "rightkit-disk-cleanup": "0.2.2",
638
641
  "rightkit-docs": "0.1.6",
639
642
  "rightkit-doctor": "0.2.0",
640
643
  "rightkit-document-workspace": "0.2.0",
@@ -651,23 +654,23 @@
651
654
  "rightkit-feed": "0.1.0",
652
655
  "rightkit-ffmpeg": "0.3.2",
653
656
  "rightkit-file-watch": "0.4.4",
654
- "rightkit-fs": "0.5.1",
655
- "rightkit-fsindex": "0.6.2",
657
+ "rightkit-fs": "0.5.2",
658
+ "rightkit-fsindex": "0.6.3",
656
659
  "rightkit-github": "0.2.0",
657
660
  "rightkit-google-apis": "0.2.3",
658
661
  "rightkit-google-identity": "0.3.0",
659
662
  "rightkit-gpu": "0.1.0",
660
663
  "rightkit-hooks": "0.3.0",
661
- "rightkit-hotkeys": "0.1.7",
664
+ "rightkit-hotkeys": "0.1.8",
662
665
  "rightkit-http": "0.4.0",
663
666
  "rightkit-i18n": "0.1.0",
664
667
  "rightkit-identity": "0.1.2",
665
668
  "rightkit-instance": "0.2.0",
666
669
  "rightkit-job-queue": "0.6.1",
667
670
  "rightkit-launcher": "0.2.2",
668
- "rightkit-launcher-win": "0.2.0",
671
+ "rightkit-launcher-win": "0.2.1",
669
672
  "rightkit-library": "0.3.0",
670
- "rightkit-license": "0.3.4",
673
+ "rightkit-license": "0.3.5",
671
674
  "rightkit-llm": "0.7.1",
672
675
  "rightkit-local-gen": "0.1.3",
673
676
  "rightkit-logs": "0.4.5",
@@ -675,7 +678,7 @@
675
678
  "rightkit-mail-gateway": "0.1.0",
676
679
  "rightkit-mail-store": "0.2.1",
677
680
  "rightkit-mcp": "0.10.1",
678
- "rightkit-media-control": "0.1.1",
681
+ "rightkit-media-control": "0.1.2",
679
682
  "rightkit-media-fetch": "0.2.0",
680
683
  "rightkit-media-gen": "0.2.3",
681
684
  "rightkit-media-gen-approvals": "0.1.2",
@@ -690,7 +693,7 @@
690
693
  "rightkit-models": "0.7.2",
691
694
  "rightkit-motion": "0.4.0",
692
695
  "rightkit-notch-ui": "0.2.2",
693
- "rightkit-notifications": "0.1.1",
696
+ "rightkit-notifications": "0.1.2",
694
697
  "rightkit-now-playing": "0.1.0",
695
698
  "rightkit-oauth": "0.11.1",
696
699
  "rightkit-ocr": "0.3.0",
@@ -707,15 +710,15 @@
707
710
  "rightkit-policy-rules": "0.1.1",
708
711
  "rightkit-power": "0.1.0",
709
712
  "rightkit-presence": "0.1.2",
710
- "rightkit-privileged-helper": "0.2.0",
713
+ "rightkit-privileged-helper": "0.2.1",
711
714
  "rightkit-profile": "0.1.0",
712
715
  "rightkit-prompt-recipes": "0.2.1",
713
- "rightkit-pty": "0.1.2",
716
+ "rightkit-pty": "0.1.3",
714
717
  "rightkit-qa": "0.10.11",
715
- "rightkit-record": "0.4.0",
718
+ "rightkit-record": "0.4.1",
716
719
  "rightkit-reframe": "0.2.0",
717
720
  "rightkit-remote-compute": "0.2.1",
718
- "rightkit-remote-gateway": "0.1.4",
721
+ "rightkit-remote-gateway": "0.1.5",
719
722
  "rightkit-repo-graph": "0.3.2",
720
723
  "rightkit-repo-graph-grammars": "0.1.1",
721
724
  "rightkit-research": "0.1.2",
@@ -724,7 +727,7 @@
724
727
  "rightkit-sandbox": "0.7.0",
725
728
  "rightkit-scheduler": "0.3.1",
726
729
  "rightkit-search": "0.4.6",
727
- "rightkit-send": "0.4.1",
730
+ "rightkit-send": "0.4.2",
728
731
  "rightkit-shorts": "0.2.4",
729
732
  "rightkit-sidecar": "0.3.4",
730
733
  "rightkit-signal": "0.1.0",
@@ -732,14 +735,14 @@
732
735
  "rightkit-social-inbox": "0.3.1",
733
736
  "rightkit-social-publish": "0.2.0",
734
737
  "rightkit-speech-client": "0.5.0",
735
- "rightkit-spend": "0.2.3",
738
+ "rightkit-spend": "0.2.4",
736
739
  "rightkit-sync": "0.4.3",
737
740
  "rightkit-sync-keys": "0.1.0",
738
741
  "rightkit-sysmem": "0.1.0",
739
- "rightkit-system-monitor": "0.3.1",
740
- "rightkit-tauri-shell": "0.8.8",
742
+ "rightkit-system-monitor": "0.3.2",
743
+ "rightkit-tauri-shell": "0.8.9",
741
744
  "rightkit-terminal-ui": "0.1.3",
742
- "rightkit-text-polish": "0.1.3",
745
+ "rightkit-text-polish": "0.1.4",
743
746
  "rightkit-theme": "0.1.1",
744
747
  "rightkit-time": "0.1.5",
745
748
  "rightkit-timeline": "0.1.1",
@@ -902,7 +905,7 @@
902
905
  "@rightkit/qa": "0.7.0",
903
906
  "@rightkit/qa-chrome": "0.1.12",
904
907
  "@rightkit/react-shell": "0.7.7",
905
- "@rightkit/release": "0.6.78",
908
+ "@rightkit/release": "0.6.79",
906
909
  "@rightkit/settings-ui": "0.7.4",
907
910
  "@rightkit/shell": "0.1.1",
908
911
  "@rightkit/tauri": "0.4.3",
@@ -947,7 +950,8 @@
947
950
  "0.2.7"
948
951
  ],
949
952
  "rightkit-ai-accounts": [
950
- "0.1.1"
953
+ "0.1.1",
954
+ "0.1.2"
951
955
  ],
952
956
  "rightkit-ai-keys": [
953
957
  "0.1.0"
@@ -958,14 +962,18 @@
958
962
  "0.3.1"
959
963
  ],
960
964
  "rightkit-app-manager": [
961
- "0.2.2"
965
+ "0.2.2",
966
+ "0.2.3",
967
+ "0.2.4"
962
968
  ],
963
969
  "rightkit-app-settings": [
964
970
  "0.2.0",
965
971
  "0.2.3",
966
972
  "0.2.4",
967
973
  "0.3.0",
968
- "0.4.1"
974
+ "0.4.1",
975
+ "0.4.2",
976
+ "0.4.3"
969
977
  ],
970
978
  "rightkit-asr": [
971
979
  "0.0.2",
@@ -1026,7 +1034,8 @@
1026
1034
  "0.2.1"
1027
1035
  ],
1028
1036
  "rightkit-chat-bridge": [
1029
- "0.2.0"
1037
+ "0.2.0",
1038
+ "0.2.1"
1030
1039
  ],
1031
1040
  "rightkit-child-process": [
1032
1041
  "0.4.0",
@@ -1042,7 +1051,8 @@
1042
1051
  "0.5.7",
1043
1052
  "0.5.13",
1044
1053
  "0.5.14",
1045
- "0.5.15"
1054
+ "0.5.15",
1055
+ "0.5.16"
1046
1056
  ],
1047
1057
  "rightkit-clipboard-history": [
1048
1058
  "0.3.2"
@@ -1076,7 +1086,8 @@
1076
1086
  "0.3.4",
1077
1087
  "0.3.5",
1078
1088
  "0.3.6",
1079
- "0.4.1"
1089
+ "0.4.1",
1090
+ "0.4.2"
1080
1091
  ],
1081
1092
  "rightkit-credentials": [
1082
1093
  "0.2.0",
@@ -1102,7 +1113,8 @@
1102
1113
  "0.3.0",
1103
1114
  "0.4.0",
1104
1115
  "0.9.0",
1105
- "0.9.1"
1116
+ "0.9.1",
1117
+ "0.9.2"
1106
1118
  ],
1107
1119
  "rightkit-db": [
1108
1120
  "0.2.1",
@@ -1113,7 +1125,8 @@
1113
1125
  "0.5.1",
1114
1126
  "0.5.2",
1115
1127
  "0.5.8",
1116
- "0.5.9"
1128
+ "0.5.9",
1129
+ "0.5.10"
1117
1130
  ],
1118
1131
  "rightkit-device": [
1119
1132
  "0.1.3",
@@ -1214,7 +1227,8 @@
1214
1227
  "0.2.1",
1215
1228
  "0.3.0",
1216
1229
  "0.4.1",
1217
- "0.5.0"
1230
+ "0.5.0",
1231
+ "0.6.2"
1218
1232
  ],
1219
1233
  "rightkit-google-apis": [
1220
1234
  "0.2.0",
@@ -1274,7 +1288,8 @@
1274
1288
  "0.2.0"
1275
1289
  ],
1276
1290
  "rightkit-launcher-win": [
1277
- "0.1.0"
1291
+ "0.1.0",
1292
+ "0.2.0"
1278
1293
  ],
1279
1294
  "rightkit-license": [
1280
1295
  "0.2.0",
@@ -1283,7 +1298,8 @@
1283
1298
  "0.2.4",
1284
1299
  "0.2.5",
1285
1300
  "0.3.1",
1286
- "0.3.2"
1301
+ "0.3.2",
1302
+ "0.3.4"
1287
1303
  ],
1288
1304
  "rightkit-llm": [
1289
1305
  "0.1.0",
@@ -1323,7 +1339,8 @@
1323
1339
  "0.2.4"
1324
1340
  ],
1325
1341
  "rightkit-media-control": [
1326
- "0.1.0"
1342
+ "0.1.0",
1343
+ "0.1.1"
1327
1344
  ],
1328
1345
  "rightkit-media-gen-approvals": [
1329
1346
  "0.1.1"
@@ -1360,7 +1377,8 @@
1360
1377
  "0.2.1"
1361
1378
  ],
1362
1379
  "rightkit-notifications": [
1363
- "0.1.0"
1380
+ "0.1.0",
1381
+ "0.1.1"
1364
1382
  ],
1365
1383
  "rightkit-oauth": [
1366
1384
  "0.2.0",
@@ -1435,7 +1453,8 @@
1435
1453
  "0.3.2"
1436
1454
  ],
1437
1455
  "rightkit-pty": [
1438
- "0.1.1"
1456
+ "0.1.1",
1457
+ "0.1.2"
1439
1458
  ],
1440
1459
  "rightkit-qa": [
1441
1460
  "0.2.7",
@@ -1487,7 +1506,8 @@
1487
1506
  "rightkit-record": [
1488
1507
  "0.3.0",
1489
1508
  "0.3.2",
1490
- "0.3.3"
1509
+ "0.3.3",
1510
+ "0.4.0"
1491
1511
  ],
1492
1512
  "rightkit-review": [
1493
1513
  "0.2.0",
@@ -1531,7 +1551,8 @@
1531
1551
  "rightkit-send": [
1532
1552
  "0.1.0",
1533
1553
  "0.2.0",
1534
- "0.4.0"
1554
+ "0.4.0",
1555
+ "0.4.1"
1535
1556
  ],
1536
1557
  "rightkit-service": [
1537
1558
  "0.1.0",
@@ -1565,7 +1586,8 @@
1565
1586
  ],
1566
1587
  "rightkit-spend": [
1567
1588
  "0.1.1",
1568
- "0.2.0"
1589
+ "0.2.0",
1590
+ "0.2.3"
1569
1591
  ],
1570
1592
  "rightkit-sync": [
1571
1593
  "0.1.1",
@@ -1576,7 +1598,8 @@
1576
1598
  "0.4.2"
1577
1599
  ],
1578
1600
  "rightkit-system-monitor": [
1579
- "0.3.0"
1601
+ "0.3.0",
1602
+ "0.3.1"
1580
1603
  ],
1581
1604
  "rightkit-tauri": [
1582
1605
  "0.1.1"
@@ -1594,7 +1617,8 @@
1594
1617
  ],
1595
1618
  "rightkit-text-polish": [
1596
1619
  "0.1.1",
1597
- "0.1.2"
1620
+ "0.1.2",
1621
+ "0.1.3"
1598
1622
  ],
1599
1623
  "rightkit-theme": [
1600
1624
  "0.1.0"
@@ -1661,7 +1685,8 @@
1661
1685
  "0.1.2"
1662
1686
  ],
1663
1687
  "rightkit-remote-gateway": [
1664
- "0.1.3"
1688
+ "0.1.3",
1689
+ "0.1.4"
1665
1690
  ],
1666
1691
  "rightkit-web-session": [
1667
1692
  "0.1.1"
@@ -1671,6 +1696,28 @@
1671
1696
  ],
1672
1697
  "rightkit-approvals": [
1673
1698
  "0.2.1"
1699
+ ],
1700
+ "rightkit-disk-cleanup": [
1701
+ "0.2.0",
1702
+ "0.2.1"
1703
+ ],
1704
+ "rightkit-agent-task-journal": [
1705
+ "0.1.0"
1706
+ ],
1707
+ "rightkit-app-host": [
1708
+ "0.1.2"
1709
+ ],
1710
+ "rightkit-autostart": [
1711
+ "0.1.0"
1712
+ ],
1713
+ "rightkit-desktop-tweaks": [
1714
+ "0.3.0"
1715
+ ],
1716
+ "rightkit-device-link-core": [
1717
+ "0.1.0"
1718
+ ],
1719
+ "rightkit-privileged-helper": [
1720
+ "0.2.0"
1674
1721
  ]
1675
1722
  }
1676
1723
  }
package/seam-broker.mjs CHANGED
@@ -119,6 +119,26 @@ const isPipe = (endpoint) => /^\\\\\.\\pipe\\/i.test(String(endpoint));
119
119
  * Where a control query to the broker goes and what identity it carries: the endpoint RustRight's discovery names (a user-owned socket, or a pipe) and the
120
120
  * runtime identity of the manifest beside the installed `client`. `{ ok, endpoint, identity }` or `{ ok: false, problem }`.
121
121
  */
122
+ /**
123
+ * Why `endpoint` is not this user's broker socket, or null when it is. The managed root may name the socket through a link to the broker's control
124
+ * root (the Mac: <managed>/broker.sock -> ~/Library/Application Support/RightKit/build-control/broker.sock). The link is followed: the socket it reaches
125
+ * must be a socket and, like the link itself, this user's. Checking only the link refused it as "not a socket", so the reclaim judge never asked the
126
+ * broker and a dead run's lock was kept for good (Mac, 2026-11-25, snapshot 770a65dcafd91981). `o` may inject lstat, realpath and uid.
127
+ */
128
+ export function socketProblem(endpoint, o = {}) {
129
+ try {
130
+ const lstat = o?.lstat ?? fs.lstatSync;
131
+ const uid = typeof (o?.uid ?? process.getuid?.()) === "number" ? (o?.uid ?? process.getuid()) : null;
132
+ const link = lstat(endpoint);
133
+ if (link.isSymbolicLink() && uid !== null && link.uid !== uid) return `${endpoint} is a link owned by another user (uid ${link.uid}), so it is not this user's broker`;
134
+ const target = link.isSymbolicLink() ? (o?.realpath ?? fs.realpathSync.native)(endpoint) : endpoint;
135
+ const stat = link.isSymbolicLink() ? lstat(target) : link;
136
+ if (!stat.isSocket()) return `${target === endpoint ? endpoint : `${endpoint} -> ${target}`} is not a socket, so it is not the broker's endpoint`;
137
+ if (uid !== null && stat.uid !== uid) return `${target} is owned by another user (uid ${stat.uid}), so it is not this user's broker`;
138
+ return null;
139
+ } catch (error) { return `cannot connect to the broker at ${endpoint} (${error?.code ?? error?.message ?? error})`; }
140
+ }
141
+
122
142
  export function brokerControlTarget(o, { client = o?.client } = {}) {
123
143
  const platform = o?.platform ?? process.platform;
124
144
  const env = o?.env ?? process.env;
@@ -138,12 +158,8 @@ export function brokerControlTarget(o, { client = o?.client } = {}) {
138
158
  try { endpoint = (o?.discoverEndpoint ?? discoverBrokerSocket)(env, { platform, exists: fs.existsSync }); } catch (error) { return { ok: false, problem: `the broker endpoint cannot be discovered (${error.message})` }; }
139
159
  if (!endpoint) return { ok: false, problem: "no broker endpoint is configured (no explicit socket variable and no broker.sock under a managed control root)" };
140
160
  if (platform !== "win32" && !isPipe(endpoint)) {
141
- try {
142
- const stat = (o?.lstat ?? fs.lstatSync)(endpoint);
143
- const uid = typeof (o?.uid ?? process.getuid?.()) === "number" ? (o?.uid ?? process.getuid()) : null;
144
- if (!stat.isSocket()) return { ok: false, problem: `${endpoint} is not a socket, so it is not the broker's endpoint` };
145
- if (uid !== null && stat.uid !== uid) return { ok: false, problem: `${endpoint} is owned by another user (uid ${stat.uid}), so it is not this user's broker` };
146
- } catch (error) { return { ok: false, problem: `cannot connect to the broker at ${endpoint} (${error?.code ?? error?.message ?? error})` }; }
161
+ const problem = socketProblem(endpoint, o);
162
+ if (problem) return { ok: false, problem };
147
163
  }
148
164
  return { ok: true, endpoint, identity: identity.identity };
149
165
  }
@@ -164,12 +180,16 @@ export function snapshotReclaimJudge({ o, client, snapshotPath, query = snapshot
164
180
  if (typeof snapshotPath !== "string" || !path.isAbsolute(snapshotPath)) throw new TypeError("snapshotReclaimJudge: snapshotPath must be absolute");
165
181
  const bound = { o, client: typeof client === "string" && client ? client : null, snapshotPath };
166
182
  return (holder) => {
183
+ // Every "no proof" says why: the reason was swallowed, so a link the endpoint check refused looked like a broker that would not answer (Mac,
184
+ // 2026-11-25).
185
+ const why = (text) => { try { bound.o?.err?.(`rightkit-gate: note: no reclaim proof for ${bound.snapshotPath}: ${text}`); } catch { /* a note only */ } return false; };
167
186
  try {
168
- if (!bound.client) return false;
187
+ if (!bound.client) return why("the RustRight client is not on PATH");
169
188
  const target = brokerControlTarget(bound.o, { client: bound.client });
170
- if (!target.ok) return false;
189
+ if (!target.ok) return why(target.problem);
171
190
  const message = snapshotStatusMessage({ protocol: BUILD_CONTROL_PROTOCOL, runtime: target.identity, snapshot: bound.snapshotPath, owner: holder });
172
- return snapshotStatusAllowsReclaim(query({ endpoint: target.endpoint, message, timeoutMs }), { snapshot: bound.snapshotPath, owner: holder });
173
- } catch { return false; }
191
+ const reply = query({ endpoint: target.endpoint, message, timeoutMs });
192
+ return snapshotStatusAllowsReclaim(reply, { snapshot: bound.snapshotPath, owner: holder }) || why(reply ? `the broker answered ${JSON.stringify(reply).slice(0, 600)}` : `the broker gave no answer within ${Math.round(timeoutMs / 1000)} s`);
193
+ } catch (error) { return why(error?.message ?? String(error)); }
174
194
  };
175
195
  }
@@ -780,6 +780,38 @@ const grantFinding = (source, id) => ({ file: source.file,
780
780
  });
781
781
 
782
782
  // ---- R6 qa-window-label ------------------------------------------------------------------------------------------------------
783
+ /** Windows an app builds through the shell's own hub_window builder: each `WindowBuild { label: X, .. }` (handed to
784
+ * `hub_window::build_window` / `build_window_with_native_options`) creates the label X at run time. Returns the labels, plus whether
785
+ * one could not be read (then nothing about the main label is concluded). */
786
+ export function hubWindowLabels(parsedFiles, consts = stringConsts(parsedFiles)) {
787
+ const labels = new Set();
788
+ let unknown = false;
789
+ for (const f of parsedFiles) for (const m of f.skel.matchAll(/\b(?:hub_window\s*::\s*)?WindowBuild\s*\{/g)) {
790
+ const open = m.index + m[0].length - 1;
791
+ const close = matchClose(f.skel, open);
792
+ if (close < 0) { unknown = true; continue; }
793
+ // The `label:` field at the struct's own depth.
794
+ let depth = 0; let found = null;
795
+ for (let k = open + 1; k < close && found === null; k++) {
796
+ const c = f.skel[k];
797
+ if (c === "(" || c === "[" || c === "{") depth += 1;
798
+ else if (c === ")" || c === "]" || c === "}") depth -= 1;
799
+ else if (depth === 0 && /\blabel\s*:/y.test(f.skel.slice(k, k + 64)) && !/\w/.test(f.skel[k - 1])) found = k;
800
+ }
801
+ if (found === null) { unknown = true; continue; }
802
+ const valueFrom = f.skel.indexOf(":", found) + 1;
803
+ let end = valueFrom;
804
+ for (let d = 0; end < close; end++) {
805
+ const c = f.skel[end];
806
+ if (c === "(" || c === "[" || c === "{") d += 1;
807
+ else if (c === ")" || c === "]" || c === "}") d -= 1;
808
+ else if (c === "," && d === 0) break;
809
+ }
810
+ const label = labelOf(f.code.slice(valueFrom, end).trim(), consts);
811
+ if (label === undefined) unknown = true; else labels.add(label);
812
+ }
813
+ return { labels, unknown };
814
+ }
783
815
  const qaWindowLabel = perApp(({ app, root }) => {
784
816
  const out = [];
785
817
  const parsed = readRust(root, app);
@@ -865,6 +897,10 @@ const qaWindowLabel = perApp(({ app, root }) => {
865
897
  const label = arg ? labelOf(f.code.slice(arg[0], arg[1]), consts) : undefined;
866
898
  if (label === undefined) unknownBuilder = true; else created.add(label);
867
899
  }
900
+ // The shell's hub_window builder creates its WindowBuild's label at run time (Pulse's "main", created by create_hub_window).
901
+ const hub = hubWindowLabels(parsed, consts);
902
+ for (const label of hub.labels) created.add(label);
903
+ if (hub.unknown) unknownBuilder = true;
868
904
  if (created.size > 0 && !created.has(shellLabel) && !unknownBuilder) {
869
905
  out.push({
870
906
  file: shellAt.file,