Skip to content

ci(agent-backup): test-backup.sh (same-second collision + future-dated snapshot regressions) run by no workflow — backup.sh is inlined into a live systemd service #6178

Closed

Description

@dezren39

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-622 declares systemd.user.services.agent-backup plus a path watcher; at :590-591 the service's script is builtins.readFile ../../pkgs/agent-backup/backup.sh — the exact file the suite tests is the file that runs live.
  • Whole-tree grep for test-backup across .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: PASS and agent-backup future-dated PREV/latest regression: PASS, exit 0. The suite is fully offline and isolated (it stubs date, points HOME/AGENT_BACKUP_DIR at a mktemp -d tree).
  • What the 88-line suite pins, against the 119-line backup.sh:

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.sh on changes under pkgs/agent-backup/ (and ideally home/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

  1. added
    kind/ciCI/CD pipelines, workflows, and build automation
    task/triageQueue packet kind: verify, reproduce, and route this item
    source/creatorFiled by the new-issue-creator job
    on Nov 5, 2026
  2. developing-today commented on Nov 5, 2026

    @developing-today
    Contributor
  3. added
    priority/normalOrdinary priority (the default)
    app/agent-backupPackage/app: agent-backup (pkgs/ or apps/ in this repo)
    on Nov 5, 2026
  4. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · state: filed

  5. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 5, 2026
  6. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  7. 13 remaining items

  8. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  9. removed
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    on Nov 5, 2026
  10. added a commit that references this issue on Nov 5, 2026
  11. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/agent-backupPackage/app: agent-backup (pkgs/ or apps/ in this repo)kind/ciCI/CD pipelines, workflows, and build automationpriority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobsource/design-architectFiled by the repo design architect jobstatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions