07c5f9a5c2
- New oracle/ package (11 modules) with unified CLI (python -m oracle) - Source tiers: Tier 1 (arxiv/github/hf), Tier 2 (rss/hn), Tier 3 (reddit) - Composite verdicts: PUBLISH/WATCH/ARCHIVE/DROP based on signal score + age - Content-hash dedup: SHA-256[:16] normalized, atomic at insert time - Multi-variant editions: 4 YAML configs (default/research/devops/brief) - Variant engine: filter → rank → render (HTML + JSON, themed) - Per-adapter timeout (10s) + threading fallback - Consolidated 12 root scripts → thin wrappers + oracle/ package - Archived stale scripts (_engagement, _live_compare, reddit_proof) - Updated .gitignore, README.md, schema.sql
30 lines
999 B
Python
30 lines
999 B
Python
#!/usr/bin/env python3
|
|
"""Thin wrapper — delegates to oracle.recency filter_fresh + analysis."""
|
|
import sys, os
|
|
sys.path.insert(0, os.path.dirname(__file__))
|
|
|
|
from datetime import datetime, timezone
|
|
from oracle.clickability import fetch_items, compute_index, decay_index
|
|
from oracle.recency import filter_fresh, blend_score
|
|
import sqlite3
|
|
from oracle.config import DB_PATH, HALF_LIFE_H
|
|
|
|
conn = sqlite3.connect(str(DB_PATH))
|
|
items = fetch_items(conn)
|
|
conn.close()
|
|
|
|
items = compute_index(items)
|
|
items = decay_index(items, HALF_LIFE_H)
|
|
|
|
today, older_new, dropped = filter_fresh(items)
|
|
|
|
print(f"=== Recency Guard ===")
|
|
print(f" Total items: {len(items)}")
|
|
print(f" TODAY (always eligible): {len(today)}")
|
|
print(f" OLDER but never posted: {len(older_new)}")
|
|
print(f" DROPPED (posted + old): {len(dropped)}")
|
|
print()
|
|
|
|
for it in sorted(today, key=lambda x: x["clickability_decayed"], reverse=True)[:5]:
|
|
print(f" [TODAY {it['clickability_decayed']:.2f}] {it['source']:10} {it['title'][:60]}")
|