#!/usr/bin/env python3
"""Vérifier pourquoi ready_signals = 0"""
from ai_predictor import AIPredictor

p = AIPredictor()
wl = p.get_watchlist()

print(f"\n📊 WATCHLIST: {len(wl)} symboles")

# Compter par status
status_counts = {}
for w in wl:
    status = w.get('status', 'unknown')
    status_counts[status] = status_counts.get(status, 0) + 1

print("\n📋 RÉPARTITION STATUS:")
for status, count in sorted(status_counts.items()):
    print(f"  {status}: {count}")

# Afficher les status=ready
ready = [w for w in wl if w.get('status') == 'ready']
print(f"\n✅ STATUS=READY: {len(ready)}")
for w in ready[:10]:
    symbol = w.get('symbol', '?')
    score = w.get('score', 0)
    smart_signal = w.get('smart_signal', '?')
    smart_eligible = w.get('smart_eligible', False)
    pattern = w.get('pattern', '?')
    print(f"  {symbol}: score={score} smart_signal={smart_signal} smart_eligible={smart_eligible} pattern={pattern}")

# Vérifier smart_eligible
eligible = [w for w in wl if w.get('smart_eligible') == True]
print(f"\n🎯 SMART_ELIGIBLE=TRUE: {len(eligible)}")
for w in eligible[:10]:
    symbol = w.get('symbol', '?')
    score = w.get('score', 0)
    smart_signal = w.get('smart_signal', '?')
    status = w.get('status', '?')
    print(f"  {symbol}: score={score} smart_signal={smart_signal} status={status}")

# Les signaux qui DEVRAIENT être ready
should_be_ready = [w for w in wl if w.get('status') == 'ready' and w.get('smart_eligible') == True]
print(f"\n🔥 DEVRAIENT ÊTRE EN READY_SIGNALS: {len(should_be_ready)}")
for w in should_be_ready:
    print(f"  {w.get('symbol')}: score={w.get('score')} pattern={w.get('pattern')}")
