fix(nas-storage-health): probe the directory the bot service's backup publishes to (#10) #23

Manually merged
bryan merged 2 commits from nas-probe-pi-bots-dir into main 2026-11-11 17:58:01 +00:00
Owner

Follow-up to N10.5 (#10, #14).

What

Studio's NAS write probe (services.nas-storage-health.shares.Bryan.directory) now writes in Backups/pi-bots, taken from services.pi-bots-backup.destDir, instead of Backups. The probe now checks the directory the bot service's nightly backup publishes to, which is what NasWriteProbeFailed should speak for. The two can't drift apart, because the probe reads the option. The probe's file (.nas-write-probe.<pid>) never matches the backup's stamp or .partial-<stamp> names, and the probe removes it before it exits.

Tests

scripts/test_nas_storage_health.py: the agent's arguments name Backups/pi-bots (main's host file fails that test), and a changed destDir moves the probe with it (a hardcoded path fails that one). test_pi_bots_backup.py passes. The built probe script, run by hand with the agent's environment against the live share and the new directory: nas_write_probe_success 1, and it left no file behind. darwin-rebuild build --flake .#studio builds.

After update-system

Within 10 minutes nas_write_probe_success{share="Bryan"} is 1 on the new directory.

Review

A visible Pi reviewer found one should-fix (wording in this description) and three nits: the option link was untested; both modules' directory assertions accept a trailing slash (pre-existing, left); the host comment claimed slightly more than the code does. All fixed except the pre-existing one.

Follow-up to N10.5 (#10, #14). ## What Studio's NAS write probe (`services.nas-storage-health.shares.Bryan.directory`) now writes in `Backups/pi-bots`, taken from `services.pi-bots-backup.destDir`, instead of `Backups`. The probe now checks the directory the bot service's nightly backup publishes to, which is what `NasWriteProbeFailed` should speak for. The two can't drift apart, because the probe reads the option. The probe's file (`.nas-write-probe.<pid>`) never matches the backup's stamp or `.partial-<stamp>` names, and the probe removes it before it exits. ## Tests `scripts/test_nas_storage_health.py`: the agent's arguments name `Backups/pi-bots` (main's host file fails that test), and a changed `destDir` moves the probe with it (a hardcoded path fails that one). `test_pi_bots_backup.py` passes. The built probe script, run by hand with the agent's environment against the live share and the new directory: `nas_write_probe_success` 1, and it left no file behind. `darwin-rebuild build --flake .#studio` builds. ## After `update-system` Within 10 minutes `nas_write_probe_success{share="Bryan"}` is 1 on the new directory. ## Review A visible Pi reviewer found one should-fix (wording in this description) and three nits: the option link was untested; both modules' directory assertions accept a trailing slash (pre-existing, left); the host comment claimed slightly more than the code does. All fixed except the pre-existing one.
Studio's write probe now writes in pi-bots-backup's destDir (Backups/pi-bots)
instead of Backups, taken from that option, so the probe checks the place the
running backup actually writes.
bryan manually merged commit 2704cecec2 into main 2026-11-11 17:58:01 +00:00
Sign in to join this conversation.
No reviewers
No labels
ready-for-agent
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bryan/nix-configs!23
No description provided.