{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://awoooi.wooo.work/schemas/ai_agent_owner_approved_result_capture_dry_run_v1.schema.json",
  "title": "AI Agent Owner Approved Result Capture Dry Run v1",
  "type": "object",
  "required": [
    "schema_version",
    "generated_at",
    "program_status",
    "source_refs",
    "prior_contract_readback",
    "dry_run_truth",
    "approval_packet",
    "result_capture_dry_run_templates",
    "critic_reviewer_score_fixtures",
    "dry_run_gates",
    "operator_actions",
    "display_redaction_contract",
    "rollups"
  ],
  "properties": {
    "schema_version": { "const": "ai_agent_owner_approved_result_capture_dry_run_v1" },
    "generated_at": { "type": "string" },
    "program_status": {
      "type": "object",
      "required": [
        "overall_completion_percent",
        "current_priority",
        "current_task_id",
        "next_task_id",
        "read_only_mode",
        "runtime_authority",
        "status_note"
      ],
      "properties": {
        "overall_completion_percent": { "type": "integer", "minimum": 0, "maximum": 100 },
        "current_priority": { "enum": ["P0", "P1", "P2", "P3"] },
        "current_task_id": { "const": "P2-106" },
        "next_task_id": { "const": "P2-107" },
        "read_only_mode": { "const": true },
        "runtime_authority": { "const": "owner_approved_result_capture_dry_run_only_no_live_write" },
        "status_note": { "type": "string" }
      },
      "additionalProperties": false
    },
    "source_refs": { "type": "array", "items": { "type": "string" }, "minItems": 1 },
    "prior_contract_readback": {
      "type": "object",
      "required": [
        "source_schema_version",
        "readback_at",
        "approval_24h_total",
        "scorecard_count",
        "result_capture_contract_count",
        "promotion_gate_count",
        "candidate_route_count",
        "approved_without_execution_meta_24h",
        "execution_failed_with_matched_24h",
        "pending_with_matched_24h",
        "result_capture_runtime_write_count",
        "learning_write_count",
        "playbook_trust_write_count",
        "telegram_send_count",
        "readback_note"
      ],
      "properties": {
        "source_schema_version": { "const": "ai_agent_critic_reviewer_result_capture_v1" },
        "readback_at": { "type": "string" },
        "approval_24h_total": { "type": "integer", "minimum": 0 },
        "scorecard_count": { "const": 5 },
        "result_capture_contract_count": { "const": 5 },
        "promotion_gate_count": { "const": 6 },
        "candidate_route_count": { "const": 4 },
        "approved_without_execution_meta_24h": { "type": "integer", "minimum": 0 },
        "execution_failed_with_matched_24h": { "type": "integer", "minimum": 0 },
        "pending_with_matched_24h": { "type": "integer", "minimum": 0 },
        "result_capture_runtime_write_count": { "const": 0 },
        "learning_write_count": { "const": 0 },
        "playbook_trust_write_count": { "const": 0 },
        "telegram_send_count": { "const": 0 },
        "readback_note": { "type": "string" }
      },
      "additionalProperties": false
    },
    "dry_run_truth": { "type": "object" },
    "approval_packet": {
      "type": "object",
      "required": [
        "packet_id",
        "display_name",
        "required_owner_fields",
        "forbidden_inputs",
        "operator_meaning",
        "dry_run_plan_fingerprint"
      ],
      "properties": {
        "packet_id": { "type": "string" },
        "display_name": { "type": "string" },
        "required_owner_fields": { "type": "array", "items": { "type": "string" }, "minItems": 1 },
        "forbidden_inputs": { "type": "array", "items": { "type": "string" } },
        "operator_meaning": { "type": "string" },
        "dry_run_plan_fingerprint": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" }
      },
      "additionalProperties": false
    },
    "result_capture_dry_run_templates": {
      "type": "array",
      "minItems": 5,
      "items": {
        "type": "object",
        "required": [
          "template_id",
          "display_name",
          "source_contract_id",
          "owner_agent",
          "result_state",
          "status",
          "candidate_count_24h",
          "required_inputs",
          "preview_outputs",
          "write_enabled",
          "runtime_writer_enabled",
          "blocked_write_action",
          "no_write_evidence_hash"
        ],
        "properties": {
          "template_id": { "type": "string" },
          "display_name": { "type": "string" },
          "source_contract_id": { "type": "string" },
          "owner_agent": { "enum": ["openclaw", "hermes", "nemotron"] },
          "result_state": { "type": "string" },
          "status": { "enum": ["ready_for_dry_run", "approval_required", "blocked_by_policy"] },
          "candidate_count_24h": { "type": "integer", "minimum": 0 },
          "required_inputs": { "type": "array", "items": { "type": "string" }, "minItems": 1 },
          "preview_outputs": { "type": "array", "items": { "type": "string" }, "minItems": 1 },
          "write_enabled": { "const": false },
          "runtime_writer_enabled": { "const": false },
          "blocked_write_action": { "type": "string" },
          "no_write_evidence_hash": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" }
        },
        "additionalProperties": false
      }
    },
    "critic_reviewer_score_fixtures": { "type": "array", "minItems": 5 },
    "dry_run_gates": { "type": "array", "minItems": 7 },
    "operator_actions": { "type": "array", "minItems": 5 },
    "display_redaction_contract": { "type": "object" },
    "rollups": { "type": "object" }
  },
  "additionalProperties": false
}
