{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:orbiplex:schema:whisper-redaction-prepare-response:v1",
  "title": "WhisperRedactionPrepareResponse v1",
  "description": "Host-capability response carrying a local redaction draft for Whisper intake. The response is private workflow data; it does not approve publication and is not an Agora record.",
  "type": "object",
  "additionalProperties": true,
  "x-dia-workflow": "project",
  "x-dia-status": "draft",
  "x-dia-basis": [
    "doc/project/30-stories/story-005-whisper-rumor-intake.md",
    "doc/project/40-proposals/013-whisper-social-signal-exchange.md",
    "doc/project/40-proposals/055-bounded-deferred-operation-contract.md",
    "doc/project/60-solutions/011-whisper/011-whisper.md"
  ],
  "required": ["schema", "schema/v", "status"],
  "properties": {
    "schema": { "const": "whisper-redaction-prepare-response.v1" },
    "schema/v": { "const": 1 },
    "status": {
      "type": "string",
      "enum": [
        "draft-ready",
        "needs-human-review",
        "unsafe-output",
        "policy-denied",
        "model-unavailable",
        "retryable-timeout",
        "failed"
      ]
    },
    "redaction/draft": {
      "description": "Provider-produced draft. Required when status is `draft-ready` or `needs-human-review`. The draft is local review material, not a publishable Agora record by itself.",
      "type": ["object", "array", "string", "number", "boolean", "null"]
    },
    "diagnostics": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "level": { "type": "string", "enum": ["info", "warning", "error"] },
          "code": { "type": "string", "minLength": 1 },
          "message": { "type": "string" },
          "category": { "type": "string" }
        }
      }
    },
    "confidence": { "type": "number", "minimum": 0, "maximum": 1 },
    "provider/id": { "type": "string" },
    "provider/runtime-id": { "type": "string" },
    "profile/id": { "type": "string" },
    "retryable": { "type": "boolean" },
    "reason": { "type": "string" }
  },
  "allOf": [
    {
      "if": { "properties": { "status": { "enum": ["draft-ready", "needs-human-review"] } }, "required": ["status"] },
      "then": { "required": ["redaction/draft"] }
    }
  ]
}
