Files
ServerKit/backend/app
Juan DenisandClaude Opus 4.8 f357742d80 refactor(unify): §8 Phase B2 — database + files executors in policy service
Folds the legacy BackupService database/files capabilities into the unified
BackupPolicyService so one policy/run system performs every backup kind.

- _resolve_target() now handles database (connection descriptor from
  target_meta + target_subtype engine), files (path list), and rejects
  server (not yet implemented) with a clear message.
- _execute_backup() routes database → BackupService.backup_database and
  files → BackupService.backup_files, building consistent run metadata
  (kind=full, includes, primary_archive).
- Restore: _restore_database (symmetric with restore_database) and
  _restore_files (safe extract into a restores/ staging dir, never blind
  overwrite of a basename-only path-list archive); run_restore_job dispatches
  by target_type.

Note: remote-copy upload still applies to dir-based runs (app/WP); single-file
database/files runs are local-only for now (documented follow-up).

Verified: 8 new executor tests (BackupService mocked) + B1 + existing
backup-protection suite pass (26 passed, 2 skipped).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 14:19:32 -04:00
..