Skip to content

ADR-102 P6a: purge confirmed-dead backup/restore code#487

Merged
aaronsb merged 2 commits into
mainfrom
adr-102-p6-deadcode-purge
Jun 1, 2026
Merged

ADR-102 P6a: purge confirmed-dead backup/restore code#487
aaronsb merged 2 commits into
mainfrom
adr-102-p6-deadcode-purge

Conversation

@aaronsb
Copy link
Copy Markdown
Owner

@aaronsb aaronsb commented Jun 1, 2026

First slice of P6 (the LAST ADR-102 spine phase) — the safe, confirmed-dead-code purge. Each item was verified to have no live caller before deletion. The larger P6 chunks (B restitching→port migration, C validator consolidation, D serialization.py split, E ADR-015/age_ops) are deferred to a planning doc.

Removed (−368 lines, all verified uncalled)

  • integrity.py: BackupAssessment + print_assessment (read the removed v1 data['data'] shape; only a comment referenced it). DatabaseIntegrity (the live runtime half — used by backup_streaming/archive/routes/admin CLIs) stays.
  • admin_service.py: create_backup / restore_backup (DEAD subprocess methods spawning the stale src.admin.* path; live path is create_backup_stream / run_restore_worker) + the now-orphaned _extract_backup_file_from_output + unused imports.
  • models/admin.py: BackupResponse / RestoreRequest / RestoreResponse (only users were the dead methods; stale imports in the route), taking the stale overwrite / handle_external_deps / external_deps_handled fields.
  • routes/admin.py: the 3 stale model imports.
  • CLI types: RestoreResponse.external_deps_handled (dead since P4 --mode).

Verification

API loads clean (imports resolve), CLI builds, focused admin/backup/restore/integrity/epoch suite (133 pass), full suite 1330 pass / 16 skip / 1 fail (pre-existing vision-config dev-DB pollution, unrelated).

aaronsb added 2 commits June 1, 2026 17:21
Removes superseded code verified to have no live callers (the safe-purge slice of
P6; B/C/D/E — restitching migration, validator consolidation, serialization.py
split, ADR-015/age_ops — deferred to a planning doc):

- api/lib/integrity.py: deleted BackupAssessment + print_assessment (read the
  removed v1 data['data'] shape; only a comment referenced it). DatabaseIntegrity
  (the live runtime half) stays. Module docstring updated.
- admin_service.py: deleted create_backup / restore_backup (DEAD subprocess methods
  spawning the stale src.admin.* path; no callers — the live path is
  create_backup_stream / run_restore_worker) + the now-orphaned
  _extract_backup_file_from_output + unused imports (subprocess, BackupResponse,
  RestoreResponse, BackupIntegrityAssessment).
- models/admin.py: deleted BackupResponse / RestoreRequest / RestoreResponse (only
  users were the dead admin_service methods; stale imports in routes/admin.py),
  taking the stale overwrite/handle_external_deps/external_deps_handled fields.
- routes/admin.py: removed the 3 stale model imports.
- cli types: removed RestoreResponse.external_deps_handled (dead since P4 --mode).

Net -368 lines. Full suite 1330 pass / 16 skip / 1 pre-existing-unrelated fail.
#487 review)

Code review found BackupIntegrityAssessment had its last importer (admin_service)
removed in this PR, leaving it defined-but-unreferenced repo-wide. Same purge.
(The TS BackupResponse/RestoreRequest/RestoreResponse interfaces noted by review
are deferred to the P6 planning doc — possible P6b.)
@aaronsb aaronsb merged commit 1a25ae5 into main Jun 1, 2026
4 checks passed
@aaronsb aaronsb deleted the adr-102-p6-deadcode-purge branch June 1, 2026 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant