[task] Add an admin-only permanent catalog purge API (deferred)

Open
#315 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
api, backend, databases

Research direction

Read the contribution guide in services/documentation-system, then inspect contracts/storage.py at the linked audited revision and the existing purge_doc implementations and purged_at guards. Trace the API-key/admin conventions and meeting-removal path before implementation. Done means the privileged endpoint, both-adapter erasure and restoration protections, offline tests, and API and provisioning documentation meet the checklist; the issue is explicitly deferred, so implementation is not currently started.

Written by the indexing model from the issue text.

Description

area/docs-system area/service on hold type/feature
Priority decision — 2026-10-23

Deferred by the project lead during feature prioritization. Keep this in the backlog, unassigned, without a release milestone or ready label. Filing it does not start implementation.

This decision supersedes the older statement that the generic purge HTTP API is required before the current rollout. Meeting-specific Google/catalog removal already works and is not deferred by this decision.

Blocked by

None. Deferred by priority, not by an unfinished implementation dependency.

What

Expose an authenticated admin operation to permanently erase an ordinary catalog document's retained content and access data from Misty, reusing the existing storage purge contract and restoration guards. Leave the original Google/GitHub/source file intact.

Why

Ordinary document removal retires the entry and removes it from search but can retain stored text and metadata. Admins need a supported way to erase accidentally imported sensitive content or honor a permanent removal request without direct database intervention.

Meeting removal already has its own Google/catalog purge cascade. This task supplies the missing general catalog API; it does not rebuild meeting cleanup.

Area

docs-system, service

Done looks like
  • Add the privileged POST /docs/{doc_id}/purge operation with a dedicated docs:purge scope, following existing API-key/admin conventions. Authorization and input validation happen before storage/provider work; the actor comes from the authenticated key.
  • Reuse StorageAdapter.purge_doc and its implementations in both adapters. Erase retained content/snapshot, all chunk sets, grants, tags, title/description and ownership metadata while retaining the minimal inactive/purged tombstone.
  • Repeated purge is safe and idempotent; an unknown document returns the documented 404 response. Failures do not leave a partially purged record.
  • Existing ingest, refetch, refresh, discovery and content/index writes cannot resurrect the purged record, including in-flight or concurrent operations. Verify the existing guards rather than adding a parallel lifecycle.
  • Keep meeting-linked documents on the existing meeting-removal workflow so this endpoint cannot bypass its Google cleanup and identity fences. Document and test the response for such a request.
  • No source file is deleted or modified and no provider call is needed for an ordinary catalog purge.
  • Offline API and adapter tests cover missing/insufficient authorization, actor attribution, unknown IDs, repeat purge, data erasure, restoration attempts and concurrent writes. Exercise both storage adapters and follow the service's required checks.
  • Update API, scope/key provisioning and operator documentation, clearly distinguishing retirement, catalog-only permanent purge, and meeting removal. Reconcile the older rollout wording with this recorded priority decision.
Design notes

Keep implementation primarily within services/documentation-system; read its contribution guide before changing it. The storage protocol, purge_doc implementations and purged_at guards already exist in staging. Inspect and reuse them rather than introducing another deletion mechanism.

Evidence and related work:

Out of scope

Deleting original source files; changing the working meeting-record removal cascade; automatic Discord link/PDF cleanup; a new bot command or UI; bulk purge; changing source ACLs or retention defaults; production deployment; automatic deletion on ordinary /doc remove.

Dominant language
Python
Stars
0
Forks
2
Avg merge
3d 3h
Merged PRs (30d)
31

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from UTMIST/Misty

All issues in UTMIST/Misty

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.