chore(adr-102): purge superseded admin CLIs + dead reset path (P6b)#488
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.shinvocation — only standalone
python -m api.admin.*entry points carrying stalesrc.admin.*docstrings that don't even match the realapi/admin/path).Deleted:
api/admin/{backup,restore,stitch}.py— superseded by the streaming/admin/backuproute +
restore_worker.api/lib/restitching.py(legacyConceptMatcher) — only importers werestitch.pyrestore.py. The live integration-mode engine isapi/app/lib/concept_matcher.py(the canonical two-tier port).
api/admin/reset.py+admin_service.reset_database+ theResetRequest/ResetResponse/SchemaValidationmodels. Reset was one of theearliest worker functions and is dangerous in the current architecture; the API
reset route was already retired and the only importer of
ResetManagerwas thedead
reset_databasemethod. Database reset is now an operator-level concern./admin/resetendpoint.Kept:
api/admin/{prune,check_integrity}.py— adjacent operator utilities notsuperseded by the backup/restore spine (they use
age_ops+integrity, both live).Fixed: stale doc/comment references to the removed files (
concept_matcher.pyheader,
routes/admin.pyimport comment,models/admin.pydocstring).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 skippedimport api.app.main) — OK🤖 Generated with Claude Code