{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://oruk.ai/examples/call-review-export-v1.schema.json",
  "title": "Oruk local passage review export v1",
  "description": "Reviewer-declared usefulness and manually timed review of saved API passages. No customer outcome, model accuracy, independent verification or publication permission is implied. Validate interval ends against starts and original response separately.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "exported_at",
    "source_classification",
    "classification_basis",
    "source",
    "question",
    "review_task",
    "timing_method",
    "independently_verified",
    "publication_approved",
    "passages"
  ],
  "properties": {
    "schema_version": {
      "const": 1
    },
    "exported_at": {
      "type": "string",
      "format": "date-time"
    },
    "source_classification": {
      "enum": [
        "unverified",
        "demonstration",
        "reviewer_pilot"
      ]
    },
    "classification_basis": {
      "const": "reviewer_declared"
    },
    "source": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "response_sha256",
        "hash_basis",
        "model",
        "model_revision"
      ],
      "properties": {
        "response_sha256": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        },
        "hash_basis": {
          "enum": [
            "source_file_bytes",
            "canonical_json_utf8"
          ]
        },
        "model": {
          "type": [
            "string",
            "null"
          ]
        },
        "model_revision": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "question": {
      "const": "Would this passage help with your stated review task?"
    },
    "review_task": {
      "type": "string",
      "maxLength": 500
    },
    "timing_method": {
      "const": "manual_start_pause_visible_page"
    },
    "independently_verified": {
      "const": false
    },
    "publication_approved": {
      "const": false
    },
    "passages": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "segment_index",
          "start_seconds",
          "end_seconds",
          "usefulness",
          "reason",
          "review_duration_ms"
        ],
        "properties": {
          "segment_index": {
            "type": "integer",
            "minimum": 0
          },
          "start_seconds": {
            "type": "number",
            "minimum": 0
          },
          "end_seconds": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "usefulness": {
            "enum": [
              null,
              "useful",
              "not_useful",
              "uncertain"
            ]
          },
          "reason": {
            "type": "string",
            "maxLength": 2000
          },
          "review_duration_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          }
        }
      }
    }
  },
  "allOf": [
    {
      "if": {
        "properties": {
          "source_classification": {
            "const": "reviewer_pilot"
          }
        }
      },
      "then": {
        "properties": {
          "review_task": {
            "minLength": 1
          }
        }
      }
    }
  ]
}
