{
  "artifact": "D11-014 REST API and MCP contract",
  "version": "d11-014.v1",
  "generated_at_utc": "2026-09-08T13:12:39Z",
  "production_changed": false,
  "error_envelope": {
    "fields": [
      "error_code",
      "message",
      "request_id",
      "details",
      "retryable"
    ],
    "rule": "No stack traces, tokens or private data in client response"
  },
  "scope": "Every route resolves authenticated actor and server-authoritative project_id before access.",
  "rest_routes": [
    {
      "method": "GET",
      "path": "/api/v1/articles",
      "purpose": "list/filter published articles and project materials",
      "idempotent": true
    },
    {
      "method": "GET",
      "path": "/api/v1/articles/{id}",
      "purpose": "read article and revision",
      "idempotent": true
    },
    {
      "method": "POST",
      "path": "/api/v1/jobs",
      "purpose": "create crawl/assess/cluster job",
      "idempotent": "Idempotency-Key required"
    },
    {
      "method": "GET",
      "path": "/api/v1/jobs/{id}",
      "purpose": "read job/run status",
      "idempotent": true
    },
    {
      "method": "POST",
      "path": "/api/v1/exports",
      "purpose": "create scoped export",
      "idempotent": "Idempotency-Key required"
    }
  ],
  "mcp_tools": [
    {
      "name": "search_articles",
      "access": "read",
      "returns": "bounded results with provenance"
    },
    {
      "name": "get_article",
      "access": "read",
      "returns": "article revision and evidence refs"
    },
    {
      "name": "create_job",
      "access": "write",
      "requires": "project scope and idempotency key"
    },
    {
      "name": "get_job",
      "access": "read",
      "returns": "status without secrets"
    }
  ],
  "validation": [
    "strict schema validation",
    "pagination and max page size",
    "allowlisted sort/filter fields",
    "URL and HTML sanitization",
    "rate limits per actor/project",
    "audit every write and export"
  ],
  "rollback": "Disable new routes/tools at gateway; keep existing readers and revoke issued job IDs."
}
