# Orchestration Runtime Policy
#
# Where orchestration is allowed to run, and how data classification constrains
# runtime selection. Aligned with SPB-10, SPB-11, and Phase 7 routing-policy.

version: 1

# Allowed runtimes for the orchestration agent itself
orchestration_runtimes:
  local:
    allowed: true
    max_autonomy: bounded_edit_with_approval
    notes: "Default for control-plane operations. Approval-gated for state changes."
  home_lab:
    allowed: true
    max_autonomy: bounded_edit_with_approval
    notes: "For workloads needing custom hardware or LAN-only services."
  cloud:
    allowed: true
    max_autonomy: bounded_edit_with_approval
    notes: "For long-running workloads that handle non-sensitive data only."

# Data classification → runtime constraints (SPB-10)
data_class_to_runtime:
  private_sensitive:
    allowed_runtimes: [local, home_lab]
    cloud_allowed: false
    rationale: "Private-sensitive data must not leave local or home-lab."
  internal:
    allowed_runtimes: [local, home_lab, cloud]
    cloud_allowed: true
    cloud_constraints:
      audit_required: true
      egress_allowlist_required: true
  low_sensitive:
    allowed_runtimes: [local, home_lab, cloud]
    cloud_allowed: true

# Cross-runtime restrictions
cross_runtime:
  cloud_can_spawn_home_lab: false
  cloud_can_spawn_local: false
  home_lab_can_spawn_cloud: false      # only orchestration_owner explicitly approves
  local_can_spawn_cloud: true_with_approval

# Mismatch behavior
on_mismatch:
  action: deny
  log_audit_event: true                # SPB-12
  emit_alert: true

# Default autonomy ceilings (cannot be exceeded by per-task config)
autonomy_ceiling:
  local: bounded_edit_with_approval
  home_lab: bounded_edit_with_approval
  cloud: bounded_edit_with_approval
