#!/usr/bin/env bash
# Evidence script for suggest resolve: score_signal.py unit tests
# Run from repo root. Expects Python 3.12 at standard Windows install path.

set -e

cd "$(dirname "$0")/../.."

PY="C:/Users/kiexp/AppData/Local/Programs/Python/Python312/python.exe"

echo "========================================"
echo "  Feature #1: score_signal.py SELFTEST"
echo "========================================"
echo ""

"$PY" scripts/signal_capture/score_signal.py

echo ""
echo "========================================"
echo "  Sample scoring on DIAMOND setup"
echo "========================================"

"$PY" -c "
import sys, json
sys.path.insert(0, 'scripts')
import pandas as pd
from signal_capture.score_signal import score_signal

volumes = [100]*25 + [190, 180, 195, 185, 200] + [500] + [480]*10
closes  = [100.0]*25 + [100.5, 101.0, 101.5, 102.0, 102.5] + [108.0] + [110.0]*10
dates   = pd.date_range('2026-01-05', periods=len(volumes), freq='B')
df = pd.DataFrame({'open':closes,'high':closes,'low':closes,'close':closes,'volume':volumes}, index=dates)

result = score_signal(df, dates[30].strftime('%Y-%m-%d'))
print(json.dumps(result, ensure_ascii=False, indent=2))
"

echo ""
echo "✅ All tests passed + sample output shown"
