{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:awoooi:github-target-decision-v1",
  "title": "AWOOOI GitHub Target Decision 事件 (v1)",
  "description": "GitHub target repo 建立、可見性、封存或待判定的 read-only 決策草案。此事件不授權建立 repo、修改 visibility、同步 refs 或主控切換。",
  "type": "object",
  "required": [
    "schema_version",
    "status",
    "decision_count",
    "approval_required_count",
    "decisions"
  ],
  "properties": {
    "schema_version": {
      "const": "github_target_decision_v1"
    },
    "status": {
      "type": "string",
      "enum": ["draft"]
    },
    "decision_count": {
      "type": "integer",
      "minimum": 0
    },
    "approval_required_count": {
      "type": "integer",
      "minimum": 0
    },
    "decisions": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "github_repo",
          "source_key",
          "probe_status",
          "target_state",
          "recommended_action",
          "risk",
          "approval_required",
          "blocked_until",
          "evidence_refs",
          "notes"
        ],
        "properties": {
          "github_repo": {
            "type": "string"
          },
          "source_key": {
            "type": "string"
          },
          "probe_status": {
            "type": "string"
          },
          "target_state": {
            "type": "string",
            "enum": [
              "exists_refs_blocked",
              "exists_aligned",
              "not_found_or_private",
              "external_scope"
            ]
          },
          "recommended_action": {
            "type": "string",
            "enum": [
              "hold_refs_reconcile",
              "create_or_grant_access_after_approval",
              "confirm_internal_remote_purpose",
              "scope_review_only"
            ]
          },
          "risk": {
            "type": "string",
            "enum": ["LOW", "MEDIUM", "HIGH", "CRITICAL"]
          },
          "approval_required": {
            "type": "boolean"
          },
          "blocked_until": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "evidence_refs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "notes": {
            "type": "string"
          }
        },
        "additionalProperties": false
      }
    }
  },
  "additionalProperties": false
}
