{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "anu_v3/schemas/policy_profile_2553plus33.schema.json",
  "title": "Policy Profile — generic engine meta-schema (task-2553+33 / Track C1)",
  "description": "Static GENERIC meta-schema that ANY concrete policy profile must satisfy for anu_v3.policy_profile_engine to load it. Intentionally a superset contract: requires only the engine-universal identity fields (profile_id, version) and recognizes engine-relevant blocks; additionalProperties:true so profile-specific blocks (e.g. test_only_hardening_pr_merge_v1's merge_ready_predicate / gemini_thread_resolve / scope_invariants) validate unchanged. Existing single profile semantics preserved (§8).",
  "type": "object",
  "required": ["profile_id", "version"],
  "additionalProperties": true,
  "properties": {
    "profile_id": { "type": "string", "minLength": 1 },
    "version": { "type": "string", "pattern": "^v[0-9]+$" },
    "task_id": { "type": "string" },
    "gate_predicate": {
      "type": "object",
      "description": "Generic AND-gate. Preferred engine gate source; if absent the engine falls back to merge_ready_predicate.",
      "additionalProperties": true
    },
    "merge_ready_predicate": {
      "type": "object",
      "description": "Profile-specific AND-gate (test_only_hardening_pr_merge_v1). Engine treats each key->value as a gate condition.",
      "additionalProperties": true
    },
    "hold_conditions": {
      "type": "object",
      "description": "Engine auto-computed. ANY truthy => HOLD, action 0.",
      "additionalProperties": true
    },
    "allowed_actions": {
      "type": "array",
      "items": { "type": "string" }
    },
    "forbidden_actions": {
      "type": "array",
      "items": { "type": "string" }
    },
    "scope_invariants": {
      "type": "object",
      "additionalProperties": true
    },
    "post_merge_steps": {
      "type": "array",
      "items": { "type": "string" }
    },
    "merge_method": {
      "type": "object",
      "additionalProperties": true
    },
    "completion_packet": {
      "type": "object",
      "additionalProperties": true
    },
    "evidence": {
      "type": "object",
      "additionalProperties": true
    }
  }
}
