@astrofoundry/pi-astro 0.40.45 → 0.40.46

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrofoundry/pi-astro",
3
- "version": "0.40.45",
3
+ "version": "0.40.46",
4
4
  "description": "Personal pi customizations (extensions, subagents, skills, prompts, themes) for the pi coding agent.",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -44,6 +44,7 @@ Power actions and snapshot changes return `{ upid, exitstatus }`; `OK` means don
44
44
  | `host-upgrade` | apt full-upgrade of the host (risky, needs approval); a new Proxmox VE major is held and printed as `held:`; ends with `reboot-needed:`. The morning run does this on its own each day |
45
45
  | `host-reboot --confirm` | reboot the host in one minute (risky): every guest on it restarts. Only on the owner's explicit request; the morning run offers a Reboot button instead |
46
46
  | `guest-exec <vmid> <status|journal|df|updates>` | fixed read inside a guest: failed units and uptime, warning journal of 24 h, disk usage, upgradable packages |
47
+ | `nightly [days]` | start, end, duration (UTC) and result of each nightly job of the last 1..14 days (default 7): vzdump tasks from the API, then from the journals of the host and every running guest the host timers, `apt-daily-upgrade`, the backup and dump timers, and Docker restarts. Answer questions about nightly run times with it |
47
48
 
48
49
  ## Guest change procedure
49
50
 
@@ -11,7 +11,7 @@ A specialist is a Pi subagent that is the only way to operate one area of the ho
11
11
  | `astro.edge` | Frontdoor VPS (`frontdoor-1337`) over an IAP tunnel; `00-frontdoor-vps/` in the homelab repository | `probe` the public path; `route-probe` (status of the Supabase, Grimoire, and Mealie public routes from Cortex); `vps status|nginx-conf|nginx-test|journal|wg|bouncer|updates|package|changelog|auto-upgrades|deploy-nginx|reboot --confirm`; `git` on the homelab checkout, writes limited to `00-frontdoor-vps/` |
12
12
  | `astro.security` | Wazuh, CrowdSec, rsyslog archive on VM 106 | Read-only: `status`, `attention`, `agents`, `alerts`, `decisions`, `bouncers`, `metrics`, `wazuh-alerts`, `wazuh-vulns`, `wazuh-events`, `wazuh-vuln-events`, `wazuh-log`, `remote-hosts`, `remote-log`, `journal` |
13
13
  | `astro.backup` | vzdump, the shared Restic repository (Pulsar host config, Arcane app backups), GCS offsite from LXC 102 | Status, journals, and manual runs of every layer; `restic-snapshots|stats|ls`, `restic-restore` into `/var/tmp/spc-restore` on Pulsar, `restore-clean` |
14
- | `astro.proxmox` | Proxmox VE on Pulsar (37) and SPACE-X (Mira) | API token: `guests`, `guest`, `get <path>`, `tasks`; `start`, `shutdown|reboot|stop --confirm`; snapshots create, delete, rollback; `set` of CPU, memory, options, network. Host key: `host-status`, `host-journal`, `updates`, `host-upgrade` (apt full-upgrade; a new Proxmox VE major is held), `host-reboot --confirm`, `guest-exec <vmid> <status|journal|df|updates>`. Every command runs on Pulsar, or on SPACE-X with the `space-x` prefix |
14
+ | `astro.proxmox` | Proxmox VE on Pulsar (37) and SPACE-X (Mira) | API token: `guests`, `guest`, `get <path>`, `tasks`; `start`, `shutdown|reboot|stop --confirm`; snapshots create, delete, rollback; `set` of CPU, memory, options, network. Host key: `host-status`, `host-journal`, `updates`, `host-upgrade` (apt full-upgrade; a new Proxmox VE major is held), `host-reboot --confirm`, `guest-exec <vmid> <status|journal|df|updates>`, `nightly-journal <days>`; `nightly [days]` combines the vzdump tasks with that journal into a table of nightly run times. Every command runs on Pulsar, or on SPACE-X with the `space-x` prefix |
15
15
  | `astro.inference` | MLX embedding and reranking servers on Nexus, Europa health | `nexus-status|start|stop|restart|log|disk`, `macos-updates`; `europa-health` |
16
16
  | `astro.media` | trendarr over TMDB, OMDb, and the `media` project on VM 100 (Radarr, Sonarr, SABnzbd) | `trending`, `search`, `recommend`, `add-movies`, `add-series` (at most 20 IMDb IDs), `sabnzbd status|pause|resume`; always trendarr's JSON plus its warnings |
17
17
 
@@ -35,6 +35,14 @@ guest_cmd() {
35
35
  esac
36
36
  }
37
37
 
38
+ # The nightly jobs on the host and in the guests; a unit a machine does not have prints nothing.
39
+ NIGHTLY_UNITS="pulsar-config-backup mira-backup-pull apt-daily-upgrade docker arcane-backup pgdump-zitadel lego-renew gcs-backup"
40
+ nightly_cmd() {
41
+ units=""
42
+ for u in $NIGHTLY_UNITS; do units="$units -u $u.service"; done
43
+ echo "journalctl --utc -o short-iso --no-pager --since '$1 days ago' $units | grep -E 'systemd\[1\]: (Starting|Started|Finished|Failed|[^ ]+\.service: (Deactivated|Failed))' || true"
44
+ }
45
+
38
46
  case "$name" in
39
47
  host-status)
40
48
  pveversion
@@ -62,6 +70,15 @@ case "$name" in
62
70
  [ "$rest" = "--confirm" ] || { echo "host-reboot needs --confirm" >&2; exit 2; }
63
71
  shutdown -r +1 "reboot requested through the proxmox specialist" 2>&1
64
72
  echo "reboot in 1 minute" ;;
73
+ nightly-journal)
74
+ case "$rest" in [1-9]|1[0-4]) ;; *) echo "days must be 1..14" >&2; exit 2 ;; esac
75
+ inner="$(nightly_cmd "$rest")"
76
+ sh -c "$inner"
77
+ for vmid in $(pct list | awk 'NR > 1 && $2 == "running" { print $1 }'); do pct exec "$vmid" -- sh -c "$inner" || true; done
78
+ # The guest agent wraps a VM's output in JSON; only its out-data is journal lines.
79
+ for vmid in $(qm list | awk 'NR > 1 && $3 == "running" { print $1 }'); do
80
+ qm guest exec "$vmid" --timeout 60 -- sh -c "$inner" | perl -MJSON::PP -0777 -ne 'my $r = eval { decode_json($_) }; print $r->{"out-data"} // "" if $r' || true
81
+ done ;;
65
82
  guest-exec)
66
83
  vmid="${rest%% *}"; action="${rest#* }"
67
84
  case "$vmid" in 1[0-9][0-9]) ;; *) echo "bad vmid" >&2; exit 2 ;; esac
@@ -35,6 +35,14 @@ guest_cmd() {
35
35
  esac
36
36
  }
37
37
 
38
+ # The nightly jobs on the host and in the guests; a unit a machine does not have prints nothing.
39
+ NIGHTLY_UNITS="pulsar-config-backup mira-backup-pull apt-daily-upgrade docker arcane-backup pgdump-zitadel lego-renew gcs-backup"
40
+ nightly_cmd() {
41
+ units=""
42
+ for u in $NIGHTLY_UNITS; do units="$units -u $u.service"; done
43
+ echo "journalctl --utc -o short-iso --no-pager --since '$1 days ago' $units | grep -E 'systemd\[1\]: (Starting|Started|Finished|Failed|[^ ]+\.service: (Deactivated|Failed))' || true"
44
+ }
45
+
38
46
  case "$name" in
39
47
  host-status)
40
48
  pveversion
@@ -62,6 +70,15 @@ case "$name" in
62
70
  [ "$rest" = "--confirm" ] || { echo "host-reboot needs --confirm" >&2; exit 2; }
63
71
  shutdown -r +1 "reboot requested through the proxmox specialist" 2>&1
64
72
  echo "reboot in 1 minute" ;;
73
+ nightly-journal)
74
+ case "$rest" in [1-9]|1[0-4]) ;; *) echo "days must be 1..14" >&2; exit 2 ;; esac
75
+ inner="$(nightly_cmd "$rest")"
76
+ sh -c "$inner"
77
+ for vmid in $(pct list | awk 'NR > 1 && $2 == "running" { print $1 }'); do pct exec "$vmid" -- sh -c "$inner" || true; done
78
+ # The guest agent wraps a VM's output in JSON; only its out-data is journal lines.
79
+ for vmid in $(qm list | awk 'NR > 1 && $3 == "running" { print $1 }'); do
80
+ qm guest exec "$vmid" --timeout 60 -- sh -c "$inner" | perl -MJSON::PP -0777 -ne 'my $r = eval { decode_json($_) }; print $r->{"out-data"} // "" if $r' || true
81
+ done ;;
65
82
  guest-exec)
66
83
  vmid="${rest%% *}"; action="${rest#* }"
67
84
  case "$vmid" in 1[0-9][0-9]) ;; *) echo "bad vmid" >&2; exit 2 ;; esac
@@ -88,11 +88,14 @@ export const HOST_COMMANDS: Readonly<Record<string, { args: number; help: string
88
88
  "host-upgrade": { args: 0, help: "apt full-upgrade of the host; a new Proxmox VE major is held (prints held:); ends with reboot-needed" },
89
89
  "host-reboot": { args: 1, help: "host-reboot --confirm reboot the host in one minute; every guest on it restarts" },
90
90
  "guest-exec": { args: 2, help: "guest-exec <vmid> <status|journal|df|updates> fixed read inside a guest (pct exec or qm guest exec)" },
91
+ "nightly-journal": { args: 1, help: "nightly-journal <days> raw systemd start and end lines of the nightly jobs on the host and in every running guest" },
91
92
  };
92
93
  export const GUEST_EXEC = ["status", "journal", "df", "updates"];
93
94
  /** A full upgrade with a new kernel and pve-manager can take several minutes on the host. */
94
95
  export const HOST_UPGRADE_TIMEOUT_MS = 20 * 60_000;
95
96
  const SINCE = /^[A-Za-z0-9 :\-+]{1,40}$/;
97
+ /** Nights `nightly` reads; the entry scripts accept 1..14. */
98
+ export const NIGHTLY_DAYS = { default: 7, max: 14 };
96
99
 
97
100
  const HELP = `proxmox specialist (Proxmox VE on Pulsar at 37 and SPACE-X at Mira)
98
101
 
@@ -109,6 +112,7 @@ const HELP = `proxmox specialist (Proxmox VE on Pulsar at 37 and SPACE-X at Mira
109
112
  snapshot-delete <vmid> <name> --confirm
110
113
  snapshot-rollback <vmid> <name> --confirm
111
114
  set <vmid> key=value... VM: ${SET_KEYS.qemu.join(", ")}, netN; CT: ${SET_KEYS.lxc.join(", ")}, netN
115
+ nightly [days] start, end, and duration (UTC) of each nightly job of the last days (default ${NIGHTLY_DAYS.default}, max ${NIGHTLY_DAYS.max}): vzdump tasks, host timers, and each running guest's updates, backups, and Docker restarts
112
116
  ${Object.entries(HOST_COMMANDS)
113
117
  .map(([name, c]) => ` ${name.padEnd(35)} ${c.help}`)
114
118
  .join("\n")}
@@ -333,6 +337,7 @@ export function buildHostRemote(args: string[]): string {
333
337
  if (rest.length !== spec.args) throw new UsageError(`${name} takes ${spec.args} argument(s)`);
334
338
  if (name === "host-journal" && !SINCE.test(rest[0])) throw new UsageError("since: letters, digits, spaces, colon, plus, minus only");
335
339
  if (name === "host-reboot" && rest[0] !== "--confirm") throw new UsageError("host-reboot restarts every guest on the host; add --confirm when the task asks for it explicitly");
340
+ if (name === "nightly-journal") parseDays(rest[0]);
336
341
  if (name === "guest-exec") {
337
342
  parseVmid(rest[0]);
338
343
  if (!GUEST_EXEC.includes(rest[1])) throw new UsageError(`guest-exec action must be one of ${GUEST_EXEC.join(", ")}`);
@@ -340,7 +345,100 @@ export function buildHostRemote(args: string[]): string {
340
345
  return [name, ...rest].join(" ");
341
346
  }
342
347
 
343
- async function host(config: Target, args: string[]): Promise<number> {
348
+ export function parseDays(text: string | undefined): number {
349
+ const days = text === undefined ? NIGHTLY_DAYS.default : Number(text);
350
+ if (!Number.isInteger(days) || days < 1 || days > NIGHTLY_DAYS.max) throw new UsageError(`days must be 1..${NIGHTLY_DAYS.max}`);
351
+ return days;
352
+ }
353
+
354
+ /** One run of a nightly job on one machine; a Docker restart runs from the daemon's stop to its start. */
355
+ export interface NightlyRun {
356
+ machine: string;
357
+ job: string;
358
+ start: string;
359
+ end: string | null;
360
+ result: string;
361
+ }
362
+
363
+ const JOURNAL_LINE = /^(\S+) (\S+) systemd\[1\]: (.*)$/;
364
+
365
+ /** Runs from the `nightly-journal` lines: Starting to Finished or Failed, and Docker from Deactivated to Started. */
366
+ export function journalRuns(text: string): NightlyRun[] {
367
+ const runs: NightlyRun[] = [];
368
+ const open = new Map<string, NightlyRun>();
369
+ const close = (key: string, end: string, result: string) => {
370
+ const run = open.get(key);
371
+ if (!run) return;
372
+ run.end = end;
373
+ run.result = result;
374
+ open.delete(key);
375
+ };
376
+ for (const line of text.split("\n")) {
377
+ const m = JOURNAL_LINE.exec(line.trim());
378
+ if (!m) continue;
379
+ const [, time, machine, message] = m;
380
+ const at = new Date(time).toISOString();
381
+ const unit = /([\w@.-]+)\.service/.exec(message)?.[1];
382
+ if (!unit) continue;
383
+ const key = `${machine} ${unit}`;
384
+ if (unit === "docker") {
385
+ if (/: Deactivated successfully/.test(message)) {
386
+ const run = { machine, job: "docker restart", start: at, end: null, result: "running" };
387
+ runs.push(run);
388
+ open.set(key, run);
389
+ } else if (/^Started /.test(message)) close(key, at, "ok");
390
+ continue;
391
+ }
392
+ if (/^Starting /.test(message)) {
393
+ const run = { machine, job: unit, start: at, end: null, result: "running" };
394
+ runs.push(run);
395
+ open.set(key, run);
396
+ } else if (/^Finished /.test(message)) close(key, at, "ok");
397
+ else if (/: Failed with result '([^']+)'/.test(message)) close(key, at, `failed (${/'([^']+)'/.exec(message)?.[1] ?? "?"})`);
398
+ else if (/^Failed to start /.test(message)) close(key, at, "failed");
399
+ }
400
+ return runs;
401
+ }
402
+
403
+ /** Runs from `/nodes/<node>/tasks?typefilter=vzdump`: one per backup task, the whole job when it names no guest. */
404
+ export function vzdumpRuns(node: string, tasks: unknown): NightlyRun[] {
405
+ if (!Array.isArray(tasks)) return [];
406
+ return (tasks as { type?: unknown; id?: unknown; starttime?: unknown; endtime?: unknown; status?: unknown }[])
407
+ .filter((t) => t.type === "vzdump" && typeof t.starttime === "number")
408
+ .map((t) => ({
409
+ machine: node,
410
+ job: typeof t.id === "string" && t.id !== "" ? `vzdump ${t.id}` : "vzdump",
411
+ start: new Date((t.starttime as number) * 1000).toISOString(),
412
+ end: typeof t.endtime === "number" ? new Date(t.endtime * 1000).toISOString() : null,
413
+ result: typeof t.status === "string" ? t.status : "running",
414
+ }));
415
+ }
416
+
417
+ function durationText(start: string, end: string | null): string {
418
+ if (end === null) return "-";
419
+ const s = Math.round((Date.parse(end) - Date.parse(start)) / 1000);
420
+ return s >= 60 ? `${Math.floor(s / 60)}m${String(s % 60).padStart(2, "0")}s` : `${s}s`;
421
+ }
422
+
423
+ /** The runs as a fixed-width table, oldest first, times in UTC. */
424
+ export function nightlyTable(runs: readonly NightlyRun[]): string {
425
+ const rows = [...runs]
426
+ .sort((a, b) => a.start.localeCompare(b.start))
427
+ .map((r) => [r.start.slice(0, 10), r.start.slice(11, 19), r.end ? r.end.slice(11, 19) : "-", durationText(r.start, r.end), r.machine, r.job, r.result]);
428
+ const head = ["date", "start", "end", "duration", "machine", "job", "result"];
429
+ const widths = head.map((h, i) => Math.max(h.length, ...rows.map((r) => r[i].length)));
430
+ return [head, ...rows].map((r) => r.map((c, i) => c.padEnd(widths[i])).join(" ").trimEnd()).join("\n");
431
+ }
432
+
433
+ async function nightly(config: Target, days: number): Promise<number> {
434
+ const since = Math.floor(Date.now() / 1000) - days * 24 * 3600;
435
+ const tasks = await api(config, "GET", `/nodes/${config.node}/tasks?typefilter=vzdump&since=${since}&limit=500`);
436
+ const journal = await hostOutput(config, ["nightly-journal", String(days)]);
437
+ printRaw(`${nightlyTable([...vzdumpRuns(config.node, tasks), ...journalRuns(journal)])}\n(times in UTC)`);
438
+ return 0;
439
+ }
440
+
441
+ async function hostOutput(config: Target, args: string[]): Promise<string> {
344
442
  const remote = buildHostRemote(args);
345
443
  const result = await sshFixed(
346
444
  {
@@ -352,8 +450,16 @@ async function host(config: Target, args: string[]): Promise<number> {
352
450
  remote,
353
451
  args[0] === "host-upgrade" ? HOST_UPGRADE_TIMEOUT_MS : 120_000,
354
452
  );
355
- if (result.stdout.length > 0) printRaw(result.stdout);
356
- if (result.code !== 0) throw new ServiceError(result.stderr.trim() || `${args[0]} exited ${result.code}`);
453
+ if (result.code !== 0) {
454
+ if (result.stdout.length > 0) printRaw(result.stdout);
455
+ throw new ServiceError(result.stderr.trim() || `${args[0]} exited ${result.code}`);
456
+ }
457
+ return result.stdout;
458
+ }
459
+
460
+ async function host(config: Target, args: string[]): Promise<number> {
461
+ const out = await hostOutput(config, args);
462
+ if (out.length > 0) printRaw(out);
357
463
  return 0;
358
464
  }
359
465
 
@@ -373,6 +479,10 @@ export async function command(args: string[]): Promise<number> {
373
479
  printJson({ host: new URL(config.apiUrl).host, fingerprint256: probe.fingerprint });
374
480
  return 0;
375
481
  }
482
+ if (rest[0] === "nightly") {
483
+ if (rest.length > 2) throw new UsageError("nightly [days]");
484
+ return nightly(config, parseDays(rest[1]));
485
+ }
376
486
  if (rest[0] !== undefined && rest[0] in HOST_COMMANDS) return host(config, rest);
377
487
  return apiCommand(config, rest);
378
488
  }
@@ -12,7 +12,7 @@ import { MAX_ADD_IDS, MAX_EXCLUDE_IDS, buildTrendarrCall, interpretRun, parseImd
12
12
  import { ServiceError, UsageError } from "./lib/errors.ts";
13
13
  import { safeRepoPath, safeWritePath } from "./lib/repo.ts";
14
14
  import { appGetPath, appPolicyDelete, portForwardDelete, clientFixedIpWrite, syslogChanges, buildPulsarRemote, cloudPath, deviceNetworkWrite, NAT_PATH, natWrite, parseQuery, parseSiteArgs, redactUnifi, unifiPath, unifiWrite, command as networkCommand } from "./network/run.ts";
15
- import { buildHostRemote, splitHost, needsConfirm, parseSetPairs, parseVmid, validateApiPath as validatePvePath, command as proxmoxCommand } from "./proxmox/run.ts";
15
+ import { buildHostRemote, journalRuns, nightlyTable, parseDays, splitHost, needsConfirm, parseSetPairs, parseVmid, validateApiPath as validatePvePath, vzdumpRuns, command as proxmoxCommand } from "./proxmox/run.ts";
16
16
  import { banLength, buildObsRemote, compactDecisions, parseGoDuration, summariseAlerts, summariseVulns, summariseWazuh, vulnEvents, wazuhEvents, command as securityCommand } from "./security/run.ts";
17
17
 
18
18
  describe("arcane wrapper", () => {
@@ -680,6 +680,46 @@ describe("proxmox wrapper", () => {
680
680
  expect(buildHostRemote(["host-reboot", "--confirm"])).toBe("host-reboot --confirm");
681
681
  expect(() => buildHostRemote(["host-reboot", "now"])).toThrow(/--confirm/);
682
682
  expect(() => buildHostRemote(["shell"])).toThrow(/unknown host command/);
683
+ expect(buildHostRemote(["nightly-journal", "7"])).toBe("nightly-journal 7");
684
+ expect(() => buildHostRemote(["nightly-journal", "15"])).toThrow(/days/);
685
+ expect(() => buildHostRemote(["nightly-journal", "7; id"])).toThrow(/days/);
686
+ expect(parseDays(undefined)).toBe(7);
687
+ expect(() => parseDays("0")).toThrow(/days/);
688
+ });
689
+
690
+ it("turns the nightly journal and vzdump tasks into runs and a table", () => {
691
+ const journal = [
692
+ "2026-11-04T03:00:24+00:00 pulsar systemd[1]: Starting pulsar-config-backup.service - PVE host config backup to restic...",
693
+ "2026-11-04T03:00:42+00:00 pulsar systemd[1]: pulsar-config-backup.service: Deactivated successfully.",
694
+ "2026-11-04T03:00:42+00:00 pulsar systemd[1]: Finished pulsar-config-backup.service - PVE host config backup to restic.",
695
+ "2026-10-31T18:52:02+00:00 pulsar systemd[1]: Starting mira-backup-pull.service - Copy Mira guest backups from TESLA to the UNAS...",
696
+ "2026-10-31T18:52:05+00:00 pulsar systemd[1]: mira-backup-pull.service: Failed with result 'exit-code'.",
697
+ "2026-10-31T18:52:05+00:00 pulsar systemd[1]: Failed to start mira-backup-pull.service - Copy Mira guest backups from TESLA to the UNAS.",
698
+ "2026-11-03T03:30:01+00:00 arcane systemd[1]: Starting apt-daily-upgrade.service - Daily apt upgrade and clean activities...",
699
+ "2026-11-03T03:30:09+00:00 arcane systemd[1]: Finished apt-daily-upgrade.service - Daily apt upgrade and clean activities.",
700
+ "2026-11-03T03:30:22+00:00 arcane systemd[1]: docker.service: Deactivated successfully.",
701
+ "2026-11-03T03:30:32+00:00 arcane systemd[1]: Starting docker.service - Docker Application Container Engine...",
702
+ "2026-11-03T03:30:33+00:00 arcane systemd[1]: Started docker.service - Docker Application Container Engine.",
703
+ "2026-11-01T05:35:22+00:00 identity systemd[1]: Starting docker.service - Docker Application Container Engine...",
704
+ ].join("\n");
705
+ expect(journalRuns(journal)).toEqual([
706
+ { machine: "pulsar", job: "pulsar-config-backup", start: "2026-11-04T03:00:24.000Z", end: "2026-11-04T03:00:42.000Z", result: "ok" },
707
+ { machine: "pulsar", job: "mira-backup-pull", start: "2026-10-31T18:52:02.000Z", end: "2026-10-31T18:52:05.000Z", result: "failed (exit-code)" },
708
+ { machine: "arcane", job: "apt-daily-upgrade", start: "2026-11-03T03:30:01.000Z", end: "2026-11-03T03:30:09.000Z", result: "ok" },
709
+ { machine: "arcane", job: "docker restart", start: "2026-11-03T03:30:22.000Z", end: "2026-11-03T03:30:33.000Z", result: "ok" },
710
+ ]);
711
+ const tasks = [
712
+ { type: "vzdump", id: "", starttime: 1793755800, endtime: 1793756268, status: "OK" },
713
+ { type: "qmstart", id: "100", starttime: 1793755000, endtime: 1793755001, status: "OK" },
714
+ ];
715
+ const runs = [...vzdumpRuns("pulsar", tasks), ...journalRuns(journal)];
716
+ expect(runs[0]).toEqual({ machine: "pulsar", job: "vzdump", start: "2026-11-04T01:30:00.000Z", end: "2026-11-04T01:37:48.000Z", result: "OK" });
717
+ expect(vzdumpRuns("pulsar", null)).toEqual([]);
718
+ const table = nightlyTable(runs).split("\n");
719
+ expect(table[0]).toBe("date start end duration machine job result");
720
+ expect(table[1]).toBe("2026-10-31 18:52:02 18:52:05 3s pulsar mira-backup-pull failed (exit-code)");
721
+ expect(table.at(-1)).toBe("2026-11-04 03:00:24 03:00:42 18s pulsar pulsar-config-backup ok");
722
+ expect(table).toContain("2026-11-04 01:30:00 01:37:48 7m48s pulsar vzdump OK");
683
723
  });
684
724
 
685
725
  it("prints help without touching config", async () => {