"""Guard: Alpaca is a dead execution broker (rebalancer CronJob suspended, keys 401). IBKR is the sole
equity executor — the Broker port stays, but no Alpaca-specific code/config may remain in src/fxhnt."""
import pathlib
import subprocess


def test_no_alpaca_symbols_in_src():
    root = pathlib.Path(__file__).parents[2] / "src" / "fxhnt"
    hits = subprocess.run(["grep", "-rin", "alpaca", str(root)], capture_output=True, text=True).stdout
    assert not hits.strip(), f"residual Alpaca references:\n{hits}"


def test_broker_port_ibkr_only():
    from fxhnt.adapters.broker.ibkr import IbkrBroker   # the sole impl still imports

    assert IbkrBroker is not None
