Effort: thorough
The current artifact endpoints (api.py:25384 —
/api/artifacts/{id}, api.py:4353 —
/api/artifacts/{id}/resolve, etc.) are pragmatic, evolve with
the schema, and are not safe for external consumers to lock onto.
There is no /api/v2, no JSON-LD context, no HATEOAS link
discovery, no documented stability guarantee. For SciDEX to be a
node in a federated research-tool ecosystem (the rest of the
q-fed-* specs depend on this), publish a versioned, contract-
stable public read API: /api/v2/artifacts with cursor pagination,
JSON-LD context, hypermedia links, and a published OpenAPI spec.
api_routes/api_v2.py mounted at /api/v2.docs/api/v2-stability.md.
GET /api/v2/artifacts — cursor-paginated list. Query:?kind=hypothesis|market|open_question|debate&entity=<name>
&since=<iso8601>&cursor=<opaque>&limit=20. Response:{"@context": "/api/v2/contexts/artifact-list",
"data": [...], "links": {"self": "...", "next": "...",
"prev": "..."}, "meta": {total, returned, cursor}}.GET /api/v2/artifacts/{id} — full resource with@context: "/api/v2/contexts/artifact", @type set per_links block per HATEOAS:{self, versions, lineage, dependents, comments, ld_jsonld}.GET /api/v2/contexts/{name} — JSON-LD context documentsGET /api/v2/openapi.json — full OpenAPI 3.1 spec.GET /api/v2/openapi (HTML) — Swagger UI.
{kind, since, last_id, last_score}); receiverscanonical_uri =https://scidex.ai/api/v2/artifacts/<id> so consumersAccess-Control-Allow-Origin: * and ETag/Cache-Controlq-perf-etag-smart-invalidation middleware.
/senate/api-keys admin pagesecrets_box.
meta.api_version: "2.0", meta.deprecated: false. Whenmeta.deprecated: true,
sunset_at: <iso> for one full year.
tests/test_api_v2.py: pagination round-tripopenapi-spec-validator.
@type,@id, name, description, dateCreated); expand asq-fed-* siblings (federation, ActivityPub, personal-scidex/atlas/artifact_registry.py — source data.q-perf-etag-smart-invalidation — cache layer.secrets_box for API-key storage.q-fed-activitypub-publisher — uses canonical URIs.q-fed-vitadao-molecule-import — cites v2 URIs.q-fed-personal-site-widget — embeds via v2.q-fed-federated-search-shim — cross-site federated search.api_routes/api_v2.py (490 lines): versioned, contract-stable router at /api/v2 with 5 endpoints:GET /api/v2/artifacts — cursor-paginated list; HMAC-SHA256 signed opaque cursors (SCIDEX_V2_CURSOR_SECRET); filters: kind, entity, since, cursor, limitGET /api/v2/artifacts/{id} — single resource; @context, @type, canonical_uri, _links HATEOAS blockGET /api/v2/contexts/{name} — JSON-LD context documents for artifact, artifact-list, hypothesis, market, open_questionGET /api/v2/openapi.json — OpenAPI 3.1 spec via FastAPI get_openapi() introspectionGET /api/v2/openapi — Swagger UI HTML
CORSMiddleware(allow_origins=[""], allow_methods=["GET"], allow_headers=[""]) for federation consumersdocs/api/v2-stability.md documenting versioning rules, deprecation envelope, rate limits, canonical URIs, cursor opacitytests/test_api_v2.py (36 passing tests): pagination round-trip, cursor tamper rejection, CORS headers, JSON-LD contexts, OpenAPI paths, HATEOAS linksGET /api/v2/artifacts?limit=3 → 200, @context: /api/v2/contexts/artifact-list, total=49807, returned=3, CORS=*GET /api/v2/artifacts/{id} → 200, canonical_uri=https://scidex.ai/api/v2/artifacts/{id}, _links={self,versions,lineage,dependents,comments,ld_jsonld}GET /api/v2/contexts/hypothesis → 200, @context keys presentGET /api/v2/openapi.json → 200, openapi=3.1.0, 5 paths4793eeda3 "[Senate] /api/v2 artifacts public read API — HATEOAS, JSON-LD, cursor pagination" to orchestra/task/b6bc9b65-api-v2-artifacts-public-read-api-with-haorchestra/task/b6bc9b65-api-v2-artifacts-public-read-api-with-ha