Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion doc/fleet-schedule-registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ preserved. OpenChamber scheduled tasks remain on the configured
`opencode-route` / `workhorse` route. The separate #3026 claimant /
executor remains on its own protocol.

### 2b. Laptop systemd user timers (48 listed: 43 enabled, 1 installed-but-disabled; 5 Nix-configured pending deployment)
### 2b. Laptop systemd user timers (49 listed: 43 enabled, 1 installed-but-disabled; 5 Nix-configured pending deployment; 1 declared in repo pending laptop install)

The OS-timer half of surface 2. Cadence is the unit's own `OnCalendar`/`OnUnitActiveUSec` spec, read live from `systemctl --user show`. Specs are recorded **complete** — the full effective calendar expression, date **and** time components (e.g. `*-*-* *:*:00`); never truncate a spec to a date-only prefix, because a bare `*-*-*` normalizes to daily at midnight and misstates the cadence (issue #5313). Prompt/brief pointer is the unit file in `~/.config/systemd/user/` (or its Nix store target for linked units). Installed-but-disabled timer units ARE listed in this table and marked `(disabled)` after the unit name: the registry inventories what is installed on the laptop, not only what is currently scheduled, so a disabled unit stays visible until it is uninstalled (reconciled 2026-11-04, issue #5661).

Expand All @@ -376,6 +376,7 @@ The OS-timer half of surface 2. Cadence is the unit's own `OnCalendar`/`OnUnitAc
| `git-maintenance@hourly.timer` | `OnCalendar=*-*-* 01..23:56:00` | `git-maintenance@hourly.service` | laptop (user systemd) | not recorded | not recorded | not recorded | 2026-11-04 |
| `git-maintenance@weekly.timer` | `OnCalendar=Mon *-*-* 00:56:00` | `git-maintenance@weekly.service` | laptop (user systemd) | not recorded | not recorded | not recorded | 2026-11-04 |
| `fleet-queue-backup-export.timer` (installed on the laptop 2026-11-22, #8584 live half) | `OnCalendar=*-*-* 02:15:00` + `RandomizedDelaySec=30m` | `fleet-queue-backup-export.service` | laptop (user systemd; code#8584) | not recorded | Disable if a scheduled export cannot verify its read-back counts; repair the cause (credentials, D1, schema) and rerun before re-enabling | 2026-11-22 | 2026-11-22 |
| `fleet-queue-backup-d1-home.timer` (declared in repo 2026-11-23, #13458; laptop install is part of that issue's live leg) | `OnCalendar=Sun *-*-* 03:40:00` + `RandomizedDelaySec=30m` | `fleet-queue-backup-d1-home.service` | laptop (user systemd; code#13458; mesh class D — D1 `fleet-queue-backup` export to Turso home `d1-backup-fleet-queue-backup`) | not recorded | Disable if a scheduled import cannot verify its counts; the previous import stays in the home — repair the cause (credentials, D1, Turso home) and rerun before re-enabling | 2026-11-23 | 2026-11-23 |
| `github-backup-drain.timer` | `OnCalendar=*-*-* *:00/5:00,OnBootUSec=3min` | `github-backup-drain.service` | laptop (user systemd) | not recorded | not recorded | not recorded | 2026-11-04 |
| `github-backup-fetch.timer` | `OnCalendar=*-*-* 00:00:00` | `github-backup-fetch.service` | laptop (user systemd) | not recorded | not recorded | not recorded | 2026-11-04 |
| `github-backup-r2.timer` (repo-shipped, not yet installed) | `OnCalendar=*-*-* 01:30:00` + `RandomizedDelaySec=30m` | `github-backup-r2.service` | laptop (user systemd; code#8584) | not recorded | Disable if any scheduled run cannot verify every planned R2 object; repair credentials or target and rerun before re-enabling | 2026-11-22 | 2026-11-22 |
Expand Down
30 changes: 26 additions & 4 deletions infra/fleet-queue-backup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,27 @@ decisions.
counts against the counts the export recorded in the copy's
`_fleet_queue_backup_meta` table.
- `bin/fq_common.py` — the shared clients and the dump builder.
- `bin/export_to_turso.py` — the reverse leg (backup mesh class D,
#13458): a weekly export of the `fleet-queue-backup` D1 database
into its dedicated Turso home `d1-backup-fleet-queue-backup`,
staged and wholesale-replacing, with the import record kept in
the home's `_d1_backup_home_meta` table. A failed import leaves
the previous import intact.
- `bin/restore_drill_d1_home.py` — the class-D acceptance drill:
rebuilds the D1 database from its Turso home into a local SQLite
file and verifies counts against the home's import record.
- `systemd/` — a daily user timer (`fleet-queue-backup-export.timer`,
02:15 + up to 30 min randomized delay) whose wrapper fetches the
credentials from Bitwarden by name at runtime. Install with
`systemd/install-units.sh` from a checkout on the laptop.
02:15 + up to 30 min randomized delay) and a weekly one
(`fleet-queue-backup-d1-home.timer`, Sundays 03:40) whose wrappers
fetch the credentials from Bitwarden by name at runtime. Install
with `systemd/install-units.sh` from a checkout on the laptop.
- `docs/RUNBOOK.md` — the restore path, the drill procedure, and the
freshness target.
- `tests/` — hermetic tests; sqlite3 is the oracle. Run:
`python3 -I tests/test_fq_common.py`,
`python3 -I tests/test_restore_drill.py`,
`python3 -I tests/test_export_to_turso.py`,
`python3 -I tests/test_restore_drill_d1_home.py`,
`bash systemd/test-export-arguments.sh`.

## Credentials
Expand All @@ -41,7 +53,9 @@ Environment only, fetched by name, never written down:
`turso.fleet-queue-rw-token` (export source) and
`cloudflare.api-token-account-wide` (D1). The restore drill takes a
token for its scratch target via `TURSO_TARGET_TOKEN` — never the
production queue token.
production queue token. The class-D leg takes the home's token via
`TURSO_HOME_TOKEN` (`turso.d1-backup-fleet-queue-backup-rw-token`,
minted when the home is provisioned; see the runbook).

## Status against #8584

Expand All @@ -50,3 +64,11 @@ This directory covers the Turso -> D1 leg. The repo legs live in
schedules). Still outstanding for #8584: the Cloudflare rehost leg
and the unified five-copy freshness/lag readout with automatic issue
filing; both are recorded on the issue.

## Status against #13458 (mesh class D)

The D1 -> Turso home leg's code, weekly units, and hermetic tests
are in this directory; the home database itself is provisioned in
that issue's live leg (create `d1-backup-fleet-queue-backup`, mint
its token into the vault, install the units, first verified import
+ drill), which is recorded on #13458.
Loading