#!/usr/bin/env python3
import os, subprocess, sys
REPO='/home/agent/projects/CryptoTradingBot/Crypto_Agent'
os.chdir(REPO)
res=subprocess.run(['.venv/bin/python','-m','src.tools.hl_reconcile_watchdog','--quiet-ok'], text=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, timeout=180)
# no_agent cron: silence on OK, emit only critical/failures
if res.returncode == 0:
    sys.exit(0)
print(res.stdout.strip())
sys.exit(res.returncode)
