@astrofoundry/pi-astro 0.40.36 → 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.
- package/extensions/astro-discord/index.ts +2 -2
- package/extensions/astro-discord/security.test.ts +1 -0
- package/extensions/astro-discord/security.ts +8 -4
- package/package.json +1 -1
- package/skills/proxmox/SKILL.md +1 -1
- package/skills/security/SKILL.md +4 -2
- package/specialists/README.md +1 -1
- package/specialists/edge/run.ts +2 -0
- package/specialists/proxmox/run.ts +1 -1
|
@@ -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 ??
|
|
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
|
-
|
|
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
package/skills/proxmox/SKILL.md
CHANGED
|
@@ -5,7 +5,7 @@ description: How the proxmox specialist operates Proxmox VE on Pulsar (37) and S
|
|
|
5
5
|
|
|
6
6
|
# Proxmox specialist
|
|
7
7
|
|
|
8
|
-
Pulsar (`10.0.10.37`, Proxmox VE 9 on Debian 13, node name `pulsar`) runs every guest: VM 100 `arcane` (Docker platform), LXC 101 `hermes` (
|
|
8
|
+
Pulsar (`10.0.10.37`, Proxmox VE 9 on Debian 13, node name `pulsar`) runs every guest: VM 100 `arcane` (Docker platform), LXC 101 `hermes` (stopped and retired on 2026-11-01; the operator deletes it after 2026-12-01; never start it), LXC 102 `backup` (GCS pusher), VM 103 `identity` (Zitadel), VM 104 `dmz` (Pomerium), LXC 105 `tailscale`, VM 106 `observability`, LXC 107 `technitium2`, LXC 108 `radius`. Storage `local-lvm` holds the disks, `unas-backup` the vzdump archives. The `proxmox` tool talks to the API with a token whose role allows audit everywhere and, on guests, power, snapshots, and CPU/memory/option/network settings; nothing else. `["--help"]` lists the commands.
|
|
9
9
|
|
|
10
10
|
SPACE-X (`10.1.10.37`, Proxmox VE 9 at Mira, node name `space-x`) runs LXC 100 `technitium3` (DNS cluster node) and LXC 105 `tailscale` (Mira's subnet router). Put `space-x` before any command to run it there, for example `["space-x", "guests"]`; without it every command runs on Pulsar. SPACE-X has the same restricted user `spc-proxmox@pve!cortex` with its own token, and the same forced-command key as Pulsar. SPACE-X backs up every guest nightly at 02:30 (Dubai time) to storage `tesla-backup` on Mira's Synology TESLA; Pulsar's `mira-backup-pull` copies the archives to 37 at 05:00. `["space-x", "tasks"]` shows the vzdump runs.
|
|
11
11
|
|
package/skills/security/SKILL.md
CHANGED
|
@@ -5,7 +5,7 @@ description: How the security specialist reads Wazuh, CrowdSec, and the remote l
|
|
|
5
5
|
|
|
6
6
|
# Security specialist
|
|
7
7
|
|
|
8
|
-
VM 106 (`10.0.90.10`, VLAN 90) runs the Wazuh manager (container `observability-wazuh-manager-1`, agents `identity`, `arcane`, `dmz`, `CORTEX`, `NEXUS`, `
|
|
8
|
+
VM 106 (`10.0.90.10`, VLAN 90) runs the Wazuh manager (container `observability-wazuh-manager-1`, agents `identity`, `arcane`, `dmz`, `CORTEX`, `NEXUS`, `frontdoor-1337`, `tailscale`, and since 2026-11-01 `pulsar`, `synapse`, `technitium2`, `radius`, `backup`, `space-x`, `technitium3`, `tailscale-mira`), CrowdSec with its local API for the front-door bouncer, and rsyslog, which archives remote logs under `/var/log/remote/<host>/<program>.log` (14 days). The Discord bridge on Cortex reads Wazuh through this tool every two minutes and posts urgent alerts at once (level 11 or higher, and rules 100011, 100012, 100020, 100021; a deployment-file change that a GitOps commit or our own operation explains is not urgent), with Investigate and Acknowledge buttons for the owners; everything else goes into the Security Daily Report (06:00) and, on Mondays, the Security Weekly Report. The VM itself no longer posts to Discord. Two local CrowdSec scenarios matter: `37pla/pomerium-http-probing` (repeated Pomerium denials) and `37pla/frontdoor-sni-scanning` (rejected SNI at the VPS; bans escalate 4h, 24h, 7d, 30d, 90d). The home WAN address is whitelisted every five minutes; a scan test in August 2026 once banned it.
|
|
9
9
|
|
|
10
10
|
The `security` tool is read-only. Every call is a fixed command on the guest; `["--help"]` lists them.
|
|
11
11
|
|
|
@@ -54,7 +54,9 @@ The `security` tool is read-only. Every call is a fixed command on the guest; `[
|
|
|
54
54
|
| `arcane` | VM 100, Docker host | `astro.arcane` for containers |
|
|
55
55
|
| `identity` | VM 103, ZITADEL | `astro.identity` |
|
|
56
56
|
| `dmz` | VM 104, Pomerium and nginx | `astro.identity` |
|
|
57
|
-
| `
|
|
57
|
+
| `pulsar`, `space-x` | Proxmox hosts at 37 and Mira | `astro.proxmox` |
|
|
58
|
+
| `synapse`, `technitium2`, `technitium3` | the three DNS nodes | `astro.dns` (`technitium host <node>`) |
|
|
59
|
+
| `radius`, `backup`, `tailscale-mira` | LXC 108, LXC 102, SPACE-X LXC 105 | `astro.network` (RADIUS), `astro.backup`, none for the Mira router |
|
|
58
60
|
| `NEXUS` | Mac Studio | `astro.inference` |
|
|
59
61
|
| `CORTEX`, `tailscale` | Mac mini, LXC 105 | none; the operator |
|
|
60
62
|
|
package/specialists/README.md
CHANGED
|
@@ -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":
|
|
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
|
```
|
package/specialists/edge/run.ts
CHANGED
|
@@ -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
|
|
|
@@ -113,7 +113,7 @@ ${Object.entries(HOST_COMMANDS)
|
|
|
113
113
|
.map(([name, c]) => ` ${name.padEnd(35)} ${c.help}`)
|
|
114
114
|
.join("\n")}
|
|
115
115
|
|
|
116
|
-
Not available: create, clone, destroy, disk changes, host
|
|
116
|
+
Not available: create, clone, destroy, disk changes, host configuration. Those are operator tasks.`;
|
|
117
117
|
|
|
118
118
|
interface PveEnvelope {
|
|
119
119
|
data?: unknown;
|