"""Promotion governance: bound the autonomous promote-to-capital decision. Kill-switch halts all; otherwise
the budget is min(free deployed slots, per-cycle burst cap)."""
from __future__ import annotations


def promote_budget(*, kill_switch: bool, deployed: int, max_deployed: int, max_new_per_cycle: int) -> int:
    if kill_switch:
        return 0
    free = max(0, max_deployed - deployed)
    return min(free, max(0, max_new_per_cycle))
