{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://alignedaccelerationism.com/specs/delegation-policy-v0.3.schema.json",
  "title": "Aligned Accelerationism — Tiered Delegation Policy Manifest (v0.3)",
  "description": "Formal JSON Schema (Draft 2020-12) governing Tier A (Proof-Carrying Formal Kernel), Tier B (Factored Oversight Tree & Staged Rollout), and Tier C (Hard Human Sovereignty Boundary) AI delegation policies for OP-05.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "manifest_id",
    "workload",
    "classification_inputs",
    "assigned_tier",
    "autonomous_execution_permitted",
    "formal_verifier",
    "specification_dual_review",
    "blast_radius_cap",
    "rollback_sla",
    "human_sovereignty_override"
  ],
  "properties": {
    "schema_version": {
      "const": "0.3",
      "description": "Version identifier for the OP-05 Tiered Delegation Policy Manifest specification."
    },
    "manifest_id": {
      "type": "string",
      "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{5,127}$",
      "description": "Globally unique, immutable identifier for this policy manifest revision."
    },
    "workload": {
      "type": "object",
      "additionalProperties": false,
      "required": ["name", "domain", "owner_institution", "description", "created_utc"],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 3,
          "maxLength": 160
        },
        "domain": {
          "type": "string",
          "minLength": 2,
          "maxLength": 120,
          "description": "Operational domain (e.g., power-grid-interlock, cryptographic-protocol, hospital-scada, municipal-policy)."
        },
        "owner_institution": {
          "type": "string",
          "minLength": 2,
          "maxLength": 160,
          "description": "Legally accountable institution or governance body owning this workload."
        },
        "description": {
          "type": "string",
          "minLength": 10,
          "maxLength": 2000
        },
        "created_utc": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "classification_inputs": {
      "type": "object",
      "additionalProperties": false,
      "description": "Structural problem-class inputs matching the OP-05 deterministic tier router.",
      "required": [
        "specifiability",
        "reversibility",
        "verification_asymmetry",
        "goodhart_risk",
        "stakeholder_scope"
      ],
      "properties": {
        "specifiability": {
          "type": "string",
          "enum": ["formal", "deterministic-diff", "rubric-audit", "open-value"],
          "description": "Degree to which required safety and correctness properties can be expressed without normative ambiguity."
        },
        "reversibility": {
          "type": "string",
          "enum": ["instant", "staged-rollback", "high-cost", "irreversible"],
          "description": "Physical, financial, legal, and institutional reversibility of a faulty action."
        },
        "verification_asymmetry": {
          "type": "string",
          "enum": ["high", "moderate", "low"],
          "description": "Ratio between solution synthesis cost and independent verification cost."
        },
        "goodhart_risk": {
          "type": "string",
          "enum": ["low", "moderate", "high"],
          "description": "Risk that optimizing a formal proxy specification diverges from genuine human safety intent."
        },
        "stakeholder_scope": {
          "type": "string",
          "enum": ["individual", "team", "critical-infra", "public-rights"],
          "description": "Blast scope across affected individuals, institutions, critical infrastructure, or public legal rights."
        }
      }
    },
    "assigned_tier": {
      "$ref": "#/$defs/DelegationTier"
    },
    "autonomous_execution_permitted": {
      "type": "boolean",
      "description": "Whether AI-synthesized actions may execute inside bounded verification gates. Strictly false for TIER-C."
    },
    "formal_verifier": {
      "type": "object",
      "additionalProperties": false,
      "description": "Trusted verification architecture required before accepting any AI-proposed artifact or transition.",
      "required": [
        "verifier_class",
        "kernel_identifier",
        "unverified_bypass_allowed",
        "proof_attestation_required",
        "prohibit_unproven_axioms"
      ],
      "properties": {
        "verifier_class": {
          "$ref": "#/$defs/VerifierClass"
        },
        "kernel_identifier": {
          "type": "string",
          "minLength": 2,
          "maxLength": 160,
          "description": "Exact trusted verifier kernel or audit harness identifier (e.g., lean4-kernel-4.x, tlc-2.x, coqchk, factored-tree-v0.3)."
        },
        "kernel_version": {
          "type": "string",
          "minLength": 1,
          "maxLength": 64
        },
        "trusted_kernel_loc_budget": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100000,
          "description": "Upper bound on Trusted Computing Base (TCB) lines of code audited to uphold the de Bruijn criterion."
        },
        "cross_check_verifier_class": {
          "oneOf": [
            { "$ref": "#/$defs/FormalKernelClass" },
            { "type": "null" }
          ],
          "description": "Optional independent secondary proof-checker implementation used to mitigate single-kernel soundness bugs."
        },
        "unverified_bypass_allowed": {
          "type": "boolean",
          "description": "Whether any emergency or fast-path route may bypass the verifier into production. Must be false for TIER-A."
        },
        "proof_attestation_required": {
          "type": "boolean",
          "description": "Requires cryptographic build attestation binding the deployed binary or state transition to the verified proof digest."
        },
        "prohibit_unproven_axioms": {
          "type": "boolean",
          "description": "Rejects proofs containing unproven placeholders (e.g., sorry, admit, custom unreviewed axioms)."
        }
      }
    },
    "specification_dual_review": {
      "type": "object",
      "additionalProperties": false,
      "description": "Anti-Goodhart specification governance requiring dual independent human review, adversarial property fuzzing, and plain-language back-translation.",
      "required": [
        "spec_uri",
        "spec_sha256",
        "dual_signoff_complete",
        "reviewers",
        "adversarial_property_fuzzing",
        "plain_language_backtranslation_audited"
      ],
      "properties": {
        "spec_uri": {
          "type": "string",
          "format": "uri-reference",
          "description": "Immutable repository path or URI pointing to the governed specification artifact."
        },
        "spec_sha256": {
          "$ref": "#/$defs/Sha256Hex"
        },
        "dual_signoff_complete": {
          "type": "boolean",
          "description": "True only when at least two independent qualified human reviewers have cryptographically signed off on the specification."
        },
        "reviewers": {
          "type": "array",
          "uniqueItems": true,
          "items": {
            "$ref": "#/$defs/SpecReviewerSignoff"
          }
        },
        "adversarial_property_fuzzing": {
          "type": "object",
          "additionalProperties": false,
          "required": ["completed", "counterexamples_closed", "fuzzer_tooling"],
          "properties": {
            "completed": {
              "type": "boolean",
              "description": "Indicates whether adversarial counterexample search was executed against the specification before deployment."
            },
            "counterexamples_closed": {
              "type": "integer",
              "minimum": 0,
              "description": "Count of pathological spec-satisfying counterexamples identified and closed prior to approval."
            },
            "fuzzer_tooling": {
              "type": "string",
              "minLength": 2,
              "maxLength": 160,
              "description": "Tooling used for property-based fuzzing or SMT counterexample synthesis."
            }
          }
        },
        "plain_language_backtranslation_audited": {
          "type": "boolean",
          "description": "True when domain stakeholders verified an independently generated plain-language translation of the formal specification."
        }
      }
    },
    "factored_oversight": {
      "type": "object",
      "additionalProperties": false,
      "description": "Decomposed oversight tree controls mandatory for TIER-B workloads and optional for TIER-A.",
      "required": [
        "max_decomposition_depth",
        "modular_diff_contract_required",
        "independent_oversight_model_id",
        "distinct_from_generator_provider",
        "op01_blind_recall_wilson_lower_95_min",
        "op01_rater_kappa_min",
        "tree_escape_probability_budget_max",
        "global_compositional_canary_required"
      ],
      "properties": {
        "max_decomposition_depth": {
          "type": "integer",
          "minimum": 1,
          "maximum": 8,
          "description": "Maximum hierarchy depth of the factored oversight tree."
        },
        "modular_diff_contract_required": {
          "type": "boolean",
          "description": "Requires deterministic record-level or typed interface diffs at every sub-task boundary."
        },
        "independent_oversight_model_id": {
          "type": "string",
          "minLength": 2,
          "maxLength": 160
        },
        "distinct_from_generator_provider": {
          "type": "boolean",
          "description": "Requires the oversight assistant to come from a distinct provider/training pipeline than the proposal generator."
        },
        "op01_blind_recall_wilson_lower_95_min": {
          "type": "number",
          "minimum": 0.0,
          "maximum": 1.0,
          "description": "Minimum 95% Wilson lower confidence bound on OP-01 blind flaw-injection recall before tier promotion."
        },
        "op01_rater_kappa_min": {
          "type": "number",
          "minimum": 0.0,
          "maximum": 1.0,
          "description": "Minimum inter-rater Cohen's kappa required across independent reviewers (OP-01 floor: 0.70)."
        },
        "tree_escape_probability_budget_max": {
          "type": "number",
          "exclusiveMinimum": 0.0,
          "maximum": 0.25,
          "description": "Upper bound on correlated tree-level undetected flaw escape probability."
        },
        "global_compositional_canary_required": {
          "type": "boolean",
          "description": "Requires end-to-end integration invariants above leaf diffs to detect deceptive task decomposition."
        }
      }
    },
    "blast_radius_cap": {
      "type": "object",
      "additionalProperties": false,
      "description": "Hard operational envelope capping maximum state mutation, resource scope, and exposure per verified epoch.",
      "required": [
        "max_autonomy_execution_mode",
        "max_bounded_actions_per_epoch",
        "max_mutated_resources_per_action",
        "canary_traffic_ceiling_pct",
        "actuator_authority_envelope",
        "automated_circuit_breaker_bound"
      ],
      "properties": {
        "max_autonomy_execution_mode": {
          "type": "string",
          "enum": [
            "proof-gated-production",
            "staged-canary",
            "bounded-sandbox",
            "advisory-only-zero-execution"
          ]
        },
        "max_bounded_actions_per_epoch": {
          "type": "integer",
          "minimum": 0,
          "description": "Matches MaxBoundedActions in SovereignDelegationGate (tier-a-invariant-example.tla)."
        },
        "max_mutated_resources_per_action": {
          "type": "integer",
          "minimum": 0
        },
        "canary_traffic_ceiling_pct": {
          "type": "number",
          "minimum": 0.0,
          "maximum": 100.0
        },
        "financial_exposure_cap_usd": {
          "type": "number",
          "minimum": 0.0
        },
        "actuator_authority_envelope": {
          "type": "string",
          "minLength": 4,
          "maxLength": 500,
          "description": "Explicit enumeration of physical or API actuators allowed (or 'none' for advisory-only workloads)."
        },
        "automated_circuit_breaker_bound": {
          "type": "boolean",
          "description": "Requires independent watchdog / circuit-breaker fencing outside the AI runtime."
        }
      }
    },
    "rollback_sla": {
      "type": "object",
      "additionalProperties": false,
      "description": "Quantitative containment and rehearsed manual-fallback SLA linked to OP-01 containment envelopes.",
      "required": [
        "max_rollback_latency_min",
        "autonomy_action_horizon_min",
        "containment_horizon_ratio_min",
        "verified_checkpoint_required",
        "manual_fallback_drill_cadence_days",
        "degraded_manual_mode_documented"
      ],
      "properties": {
        "max_rollback_latency_min": {
          "type": "number",
          "exclusiveMinimum": 0.0,
          "description": "Maximum permitted minutes to halt execution, fence queued actions, and restore verified state."
        },
        "autonomy_action_horizon_min": {
          "type": "number",
          "minimum": 0.0,
          "description": "Time horizon (minutes) over which autonomous actions may operate before mandatory checkpointing."
        },
        "containment_horizon_ratio_min": {
          "type": "number",
          "minimum": 1.0,
          "description": "Required minimum ratio autonomy_action_horizon_min / max_rollback_latency_min (OP-01 floor: 4.0)."
        },
        "verified_checkpoint_required": {
          "type": "boolean",
          "description": "Requires rollbackReady = TRUE in SovereignDelegationGate prior to any bounded execution."
        },
        "manual_fallback_drill_cadence_days": {
          "type": "integer",
          "minimum": 1,
          "maximum": 365,
          "description": "Maximum interval between live manual-fallback rehearsals to prevent operator skill atrophy."
        },
        "last_manual_fallback_drill_utc": {
          "oneOf": [
            { "type": "string", "format": "date-time" },
            { "type": "null" }
          ],
          "description": "Timestamp of the most recently completed timed manual-fallback rehearsal (null if not yet rehearsed)."
        },
        "degraded_manual_mode_documented": {
          "type": "boolean",
          "description": "Confirms that a human-operable degraded mode runbook exists independent of frontier AI availability."
        }
      }
    },
    "human_sovereignty_override": {
      "type": "object",
      "additionalProperties": false,
      "description": "Non-overridable constitutional and operational human sovereignty controls.",
      "required": [
        "unilateral_halt_authority_roles",
        "hardware_or_control_plane_killswitch_id",
        "tier_reclassification_requires_human_governance",
        "democratic_or_institutional_authorization_required",
        "adversarial_epistemic_pluralism_required",
        "contestability_and_sunset_required",
        "sunset_review_interval_days"
      ],
      "properties": {
        "unilateral_halt_authority_roles": {
          "type": "array",
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "minLength": 2,
            "maxLength": 120
          },
          "description": "Human operational or oversight roles empowered to trip the circuit breaker unilaterally without AI concurrence."
        },
        "hardware_or_control_plane_killswitch_id": {
          "type": "string",
          "minLength": 3,
          "maxLength": 160,
          "description": "Out-of-band physical or control-plane halt mechanism verified outside the AI execution domain."
        },
        "tier_reclassification_requires_human_governance": {
          "const": true,
          "description": "Prohibits autonomous AI self-promotion across tiers (e.g., TIER-C -> TIER-B or TIER-B -> TIER-A)."
        },
        "democratic_or_institutional_authorization_required": {
          "type": "boolean",
          "description": "Requires documented democratic, statutory, or institutional board authorization prior to action. Mandatory true for TIER-C."
        },
        "adversarial_epistemic_pluralism_required": {
          "type": "boolean",
          "description": "Requires multi-provider Red-Blue-Steelman adversarial briefs and primary-source binding (OP-03). Mandatory true for TIER-C."
        },
        "contestability_and_sunset_required": {
          "type": "boolean",
          "description": "Requires recorded dissent, stakeholder appeal mechanisms, and mandatory sunset expiration. Mandatory true for TIER-C."
        },
        "sunset_review_interval_days": {
          "type": "integer",
          "minimum": 1,
          "maximum": 730,
          "description": "Maximum calendar days before this delegation policy automatically expires unless explicitly re-authorized by humans."
        }
      }
    },
    "audit_attestation": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "policy_manifest_sha256": {
          "$ref": "#/$defs/Sha256Hex"
        },
        "tla_gate_module_ref": {
          "type": "string",
          "description": "Reference to the formal state-machine specification enforcing runtime transitions (e.g., SovereignDelegationGate)."
        },
        "build_provenance_standard": {
          "type": "string",
          "description": "Cryptographic provenance standard binding code to verified proofs (e.g., SLSA-v1.0, in-toto)."
        }
      }
    }
  },
  "allOf": [
    {
      "$comment": "Hard Constitutional Trigger 1: open-value, irreversible, or public-rights workloads MUST be routed to TIER-C.",
      "if": {
        "required": ["classification_inputs"],
        "properties": {
          "classification_inputs": {
            "anyOf": [
              {
                "required": ["specifiability"],
                "properties": { "specifiability": { "const": "open-value" } }
              },
              {
                "required": ["reversibility"],
                "properties": { "reversibility": { "const": "irreversible" } }
              },
              {
                "required": ["stakeholder_scope"],
                "properties": { "stakeholder_scope": { "const": "public-rights" } }
              }
            ]
          }
        }
      },
      "then": {
        "properties": {
          "assigned_tier": { "const": "TIER-C" }
        }
      }
    },
    {
      "$comment": "Hard Constitutional Trigger 2: high Goodhart risk paired with low verification asymmetry MUST be routed to TIER-C.",
      "if": {
        "required": ["classification_inputs"],
        "properties": {
          "classification_inputs": {
            "required": ["goodhart_risk", "verification_asymmetry"],
            "properties": {
              "goodhart_risk": { "const": "high" },
              "verification_asymmetry": { "const": "low" }
            }
          }
        }
      },
      "then": {
        "properties": {
          "assigned_tier": { "const": "TIER-C" }
        }
      }
    },
    {
      "$comment": "TIER-A Policy Invariants: strict formal kernel eligibility, zero unverified bypass, dual spec review, and verified rollback.",
      "if": {
        "required": ["assigned_tier"],
        "properties": {
          "assigned_tier": { "const": "TIER-A" }
        }
      },
      "then": {
        "properties": {
          "classification_inputs": {
            "properties": {
              "specifiability": { "const": "formal" },
              "verification_asymmetry": { "const": "high" },
              "goodhart_risk": { "const": "low" },
              "reversibility": { "enum": ["instant", "staged-rollback"] },
              "stakeholder_scope": { "enum": ["individual", "team", "critical-infra"] }
            }
          },
          "formal_verifier": {
            "required": ["trusted_kernel_loc_budget"],
            "properties": {
              "verifier_class": { "$ref": "#/$defs/FormalKernelClass" },
              "unverified_bypass_allowed": { "const": false },
              "proof_attestation_required": { "const": true },
              "prohibit_unproven_axioms": { "const": true }
            }
          },
          "specification_dual_review": {
            "properties": {
              "dual_signoff_complete": { "const": true },
              "reviewers": { "minItems": 2 },
              "adversarial_property_fuzzing": {
                "properties": {
                  "completed": { "const": true }
                }
              },
              "plain_language_backtranslation_audited": { "const": true }
            }
          },
          "blast_radius_cap": {
            "properties": {
              "max_autonomy_execution_mode": {
                "enum": ["proof-gated-production", "staged-canary", "bounded-sandbox"]
              },
              "automated_circuit_breaker_bound": { "const": true }
            }
          },
          "rollback_sla": {
            "properties": {
              "containment_horizon_ratio_min": { "minimum": 4.0 },
              "verified_checkpoint_required": { "const": true },
              "degraded_manual_mode_documented": { "const": true }
            }
          }
        }
      }
    },
    {
      "$comment": "TIER-B Policy Invariants: mandatory factored oversight tree, OP-01 audit gates, staged canary or sandbox cap, and 4x containment SLA.",
      "if": {
        "required": ["assigned_tier"],
        "properties": {
          "assigned_tier": { "const": "TIER-B" }
        }
      },
      "then": {
        "required": ["factored_oversight"],
        "properties": {
          "formal_verifier": {
            "properties": {
              "unverified_bypass_allowed": { "const": false }
            }
          },
          "specification_dual_review": {
            "properties": {
              "dual_signoff_complete": { "const": true },
              "reviewers": { "minItems": 2 }
            }
          },
          "factored_oversight": {
            "properties": {
              "modular_diff_contract_required": { "const": true },
              "distinct_from_generator_provider": { "const": true },
              "op01_blind_recall_wilson_lower_95_min": { "minimum": 0.8 },
              "op01_rater_kappa_min": { "minimum": 0.7 },
              "global_compositional_canary_required": { "const": true }
            }
          },
          "blast_radius_cap": {
            "properties": {
              "max_autonomy_execution_mode": {
                "enum": ["staged-canary", "bounded-sandbox"]
              },
              "automated_circuit_breaker_bound": { "const": true }
            }
          },
          "rollback_sla": {
            "properties": {
              "containment_horizon_ratio_min": { "minimum": 4.0 },
              "verified_checkpoint_required": { "const": true },
              "degraded_manual_mode_documented": { "const": true }
            }
          }
        }
      }
    },
    {
      "$comment": "TIER-C Policy Invariants: hard prohibition on autonomous execution, advisory-only AI scope, and mandatory democratic/pluralistic sovereignty controls.",
      "if": {
        "required": ["assigned_tier"],
        "properties": {
          "assigned_tier": { "const": "TIER-C" }
        }
      },
      "then": {
        "properties": {
          "autonomous_execution_permitted": { "const": false },
          "formal_verifier": {
            "properties": {
              "verifier_class": { "const": "pluralistic-human-deliberation" },
              "unverified_bypass_allowed": { "const": false }
            }
          },
          "blast_radius_cap": {
            "properties": {
              "max_autonomy_execution_mode": { "const": "advisory-only-zero-execution" },
              "max_bounded_actions_per_epoch": { "const": 0 },
              "max_mutated_resources_per_action": { "const": 0 }
            }
          },
          "human_sovereignty_override": {
            "properties": {
              "democratic_or_institutional_authorization_required": { "const": true },
              "adversarial_epistemic_pluralism_required": { "const": true },
              "contestability_and_sunset_required": { "const": true }
            }
          }
        }
      }
    }
  ],
  "$defs": {
    "DelegationTier": {
      "type": "string",
      "enum": ["TIER-A", "TIER-B", "TIER-C"],
      "description": "TIER-A: Proof-Carrying Kernel Delegation; TIER-B: Factored Oversight Tree & Staged Rollout; TIER-C: Hard Human Sovereignty Boundary."
    },
    "FormalKernelClass": {
      "type": "string",
      "enum": [
        "lean4",
        "coq",
        "isabelle-hol",
        "tla-plus",
        "smt-solver",
        "deterministic-oracle"
      ],
      "description": "Machine-checkable formal verifier classes eligible for TIER-A proof-carrying delegation."
    },
    "VerifierClass": {
      "type": "string",
      "enum": [
        "lean4",
        "coq",
        "isabelle-hol",
        "tla-plus",
        "smt-solver",
        "deterministic-oracle",
        "factored-oversight-tree",
        "pluralistic-human-deliberation"
      ]
    },
    "Sha256Hex": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$",
      "description": "Lowercase hexadecimal SHA-256 cryptographic digest."
    },
    "SpecReviewerSignoff": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "reviewer_id",
        "affiliation",
        "role",
        "independent_of_author",
        "signed_utc",
        "signature_alg",
        "signature_digest"
      ],
      "properties": {
        "reviewer_id": {
          "type": "string",
          "minLength": 2,
          "maxLength": 120
        },
        "affiliation": {
          "type": "string",
          "minLength": 2,
          "maxLength": 160
        },
        "role": {
          "type": "string",
          "enum": [
            "formal-methods-engineer",
            "domain-safety-engineer",
            "independent-red-team-auditor",
            "institutional-governance-signatory"
          ]
        },
        "independent_of_author": {
          "type": "boolean",
          "description": "Attests organizational or team independence from the specification's primary author."
        },
        "signed_utc": {
          "type": "string",
          "format": "date-time"
        },
        "signature_alg": {
          "type": "string",
          "enum": ["ed25519", "ecdsa-p256", "rsa-pss-sha256"]
        },
        "signature_digest": {
          "type": "string",
          "minLength": 32,
          "maxLength": 512
        }
      }
    }
  }
}
