{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/corvio-ai/json-schema/corvio-ai-public-question-response-schema.json",
  "title": "PublicQuestionResponse",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/corvio-ai-openapi.yml#/components/schemas/PublicQuestionResponse",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
    },
    "object": {
      "type": "string",
      "const": "question",
      "title": "Object",
      "default": "question"
    },
    "status": {
      "type": "string",
      "enum": [
        "in_progress",
        "needs_user_input",
        "completed",
        "failed",
        "cancelled"
      ],
      "title": "Status"
    },
    "prompt": {
      "type": "string",
      "title": "Prompt"
    },
    "answer": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Answer"
    },
    "conversation_id": {
      "type": "string",
      "format": "uuid",
      "title": "Conversation Id"
    },
    "thread_id": {
      "type": "string",
      "format": "uuid",
      "title": "Thread Id"
    },
    "trace_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Trace Id"
    },
    "sources": {
      "items": {
        "$ref": "#/$defs/PublicQuestionSource"
      },
      "type": "array",
      "title": "Sources"
    },
    "source_document_ids": {
      "items": {
        "type": "string",
        "format": "uuid"
      },
      "type": "array",
      "title": "Source Document Ids"
    },
    "artifacts": {
      "items": {
        "$ref": "#/$defs/PublicQuestionArtifact"
      },
      "type": "array",
      "title": "Artifacts"
    },
    "operations": {
      "items": {
        "$ref": "#/$defs/PublicQuestionOperation"
      },
      "type": "array",
      "title": "Operations"
    },
    "clarification": {
      "anyOf": [
        {
          "$ref": "#/$defs/PublicQuestionClarification"
        },
        {
          "type": "null"
        }
      ],
      "description": "A safe user-visible decision request emitted by Corvio. The host must relay it to its user and submit the user's answers; it must not choose or skip answers on the user's behalf."
    },
    "answer_blocks": {
      "items": {
        "additionalProperties": true,
        "type": "object"
      },
      "type": "array",
      "title": "Answer Blocks"
    },
    "usage": {
      "additionalProperties": true,
      "type": "object",
      "title": "Usage"
    },
    "execution": {
      "additionalProperties": true,
      "type": "object",
      "title": "Execution",
      "description": "Durable execution receipt including caller origin, requested/effective processing profile, the scan/Skill-evaluation knowledge policy, and bounded Memory/Skill review and execution outcomes when this Question performed durable learning."
    },
    "error": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Error"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
    },
    "links": {
      "additionalProperties": {
        "type": "string"
      },
      "type": "object",
      "title": "Links"
    }
  },
  "type": "object",
  "required": [
    "id",
    "status",
    "prompt",
    "conversation_id",
    "thread_id",
    "created_at",
    "updated_at",
    "links"
  ],
  "$defs": {
    "PublicQuestionArtifact": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id",
          "description": "Canonical workspace_uuid/page_uuid handle accepted by document read and mutation tools."
        },
        "kind": {
          "type": "string",
          "title": "Kind"
        },
        "structural_kind": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Structural Kind",
          "description": "Live tree kind. Only project proves a structural Project; a Page may have doc_type/project semantics without owning Project ancestry."
        },
        "role": {
          "type": "string",
          "enum": [
            "reader_output",
            "structure_container"
          ],
          "title": "Role"
        },
        "document_id": {
          "type": "string",
          "format": "uuid",
          "title": "Document Id"
        },
        "node_id": {
          "type": "string",
          "format": "uuid",
          "title": "Node Id"
        },
        "parent_node_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "title": "Parent Node Id"
        },
        "project_ancestor_node_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "title": "Project Ancestor Node Id",
          "description": "Nearest live Project ancestor, including the artifact itself when it is a Project. Null means no complete live Project ancestry was verified."
        },
        "title": {
          "type": "string",
          "title": "Title"
        },
        "content_revision": {
          "type": "integer",
          "title": "Content Revision"
        },
        "readback_verified": {
          "type": "boolean",
          "title": "Readback Verified",
          "description": "True when Corvio re-resolved this live object for the terminal response and the returned identity, kind, title, revision, parent, and URL are current. This does not inline or attest every body claim; read the body only when exact wording can change acceptance."
        },
        "url": {
          "type": "string",
          "title": "Url"
        }
      },
      "type": "object",
      "required": [
        "id",
        "kind",
        "role",
        "document_id",
        "node_id",
        "title",
        "content_revision",
        "readback_verified",
        "url"
      ],
      "title": "PublicQuestionArtifact"
    },
    "PublicQuestionClarification": {
      "properties": {
        "session_id": {
          "type": "string",
          "title": "Session Id"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Title"
        },
        "intro": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Intro"
        },
        "submit_label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Submit Label"
        },
        "final_optional_note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Final Optional Note"
        },
        "questions": {
          "items": {
            "$ref": "#/$defs/PublicQuestionClarificationItem"
          },
          "type": "array",
          "title": "Questions"
        }
      },
      "type": "object",
      "required": [
        "session_id"
      ],
      "title": "PublicQuestionClarification"
    },
    "PublicQuestionClarificationItem": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "question": {
          "type": "string",
          "title": "Question"
        },
        "mode": {
          "type": "string",
          "enum": [
            "single_choice",
            "multiple_choice"
          ],
          "title": "Mode"
        },
        "required": {
          "type": "boolean",
          "title": "Required",
          "default": true
        },
        "options": {
          "items": {
            "$ref": "#/$defs/PublicQuestionClarificationOption"
          },
          "type": "array",
          "title": "Options"
        },
        "allow_note": {
          "type": "boolean",
          "title": "Allow Note",
          "default": false
        },
        "note_label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Note Label"
        },
        "note_placeholder": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Note Placeholder"
        }
      },
      "type": "object",
      "required": [
        "id",
        "question",
        "mode"
      ],
      "title": "PublicQuestionClarificationItem"
    },
    "PublicQuestionClarificationOption": {
      "properties": {
        "key": {
          "type": "string",
          "title": "Key"
        },
        "label": {
          "type": "string",
          "title": "Label"
        },
        "detail": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Detail"
        }
      },
      "type": "object",
      "required": [
        "key",
        "label"
      ],
      "title": "PublicQuestionClarificationOption"
    },
    "PublicQuestionOperation": {
      "properties": {
        "name": {
          "type": "string",
          "title": "Name"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "summary": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Summary"
        },
        "detail": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Detail"
        }
      },
      "type": "object",
      "required": [
        "name",
        "status"
      ],
      "title": "PublicQuestionOperation"
    },
    "PublicQuestionSource": {
      "properties": {
        "kind": {
          "type": "string",
          "title": "Kind"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Title"
        },
        "url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Url"
        },
        "document_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "title": "Document Id"
        },
        "asset_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "title": "Asset Id"
        },
        "node_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "title": "Node Id"
        },
        "conversation_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "title": "Conversation Id"
        },
        "question_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "title": "Question Id"
        },
        "page_revision": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Page Revision"
        },
        "heading_path": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Heading Path"
        },
        "quote": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Quote"
        },
        "locator": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Locator"
        }
      },
      "type": "object",
      "required": [
        "kind"
      ],
      "title": "PublicQuestionSource"
    }
  }
}