{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://iop.local/schemas/single-request-claude-smoke-manifest.schema.json",
  "title": "Single-request Claude smoke manifest",
  "description": "Closed, redacted S12 evidence. Every object is closed; raw prompts, outputs, paths, endpoints, headers, credentials, and provider payloads are deliberately absent.",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema_version", "source", "runtime", "ingress", "stages", "terminal", "workspace", "verification", "redaction"],
  "properties": {
    "schema_version": { "const": "1" },
    "source": { "$ref": "#/$defs/source" },
    "runtime": { "$ref": "#/$defs/runtime" },
    "ingress": { "$ref": "#/$defs/ingress" },
    "stages": {
      "type": "array",
      "minItems": 3,
      "maxItems": 3,
      "prefixItems": [
        { "$ref": "#/$defs/stage", "properties": { "stage": { "const": "plan" }, "engine_family": { "const": "gemini" } } },
        { "$ref": "#/$defs/stage", "properties": { "stage": { "const": "work" }, "engine_family": { "const": "ornith-fast" } } },
        { "$ref": "#/$defs/stage", "properties": { "stage": { "const": "review" }, "engine_family": { "const": "gemini" } } }
      ],
      "items": false
    },
    "terminal": { "$ref": "#/$defs/terminal" },
    "workspace": { "$ref": "#/$defs/workspace" },
    "verification": { "$ref": "#/$defs/verification" },
    "redaction": { "$ref": "#/$defs/redaction" }
  },
  "$defs": {
    "digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
    "platform": { "type": "string", "pattern": "^[a-z0-9_+-]{1,32}$" },
    "source": {
      "type": "object",
      "additionalProperties": false,
      "required": ["head", "branch_digest", "worktree_digest"],
      "properties": {
        "head": { "type": "string", "pattern": "^[0-9a-f]{40}$" },
        "branch_digest": { "$ref": "#/$defs/digest" },
        "worktree_digest": { "$ref": "#/$defs/digest" }
      }
    },
    "runtime": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "runner_os",
        "runner_arch",
        "workspace_os",
        "workspace_arch",
        "workspace_root_digest",
        "workspace_owner_digest",
        "claude_digest",
        "claude_version_digest",
        "claude_help_digest",
        "edge_digest",
        "edge_version_digest",
        "node_digest",
        "node_version_digest",
        "config_digest",
        "config_check_digest",
        "schema_digest",
        "base_url_digest",
        "public_model_digest",
        "stage_engines",
        "stage_binding_digest"
      ],
      "properties": {
        "runner_os": { "$ref": "#/$defs/platform" },
        "runner_arch": { "$ref": "#/$defs/platform" },
        "workspace_os": { "enum": ["darwin", "linux"] },
        "workspace_arch": { "$ref": "#/$defs/platform" },
        "workspace_root_digest": { "$ref": "#/$defs/digest" },
        "workspace_owner_digest": { "$ref": "#/$defs/digest" },
        "claude_digest": { "$ref": "#/$defs/digest" },
        "claude_version_digest": { "$ref": "#/$defs/digest" },
        "claude_help_digest": { "$ref": "#/$defs/digest" },
        "edge_digest": { "$ref": "#/$defs/digest" },
        "edge_version_digest": { "$ref": "#/$defs/digest" },
        "node_digest": { "$ref": "#/$defs/digest" },
        "node_version_digest": { "$ref": "#/$defs/digest" },
        "config_digest": { "$ref": "#/$defs/digest" },
        "config_check_digest": { "$ref": "#/$defs/digest" },
        "schema_digest": { "$ref": "#/$defs/digest" },
        "base_url_digest": { "$ref": "#/$defs/digest" },
        "public_model_digest": { "$ref": "#/$defs/digest" },
        "stage_engines": {
          "type": "array",
          "minItems": 3,
          "maxItems": 3,
          "prefixItems": [
            { "const": "gemini" },
            { "const": "ornith-fast" },
            { "const": "gemini" }
          ],
          "items": false
        },
        "stage_binding_digest": { "$ref": "#/$defs/digest" }
      }
    },
    "ingress": {
      "type": "object",
      "additionalProperties": false,
      "required": ["delta"],
      "properties": { "delta": { "const": 1 } }
    },
    "stage": {
      "type": "object",
      "additionalProperties": false,
      "required": ["stage", "engine_family", "duration_ms", "binding_digest"],
      "properties": {
        "stage": { "enum": ["plan", "work", "review"] },
        "engine_family": { "enum": ["gemini", "ornith-fast"] },
        "duration_ms": { "type": "integer", "minimum": 0 },
        "binding_digest": { "$ref": "#/$defs/digest" }
      }
    },
    "terminal": {
      "type": "object",
      "additionalProperties": false,
      "required": ["count", "stop_reason", "duration_ms"],
      "properties": {
        "count": { "const": 1 },
        "stop_reason": { "const": "end_turn" },
        "duration_ms": { "type": "integer", "minimum": 0 }
      }
    },
    "workspace": {
      "type": "object",
      "additionalProperties": false,
      "required": ["before_digest", "after_digest", "changed"],
      "properties": {
        "before_digest": { "$ref": "#/$defs/digest" },
        "after_digest": { "$ref": "#/$defs/digest" },
        "changed": { "const": true }
      }
    },
    "verification": {
      "type": "object",
      "additionalProperties": false,
      "required": ["command_digest", "result_file_digest", "exit_code"],
      "properties": {
        "command_digest": { "$ref": "#/$defs/digest" },
        "result_file_digest": { "$ref": "#/$defs/digest" },
        "exit_code": { "const": 0 }
      }
    },
    "redaction": {
      "type": "object",
      "additionalProperties": false,
      "required": ["forbidden_match_count", "forbidden_key_count"],
      "properties": {
        "forbidden_match_count": { "const": 0 },
        "forbidden_key_count": { "const": 0 }
      }
    }
  }
}
