Skip to content

atlas(#5670 §8): atlas-backup → fleet search backup verb (verify nix copy vs surviving shell original first) #14129

Backlog

Description

@developing-today-fleet

Slice of #5670 (§8 of the Scaler-era data architecture revision, design PR #5667).

Row: atlas-backup (laptop systemd unit; nix-declared 2026-10-30) → a fleet search backup verb or a fleet serve maintenance role. Nightly atlas.db snapshot → laptop backups + R2 + Drive, sha256-verified.

Precondition (from §8): first verify the flake/nix copy matches the surviving shell original (~/tmp/atlas-backup.sh on the laptop). Note the other surviving copy: hatch-personal/workspace/turso-atlas/scripts/atlas-backup.py (21 KB, 2026-10-28) — reconcile all three before designing the verb; if they disagree, record which is live on the laptop unit today.

Work: verification record on this issue; then implement the backup verb/role in the fleet binary with the same destinations and sha256 verification; switch the laptop unit over; retire the outside copies.

Acceptance: copy-reconciliation recorded; verb lands with a test; laptop unit runs the fleet path for one nightly cycle; outside copies marked retired; #5670 updated.

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-24T06:22:39Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": "/home/hatch",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/hatch",
      "repo": "developing-today/code",
      "branch": "main",
      "sha": "76bbec72135cee7bd837984b0cd283ae295766e0"
    },
    "auth_subject": "felix",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Acceptance criteria

  • The copy-reconciliation is recorded on this issue: nix/flake copy vs the surviving shell original vs the hatch-personal Python copy, naming which is live on the laptop unit today.
  • The fleet search backup verb (or fleet serve maintenance role) lands with a test, producing the nightly atlas.db snapshot to laptop backups + R2 + Drive with sha256 verification.
  • The laptop unit runs the fleet path for one full nightly cycle.
  • The outside copies are marked retired and migrate all Atlas/search/embedder scripts into developing-today/code + fleet binary; retire outside copies #5670 is updated.

Activity

  1. added
    task/small-fix
    epic/atlas-program
    on Nov 24, 2026
  2. developing-today commented on Nov 24, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Nov 24, 2026

    @dezren39
    Member

    Copy reconciliation (lane oc-code-08, task 21685):

    • Repo nixos/home/atlas-backup.sh on main matches the nix-store atlas-backup binary that the laptop atlas-backup.service executes (only the nix shebang/wrapper header differs). This is the live copy.
    • ~/tmp/atlas-backup.sh no longer exists on the laptop.
    • hatch-personal/workspace/turso-atlas/scripts/atlas-backup.py differs (29.6 KB, older). Treat as outside copy to retire once the verb lands.
    • Laptop unit state: last run failed with Result: timeout on 2026-11-23 06:28 CST; next timer 2026-11-24 04:59.
      Verb not started; parked until the next timer run is observed. Task 21685 claim parked with resume condition after 2026-11-25 04:59 CST.
  4. developing-today-fleet commented on Nov 25, 2026

    @developing-today-fleet
    ContributorAuthor

    agent-note:v1
    Agent: item-work-288
    Task: 21685
    State: claimed

    Resumed after the prior lane's timed park (oc-code-08's copy reconciliation stands: the nix copy in nixos/home/atlas-backup.sh is the live one; ~/tmp/atlas-backup.sh is gone; the hatch-personal Python copy is the outside copy to retire).

    Fresh observation the park was waiting for: the timer run it was parked to observe has now happened — and failed the same way. atlas-backup.service started 2026-11-24 04:58:20 CST and was killed at 06:28:20 CST with Result: timeout (1h30m wall, 3.1G memory peak), identical to the 2026-11-23 failure. The shell backup is timing out nightly, so waiting for another cycle only repeats a known failure; the fleet verb is the fix path.

    This lane's slice: implement the fleet search backup verb (same destinations + sha256 verification as the live script) with a test, land it by PR, then park this task for the laptop-unit switch-over plus one nightly cycle on the fleet path.

  5. added a commit that references this issue on Nov 25, 2026
  6. developing-today-fleet commented on Nov 25, 2026

    @developing-today-fleet
    ContributorAuthor

    agent-note:v1
    Agent: item-work-288
    Task: 21685
    State: slice-landed, parked for the switch-over

    Slice landed: PR #14906 (merged 4532657ef73c674536745a3d1e9cc0a9c08bba1c) — fleet search backup, a faithful port of the live atlas-backup shell routine into the fleet binary: same destinations (laptop root, R2 supabase-backups, Drive via rclone), sha256 verification at every destination, same manifest shape, dedupe against backup-log.md, rotation (newest 7 dates laptop + R2, newest 4 archives on Drive), same verdict/log formats and exit codes. Registry inventory + Fleet Book updated in the same PR.

    Verification (laptop worktree named fallback — CI runs on main only; an Actions exec session was started but its runner cannot reach this repo's branch, the recorded no-cross-repo-credentials gap, and was closed unused): cargo test -p fleet-search all pass, including the new contract test that runs the verb end-to-end against stub sqlite3/bws/rclone with the shell script's documented behaviour as oracle; cargo test -p fleet-registry pass; cargo check -p fleet --features search,search-serve pass; fmt clean.

    Acceptance status: copy reconciliation ✓ (prior lane, comment 7123982770) · verb lands with a test ✓ (this slice) · laptop unit runs the fleet path for one nightly cycle ✗ · outside copies marked retired ✗ · #5670 updated ✗.

    Wake protocol (task 21685 parked, not_before 2026-11-26T12:00:00Z): on wake —

    1. Check whether the laptop's deployed fleet binary carries the verb: fleet search backup --help on the laptop. If it does not (the verb merged 2026-11-25; the laptop binary updates via the fleet-static bootstrap pin), re-park naming the deploy as the blocker.
    2. Switch the unit: edit the atlas-backup declaration (nixos/home/laptop-backups.nix) so the service runs fleet search backup instead of the nix script package, land it by PR, and apply it on the laptop via the standing switch route.
    3. Observe one nightly cycle on the fleet path (timer ~05:01 CST): the run's verdict line + backup-log.md entry are the evidence; the shell script's nightly timeouts (2026-11-23 and 2026-11-24, both Result: timeout) are what the fleet path must not repeat.
    4. Mark the outside copies retired (the hatch-personal Python runner; the nix script stays in-tree as the port's source until the cycle proves, then retire it too), update migrate all Atlas/search/embedder scripts into developing-today/code + fleet binary; retire outside copies #5670, and close this issue.
  7. developing-today-fleet commented on Nov 26, 2026

    @developing-today-fleet
    ContributorAuthor

    Fresh resume check (2026-11-26, lane code-f):

  8. developing-today-fleet commented on Nov 27, 2026

    @developing-today-fleet
    ContributorAuthor

    Wake-protocol step 1 executed (2026-11-26, lane 2037-H):

    • Laptop channel is UP this run (fleet shell targets: laptop reachable via fleet laptop-agent) — the blocker lane code-f hit earlier today has cleared.
    • Deployed-binary check: fleet search backup --help on the laptop printed the generic fleet search help with no backup verb — the laptop's deployed fleet binary (fleet 0.1.0, source rev 74eee892e18e43e0d214f977de67b5ab9c7b8aef) does not carry the verb merged in PR fleet search: add the backup verb (atlas-backup port, #14129) #14906 (4532657ef73c674536745a3d1e9cc0a9c08bba1c, 2026-11-25).
    • Per the recorded wake protocol step 1: re-park naming the deploy as the blocker. No unit, host, or outside copy changed.

    Ready condition: the laptop's fleet-static bootstrap pin advances to a build containing PR #14906 and fleet search backup --help on the laptop shows the backup verb. Then resume at protocol step 2 (switch nixos/home/laptop-backups.nix to the fleet path by PR, apply via the standing switch route, observe one nightly cycle, retire outside copies, update #5670, close #14129).

    Acceptance status unchanged: copy reconciliation ✓ · verb lands with a test ✓ (PR #14906) · one nightly cycle on the fleet path ✗ (blocked on deploy) · outside copies retired ✗ · #5670 updated ✗.

  9. developing-today-fleet commented on Nov 28, 2026

    @developing-today-fleet
    ContributorAuthor

    Wake-protocol step 1 re-executed (2026-11-28 ~02:50Z, lane code-g):

    • Laptop channel is UP (fleet shell targets: laptop reachable via fleet laptop-agent).
    • Deployed-binary check: fleet search backup --help on the laptop still prints the generic fleet search help with no backup verb — deployed binary is still source rev 74eee892e18e43e0d214f977de67b5ab9c7b8aef, unchanged since the 2026-11-26/27 checks. PR fleet search: add the backup verb (atlas-backup port, #14129) #14906 (4532657e) is still not deployed.
    • Per protocol step 1: re-parked (task 21685, checkpoint + park recorded) naming the deploy as the blocker. No unit, host, or outside copy changed.

    Ready condition (unchanged): the laptop's fleet-static bootstrap pin advances to a build containing PR #14906 and fleet search backup --help on the laptop shows the backup verb. Then resume at protocol step 2.

    Acceptance status unchanged: copy reconciliation ✓ · verb lands with a test ✓ (PR #14906) · one nightly cycle on the fleet path ✗ (blocked on deploy) · outside copies retired ✗ · #5670 updated ✗.

  10. developing-today-fleet commented on Nov 28, 2026

    @developing-today-fleet
    ContributorAuthor

    Wake-protocol step 1 re-executed (2026-11-28 ~03:15Z, lane code-h):

    Ready condition (unchanged): the laptop's fleet-static bootstrap pin advances to a build containing PR #14906 and fleet search backup --help on the laptop shows the backup verb. Then resume at protocol step 2.

    Acceptance status unchanged: copy reconciliation ✓ · verb lands with a test ✓ (PR #14906) · one nightly cycle on the fleet path ✗ (blocked on deploy) · outside copies retired ✗ · #5670 updated ✗.

  11. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    ContributorAuthor

    Lane DRV-C3 — claim: copy-reconciliation record (the §8 precondition)

    Working the precondition + first deliverable of this issue: verify the flake/nix copy against the surviving shell original on the laptop and the hatch-personal Python copy, record which copy the live laptop unit runs today. The fleet backup verb itself is the follow-on slice. Key: DRV-C3

  12. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    ContributorAuthor

    Lane DRV-C3 — copy-reconciliation record (the §8 precondition, executed 2026-11-29)

    All three copies checked firsthand today, plus the live unit and the fleet verb:

    1. The shell original (~/tmp/atlas-backup.sh on the laptop) — GONE. Verified absent via laptop-agent 2026-11-29 (~/tmp holds only probe logs). No diff against it is possible anymore; the nix copy's own header is the surviving record of the migration.

    2. The nix copy — LIVE. nixos/home/atlas-backup.sh (15,186 bytes, git blob 36d219ae), vendored by nixos/home/laptop-backups.nix (atlasPkg = writeShellScriptBin "atlas-backup", user service atlas-backup, ExecStart = that package, line 335). Behaviour: sqlite3 .backup snapshot → deterministic gzip → the SAME bytes to laptop ~/backups/atlas/<DATE>/, R2 supabase-backups key atlas/<DATE>/, Drive Cloud/cold-store/db-backups/local-atlas/; every offsite copy sha256-verified; content-hash dedupe; rotation 7 dates laptop+R2 / 4 Drive. Live proof: atlas-backup.timer enabled, last ran 2026-11-28 05:00 CST, next 2026-11-29 04:52 CST; ~/backups/atlas/backup-log.md shows 2026-11-27 and 2026-11-28 verdicts (UNCHANGED, sha256 443c2864…, size 494,902,439).

    3. The Python copy — SUPERSEDED, still on disk. dezren39/hatch-personal workspace/turso-atlas/scripts/atlas-backup.py, now 29,612 bytes (sha256 b5169c2f…; the issue's 21 KB figure is stale). Per the nix header it was the pre-2026-10-30 implementation (sandbox cron snapshotting over SSH); the laptop-native shell copy replaced it. It is not what runs.

    4. The fleet verb — ALREADY LANDED. pkgs/fleet/crates/fleet-search/src/backup.rs (40,560 bytes, on main) implements fleet search backup as a faithful port of the nix shell original — same destinations, sha256 verification, dedupe, rotation, verdict lines and exit codes — with tests in-file. Its header names this issue.

    Remaining for acceptance: (a) switch the laptop unit's ExecStart from the shell package to fleet search backup (one-line change at nixos/home/laptop-backups.nix:335 + laptop deploy) and let it run one nightly cycle; (b) mark the Python copy retired in hatch-personal; (c) update #5670. The reconciliation precondition itself is now satisfied and recorded. Key: DRV-C3

  13. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    ContributorAuthor

    Lane 0640-T claim (2026-11-29). Taking the landable remainder of #14129 after DRV-C3's reconciliation record: (a) the code half of the unit switch — nixos/home/laptop-backups.nix atlas-backup ExecStart from the shell package to fleet search backup (the laptop deploy + one nightly cycle ride the next rebuild, as with the other calendar-gated landings); (b) mark the superseded Python copy retired in hatch-personal; (c) note the state on #5670. Re-reading comments after this post to confirm no sibling claimed in the same window.

  14. 1 remaining item

  15. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    ContributorAuthor

    Census 2026-11-29 (lane CEN-C14)

    Verified firsthand (body + all comments). State: the copy reconciliation landed on this issue today (2026-11-29): the shell original is gone from the laptop's ~/tmp; the nix copy is the LIVE one (ExecStart + enabled timer); the Python copy is superseded; and the fleet verb this issue asked for already exists on main (pkgs/fleet/crates/fleet-search/src/backup.rs, with the #14079 backup-safety contract as its tests). The remainder was claimed today (lane 0640-T): the unit ExecStart switch (code half, in nixos/home/laptop-backups.nix), the Python-copy retirement, and the #5670 note — plus one nightly cycle on the fleet path as the cutover proof.

    Blockers: none. Census action: added priority/normal. Verdict: ready (remainder claimed and in flight).

  16. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    ContributorAuthor

    Lane 0640-T progress — #14129 remainder landed as PRs (2026-11-29).

    Verification evidence:

    • nix-instantiate --parse on the edited module: OK.
    • deploy flake checks workflow on the branch (run 46271600692) fails at eval with the bws unfree-license refusal — and unmodified main fails identically (run 46272269260, same error): a pre-existing CI break in that workflow, not caused by this change; filed as code#16820.
    • The targeted eval (nix eval .#nixosConfigurations.amd.…atlas-backup.Service.ExecStart) is dispatched as fleet-command run 46272965401; the executor's target-selection step is currently stalled fleet-wide (three consecutive dispatches sat in "Select execution target" for 7–27 min; the first two were cancelled). The run is left in place — its log will carry NIX-PARSE-OK + EVAL-OK + the store-path ExecStart when placement recovers. Felix: please read that run before merging laptop-backups: run atlas-backup via fleet search backup #16813.

    Still remaining on #14129 after #16813 merges: the laptop deploy (rides the next rebuild) and one nightly cycle on the verb; then this issue closes.

  17. added
    kind/infrastructure
    app/atlas-search
    effort/m
    on Nov 29, 2026
  18. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    ContributorAuthor

    Issue census — 2026-11-29

    Gaps found

    • No kind/* label, no app//area/ label, no effort/* label at census time.
    • Acceptance existed only as an inline Acceptance: line, not as an ## Acceptance criteria section.

    Strengths

    • Body names the precondition (three-way copy reconciliation) before any design work, with exact paths and dates.
    • Live lane work today: lane 0640-T recorded remainder PRs landing (2026-11-29) — this census made only metadata/body-append fixes and did not touch the lane's in-flight code work.

    Actions taken by this census

    • Labels added: kind/infrastructure, app/atlas-search, effort/m.
    • Appended an ## Acceptance criteria section to the body (original text unchanged).
  19. added
    kind/feature
    on Nov 29, 2026
  20. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    ContributorAuthor

    Census 2026-11-29 (Felix): rechecked in full (body, labels, comments, edges).

    STRENGTHS: The precondition is handled the way it should be: before designing the verb, reconcile all THREE surviving copies (the flake/nix copy, the laptop's ~/tmp/atlas-backup.sh shell original, and the hatch-personal atlas-backup.py) and record which is live on the unit today. That reconciliation was executed today (lane DRV-C3's record, 2026-11-29), and a felix lane (0640-T) has claimed the landable remainder — the code half of the unit switch (nixos/home/laptop-backups.nix ExecStart) plus the verb work.

    GAPS: No priority/* and no kind/* label.

    FIXES I APPLIED: Added priority/normal (default band) and kind/feature.

    REMAINS: Nothing for Drewry.

  21. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    ContributorAuthor

    Lane 0922-F (delta PRESS, 2026-11-29): remainder (a) landed — PR #16813 merged 2026-11-29T15:49:13Z (merge 1558e29). The atlas-backup unit now runs fleet search backup; the vendored shell package stays as rollback until one nightly cycle has run on the verb. Verified pre-merge: full diff read against purpose; pkgs/fleet/crates/fleet-search/src/backup.rs present on main with the sha256/dedupe/rotation contract; fleetPkgs callPackage pattern matches home/common/default.nix.

  22. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    ContributorAuthor

    🤖 Agent note · Felix lane 0640-AN (worker felix), 2026-11-29 — verification evidence for PR #16813 / hatch-personal PR #162 (both now merged), from fleet-command run 46272965401 (ran against PR head 7109b8c, the exact head that merged).

    Read the full Execute-step log firsthand. Mixed result — NOT a clean pass:

    • NIX-PARSE-OK printed as real command output (15:25:55Z) — the parse leg passed.
    • The eval leg did NOT print its success marker. Instead the log ends the command output with error: cannot coerce a list to a string: [ "/nix/store/b3s1dcmx47s586ald4d76h0sb9kmfg43-fleet-0.1.0/bin/fleet search backup" ] (…while generating the eval command output) followed by VERIFY-FAIL (15:27:42Z).
    • The Actions step nevertheless concluded success (the marker scheme did not propagate the failure to the exit code), so the run shows green at run level while its own verdict line is VERIFY-FAIL.

    So: parse verified; the systemd-unit eval leg failed as designed-or-written (either the evaluated attribute is genuinely list-valued in the merged module, or the eval expression needs a list-aware form). This needs a follow-up look before the laptop-rebuild acceptance treats the eval leg as proven. Recording here; no claim on the remainder (laptop rebuild acceptance).

  23. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    ContributorAuthor

    Claim — Felix lane 0640-DP (2026-11-29). Taking the #14129 eval-leg follow-up left open by lane 0640-AN's evidence note (16:18Z): determine whether the merged module's evaluated ExecStart is genuinely list-valued (normal for systemd units) or the eval expression needs a list-aware form, then produce a passing eval verification against current main whose failure would actually propagate (no swallowed VERIFY-FAIL). Laptop-rebuild acceptance itself stays with Felix/Drewry; this lane covers the eval-leg evidence only.

  24. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    ContributorAuthor

    Eval-leg diagnosis + corrected run dispatched — Felix lane 0640-DP.

    Recovered lane 0640-AN's original command from run 46272965401's log firsthand: the eval leg used nix eval …Service.ExecStart --raw. ExecStart in the merged module is genuinely list-valued — the error's own payload shows the value is exactly [ "/nix/store/…-fleet-0.1.0/bin/fleet search backup" ], the correct one-element list for a systemd unit. So the module is sound; the eval expression needed a list-aware form (--raw coerces to string), and AN's || echo VERIFY-FAIL shape swallowed the failure into a green step.

    Corrected verification dispatched as fleet-command run 46313300869 against current main: same parse leg, then nix eval …ExecStart --json, prints the JSON, and greps it for bin/fleet search backup as the final command in an && chain — under bash -e any failure now fails the step. Verdict follows when the run finalizes.

  25. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    ContributorAuthor

    🤖 Agent note · Felix lane 0640-DP (worker felix)

    Verdict — the eval leg of this issue's verification is discharged, and the 0640-AN "VERIFY-FAIL" was an eval-expression artifact, not a module defect.

    Run 46313300869 (fleet-command against developing-today/code main, completed success; full log read):

    • NIX-PARSE-OK — nixos/home/laptop-backups.nix parses.
    • EXECSTART-JSON: ["/nix/store/4lzl2wwky20p8h0mwjyc9y000v3yqni5-fleet-0.1.0/bin/fleet search backup"] — the atlas-backup unit's ExecStart evaluates, with --json, to exactly the correct one-element systemd command list: the fleet search backup invocation from the fleet package.
    • EVAL-OK-14129 — the grep gate over that JSON passed.

    Diagnosis of the earlier failure (lane 0640-AN, run 46272965401): the eval used --raw against Service.ExecStart, which is genuinely list-valued in systemd's home-manager schema — Nix refuses --raw on a list ("cannot coerce a list to a string"). The module was sound all along; the expression needed the list-aware --json form. The run's || echo VERIFY-FAIL shape then converted that expression error into a green step with a scary marker — the exact swallow-shape the fleet-command verification doctrine now bans.

    Scope note: this discharges only the eval-leg follow-up I claimed. The issue's full acceptance — the laptop-rebuild verification on amd-6 (this seat cannot reach the laptop; queue/shell legs down, #16762) — stays with Felix/Drewry and the calendar gate on the next rebuild, unchanged.

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/atlas-searcheffort/mepic/atlas-programkind/featurekind/infrastructurepriority/normalstatus/in-reviewtask/small-fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions