Skip to content

chore(adr-102): purge superseded admin CLIs + dead reset path (P6b)#488

Merged
aaronsb merged 2 commits into
mainfrom
chore/adr-102-p6b-purge-legacy-admin-clis
Jun 1, 2026
Merged

chore(adr-102): purge superseded admin CLIs + dead reset path (P6b)#488
aaronsb merged 2 commits into
mainfrom
chore/adr-102-p6b-purge-legacy-admin-clis

Conversation

@aaronsb
Copy link
Copy Markdown
Owner

@aaronsb aaronsb commented Jun 1, 2026

ADR-102 P6b — legacy admin-CLI + dead-reset purge

Part of P6, the last ADR-102 spine phase (cleanup). Follows P6a (#487, the safe
dead-code purge). Verified-in-code, scoped strictly to the backup/restore spine
supersession (decision gated with maintainer: option 1 + delete the reset pair).

What & why

The ADR-102 API + worker spine supersedes the old standalone admin CLIs. None of
the deleted files had any automated caller (no .sh / Dockerfile / operator.sh
invocation — only standalone python -m api.admin.* entry points carrying stale
src.admin.* docstrings that don't even match the real api/admin/ path).

Deleted:

  • api/admin/{backup,restore,stitch}.py — superseded by the streaming /admin/backup
    route + restore_worker.
  • api/lib/restitching.py (legacy ConceptMatcher) — only importers were stitch.py
    • restore.py. The live integration-mode engine is api/app/lib/concept_matcher.py
      (the canonical two-tier port).
  • api/admin/reset.py + admin_service.reset_database + the
    ResetRequest/ResetResponse/SchemaValidation models. Reset was one of the
    earliest worker functions and is dangerous in the current architecture; the API
    reset route was already retired and the only importer of ResetManager was the
    dead reset_database method. Database reset is now an operator-level concern.
  • The dead skipped test for the removed /admin/reset endpoint.

Kept: api/admin/{prune,check_integrity}.py — adjacent operator utilities not
superseded by the backup/restore spine (they use age_ops + integrity, both live).

Fixed: stale doc/comment references to the removed files (concept_matcher.py
header, routes/admin.py import comment, models/admin.py docstring).

No legacy backup/restore compatibility is retained from before this implementation cycle.

Impact

~2032 lines removed; 12 added. No production code paths reference the deleted symbols.

Tests

  • test_endpoint_security.py, test_backup_streaming.py, test_restore_modes.py — 62 passed, 1 skipped
  • ADR-102 slice (kg_backup_v2 / reader / id_remap / lane_control / restore_worker_epoch / kg_backup_v2_restore / epoch_reconciliation / backup_integrity) — 74 passed
  • Full-app import smoke (import api.app.main) — OK

🤖 Generated with Claude Code

aaronsb added 2 commits June 1, 2026 17:40
Remove the legacy backup/restore admin CLIs that the ADR-102 API+worker spine
supersedes, plus the dead database-reset path:

- Delete api/admin/{backup,restore,stitch}.py — superseded by the streaming
  /admin/backup route + restore_worker; zero automated callers (only standalone
  python -m api.admin.* entry points with stale src.admin.* docstrings).
- Delete api/lib/restitching.py (legacy ConceptMatcher) — its only importers
  were stitch.py + restore.py. The live integration-mode engine is
  api/app/lib/concept_matcher.py (the canonical two-tier port).
- Delete api/admin/reset.py + admin_service.reset_database + the
  ResetRequest/ResetResponse/SchemaValidation models. Reset was one of the
  earliest worker functions and is dangerous in the current architecture; the
  API reset path was already retired (route removed) and the only importer of
  ResetManager was the dead reset_database method. Database reset is now an
  operator-level concern, not an API/worker operation.
- Drop the dead skipped test for the removed /admin/reset endpoint.
- Fix stale doc/comment references to the removed files.

Keep api/admin/{prune,check_integrity}.py — adjacent operator utilities not
superseded by the backup/restore spine (they use age_ops + integrity, both live).

No legacy backup/restore compatibility is retained from before this cycle.

~2032 lines removed. All ADR-102 + admin/security test slices green.
The Phase-2 require_role docstring used /admin/reset / reset_database as its
illustrative example; that endpoint was retired in this PR. Point it at the
live /admin/backup route instead. Cosmetic (placeholder decorator, never wired).
@aaronsb aaronsb merged commit 7fc65c8 into main Jun 1, 2026
4 checks passed
@aaronsb aaronsb deleted the chore/adr-102-p6b-purge-legacy-admin-clis branch June 1, 2026 22:43
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