vps-health-api/__tests__
le king fu 429ddda15a
All checks were successful
CI / verification (pull_request) Successful in 37s
fix(pg-backup-pull): cap the backups at 30 days from today, even on a failed pull
The privacy policy promises backup copies kept 30 days at most. The rotation
was anchored on the newest local backup and skipped on a failed pull, so when
pulls stopped, copies older than 30 days stayed for good.

The rotation now runs on every pass, anchored on today (UTC): it keeps today
and the 29 days before it and removes every older dated directory, the last
copy included (Max, 2026-10-24). The latest-anchored pass is gone: since
latest is never after today, it never removed anything the cap does not.
latest and files are counted after the rotation. A failed pull is still
reported pull_failed with exit 2, a rotation failure then only logged.
A dated symbolic link is neither removed (rm -rf link/ would empty its
target) nor counted.

Refs #71

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 21:15:58 -04:00
..
fixtures/claude-usage feat(agent): add the claude-usage agent: plan limits, local cache, push 2026-10-04 15:26:15 -04:00
agent-claude-usage.test.js feat(agent): one-shot backfill of the Claude usage history from local transcripts 2026-10-08 20:44:45 -04:00
agent-pg-backup-pull.test.js fix(pg-backup-pull): cap the backups at 30 days from today, even on a failed pull 2026-10-26 21:15:58 -04:00
agent.test.js feat(agent): push workstation metrics to /hosts/<id> from cron 2026-08-16 12:21:59 -04:00
auth.test.js feat(backups): GET /backups and POST /backups/pull 2026-10-10 19:43:07 -04:00
backups.test.js feat(backups): pass the files[] block of status.json through GET /backups 2026-10-12 20:04:12 -04:00
ci.test.js feat(backups): GET /backups and POST /backups/pull 2026-10-10 19:43:07 -04:00
claude-usage-history.test.js fix(server): archive by latest date, never a day past reception 2026-10-08 21:34:54 -04:00
claude-usage.test.js feat(backups): GET /backups and POST /backups/pull 2026-10-10 19:43:07 -04:00
findings.test.js feat(defenseurs): add GET /defenseurs/findings?project=X route 2026-05-12 20:56:56 -04:00
health.test.js refactor: extract CPU/RAM/disk collection into metrics.js 2026-08-16 11:30:03 -04:00
hosts.test.js fix(server): require a full ISO receivedAt on read, cover the temp-file cleanup 2026-10-07 20:25:26 -04:00
state.test.js feat(defenseurs): serve the Sergent's findings state at GET /defenseurs/state 2026-09-24 20:42:20 -04:00
writes.test.js feat(backups): GET /backups and POST /backups/pull 2026-10-10 19:43:07 -04:00