@rightkit/release 0.6.91 → 0.6.93

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.
@@ -41,6 +41,19 @@ export function isClassAProgram(start) {
41
41
  if (name === "cargo") return ["deny", "audit"].includes(cargoVerb(args));
42
42
  return false;
43
43
  }
44
+ /**
45
+ * A cargo-deny row's own preparation, which it runs before `cargo deny` (deterministic-scans.mjs, the deny row): `cargo fetch --locked`, then
46
+ * `cargo metadata --format-version 1 --locked` (metadataArgs with noDeps false). Only that row starts cargo with exactly these arguments (after an
47
+ * optional `+toolchain`); every other metadata call names --no-deps, --offline, --filter-platform or --manifest-path, and every other fetch names a manifest.
48
+ */
49
+ export function isDenyPreparation(start) {
50
+ if (programName(start.program) !== "cargo") return false;
51
+ const args = (start.args ?? []).map(String).filter((a, i) => !(i === 0 && a.startsWith("+")));
52
+ const same = (want) => args.length === want.length && want.every((w, i) => args[i] === w);
53
+ return same(["fetch", "--locked"]) || same(["metadata", "--format-version", "1", "--locked"]);
54
+ }
55
+ /** NN03's view of Class A work: a row's own program, or the deny row's preparation, which starts the row on time though cargo deny starts after it. */
56
+ const isClassAWork = (start) => isClassAProgram(start) || isDenyPreparation(start);
44
57
  /** The workspace, verb, feature flags and targets of a broker job: what NN09 holds against the cases file's exact list. A command that names no --target builds for the host. */
45
58
  export function groupOf(job, hostTarget) {
46
59
  const args = job.args ?? []; const snap = plain(job.gate?.snapshot); const cwd = plain(job.cwd);
@@ -216,7 +229,9 @@ const LINES = {
216
229
  const run = c.runs[0]; const fails = []; const lanes = run.lanes;
217
230
  if (!Number.isInteger(lanes) || lanes < 1) return verdict(["the launcher recorded no lane count"], "");
218
231
  if (run.processGaps.length) fails.push(`the process record is incomplete (${run.processGaps[0]})`);
219
- const progs = run.starts.filter(isClassAProgram).sort((a, b) => a.at - b.at);
232
+ // A deny row's fetch and metadata count as its work (0.6.93 acceptance, 28 Nov: cold metadata took 3.9 s, and the row's cargo deny started 3.6 s
233
+ // after the program before it, which read as a row waiting beside a free lane though the row had started on time).
234
+ const progs = run.starts.filter(isClassAWork).sort((a, b) => a.at - b.at);
220
235
  const rows = Object.values(cases.classA?.programRows ?? {}).flat().length;
221
236
  if (progs.length < 2) return verdict([...fails, `${progs.length} Class A program(s) started in a run from nothing; the cases file lists ${rows} rows that start one`], "");
222
237
  const runningAt = (t) => progs.filter((p) => p.at <= t && (p.end === null || p.end > t)).length;
@@ -40,11 +40,40 @@ export function caseCommit(repo, base, edits, name, scratch) {
40
40
  git(repo, ["update-ref", `refs/witness/acceptance-${name}`, commit]); fs.rmSync(idx, { force: true });
41
41
  return commit;
42
42
  }
43
- /** The history file the gate keeps for a store (class-a-cache-history.mjs: named after the store's path). */
44
- export const historyFileOf = (managed, storeDir) => path.join(managed, "runs", "rightkit-class-a-history", `${sha256(path.resolve(storeDir).toLowerCase())}.json`);
43
+ /** The history file the gate keeps for a store (class-a-cache-history.mjs: named after the store's path, lowercased on Windows only). */
44
+ export const historyFileOf = (managed, storeDir) => path.join(managed, "runs", "rightkit-class-a-history", `${sha256(process.platform === "win32" ? path.resolve(storeDir).toLowerCase() : path.resolve(storeDir))}.json`);
45
45
  const moveAside = (from, to) => { if (!fs.existsSync(from)) return false; fs.mkdirSync(path.dirname(to), { recursive: true }); fs.renameSync(from, to); return true; };
46
- /** Ends the gate and every program it started (Windows: the whole tree by pid; elsewhere the process group is the launcher's to signal). */
47
- const killTree = (pid) => { try { if (process.platform === "win32") execFileSync("taskkill", ["/PID", String(pid), "/T", "/F"], { windowsHide: true, stdio: "ignore" }); else process.kill(pid, "SIGKILL"); } catch { /* already gone */ } };
46
+ /** Every live process as { pid, ppid, startMs } (Windows), or null when the list cannot be read. */
47
+ const windowsProcesses = () => {
48
+ try {
49
+ const text = execFileSync("powershell", ["-NoProfile", "-NonInteractive", "-Command", "Get-CimInstance Win32_Process | ForEach-Object { '{0} {1} {2}' -f $_.ProcessId, $_.ParentProcessId, $_.CreationDate.ToUniversalTime().ToString('o') }"], { encoding: "utf8", windowsHide: true, stdio: ["ignore", "pipe", "ignore"] });
50
+ return text.split(/\r?\n/).filter(Boolean).map((l) => { const [pid, ppid, t] = l.trim().split(" "); return { pid: Number(pid), ppid: Number(ppid), startMs: Date.parse(t) }; }).filter((p) => Number.isInteger(p.pid) && Number.isInteger(p.ppid) && Number.isFinite(p.startMs));
51
+ } catch { return null; }
52
+ };
53
+ /**
54
+ * Ends the gate and every program it started. Elsewhere the process group is the launcher's to signal. On Windows `taskkill /T` walks the tree once, so a
55
+ * child the gate starts in the milliseconds of the kill is not in the walk and lives on as an orphan (0.6.92 acceptance, 27 Nov: `cargo tree` started 3 ms
56
+ * before the gate died, case 7 NN08). So the walk is repeated: every live process descended from a process of this tree (by parent pid, started no earlier
57
+ * than the gate, so a reused pid is not taken) is ended, until a walk finds none, bounded at 10 s.
58
+ */
59
+ export const killTree = (pid) => {
60
+ if (process.platform !== "win32") { try { process.kill(pid, "SIGKILL"); } catch { /* already gone */ } return; }
61
+ const before = windowsProcesses(); const root = before?.find((p) => p.pid === pid) ?? null;
62
+ const since = root ? root.startMs - 1000 : Date.now() - 24 * 3600 * 1000;
63
+ const tree = new Set([pid]);
64
+ // The tree as it stood just before the kill, so an orphan whose parent the kill ended is still known by that parent's pid.
65
+ const grow = (list) => { let grew = true; while (grew) { grew = false; for (const p of list) if (!tree.has(p.pid) && tree.has(p.ppid) && p.startMs >= since) { tree.add(p.pid); grew = true; } } };
66
+ grow(before ?? []);
67
+ try { execFileSync("taskkill", ["/PID", String(pid), "/T", "/F"], { windowsHide: true, stdio: "ignore" }); } catch { /* already gone */ }
68
+ const deadline = Date.now() + 10_000;
69
+ while (Date.now() < deadline) {
70
+ const live = windowsProcesses(); if (!live) return;
71
+ grow(live);
72
+ const left = live.filter((p) => tree.has(p.pid) && p.startMs >= since);
73
+ if (!left.length) return;
74
+ for (const p of left) { try { execFileSync("taskkill", ["/PID", String(p.pid), "/T", "/F"], { windowsHide: true, stdio: "ignore" }); } catch { /* already gone */ } }
75
+ }
76
+ };
48
77
 
49
78
  /**
50
79
  * The machine's total CPU load, sampled every two seconds for the whole acceptance run (Adrian, 2026-11-25: "run the 7 cases on a quiet machine with CPU load
@@ -111,7 +111,7 @@ import { buildCoverageReport, limitedEvidenceOf, seconds, writeCoverageReport }
111
111
  import { renderViews, renderViewsOf } from "../render-views.mjs";
112
112
  import { LINUX_BROKER_ROUTE, NO_BROKER_ENV, directCargoPath, directPlatform, managedRuntimeClient, realCargoOf, runCargoSync } from "../managed-cargo.mjs";
113
113
  import { createBrokerLive } from "../broker-admission.mjs";
114
- import { bindingOf, builtBinsOfRun, compileOutputsRecord, compileReuseProblem, endRun, readReceipt, RECEIPT_SCHEMA, receiptKey, sameBinding, sameSource, sealedFor, stagesTo, startRun, STAGES, STAGE_SOURCES, writeReceipt } from "../gate-stages.mjs";
114
+ import { bindingOf, builtBinsOfRun, compileOutputsRecord, compileReuseProblem, compileStageReuse, endRun, readReceipt, RECEIPT_SCHEMA, receiptKey, sameBinding, sameSource, sealedFor, stagesTo, startRun, STAGES, STAGE_SOURCES, writeReceipt } from "../gate-stages.mjs";
115
115
  import { spawnSync as spawnInherit } from "../background-process.mjs";
116
116
  // GC-A21: a run that stamps its own lines also stamps its inherited-output children's lines, through stamp-relay.mjs in front of the child
117
117
  // (the launch stays synchronous and the output still streams). Set by main() when the run stamps; off for machine-readable runs.
@@ -2315,8 +2315,14 @@ async function runStages(o, args, root, git, io) {
2315
2315
  // GB-13 (GATE E6/E7/E16): a recorded compile stands only while the outputs it recorded are still on disk and the compile environment is
2316
2316
  // the one it ran in; otherwise the compile runs again, warm (never a cleared target), unless the sealed bytes below carry it.
2317
2317
  const outputsProblem = (o.compileReuseProblem ?? compileReuseProblem)(receipt.stages.compile, { env: o.env });
2318
- if (!outputsProblem) { o.out(`${tag} [${stage}] already passed for this exact input (commit, tree, lockfiles, gate, toolchain) and its outputs are intact`); continue; }
2319
- if (!sealedIntact) o.out(`${tag} [${stage}] the recorded compile no longer stands: ${outputsProblem}; running it again (warm)`);
2318
+ // On a broker host a package stage that will run needs each Cargo workspace's broker output folder, which only the compile stage hands on
2319
+ // (onCompileOutputs). The recorded compile keeps the folders, not which workspace each belongs to, so skipping the stage whole left the package
2320
+ // admission with no target and it refused RK_SPLIT_TARGET_UNRESOLVED (CodeRight qualify on the Mac, 27 Nov, eaef5f533). There the compile takes
2321
+ // its ordinary path instead: every row is a cache hit, the broker is asked nothing, and the cached rows' receipts name the folders (rightkit#1800).
2322
+ const reuse = compileStageReuse({ outputsProblem, executorKind: executor.kind, stages, sealedIntact });
2323
+ if (reuse === "rows") o.out(`${tag} [${stage}] already passed for this exact input and its outputs are intact; its rows are read again from the cache so the package stage knows each workspace's Cargo target`);
2324
+ else if (reuse === "skip") { o.out(`${tag} [${stage}] already passed for this exact input (commit, tree, lockfiles, gate, toolchain) and its outputs are intact`); continue; }
2325
+ if (outputsProblem && !sealedIntact) o.out(`${tag} [${stage}] the recorded compile no longer stands: ${outputsProblem}; running it again (warm)`);
2320
2326
  }
2321
2327
  if (((stage === "check" && publisherUploadOnly) || stage === "compile" || stage === "package") && sealedIntact) {
2322
2328
  o.out(`${tag} [${stage}] already passed for the sealed set ${sealedNow.id} (manifest ${sealedNow.digest.slice(0, 12)})`); continue;
package/gate-stages.mjs CHANGED
@@ -350,6 +350,18 @@ export function compileReuseProblem(recorded, { env = {}, census = outputCensus
350
350
  return null;
351
351
  }
352
352
 
353
+ /**
354
+ * What a door run does with a recorded passing compile: "skip" (it stands; the stage is not run), "rows" (it stands, but the stage takes its
355
+ * ordinary path so each row answers from the cache and names its workspace's broker output folder), or "rerun" (it no longer stands).
356
+ * "rows" is for a broker host whose package stage will run: the package admission resolves each Cargo workspace's target from the folders the
357
+ * compile stage hands on, and the record keeps the folders but not which workspace each belongs to. Skipping the stage left that admission with no
358
+ * target: RK_SPLIT_TARGET_UNRESOLVED (CodeRight qualify on the Mac, 27 Nov 2026, after a compile that had already passed).
359
+ */
360
+ export function compileStageReuse({ outputsProblem, executorKind, stages, sealedIntact }) {
361
+ if (outputsProblem) return "rerun";
362
+ return executorKind === "broker" && (stages ?? []).includes("package") && !sealedIntact ? "rows" : "skip";
363
+ }
364
+
353
365
  /** The sealed release directory build-release wrote for `commit` on `platform`: { id, manifest, digest } or null. */
354
366
  export function sealedFor({ root, commit, platform, readdir = fs.readdirSync, readFile = (f) => fs.readFileSync(f) }) {
355
367
  const base = path.join(root, ".right-release", "sealed");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rightkit/release",
3
- "version": "0.6.91",
3
+ "version": "0.6.93",
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",
@@ -49,7 +49,7 @@
49
49
  "@rightkit/qa": "0.7.0",
50
50
  "@rightkit/qa-chrome": "0.1.12",
51
51
  "@rightkit/react-shell": "0.7.9",
52
- "@rightkit/release": "0.6.91",
52
+ "@rightkit/release": "0.6.93",
53
53
  "@rightkit/send-ui": "0.1.0",
54
54
  "@rightkit/settings-ui": "0.7.7",
55
55
  "@rightkit/social-ui": "0.2.1",
@@ -457,7 +457,9 @@
457
457
  "0.6.87",
458
458
  "0.6.88",
459
459
  "0.6.89",
460
- "0.6.90"
460
+ "0.6.90",
461
+ "0.6.91",
462
+ "0.6.92"
461
463
  ],
462
464
  "@rightkit/settings-ui": [
463
465
  "0.1.0",
@@ -549,7 +551,7 @@
549
551
  "stagedCargo": {
550
552
  "rightkit-adapt": "0.2.1",
551
553
  "rightkit-adapt-taste": "0.1.3",
552
- "rightkit-agent-coding-tools": "0.2.0",
554
+ "rightkit-agent-coding-tools": "0.2.1",
553
555
  "rightkit-agent-config": "0.1.6",
554
556
  "rightkit-agent-daemon": "0.2.0",
555
557
  "rightkit-agent-demo": "0.2.1",
@@ -560,9 +562,9 @@
560
562
  "rightkit-agent-engine-api-workflows": "0.2.2",
561
563
  "rightkit-agent-engine-attention": "0.2.2",
562
564
  "rightkit-agent-engine-cli": "0.1.1",
563
- "rightkit-agent-engine-core": "0.1.4",
565
+ "rightkit-agent-engine-core": "0.2.1",
564
566
  "rightkit-agent-engine-history": "0.1.6",
565
- "rightkit-agent-engine-mobile-runtime": "0.1.1",
567
+ "rightkit-agent-engine-mobile-runtime": "0.1.2",
566
568
  "rightkit-agent-engine-protocol": "0.4.1",
567
569
  "rightkit-agent-engine-runtime-middleware": "0.1.4",
568
570
  "rightkit-agent-engine-runtime-resources": "0.1.2",
@@ -578,13 +580,13 @@
578
580
  "rightkit-agent-policy": "0.2.4",
579
581
  "rightkit-agent-recipes": "0.1.3",
580
582
  "rightkit-agent-server": "0.2.0",
581
- "rightkit-agent-skills": "0.1.0",
583
+ "rightkit-agent-skills": "0.2.0",
582
584
  "rightkit-agent-task-contract": "0.1.2",
583
585
  "rightkit-agent-task-journal": "0.1.1",
584
586
  "rightkit-agent-telemetry": "0.1.1",
585
587
  "rightkit-agent-tools": "0.4.4",
586
588
  "rightkit-agent-transcript": "0.1.4",
587
- "rightkit-agents": "0.2.8",
589
+ "rightkit-agents": "0.3.0",
588
590
  "rightkit-ai-accounts": "0.1.4",
589
591
  "rightkit-ai-keys": "0.1.1",
590
592
  "rightkit-android": "0.3.3",
@@ -592,13 +594,13 @@
592
594
  "rightkit-app-icon": "0.1.1",
593
595
  "rightkit-app-lock": "0.1.1",
594
596
  "rightkit-app-manager": "0.2.5",
595
- "rightkit-app-settings": "0.4.4",
597
+ "rightkit-app-settings": "0.4.5",
596
598
  "rightkit-app-update": "0.2.1",
597
599
  "rightkit-apple-ops": "0.2.0",
598
600
  "rightkit-approvals": "0.2.2",
599
601
  "rightkit-asr": "0.5.2",
600
602
  "rightkit-assist": "0.1.1",
601
- "rightkit-audio": "0.4.5",
603
+ "rightkit-audio": "0.4.6",
602
604
  "rightkit-autoedit": "0.2.1",
603
605
  "rightkit-automation": "0.7.6",
604
606
  "rightkit-autostart": "0.1.1",
@@ -645,7 +647,7 @@
645
647
  "rightkit-device-link": "0.1.0",
646
648
  "rightkit-device-link-core": "0.1.1",
647
649
  "rightkit-device-link-types": "0.1.2",
648
- "rightkit-dictation-app-runtime": "0.3.2",
650
+ "rightkit-dictation-app-runtime": "0.3.3",
649
651
  "rightkit-dictation-command-host": "0.3.4",
650
652
  "rightkit-dictation-core": "0.3.7",
651
653
  "rightkit-dictation-engine": "0.2.1",
@@ -680,7 +682,7 @@
680
682
  "rightkit-google-apis": "0.2.3",
681
683
  "rightkit-google-identity": "0.3.0",
682
684
  "rightkit-gpu": "0.1.1",
683
- "rightkit-hooks": "0.3.0",
685
+ "rightkit-hooks": "0.3.1",
684
686
  "rightkit-hotkeys": "0.1.8",
685
687
  "rightkit-http": "0.4.1",
686
688
  "rightkit-i18n": "0.1.0",
@@ -690,7 +692,7 @@
690
692
  "rightkit-launcher": "0.2.2",
691
693
  "rightkit-launcher-win": "0.2.1",
692
694
  "rightkit-library": "0.3.1",
693
- "rightkit-license": "0.3.5",
695
+ "rightkit-license": "0.3.6",
694
696
  "rightkit-llm": "0.7.2",
695
697
  "rightkit-local-gen": "0.1.4",
696
698
  "rightkit-logs": "0.4.5",
@@ -760,7 +762,7 @@
760
762
  "rightkit-sync-keys": "0.1.0",
761
763
  "rightkit-sysmem": "0.1.0",
762
764
  "rightkit-system-monitor": "0.3.2",
763
- "rightkit-tauri-shell": "0.8.11",
765
+ "rightkit-tauri-shell": "0.8.12",
764
766
  "rightkit-terminal-ui": "0.2.0",
765
767
  "rightkit-text-polish": "0.1.4",
766
768
  "rightkit-theme": "0.1.1",
@@ -925,7 +927,7 @@
925
927
  "@rightkit/qa": "0.7.0",
926
928
  "@rightkit/qa-chrome": "0.1.12",
927
929
  "@rightkit/react-shell": "0.7.7",
928
- "@rightkit/release": "0.6.90",
930
+ "@rightkit/release": "0.6.92",
929
931
  "@rightkit/settings-ui": "0.7.4",
930
932
  "@rightkit/shell": "0.1.1",
931
933
  "@rightkit/tauri": "0.4.3",
@@ -945,7 +947,9 @@
945
947
  "0.2.1"
946
948
  ],
947
949
  "rightkit-agent-engine-core": [
948
- "0.1.3"
950
+ "0.1.3",
951
+ "0.1.4",
952
+ "0.2.0"
949
953
  ],
950
954
  "rightkit-agent-local-models": [
951
955
  "0.1.1",
@@ -976,7 +980,8 @@
976
980
  "rightkit-agents": [
977
981
  "0.1.0",
978
982
  "0.2.0",
979
- "0.2.7"
983
+ "0.2.7",
984
+ "0.2.8"
980
985
  ],
981
986
  "rightkit-ai-accounts": [
982
987
  "0.1.1",
@@ -1004,7 +1009,8 @@
1004
1009
  "0.3.0",
1005
1010
  "0.4.1",
1006
1011
  "0.4.2",
1007
- "0.4.3"
1012
+ "0.4.3",
1013
+ "0.4.4"
1008
1014
  ],
1009
1015
  "rightkit-asr": [
1010
1016
  "0.0.2",
@@ -1030,7 +1036,8 @@
1030
1036
  "0.4.0",
1031
1037
  "0.4.1",
1032
1038
  "0.4.3",
1033
- "0.4.4"
1039
+ "0.4.4",
1040
+ "0.4.5"
1034
1041
  ],
1035
1042
  "rightkit-automation": [
1036
1043
  "0.3.0",
@@ -1183,7 +1190,8 @@
1183
1190
  "rightkit-dictation-app-runtime": [
1184
1191
  "0.2.0",
1185
1192
  "0.2.2",
1186
- "0.3.1"
1193
+ "0.3.1",
1194
+ "0.3.2"
1187
1195
  ],
1188
1196
  "rightkit-dictation-command-host": [
1189
1197
  "0.3.0",
@@ -1293,7 +1301,8 @@
1293
1301
  "rightkit-hooks": [
1294
1302
  "0.1.0",
1295
1303
  "0.2.0",
1296
- "0.2.13"
1304
+ "0.2.13",
1305
+ "0.3.0"
1297
1306
  ],
1298
1307
  "rightkit-hotkeys": [
1299
1308
  "0.1.0",
@@ -1354,7 +1363,8 @@
1354
1363
  "0.2.5",
1355
1364
  "0.3.1",
1356
1365
  "0.3.2",
1357
- "0.3.4"
1366
+ "0.3.4",
1367
+ "0.3.5"
1358
1368
  ],
1359
1369
  "rightkit-llm": [
1360
1370
  "0.1.0",
@@ -1684,7 +1694,8 @@
1684
1694
  "0.8.2",
1685
1695
  "0.8.7",
1686
1696
  "0.8.9",
1687
- "0.8.10"
1697
+ "0.8.10",
1698
+ "0.8.11"
1688
1699
  ],
1689
1700
  "rightkit-text-polish": [
1690
1701
  "0.1.1",