{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:awoooi:agent-market-watch-promotion-review-v1",
  "title": "AWOOOI Agent Market Watch Promotion Review (v1)",
  "type": "object",
  "required": [
    "schema_version",
    "generated_at",
    "inputs",
    "policy",
    "summary",
    "reviews"
  ],
  "properties": {
    "schema_version": {
      "type": "string",
      "const": "agent_market_watch_promotion_review_v1"
    },
    "generated_at": {
      "type": "string",
      "minLength": 1
    },
    "inputs": {
      "type": "object",
      "required": [
        "watch_report_generated_at",
        "integration_review_generated_at",
        "discovery_classification_generated_at",
        "candidate_registry_schema_version"
      ],
      "properties": {
        "watch_report_generated_at": {"type": ["string", "null"]},
        "integration_review_generated_at": {"type": ["string", "null"]},
        "discovery_classification_generated_at": {"type": ["string", "null"]},
        "candidate_registry_schema_version": {"type": "string"}
      },
      "additionalProperties": true
    },
    "policy": {
      "type": "object",
      "required": [
        "priority_upgrade_approved",
        "market_scorecard_update_approved",
        "replay_candidate_approved",
        "sdk_installation_approved",
        "paid_api_calls_approved",
        "production_changes_approved",
        "shadow_or_canary_approved",
        "replacement_decision_allowed"
      ],
      "properties": {
        "priority_upgrade_approved": {"type": "boolean", "const": false},
        "market_scorecard_update_approved": {"type": "boolean", "const": false},
        "replay_candidate_approved": {"type": "boolean", "const": false},
        "sdk_installation_approved": {"type": "boolean", "const": false},
        "paid_api_calls_approved": {"type": "boolean", "const": false},
        "production_changes_approved": {"type": "boolean", "const": false},
        "shadow_or_canary_approved": {"type": "boolean", "const": false},
        "replacement_decision_allowed": {"type": "boolean", "const": false}
      },
      "additionalProperties": true
    },
    "summary": {
      "type": "object",
      "required": [
        "watch_only_candidates_reviewed",
        "eligible_for_market_scorecard_prescreen",
        "remain_watch_only",
        "priority_upgrades_approved",
        "market_scorecard_updates_approved",
        "replay_candidates_approved",
        "sdk_installations_approved",
        "paid_api_calls_approved",
        "production_changes_approved",
        "shadow_or_canary_approved"
      ],
      "properties": {
        "watch_only_candidates_reviewed": {"type": "integer", "minimum": 0},
        "eligible_for_market_scorecard_prescreen": {"type": "integer", "minimum": 0},
        "remain_watch_only": {"type": "integer", "minimum": 0},
        "priority_upgrades_approved": {"type": "integer", "const": 0},
        "market_scorecard_updates_approved": {"type": "integer", "const": 0},
        "replay_candidates_approved": {"type": "integer", "const": 0},
        "sdk_installations_approved": {"type": "integer", "const": 0},
        "paid_api_calls_approved": {"type": "integer", "const": 0},
        "production_changes_approved": {"type": "integer", "const": 0},
        "shadow_or_canary_approved": {"type": "integer", "const": 0}
      },
      "additionalProperties": true
    },
    "reviews": {
      "type": "array",
      "items": {"$ref": "#/$defs/review"}
    }
  },
  "$defs": {
    "review": {
      "type": "object",
      "required": [
        "candidate_id",
        "display_name",
        "source_count",
        "source_failures",
        "release_version_observed",
        "integration_stage",
        "classification",
        "decision",
        "eligible_for_market_scorecard_prescreen",
        "approved_for_replay",
        "approved_for_sdk_install",
        "approved_for_paid_api_calls",
        "approved_for_shadow_or_canary",
        "blockers",
        "required_next_gate"
      ],
      "properties": {
        "candidate_id": {"type": "string", "minLength": 1},
        "display_name": {"type": "string"},
        "role": {"type": ["string", "null"]},
        "official_url": {"type": ["string", "null"]},
        "source_count": {"type": "integer", "minimum": 0},
        "source_failures": {"type": "integer", "minimum": 0},
        "release_version_observed": {"type": "boolean"},
        "latest_versions": {
          "type": "array",
          "items": {"type": ["string", "null"]}
        },
        "integration_stage": {"type": "string"},
        "classification": {"type": "object", "additionalProperties": true},
        "decision": {"type": "string"},
        "eligible_for_market_scorecard_prescreen": {"type": "boolean"},
        "approved_for_replay": {"type": "boolean", "const": false},
        "approved_for_sdk_install": {"type": "boolean", "const": false},
        "approved_for_paid_api_calls": {"type": "boolean", "const": false},
        "approved_for_shadow_or_canary": {"type": "boolean", "const": false},
        "blockers": {
          "type": "array",
          "items": {"type": "string"}
        },
        "required_next_gate": {"type": "string"}
      },
      "additionalProperties": true
    }
  },
  "additionalProperties": false
}
