@astrofoundry/pi-astro 0.40.37 → 0.40.38

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.
@@ -5,7 +5,7 @@ import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-a
5
5
  import { loadConfig as loadSpecialists } from "../specialist-gate/config.ts";
6
6
  import { APPROVAL_TOKEN_ENV, APPROVAL_URL_ENV } from "../specialist-gate/index.ts";
7
7
  import { type AgentConfig, defaultDirs, discoverAgents, resolveSkills } from "../astro-subagents/agents.ts";
8
- import { AGENT_ENV, type ChildSession, type DispatchDefaults, type RunResult, childRemaining, currentDepth, finalOutput, isFailed, runAgent } from "../astro-subagents/child.ts";
8
+ import { AGENT_ENV, type ChildSession, type DispatchDefaults, type RunResult, childRemaining, currentDepth, finalOutput, isFailed, resultOutput, runAgent } from "../astro-subagents/child.ts";
9
9
  import { pruneSessions, sessionDirFor } from "../astro-subagents/sessions.ts";
10
10
  import { ApprovalServer, type Ticket } from "./approvals.ts";
11
11
  import { chunkMessage } from "./chunk.ts";
@@ -942,7 +942,7 @@ class Bridge {
942
942
  env: { [ACTIVATION_ENV]: "0" },
943
943
  });
944
944
  const verdict = isFailed(result) ? null : parseVerdict(finalOutput(result.messages));
945
- log(`release review: ${subject}: ${verdict?.verdict ?? "no answer"}`);
945
+ log(`release review: ${subject}: ${verdict?.verdict ?? `no answer (${isFailed(result) ? "failed" : "unparsed"}: ${resultOutput(result).replace(/\s+/g, " ").slice(0, 300)})`}`);
946
946
  return verdict ?? { verdict: null, reason: "the review gave no usable answer; read the notes before updating" };
947
947
  } catch (err) {
948
948
  return { verdict: null, reason: `the review failed: ${err instanceof Error ? err.message.slice(0, 120) : String(err)}` };
@@ -602,6 +602,7 @@ describe("weekly report", () => {
602
602
  { vmid: "101", name: "101", last: 5 },
603
603
  ]);
604
604
  expect(backupGuests({})).toBeNull();
605
+ expect(backupGuests([{ vmid: 100, ctime: 20, notes: "arcane" }, { vmid: 101, ctime: 5, notes: "hermes" }, { vmid: 101, ctime: 9, notes: "hermes", protected: 1 }])).toEqual([{ vmid: "100", name: "arcane", last: 20 }]);
605
606
  expect(resticStatus("Result=success\nExecMainStartTimestamp=Sun 2026-10-18 04:00:24 CEST\n")).toEqual({ result: "success", at: "18 Oct 04:00" });
606
607
  expect(resticStatus("nothing")).toBeNull();
607
608
  expect(backupLine(null, 0, TZ)).toBe("Backups · the check failed");
@@ -834,15 +834,19 @@ export interface WeeklyData {
834
834
  /** `vzdump-archives`: the newest archive per guest, by `ctime` (seconds). */
835
835
  export function backupGuests(value: unknown): BackupFacts["guests"] | null {
836
836
  if (!Array.isArray(value)) return null;
837
- const latest = new Map<string, { vmid: string; name: string; last: number }>();
838
- for (const a of value as { vmid?: unknown; ctime?: unknown; notes?: unknown }[]) {
837
+ const latest = new Map<string, { vmid: string; name: string; last: number; kept: boolean }>();
838
+ for (const a of value as { vmid?: unknown; ctime?: unknown; notes?: unknown; protected?: unknown }[]) {
839
839
  if ((typeof a.vmid !== "number" && typeof a.vmid !== "string") || typeof a.ctime !== "number") continue;
840
840
  const vmid = String(a.vmid);
841
841
  const name = typeof a.notes === "string" && a.notes.length > 0 ? a.notes.split("\n")[0].slice(0, 40) : vmid;
842
842
  const seen = latest.get(vmid);
843
- if (!seen || a.ctime > seen.last) latest.set(vmid, { vmid, name, last: a.ctime });
843
+ if (!seen || a.ctime > seen.last) latest.set(vmid, { vmid, name, last: a.ctime, kept: a.protected === 1 || a.protected === true });
844
844
  }
845
- return [...latest.values()].sort((x, y) => x.vmid.localeCompare(y.vmid));
845
+ // A retired guest's newest archive is protected as its final backup; it is not a missed backup.
846
+ return [...latest.values()]
847
+ .filter((g) => !g.kept)
848
+ .map(({ vmid, name, last }) => ({ vmid, name, last }))
849
+ .sort((x, y) => x.vmid.localeCompare(y.vmid));
846
850
  }
847
851
 
848
852
  /** `restic-check-status`: systemd's `Result=` and the start of the last run, as printed (local time). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrofoundry/pi-astro",
3
- "version": "0.40.37",
3
+ "version": "0.40.38",
4
4
  "description": "Personal pi customizations (extensions, subagents, skills, prompts, themes) for the pi coding agent.",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -130,7 +130,7 @@ Host: Cortex (macOS on Apple silicon; Homebrew git; the specialists' Node, trend
130
130
  { "agent": "astro.edge", "tool": "edge", "service": "edge", "timeoutMs": 300000 },
131
131
  { "agent": "astro.security", "tool": "security", "service": "security", "timeoutMs": 120000 },
132
132
  { "agent": "astro.backup", "tool": "backup", "service": "backup", "timeoutMs": 3600000 },
133
- { "agent": "astro.proxmox", "tool": "proxmox", "service": "proxmox", "timeoutMs": 360000 },
133
+ { "agent": "astro.proxmox", "tool": "proxmox", "service": "proxmox", "timeoutMs": 1320000 },
134
134
  { "agent": "astro.inference", "tool": "inference", "service": "inference", "timeoutMs": 1260000 },
135
135
  { "agent": "astro.media", "tool": "media", "service": "media", "timeoutMs": 660000 } ] }
136
136
  ```
@@ -210,6 +210,8 @@ async function vps(config: EdgeConfig, args: string[]): Promise<number> {
210
210
  return 0;
211
211
  }
212
212
  if (result.code !== 0) throw new ServiceError(result.stderr.trim() || `vps ${args[0]} exited ${result.code}`);
213
+ // nginx -t reports success on stderr.
214
+ if (remote === "nginx-test" && result.stderr.trim().length > 0) printRaw(result.stderr);
213
215
  return 0;
214
216
  }
215
217