{
  "schema": "mathcast.d15.scheduler-publisher/v1",
  "plan_code": "D15-022",
  "status": "VERIFIED_CONTRACT",
  "runtime_started": false,
  "default_mode": "MANUAL_ONLY_DEFAULT_DENY",
  "inputs": ["capacity_snapshot", "policy_version", "queue", "manual_lock", "cooldown", "recovery_window"],
  "capacity_gate": {
    "green": "ADMIT_AUTONOMOUS",
    "amber": "DEFER_AUTONOMOUS",
    "red": "DENY_AND_PAUSE",
    "admission_samples": 3,
    "admission_window_seconds": 45,
    "snapshot_max_age_seconds": 60,
    "pilot_max_active_writer_runs": 1,
    "cooldown_seconds": 600,
    "recovery_observation_seconds": 300,
    "recovery_green_samples": 3,
    "amber_override": {"allowed": true, "requires": ["actor", "reason", "expiry", "audit_event"]},
    "red_override": {"allowed": false}
  },
  "tick": {
    "idempotency_key": "project_id+policy_version+admission_window+topic_set_hash",
    "duplicate_tick_creates_new_run": false,
    "events": ["TICK_EVALUATED", "RUN_DEFERRED", "RUN_ADMITTED", "RECOVERY_WAIT"]
  },
  "lease": {
    "heartbeat_seconds": 15,
    "lease_seconds": 60,
    "recheck_seconds": 60,
    "stale_owner_may_complete": false,
    "checkpoints": ["discovery", "extraction", "research", "editorial_brief", "draft", "html", "qa", "registry_handoff"]
  },
  "retry": {
    "transient": ["network", "5xx"],
    "max_attempts": 3,
    "non_retryable": ["auth", "robots", "permission", "schema", "rights", "policy"]
  },
  "controls": {
    "cancel_state": "CANCEL_REQUESTED",
    "kill_switch": "MANUAL_LOCK",
    "kill_switch_stops_new_claims": true,
    "kill_switch_deletes_evidence": false,
    "activity_append_only": true
  },
  "publisher": {
    "input_status": "READY_FOR_PUBLICATION",
    "qa_allowed": ["PASS", "PASS_WITH_WARNINGS"],
    "requires": ["human_approval", "project_scope", "complete_publication_package", "unchanged_revision_hash", "rights_check", "destination_check", "unique_publication_idempotency_key"],
    "qwen_can_publish": false,
    "image_worker_can_publish": false,
    "ui_can_publish_directly": false,
    "automatic_promotion_to_ready": false,
    "success_state": "PUBLISHED",
    "failure_state": "PUBLISH_FAILED",
    "previous_published_pointer_survives_failure": true,
    "same_key_same_input": "return_original_result",
    "same_key_different_input": "IDEMPOTENCY_CONFLICT"
  },
  "required_events": ["HEARTBEAT", "LEASE_LOST", "KILL_SWITCH_ON", "PUBLISH_CHECKED", "PUBLISH_SUCCEEDED", "PUBLISH_FAILED"],
  "fixtures": ["green_admission", "amber_defer", "stale_metrics", "red_hard_stop", "manual_lock", "recovery_window", "cooldown", "duplicate_tick", "idempotency_conflict", "crash_after_checkpoint", "expired_lease", "old_worker_completion_rejected", "transient_retry", "permission_failure_no_retry", "cancel_race", "publisher_without_approval", "publisher_without_qa", "changed_hash", "incomplete_package", "duplicate_publish", "destination_failure", "atomic_publish_success"],
  "not_run": ["cron", "systemd", "scheduler_service", "worker", "publisher", "migrations", "api_server", "mcp_server", "qwen_run", "comfy_workflow", "production_publication"],
  "rollback": {"disable_admissions": true, "preserve_queue_evidence_activity": true, "keep_previous_published_pointer": true, "restore_policy_version": true, "delete_source_evidence": false}
}
