{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://awoooi.wooo.work/schemas/ai_agent_runtime_worker_shadow_gate_v1.schema.json",
  "title": "AI Agent Runtime Worker Shadow Gate v1",
  "type": "object",
  "required": [
    "schema_version",
    "generated_at",
    "program_status",
    "source_refs",
    "shadow_gate_truth",
    "shadow_worker_candidates",
    "no_write_execution_replays",
    "verifier_shadow_cases",
    "agent_shadow_roles",
    "operator_checkpoints",
    "display_redaction_contract",
    "rollups"
  ],
  "properties": {
    "schema_version": { "const": "ai_agent_runtime_worker_shadow_gate_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-404" },
        "next_task_id": { "const": "P2-101" },
        "read_only_mode": { "const": true },
        "runtime_authority": {
          "const": "runtime_worker_shadow_no_write_execution_evidence_gate_only_no_live_send_or_write"
        },
        "status_note": { "type": "string" }
      },
      "additionalProperties": false
    },
    "source_refs": { "type": "array", "items": { "type": "string" }, "minItems": 1 },
    "shadow_gate_truth": {
      "type": "object",
      "required": [
        "shadow_worker_evidence_gate_ready",
        "promotion_from_fixture_readback_ready",
        "no_write_replay_plan_ready",
        "action_candidate_selection_ready",
        "mcp_evidence_reuse_ready",
        "verifier_dry_run_binding_ready",
        "failure_lane_ready",
        "operator_review_packet_ready",
        "production_delivery_enabled",
        "gateway_queue_write_enabled",
        "telegram_send_enabled",
        "telegram_bot_api_call_enabled",
        "delivery_receipt_write_enabled",
        "shadow_worker_live_enabled",
        "ai_runtime_worker_enabled",
        "medium_low_auto_worker_enabled",
        "post_action_verifier_live_readback_enabled",
        "production_write_enabled",
        "secret_value_read_enabled",
        "work_window_transcript_display_allowed",
        "shadow_worker_live_run_count_24h",
        "gateway_queue_write_count_24h",
        "telegram_send_count_24h",
        "telegram_bot_api_call_count_24h",
        "delivery_receipt_write_count_24h",
        "ai_runtime_worker_run_count_24h",
        "medium_low_auto_execution_count_24h",
        "post_action_verifier_live_readback_count_24h",
        "production_write_count_24h",
        "truth_note"
      ],
      "properties": {
        "shadow_worker_evidence_gate_ready": { "const": true },
        "promotion_from_fixture_readback_ready": { "const": true },
        "no_write_replay_plan_ready": { "const": true },
        "action_candidate_selection_ready": { "const": true },
        "mcp_evidence_reuse_ready": { "const": true },
        "verifier_dry_run_binding_ready": { "const": true },
        "failure_lane_ready": { "const": true },
        "operator_review_packet_ready": { "const": true },
        "production_delivery_enabled": { "const": false },
        "gateway_queue_write_enabled": { "const": false },
        "telegram_send_enabled": { "const": false },
        "telegram_bot_api_call_enabled": { "const": false },
        "delivery_receipt_write_enabled": { "const": false },
        "shadow_worker_live_enabled": { "const": false },
        "ai_runtime_worker_enabled": { "const": false },
        "medium_low_auto_worker_enabled": { "const": false },
        "post_action_verifier_live_readback_enabled": { "const": false },
        "production_write_enabled": { "const": false },
        "secret_value_read_enabled": { "const": false },
        "work_window_transcript_display_allowed": { "const": false },
        "shadow_worker_live_run_count_24h": { "const": 0 },
        "gateway_queue_write_count_24h": { "const": 0 },
        "telegram_send_count_24h": { "const": 0 },
        "telegram_bot_api_call_count_24h": { "const": 0 },
        "delivery_receipt_write_count_24h": { "const": 0 },
        "ai_runtime_worker_run_count_24h": { "const": 0 },
        "medium_low_auto_execution_count_24h": { "const": 0 },
        "post_action_verifier_live_readback_count_24h": { "const": 0 },
        "production_write_count_24h": { "const": 0 },
        "truth_note": { "type": "string" }
      },
      "additionalProperties": false
    },
    "shadow_worker_candidates": {
      "type": "array",
      "minItems": 5,
      "items": {
        "type": "object",
        "required": [
          "candidate_id",
          "display_name",
          "owner_agent",
          "source_fixture_id",
          "target_surface",
          "shadow_status",
          "promotion_hash",
          "dry_run_ref",
          "writes_production",
          "sends_telegram",
          "reads_secret_value",
          "live_shadow_run_count_24h",
          "blocked_reason",
          "next_no_write_step"
        ],
        "properties": {
          "candidate_id": {
            "enum": [
              "shadow_report_daily_digest_candidate",
              "shadow_report_weekly_digest_candidate",
              "shadow_report_monthly_digest_candidate",
              "shadow_medium_low_noop_repair_candidate",
              "shadow_post_action_verifier_candidate"
            ]
          },
          "display_name": { "type": "string" },
          "owner_agent": { "enum": ["openclaw", "hermes", "nemotron"] },
          "source_fixture_id": { "type": "string" },
          "target_surface": { "type": "string" },
          "shadow_status": {
            "enum": ["passed_no_write_replay", "needs_owner_review", "blocked_by_runtime_gate"]
          },
          "promotion_hash": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
          "dry_run_ref": { "type": "string" },
          "writes_production": { "const": false },
          "sends_telegram": { "const": false },
          "reads_secret_value": { "const": false },
          "live_shadow_run_count_24h": { "const": 0 },
          "blocked_reason": { "type": "string" },
          "next_no_write_step": { "type": "string" }
        },
        "additionalProperties": false
      }
    },
    "no_write_execution_replays": {
      "type": "array",
      "minItems": 4,
      "items": {
        "type": "object",
        "required": [
          "replay_id",
          "display_name",
          "owner_agent",
          "input_source",
          "expected_action",
          "simulated_outcome",
          "replay_status",
          "evidence_hash",
          "verifier_bound",
          "writes_result",
          "production_side_effect_count"
        ],
        "properties": {
          "replay_id": {
            "enum": [
              "daily_report_shadow_replay",
              "weekly_report_shadow_replay",
              "medium_low_noop_shadow_replay",
              "verifier_shadow_replay"
            ]
          },
          "display_name": { "type": "string" },
          "owner_agent": { "enum": ["openclaw", "hermes", "nemotron"] },
          "input_source": { "type": "string" },
          "expected_action": { "type": "string" },
          "simulated_outcome": { "type": "string" },
          "replay_status": { "enum": ["passed_no_write", "blocked_by_runtime_gate"] },
          "evidence_hash": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
          "verifier_bound": { "const": true },
          "writes_result": { "const": false },
          "production_side_effect_count": { "const": 0 }
        },
        "additionalProperties": false
      }
    },
    "verifier_shadow_cases": {
      "type": "array",
      "minItems": 4,
      "items": {
        "type": "object",
        "required": [
          "case_id",
          "display_name",
          "owner_agent",
          "expected_signal",
          "observed_signal",
          "evidence_hash",
          "live_readback_enabled",
          "writes_result",
          "requires_secret_value"
        ],
        "properties": {
          "case_id": {
            "enum": [
              "shadow_promotion_verifier_case",
              "queue_write_block_verifier_case",
              "telegram_send_block_verifier_case",
              "production_write_block_verifier_case"
            ]
          },
          "display_name": { "type": "string" },
          "owner_agent": { "enum": ["hermes", "nemotron"] },
          "expected_signal": { "type": "string" },
          "observed_signal": { "type": "string" },
          "evidence_hash": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
          "live_readback_enabled": { "const": false },
          "writes_result": { "const": false },
          "requires_secret_value": { "const": false }
        },
        "additionalProperties": false
      }
    },
    "agent_shadow_roles": {
      "type": "array",
      "minItems": 3,
      "items": {
        "type": "object",
        "required": [
          "agent_id",
          "display_name",
          "shadow_responsibility",
          "observed_work",
          "blocked_now",
          "live_action_count_24h"
        ],
        "properties": {
          "agent_id": { "enum": ["openclaw", "hermes", "nemotron"] },
          "display_name": { "type": "string" },
          "shadow_responsibility": { "type": "string" },
          "observed_work": { "type": "array", "items": { "type": "string" }, "minItems": 1 },
          "blocked_now": { "type": "array", "items": { "type": "string" }, "minItems": 1 },
          "live_action_count_24h": { "const": 0 }
        },
        "additionalProperties": false
      }
    },
    "operator_checkpoints": {
      "type": "array",
      "minItems": 6,
      "items": {
        "type": "object",
        "required": [
          "checkpoint_id",
          "display_name",
          "owner_agent",
          "risk_tier",
          "approval_required",
          "status",
          "next_safe_step"
        ],
        "properties": {
          "checkpoint_id": { "type": "string" },
          "display_name": { "type": "string" },
          "owner_agent": { "enum": ["openclaw", "hermes", "nemotron"] },
          "risk_tier": { "enum": ["low", "medium", "high", "critical"] },
          "approval_required": { "type": "boolean" },
          "status": {
            "enum": ["passed_no_write", "needs_owner_review", "blocked_by_runtime_gate"]
          },
          "next_safe_step": { "type": "string" }
        },
        "additionalProperties": false
      }
    },
    "display_redaction_contract": {
      "type": "object",
      "required": [
        "redaction_required",
        "raw_report_payload_display_allowed",
        "raw_telegram_payload_display_allowed",
        "raw_shadow_payload_display_allowed",
        "private_reasoning_display_allowed",
        "secret_value_display_allowed",
        "work_window_transcript_display_allowed",
        "allowed_display_fields",
        "blocked_display_fields"
      ],
      "properties": {
        "redaction_required": { "const": true },
        "raw_report_payload_display_allowed": { "const": false },
        "raw_telegram_payload_display_allowed": { "const": false },
        "raw_shadow_payload_display_allowed": { "const": false },
        "private_reasoning_display_allowed": { "const": false },
        "secret_value_display_allowed": { "const": false },
        "work_window_transcript_display_allowed": { "const": false },
        "allowed_display_fields": { "type": "array", "items": { "type": "string" }, "minItems": 1 },
        "blocked_display_fields": { "type": "array", "items": { "type": "string" }, "minItems": 1 }
      },
      "additionalProperties": false
    },
    "rollups": {
      "type": "object",
      "required": [
        "shadow_candidate_count",
        "passed_no_write_candidate_count",
        "blocked_candidate_count",
        "needs_owner_review_candidate_count",
        "no_write_replay_count",
        "passed_no_write_replay_count",
        "verifier_shadow_case_count",
        "agent_role_count",
        "operator_checkpoint_count",
        "approval_required_checkpoint_ids",
        "shadow_worker_live_run_count",
        "gateway_queue_write_count",
        "telegram_send_count",
        "telegram_bot_api_call_count",
        "delivery_receipt_write_count",
        "ai_runtime_worker_run_count",
        "medium_low_auto_execution_count",
        "post_action_verifier_live_readback_count",
        "production_write_count"
      ],
      "properties": {
        "shadow_candidate_count": { "type": "integer" },
        "passed_no_write_candidate_count": { "type": "integer" },
        "blocked_candidate_count": { "type": "integer" },
        "needs_owner_review_candidate_count": { "type": "integer" },
        "no_write_replay_count": { "type": "integer" },
        "passed_no_write_replay_count": { "type": "integer" },
        "verifier_shadow_case_count": { "type": "integer" },
        "agent_role_count": { "type": "integer" },
        "operator_checkpoint_count": { "type": "integer" },
        "approval_required_checkpoint_ids": { "type": "array", "items": { "type": "string" } },
        "shadow_worker_live_run_count": { "const": 0 },
        "gateway_queue_write_count": { "const": 0 },
        "telegram_send_count": { "const": 0 },
        "telegram_bot_api_call_count": { "const": 0 },
        "delivery_receipt_write_count": { "const": 0 },
        "ai_runtime_worker_run_count": { "const": 0 },
        "medium_low_auto_execution_count": { "const": 0 },
        "post_action_verifier_live_readback_count": { "const": 0 },
        "production_write_count": { "const": 0 }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
