Repository navigation
Description
Problem
pkgs/agent-backup/test-backup.sh — the only regression suite for pkgs/agent-backup/backup.sh — is run by no workflow, flake check, or justfile recipe. backup.sh is not dead code: it is inlined verbatim into a live systemd user service, so its snapshot/dedup logic runs on the laptop continuously, while the suite that pins its two worst historical bugs executes only when a human remembers to run it.
Evidence (verified this run, laptop primary @ f2a72d9, HEAD == origin/main)
home/common/default.nix:582-622declaressystemd.user.services.agent-backupplus a path watcher; at:590-591the service's script isbuiltins.readFile ../../pkgs/agent-backup/backup.sh— the exact file the suite tests is the file that runs live.- Whole-tree grep for
test-backupacross.github/workflows/,flake.nix,justfile, Nix files, and docs returns zero references. No automated check ever runs the suite. - Hand run on the laptop this run:
bash pkgs/agent-backup/test-backup.sh→agent-backup same-second collision regression: PASSandagent-backup future-dated PREV/latest regression: PASS, exit 0. The suite is fully offline and isolated (it stubsdate, pointsHOME/AGENT_BACKUP_DIRat amktemp -dtree). - What the 88-line suite pins, against the 119-line
backup.sh:- A second run in the same second gets its own
-0000000001directory and must not delete the first run's snapshot or leavelatestdangling — the regression suite for closed agent-backup: two runs in the same second share one snapshot dir — the second run can delete the first run's snapshot and leavelatestdangling #3340. - A future-dated snapshot must neither become the dedup baseline nor lose/regress the
latestpointer — the regression suite for closed agent-backup: PREV selection picks a future-dated snapshot — dedup compares against the wrong snapshot andlatestrepoints backwards #4602 (cases seeded with 2026/2027/2028 stamps). - A duplicate-content run removes only its own newly reserved directory and leaves
latestresolving to a real snapshot.
- A second run in the same second gets its own
Why it matters
Both pinned bugs were data-loss class: a same-second rerun could delete the previous snapshot, and a future-dated snapshot made dedup compare against the wrong baseline while latest pointed backwards. The backup service runs unattended via a path watcher; if either behaviour regresses, the failure mode is silently losing the very snapshots the service exists to keep — discovered only when a restore is needed. The suite exists, is fast, offline, and deterministic; it is simply never executed.
Acceptance criteria
- An automated check (a workflow step, flake check, or equivalent) runs
bash pkgs/agent-backup/test-backup.shon changes underpkgs/agent-backup/(and ideallyhome/common/default.nix's agent-backup unit). - The check asserts the suite file exists first, so a green run cannot be a silently skipped suite.
- The check passes on current main (both PASS lines at filing).
- Breaking a pinned behaviour (e.g. letting a same-second second run reuse/delete the first snapshot directory, or letting a future-dated snapshot become the dedup baseline) makes the check fail.
Activity
developing-today commentedon Nov 5, 2026
CODE-1792
dezren39 commentedon Nov 5, 2026
🤖 Agent note · state: filed
latestdangling #3340 same-second collision + agent-backup: PREV selection picks a future-dated snapshot — dedup compares against the wrong snapshot andlatestrepoints backwards #4602 future-dated snapshot regression suite) is run by no workflow/flake/justfile, while backup.sh is inlined into the live agent-backup systemd user service (home/common/default.nix:590-591). Verified by whole-tree grep (zero refs) plus a hand run on the laptop @f2a72d9478 (both PASS lines, exit 0, offline).dezren39 commentedon Nov 5, 2026
🤖 Agent note · picked up
13 remaining items
dezren39 commentedon Nov 5, 2026
🤖 Agent note · picked up
Merge pull request #6184 from developing-today/queue/9977-6178-agent-…
dezren39 commentedon Nov 5, 2026
🤖 Agent note · done