#!/usr/bin/env python3
"""2026-10-23 pass 3: higgsfield_ai chronology (Ideogram Vector), Kling_ai, new-signal full texts."""
import json
from datetime import datetime, timezone

D = "/home/kiro/trend-engine/trends/x/raw/scan_results_2026-10-23_FULL.json"
d = json.load(open(D))
raw, qual = d["raw"], d["qualifying"]
cutoff = datetime(2026, 10, 20, 0, 0, tzinfo=timezone.utc)

def pdate(s):
    return datetime.strptime(s, "%a %b %d %H:%M:%S %z %Y")

for h in ("higgsfield_ai", "higgsfield", "Kling_ai", "EHuanglu", "azed_ai", "AIWarper", "pika_labs", "runwayml"):
    print("\n===== %s (n=%d) =====" % (h, len(raw.get(h, []))))
    arr = sorted(raw.get(h, []), key=lambda t: pdate(t["createdAt"]))
    for t in arr:
        dt = pdate(t["createdAt"])
        mark = "" if dt >= cutoff else "  [OUT]"
        print("%s %6dL/%5dRT/%9dV%s %s" % (dt.strftime("%m-%d %H:%M"), t.get("likeCount", 0),
                                           t.get("retweetCount", 0), t.get("viewCount", 0), mark,
                                           (t.get("text") or "").replace("\n", " ")[:220]))
