Files
dashboards/tests/fixtures/nut_apc.vars
T
ducoterra 28139df6d6 phase: 12_nut_self_test_verdict
Final state verified. Report:

**Verified (phase 12 — all 3 tasks already complete; this was the verification pass)**
- Re-ran the wire capture live: `ups.test.result` = `No test initiated` (apc) / `Done and passed` (cyberpower) — matches `LIVE_SELF_TEST_WORDS` + both fixtures; `/api/summary` has **no** self-test row, `/api/ups/snapshot` reads `cyberpower ok | Done and passed`, `apc unknown | …run a battery test`; both screenshots read back correct.
- Fixed a defect found in prior work while checking the "unrelated live noise" note: `NutMonitor.collect()` reused one upsd socket after a *partially-read* reply, so a 4 s stall produced bogus `expected 'BEGIN LIST VAR', got 'RW apc battery.charge.low "10"'` errors (same hazard on `INSTCMD`, where a late `OK` could be read as a different command's success). `NutClient` now marks a socket whose reply stopped early as `UNUSABLE`, naming the command that stalled; a complete `ERR …` line still leaves it usable (the per-UPS tolerance `collect()` depends on). +3 hermetic pins against the fake upsd; live re-check (09:33–09:44) now logs one line per stall, no cascade.

**Tests / lint / coverage (all green)**
- `bash .agents/validate.sh` → **exit 0**; `uv run pytest --cov --cov-fail-under=94` → **1172 passed, 11 skipped**, coverage **98.63 %** (floor 94); `uv run ruff check src tests agent` clean; `uv run pyright` 0 errors; `node --check` clean. Modified modules: `sources/nut.py` 95 %, `collectors.py` 97 % (no new line uncovered).
- `uv run pytest -m live --live` → **8 passed / 3 failed**, all three the pre-existing `driveripper` agent-transport failures AGENTS.md records (verified still true: unit `inactive`, no installed file, nothing on `:9120`).
- `./scripts/dev-server.sh status`: `nut ok`, `llm:* ok`, `host/disks:deskwork|gateway ok`; the two `driveripper` jobs DOWN.

**Completion criteria**
- Live capture recorded + asserts `ok` — met (re-confirmed from the wire today).
- `/ups` renders `ok`, overview silent, screenshots present — met.
- pytest / cov / ruff / pyright / validate — met (above).
- No other `health.checks[]` behaviour changed — met (diff confined to the `test_result` branch; all prior nut/ups-contract tests unmodified).

**Documentation**: README verified consistent (self-test wording, config table cross-checked against `config.py`, all documented commands/flags exist) — no changes needed beyond phase tasks' edit. AGENTS.md fixes: stale test count (1140 → 1172), `nvme0n1` power-on hours 19 158 → 19 160, gap 4 store-error claim corrected (last stored `store-error` 2026-10-18 06:33, none in the previous 24 h), new `collectors.py`/`sources/nut.py` socket-hygiene note, new gap-1 bullet on the upsd stall, plus live evidence appended to `data/logs/NOTES-self-test.md`.

**Deviations**: made no live *changes* (read-only probes only) — `driveripper`'s agent install needs root (`ops` has no installer/visudo grant) and a battery test stays the operator's call; the upsd 4 s stall itself is upstream-side. `uv pip list --outdated` still advisory (certifi/fastapi/starlette) — dependencies untouched this phase.

**Next pending phase**: `13_llm_page_and_decode_rate`.
2026-10-19 09:54:03 -04:00

76 lines
2.6 KiB
Plaintext

# Verbatim upsd reply (LIST UPS / LIST VAR / LIST CMD), recorded by
# ./scripts/capture-fixtures.sh — one `VAR`/`CMD` line per protocol line.
# Volatile values (ups.load, battery.runtime, the voltages) move every poll,
# so a diff here on re-capture is expected; the contract asserts shape, units
# and which variables the drivers omit, never those numbers.
UPS apc "APC Back-UPS RS 1500MS (USB)"
VAR apc battery.charge "100"
VAR apc battery.charge.low "10"
VAR apc battery.charge.warning "50"
VAR apc battery.date "2001/09/25"
VAR apc battery.mfr.date "2021/06/24"
VAR apc battery.runtime "621"
VAR apc battery.runtime.low "120"
VAR apc battery.type "PbAc"
VAR apc battery.voltage "27.3"
VAR apc battery.voltage.nominal "24.0"
VAR apc device.mfr "American Power Conversion"
VAR apc device.model "Back-UPS RS 1500MS"
VAR apc device.serial "SCRUBBEDSERIAL1 "
VAR apc device.type "ups"
VAR apc driver.debug "0"
VAR apc driver.flag.allow_killpower "0"
VAR apc driver.name "usbhid-ups"
VAR apc driver.parameter.interrupt_pipe_no_events_tolerance "-1"
VAR apc driver.parameter.pollfreq "30"
VAR apc driver.parameter.pollinterval "2"
VAR apc driver.parameter.port "auto"
VAR apc driver.parameter.productid "0002"
VAR apc driver.parameter.synchronous "auto"
VAR apc driver.parameter.vendorid "051d"
VAR apc driver.state "quiet"
VAR apc driver.version "2.8.5"
VAR apc driver.version.data "APC HID 0.101"
VAR apc driver.version.internal "0.71"
VAR apc driver.version.usb "libusb-1.0.30 (API: 0x0100010C)"
VAR apc input.sensitivity "medium"
VAR apc input.transfer.high "144"
VAR apc input.transfer.low "88"
VAR apc input.voltage "124.0"
VAR apc input.voltage.nominal "120"
VAR apc ups.beeper.status "enabled"
VAR apc ups.delay.shutdown "20"
VAR apc ups.firmware "952.e5 .D"
VAR apc ups.firmware.aux "e5 "
VAR apc ups.load "46"
VAR apc ups.mfr "American Power Conversion"
VAR apc ups.mfr.date "2021/01/08"
VAR apc ups.model "Back-UPS RS 1500MS"
VAR apc ups.productid "0002"
VAR apc ups.realpower.nominal "900"
VAR apc ups.serial "SCRUBBEDSERIAL1 "
VAR apc ups.status "OL"
VAR apc ups.test.result "No test initiated"
VAR apc ups.timer.reboot "0"
VAR apc ups.timer.shutdown "-1"
VAR apc ups.vendorid "051d"
CMD apc beeper.disable
CMD apc beeper.enable
CMD apc beeper.mute
CMD apc beeper.off
CMD apc beeper.on
CMD apc driver.killpower
CMD apc driver.reload
CMD apc driver.reload-or-error
CMD apc driver.reload-or-exit
CMD apc load.off
CMD apc load.off.delay
CMD apc shutdown.default
CMD apc shutdown.reboot
CMD apc shutdown.stop
CMD apc test.battery.start.deep
CMD apc test.battery.start.quick
CMD apc test.battery.stop
CMD apc test.panel.start
CMD apc test.panel.stop