@rightkit/release 0.6.91 → 0.6.92

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.
@@ -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rightkit/release",
3
- "version": "0.6.91",
3
+ "version": "0.6.92",
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.92",
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,8 @@
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"
461
462
  ],
462
463
  "@rightkit/settings-ui": [
463
464
  "0.1.0",
@@ -549,7 +550,7 @@
549
550
  "stagedCargo": {
550
551
  "rightkit-adapt": "0.2.1",
551
552
  "rightkit-adapt-taste": "0.1.3",
552
- "rightkit-agent-coding-tools": "0.2.0",
553
+ "rightkit-agent-coding-tools": "0.2.1",
553
554
  "rightkit-agent-config": "0.1.6",
554
555
  "rightkit-agent-daemon": "0.2.0",
555
556
  "rightkit-agent-demo": "0.2.1",
@@ -560,7 +561,7 @@
560
561
  "rightkit-agent-engine-api-workflows": "0.2.2",
561
562
  "rightkit-agent-engine-attention": "0.2.2",
562
563
  "rightkit-agent-engine-cli": "0.1.1",
563
- "rightkit-agent-engine-core": "0.1.4",
564
+ "rightkit-agent-engine-core": "0.2.0",
564
565
  "rightkit-agent-engine-history": "0.1.6",
565
566
  "rightkit-agent-engine-mobile-runtime": "0.1.1",
566
567
  "rightkit-agent-engine-protocol": "0.4.1",
@@ -584,7 +585,7 @@
584
585
  "rightkit-agent-telemetry": "0.1.1",
585
586
  "rightkit-agent-tools": "0.4.4",
586
587
  "rightkit-agent-transcript": "0.1.4",
587
- "rightkit-agents": "0.2.8",
588
+ "rightkit-agents": "0.3.0",
588
589
  "rightkit-ai-accounts": "0.1.4",
589
590
  "rightkit-ai-keys": "0.1.1",
590
591
  "rightkit-android": "0.3.3",
@@ -680,7 +681,7 @@
680
681
  "rightkit-google-apis": "0.2.3",
681
682
  "rightkit-google-identity": "0.3.0",
682
683
  "rightkit-gpu": "0.1.1",
683
- "rightkit-hooks": "0.3.0",
684
+ "rightkit-hooks": "0.3.1",
684
685
  "rightkit-hotkeys": "0.1.8",
685
686
  "rightkit-http": "0.4.1",
686
687
  "rightkit-i18n": "0.1.0",
@@ -925,7 +926,7 @@
925
926
  "@rightkit/qa": "0.7.0",
926
927
  "@rightkit/qa-chrome": "0.1.12",
927
928
  "@rightkit/react-shell": "0.7.7",
928
- "@rightkit/release": "0.6.90",
929
+ "@rightkit/release": "0.6.91",
929
930
  "@rightkit/settings-ui": "0.7.4",
930
931
  "@rightkit/shell": "0.1.1",
931
932
  "@rightkit/tauri": "0.4.3",
@@ -945,7 +946,8 @@
945
946
  "0.2.1"
946
947
  ],
947
948
  "rightkit-agent-engine-core": [
948
- "0.1.3"
949
+ "0.1.3",
950
+ "0.1.4"
949
951
  ],
950
952
  "rightkit-agent-local-models": [
951
953
  "0.1.1",
@@ -976,7 +978,8 @@
976
978
  "rightkit-agents": [
977
979
  "0.1.0",
978
980
  "0.2.0",
979
- "0.2.7"
981
+ "0.2.7",
982
+ "0.2.8"
980
983
  ],
981
984
  "rightkit-ai-accounts": [
982
985
  "0.1.1",
@@ -1293,7 +1296,8 @@
1293
1296
  "rightkit-hooks": [
1294
1297
  "0.1.0",
1295
1298
  "0.2.0",
1296
- "0.2.13"
1299
+ "0.2.13",
1300
+ "0.3.0"
1297
1301
  ],
1298
1302
  "rightkit-hotkeys": [
1299
1303
  "0.1.0",