@rightkit/release 0.6.49 → 0.6.50

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.
@@ -1531,9 +1531,13 @@ export function runningBrokerProcess({ platform = process.platform, run = spawnS
1531
1531
  }
1532
1532
  if (platform !== "darwin") return null;
1533
1533
  try {
1534
- const lc = run("launchctl", ["print", `gui/${uid}/dev.rustright.broker`], { encoding: "utf8", timeout: 5000 });
1535
- const pid = Number(/^\s*pid = (\d+)$/m.exec(String(lc.stdout ?? ""))?.[1]);
1536
- if (!Number.isInteger(pid) || pid <= 0) return null;
1534
+ // The broker alternates between two launchd entries at each cutover (rustright-install entries.rs: `dev.rustright.broker` and
1535
+ // `dev.rustright.broker.b`). Exactly one of them running is the broker; none or both (mid-cutover) is unknown (fail safe).
1536
+ const pids = ["dev.rustright.broker", "dev.rustright.broker.b"]
1537
+ .map((label) => Number(/^\s*pid = (\d+)$/m.exec(String(run("launchctl", ["print", `gui/${uid}/${label}`], { encoding: "utf8", timeout: 5000 }).stdout ?? ""))?.[1]))
1538
+ .filter((pid) => Number.isInteger(pid) && pid > 0);
1539
+ if (pids.length !== 1) return null;
1540
+ const pid = pids[0];
1537
1541
  const ps = run("ps", ["-o", "lstart=", "-p", String(pid)], { encoding: "utf8", timeout: 5000, env: { ...process.env, LC_ALL: "C", LANG: "C" } });
1538
1542
  const startedMs = Date.parse(String(ps.stdout ?? "").trim());
1539
1543
  return Number.isFinite(startedMs) ? { pid, startedMs } : null;
@@ -2857,12 +2857,19 @@ export async function runScans(plan, options = {}) {
2857
2857
  toolVersions[tool] = outcome.ok ? outcome.version : null;
2858
2858
  return outcome;
2859
2859
  });
2860
- const probe = (tool, scanDir = null) => {
2860
+ // rustright's `--version` names the client, which no directory changes; it is probed where the scan runs only because the client refuses
2861
+ // outside a Cargo workspace (rightkit#1215). Once it has answered in one directory that answer serves every directory: each fresh probe is a
2862
+ // broker CONTROL-lane request, and one sent while this run holds the broker's quiet lease waits the lease out and fails (rightkit#1526).
2863
+ let rustrightAnswer = null;
2864
+ const probe = async (tool, scanDir = null) => {
2865
+ if (tool === "rustright" && rustrightAnswer) return rustrightAnswer;
2861
2866
  const trust = TRUSTED_SCAN_TOOLS.includes(tool) ? resolveTrustedScanTool(tool, { policy: options.toolPolicy, platform: deps.platform, ops: options.toolOps }) : null;
2862
2867
  const command = trust ? (trust.ok ? trust.identity.path : null) : toolCommand(tool);
2863
2868
  const cwd = (tool === "rustright" || (tool === "cargo" && cargoLiveRoot)) && scanDir ? scanDir : (deps.probeDir ?? probeDir());
2864
2869
  const key = sha256(canonicalJson({ tool, command, cwd, args: PROBES[tool] ?? ["--version"], env: deps.env }));
2865
- return probeFlight(key, tool, scanDir);
2870
+ const outcome = await probeFlight(key, tool, scanDir);
2871
+ if (tool === "rustright" && outcome?.ok && !outcome.pinProblem) rustrightAnswer = outcome;
2872
+ return outcome;
2866
2873
  };
2867
2874
 
2868
2875
  const jobs = Math.max(1, Number(options.jobs ?? 1) || 1);
package/local-publish.mjs CHANGED
@@ -498,10 +498,13 @@ export function compileRequirements({ kind, unit, dir, config, manifest, platfor
498
498
  if (kind === "cargo") add({ workspace, cwd: dir, executable: null, internal: "scanCrateForSecrets", argv: [dir], env: {}, phase: "check" });
499
499
  for (const step of steps) {
500
500
  const consumer = step.command === "cargo" && step.args.includes("--manifest-path");
501
- const cwd = consumer || kind === "npm" ? "." : dir;
502
501
  const manifestIndex = step.args.indexOf("--manifest-path");
503
502
  const requirementWorkspace = consumer ? path.posix.dirname(step.args[manifestIndex + 1]) : kind === "cargo" ? workspace : ".";
504
- const argv = step.command === "cargo" ? oneOutput(withCargoJobs(step.args, jobs), { platform }) : [...step.args];
503
+ // A consumer row runs from its own manifest's directory, without --manifest-path: the RustRight client refuses an invocation it
504
+ // would have to rewrite ("the client would rewrite this invocation (for example --manifest-path)"), so the flag never reaches it.
505
+ const cwd = consumer ? requirementWorkspace : kind === "npm" ? "." : dir;
506
+ const stepArgs = consumer ? step.args.filter((_, i) => i !== manifestIndex && i !== manifestIndex + 1) : step.args;
507
+ const argv = step.command === "cargo" ? oneOutput(withCargoJobs(stepArgs, jobs), { platform }) : [...stepArgs];
505
508
  add({ workspace: requirementWorkspace, cwd, executable: step.command, argv, env: { ...executionEnv, ...(step.env ?? {}) }, phase: step.test ? "test" : "compile" });
506
509
  }
507
510
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rightkit/release",
3
- "version": "0.6.49",
3
+ "version": "0.6.50",
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",
@@ -50,7 +50,7 @@
50
50
  "@rightkit/qa": "0.7.0",
51
51
  "@rightkit/qa-chrome": "0.1.12",
52
52
  "@rightkit/react-shell": "0.7.3",
53
- "@rightkit/release": "0.6.49",
53
+ "@rightkit/release": "0.6.50",
54
54
  "@rightkit/settings-ui": "0.7.1",
55
55
  "@rightkit/social-ui": "0.1.0",
56
56
  "@rightkit/system-ui": "0.1.0",
package/stage-sidecar.mjs CHANGED
@@ -2208,9 +2208,12 @@ export async function stageSidecars({ appRoot, manifest, target, cacheRoot, ifSt
2208
2208
  };
2209
2209
  validateStageSidecarReceipt(receipt, { target: plan.target.triple });
2210
2210
  const receiptFile = path.resolve(appRoot, plan.receiptPath);
2211
- // A receipt that would differ only in `stagedAt` is kept as it is: staging the same target again with the same results (the gate staged it
2212
- // first in a split, rightkit-gate stageSidecarsOnce) leaves every byte unchanged, so the gate's stage ledger sees no change to its staged outputs.
2213
- const sameAs = (old) => { const { stagedAt: _a, ...a } = old; const { stagedAt: _b, ...b } = receipt; return JSON.stringify(a) === JSON.stringify(b); };
2211
+ // A receipt that would differ only in what a run observes about itself is kept as it is: staging the same target again with the same results (the gate staged it
2212
+ // first in a split, rightkit-gate stageSidecarsOnce) leaves every byte unchanged, so the gate's stage ledger sees no change to its staged outputs. The observations are
2213
+ // `stagedAt`, each file's `changed` (written this run) and `cached` (download already cached), and `wiped` (stale files this run removed): the first run sees changed true,
2214
+ // cached false and a wiped list, the repeat sees changed false, cached true and none, for the same staged bytes (Pulse Mac dev install, 2026-11-06).
2215
+ const stable = (r) => { const { stagedAt: _t, wiped: _w, files, ...rest } = r; return JSON.stringify({ ...rest, files: (files ?? []).map(({ changed: _c, cached: _k, ...file }) => file) }); };
2216
+ const sameAs = (old) => stable(old) === stable(receipt);
2214
2217
  let previous = null;
2215
2218
  try { previous = JSON.parse(fs.readFileSync(receiptFile, "utf8")); } catch { previous = null; }
2216
2219
  if (previous && sameAs(previous)) return { receipt: previous, receiptPath: receiptFile, files: previous.files, externalBinNames: previous.files.filter((file) => file.externalBin).map((file) => file.name), unchanged: true };