Repository navigation
Description
atlas-backup: filed-snapshot log parser never matches the script's own OK lines — dedupe dead, keep-7 rotation collapses to keep-1
Found during the 2026-11-01 R2 review (developing-today/code nixos/home/atlas-backup.sh).
Root cause. The parser that rebuilds LAST_SHA / FILED_DATES from ~/backups/atlas/backup-log.md only counts a line as filed when the third | field starts with OK:
if len(parts) >= 3 and "sha256" in parts[1] and parts[2].startswith("OK"):But on full success the script itself writes:
log_line "sha256=$DIGEST | ok laptop/r2/drive | size=$SIZE | counts $COUNTS_CSV"
i.e. the third field is lowercase ok laptop/r2/drive — it never starts with OK. The parser was carried over from the old runner's log format (see the "old runner's last_filed rule" comment) and never matched the new writer.
Verified live effects (2026-10-31 → 2026-11-01).
- Dedupe never fires (
LAST_SHAalways empty): the 2026-10-31 and 2026-11-01 runs have identical digest/size/counts (sha256=38bc8c55…, 492,009,626 B, sessions:18325, messages:122124, chunks:107639) yet both ran all three legs in full — 492 MB re-uploaded to laptop + R2 + Drive for an unchanged database. - Rotation keep-set collapses to just today:
ALL_DATES=FILED_DATES(always empty) + today, soKEEP_SET= {today}. The 2026-11-01 run purged the 2026-10-31 artifacts from the laptop dir and from R2 (supabase-backups/atlas/holds only2026-11-01/), silently degrading the declared keep-7 to keep-1 on those legs. The Drive leg (filename-based rotation) is unaffected, so no data was ultimately lost — this time.
Fix options. Make the parser accept the emitted format (or make the writer emit a third field starting with OK), and add a regression test in the style of the sibling *.test.sh backup tests: two consecutive runs over an unchanged DB must produce a skipped second run and a keep-set containing both dates. Also worth asserting the R2 date-dir set after rotation in the test.
Acceptance criteria
- The filed-snapshot parser matches the lines the script actually writes (or the writer emits the format the parser expects — one canonical format, both sides).
- Dedupe fires: two consecutive runs over an unchanged database produce a skipped second run (no 492 MB re-upload).
- Keep-7 rotation holds on the laptop and R2 legs: after a run, the retained date set contains the last 7 filed dates, not just today.
- A regression test in the sibling
*.test.shstyle covers both: unchanged-DB second run is skipped, and the post-rotation date-dir set (including R2) matches the keep set.
Activity
dezren39 commentedon Nov 1, 2026
Intake review
Related: the sibling backup issues from the same R2 review (code issue #3915, #3914, #3860) share the backup-tooling surface but are independent fixes.
Notes: Root cause is already pinned in the issue: the parser requires the third
|field to start withOK; the writer emits lowercaseok laptop/r2/drive. Verified live 2026-10-31 → 2026-11-01: identical digest re-uploaded in full, and the R2 atlas prefix was purged down to a single date.Risks: Until fixed, every run risks purging the previous day's R2/laptop artifacts (keep-1 instead of keep-7) — the Drive leg's filename-based rotation is currently the only intact retention. Fix the parser before the next scheduled run if possible.
Suggested approach: Make the parser accept the emitted format (defensive: accept both the legacy
OKand currentok …forms), add the two-run regression test, and state the canonical log format in a comment at both the writer and the parser.— fleet monitor intake enrichment, 2026-11-01 run (protocol §5). Acceptance criteria appended to the body where missing; labels normalized.
developing-today commentedon Nov 3, 2026
agent-note:v1
state: reviewed (coverage loop-back)
Coverage pass 2026-11-03, loop-back review: this issue was re-reviewed (drift / overlap / already-handled / stale / blockers / ordering) so every open issue in the four repos is reviewed and in the system. Verdict: still live; in the system as task 7419 (triage, queued, priority 50) in repo-health-code-pilot. Labels audited and synced. If it is already handled at current main, its triage closes it with evidence; if oversized, the triage files the split; blockers belong on this issue.
Found via: coverage loop-back 2026-11-03
30 remaining items
dezren39 commentedon Nov 4, 2026
🤖 Agent note · blocked
~/tools/laptop-ssh.shis absent; the available~/hatch/tools/laptop-ssh.shfails becauseHTTPS_PROXYis unset, and the expected proxy connector is not installed at its referenced path.queue/8941-3913-atlas-backup-parser//home/user/git/fleet/queue-8941-3913-atlas-backup-parser.dezren39 commentedon Nov 12, 2026
🤖 Agent note · picked up
/home/user/git/fleet/queue-8941-3913-atlas-backup-parserand task branch are absent from the current local worktree/branch inventory. Existing unrelated worktrees and primary-clone edits are preserved.dezren39 commentedon Nov 12, 2026
🤖 Agent note · done — PR opened
Fixes #3913; CI is pending.bash nixos/home/atlas-backup.test.sh,bash -n nixos/home/atlas-backup.sh nixos/home/atlas-backup.test.sh,bash nixos/home/openclaw-backup.test.sh, andbash nixos/home/pm-dashboard-backup.test.shall pass;git diff --checkpasses.