3 Commits

Author SHA1 Message Date
Epictetus 641d531d88 Sprint 3: Anti-bot retrieval layer + metrics module
Anti-bot changes (all 6 adapters):
- Browser-grade User-Agent rotation (Chrome/Firefox on Linux/Windows)
- Shared browser_headers() with Accept, Accept-Language, DNT
- Session-consistent UA fingerprint (picked once, not per-request)
- jitter_sleep() replaces fixed time.sleep() on all adapters
- Exponential backoff on 429/503 already on reddit, now consistent

New shared module:
- adapters/__init__.py: browser_user_agent(), browser_headers(), jitter_sleep()
- adapters/_http.py: HTTPClient class for future browser-mode adapters

Metrics module (from Sprint 2 carry):
- oracle/metrics.py: MetricsRun for log_adapter/log_verdicts/log_scores
- oracle/weekly.py: SYSTEM HEALTH section wired to adapter_health
- oracle/cli.py: metrics subparser with --adapters/--publish/--scores/--alerts

Before: bot signatures like 'ai-oracle/0.1', 'python:athena:v0.1'
After: 'Mozilla/5.0 (X11; Linux x86_64; rv:139.0) Gecko/20100101 Firefox/139.0'
2026-07-22 14:26:42 +00:00
Epictetus feba2fe7b7 feat: apply fix/adapter-health-1-2-9 changes (unified retry, failure_class, RSS enabled)
- adapters/__init__.py: add http_get() unified retry helper + AdapterHTTPError
  + failure_class classification (429/5xx/4xx/error/zero_fetch/ok)
  + last_failure_class on SourceAdapter for pipeline capture
- pipeline.py: ENABLED_SOURCES now includes RSS
  + failure_class rollup in run_log (most severe across all adapters)
  + per-source failure_class in source_stats
- schema.sql: add failure_class column to run_log table

Backport of fix/adapter-health-1-2-9 branch (issues #1, #2, #9).
2026-07-12 04:51:24 +00:00
Epictetus 67c002b665 Initial commit: Oracle AI research pipeline (adapters, pipeline, summarize, query)
Source-controlled baseline before Phase 5 cron. Excludes oracle.db,
logs/, and __pycache__ via .gitignore. Pipeline verified running
clean end-to-end (run_log write confirmed before conn.close()).
2026-07-08 04:03:36 +00:00