Add AGENTS.md and align the docs with the code

The brief asked for an AGENTS.md capturing the overall plan and it never
landed, while two files already pointed readers at it. It now holds the
invariants (read-only by construction, never invent a number,
unconfigured is not broken, no CDN, no guessed metric names), the locked
decisions with their reasons, the verified fleet facts, the commands, and
the four known gaps.

Also corrected the docs that had drifted:
- upsd config lives in /etc/ups on driveripper, not /etc/nut, and the
  real blocker is that upsd binds nothing on 3493 — with the sudo rules
  still needed written down in deploy/nut-sudoers.
- .env.example told operators to set `LISTEN 0.0.0.0` and `actions = -`;
  both are worse than needed. Loopback + ssh forward, and per-command
  instcmds instead of granting load.off.
- nut.py claimed the command path is gated three times and that the
  confirmation asks for the UPS name; it is gated four times and asks
  for DANGER.
- .gitignore described a tracked .agents/ roadmap that does not exist.

LLM-Generated: true
This commit is contained in:
2026-10-16 18:54:35 -04:00
parent 426682a999
commit 87042f8855
8 changed files with 347 additions and 17 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
"""Homelab dashboards: system resources, LLM engines, and UPS battery health.
One FastAPI app, one domain, one SQLite file. See AGENTS.md for the rules and
.agent(s)/PLAN.md for the locked decisions.
One FastAPI app, one domain, one SQLite file. See AGENTS.md (repo root) for the rules,
the locked decisions, the fleet facts, and the known gaps.
"""
from .config import SETTINGS
+3 -2
View File
@@ -6,8 +6,9 @@ and the protocol is a line protocol with ~10 commands. So: talk to upsd on 3493
Reading is unauthenticated in stock NUT (`LIST UPS` / `LIST VAR`), so the dashboard works
with a read-only upsd. Instant commands (the battery-test buttons) require a user with
`actions` in upsd.users — that is the ONLY write path in this whole application, and it is
gated three times: `NUT_ALLOW_ACTIONS`, not `DASH_READ_ONLY`, and a confirmation in the UI
(destructive ones require typing the UPS name).
gated four times: `NUT_ALLOW_ACTIONS`, not `DASH_READ_ONLY`, an upsd.users account that
actually has the command, and a confirmation in the UI (the ones that can cut power require
typing `DANGER`; see `ACTION_CATALOG` and `available_commands`).
Verified against NUT 2.8.5 (`/usr/bin/upsc` on driveripper). Protocol shape: