# AI-Radar — Sprint B Fetcher

Halb-automatischer Fetch-Lauf. Holt Items aus 5 Plattformen, dedupliziert, schreibt JSON-Snapshot. Synthese bleibt manuell (Sprint A pattern).

> Quelle: `brain/02-Wissen/ai-radar/architecture.md` Sprint B
> Linear: `KAR-38`

## Komponenten

- `aria-radar-fetch.sh` — systemd-Entrypoint (sourced `.env`, ruft Python)
- `aria-radar-fetch.py` — Orchestrator
- `normalizer.py` — `{title, url, date, source, score, raw}` Schema
- `dedupe.py` — SHA256(url) gegen `seen_urls.txt`
- `snapshot.py` — JSON-Writer
- `platforms/` — pro Plattform 1 Modul mit `fetch(since=...)` → `list[dict]`

## Bedienung

```bash
# Dry-Run (kein Snapshot, kein State-Update)
python3 /root/aria/scripts/ai-radar/aria-radar-fetch.py --dry-run

# Voll-Lauf (manuell)
/root/aria/scripts/ai-radar/aria-radar-fetch.sh

# Via systemd (täglich 06:30 Europe/Berlin)
systemctl start aria-radar-fetch.service
systemctl list-timers aria-radar-fetch.timer
journalctl -u aria-radar-fetch.service --since="1h ago"
```

## Outputs

- `/var/lib/aria-radar/snapshots/YYYY-MM-DD.json` — täglicher Snapshot
- `/var/lib/aria-radar/state/seen_urls.txt` — rolling Dedupe-Set
- Snapshots >30 Tage werden vom Orchestrator gelöscht

## Plattform-Helper (8 v1)

Jeder Helper exportiert `fetch(since: datetime, **kwargs) -> list[dict]`. Required keys im Output: `title`, `url`, `date`, `source`. Optional: `score`, `raw`.

Bei Fehler: empty list, Log-Eintrag mit Traceback. Plattform-Skip blockt andere Plattformen nicht.

| Plattform | Methode | Auth | Anmerkung |
|---|---|---|---|
| `github` | REST `/search/repositories` Tier-1-Topics | PAT | 10 Topics, 5/Topic, dedupe |
| `github_trending` | HTML-Scrape `/trending?since=daily` | — | regex defensiv |
| `hackernews` | Algolia REST `tags=story` | — | `points>50`, 24h |
| `anthropic_docs` | raw CHANGELOG + platform docs | — | claude-code Versions + API release-notes |
| `huggingface` | REST `/api/models` | — | `sort=lastModified`, `pipeline_tag=text-generation` |
| `bluesky` | `api.bsky.app/xrpc/...searchPosts` | — | NICHT `public.api.bsky.app` (403!) |
| `mastodon` | RSS pro User | — | aktuell nur fedi.simonwillison.net |
| `mcp_so` | HTML-Scrape `mcp.so` | — | Server-Cards via regex |

## Skip in v1 (Sprint C+)
- **Reddit** (Kais 13.05.2026: „skip OK") — WebFetch fragil ohne API-Key
- **X/Twitter** — kein API-Token
- **Product Hunt** — Sprint C
- **Auto-Watchlist** (`aria-radar-auto-watchlist.py`) — separate Komponente, Sub-Issue von KAR-38

## Sicherheits-Constraints

Per `brain/02-Wissen/ai-radar/SYSTEM-PROMPT.md` §2:
- Keine Secrets in Snapshots (Normalizer filtert nichts — Plattform-Helper sind verantwortlich)
- Keine Account-Creation, kein Login
- Bei MFA/Captcha/kostenpflichtigem Zugriff: Helper returnt empty + log

## Verwandt

- `brain/02-Wissen/ai-radar/architecture.md`
- `brain/02-Wissen/ai-radar/source-registry.md`
- `brain/02-Wissen/ai-radar/watchlist.md`
- `brain/01-Projekte/kar-38-ai-radar-sprint-b/` (Doc-Manager-Files)
