Summary
osa exposes exactly one ingestion operation today — start_ingestion (POST /api/v1/ingestions) plus discover_ingestable_conventions. There's no way to list ingestion runs, get the status of a run, or cancel a running one. Downstream CLIs (e.g. amacrin) want to present ingestion as a resource group (amacrin ingest start|list|status|cancel), but only start can be backed right now.
An ingestion is a run (a job), so the natural surface is create / read / cancel — there's no meaningful "update":
start — already exists (start_ingestion).
list — list runs for an archive/convention.
status — get one run by id.
cancel — stop a running ingestion.
What's needed
SDK helpers (in osa/cli/ingestion.py, reusable by downstream CLIs)
def list_ingestions(*, server, token, convention=None, http=None) -> list[dict]: ... # GET /api/v1/ingestions
def get_ingestion(*, server, ingestion_id, token, http=None) -> dict: ... # GET /api/v1/ingestions/{id}
def cancel_ingestion(*, server, ingestion_id, token, http=None) -> dict: ... # POST /api/v1/ingestions/{id}/cancel (or DELETE)
Same shape/conventions as start_ingestion (keyword-only, injectable http, raise IngestionError on failure).
Archive-server endpoints
GET /api/v1/ingestions (optionally filtered by convention SRN) → list of runs.
GET /api/v1/ingestions/{id} → one run (status, counts, timestamps).
POST /api/v1/ingestions/{id}/cancel (or DELETE /api/v1/ingestions/{id}) → cancel.
CLI
Extend the osa ingestion sub-app with list, status, cancel alongside start.
Why
amacrin now models ingestion as a noun sub-app (amacrin ingest start) to match its archive group, but it can only wrap start until these SDK helpers + endpoints exist. Centralizing the helpers in osa (as was done for discover_ingestable_conventions in #2) lets amacrin ingest list/status/cancel be thin wrappers rather than reimplementing HTTP against the archive server.
Acceptance criteria
Summary
osa exposes exactly one ingestion operation today —
start_ingestion(POST/api/v1/ingestions) plusdiscover_ingestable_conventions. There's no way to list ingestion runs, get the status of a run, or cancel a running one. Downstream CLIs (e.g.amacrin) want to present ingestion as a resource group (amacrin ingest start|list|status|cancel), but onlystartcan be backed right now.An ingestion is a run (a job), so the natural surface is create / read / cancel — there's no meaningful "update":
start— already exists (start_ingestion).list— list runs for an archive/convention.status— get one run by id.cancel— stop a running ingestion.What's needed
SDK helpers (in
osa/cli/ingestion.py, reusable by downstream CLIs)Same shape/conventions as
start_ingestion(keyword-only, injectablehttp, raiseIngestionErroron failure).Archive-server endpoints
GET /api/v1/ingestions(optionally filtered by convention SRN) → list of runs.GET /api/v1/ingestions/{id}→ one run (status, counts, timestamps).POST /api/v1/ingestions/{id}/cancel(orDELETE /api/v1/ingestions/{id}) → cancel.CLI
Extend the
osa ingestionsub-app withlist,status,cancelalongsidestart.Why
amacrinnow models ingestion as a noun sub-app (amacrin ingest start) to match itsarchivegroup, but it can only wrapstartuntil these SDK helpers + endpoints exist. Centralizing the helpers in osa (as was done fordiscover_ingestable_conventionsin #2) letsamacrin ingest list/status/cancelbe thin wrappers rather than reimplementing HTTP against the archive server.Acceptance criteria
list_ingestions,get_ingestion,cancel_ingestionhelpers inosa/cli/ingestion.py, unit-tested at the http boundary.osa ingestion list|status|cancelcommands.IngestionErrorraised with useful detail on failure.