turnstone/app/services
pyr0ball 01f0e45222 feat: anomaly scoring pipeline (#10)
- Add app/services/anomaly.py: batch scorer using HF text-classification
  pipeline; rewrites anomaly_score/anomaly_label/anomaly_scored_at on
  log_entries; inserts high-confidence hits into detections table
- Add app/tasks/anomaly_scorer.py: background task (same shape as
  glean_scheduler); triggered after each glean cycle when
  TURNSTONE_ANOMALY_MODEL is set
- DB schema: add anomaly_score/anomaly_label/anomaly_scored_at columns to
  log_entries (idempotent ALTER TABLE migration); add detections table
- Wire scorer into scheduler_loop and glean_scheduler.run_once; no-op when
  model env var is empty (safe to leave unconfigured)
- REST endpoints: GET/POST /api/anomaly/status, /api/anomaly/run,
  GET /api/anomaly/detections, POST /api/anomaly/detections/{id}/acknowledge
- Reuses Hybrid-BERT label map from diagnose/classifier.py; works with any
  HF text-classification model
- 12 new tests; 406/406 passing

Closes: #10
2026-06-09 11:15:13 -07:00
..
diagnose Merge feat/32-domain-view: domain-view mapping for patterns and diagnose output (#32) 2026-06-01 20:01:19 -07:00
__init__.py feat: initial Turnstone POC — ingest, FTS search, MCP server 2026-05-08 12:12:34 -07:00
anomaly.py feat: anomaly scoring pipeline (#10) 2026-06-09 11:15:13 -07:00
blocklist.py feat: dual-backend SQLite/Postgres + multi-tenant source namespacing 2026-06-08 08:37:54 -07:00
discover.py feat: bundle PII sanitization, onboarding wizard, NL source addition (#51, #52, #53) 2026-05-29 14:14:28 -07:00
embeddings.py refactor: extract embeddings service layer — decouple context embedder from Ollama 2026-05-25 11:01:25 -07:00
incidents.py feat: dual-backend SQLite/Postgres + multi-tenant source namespacing 2026-06-08 08:37:54 -07:00
llm.py fix(diagnose): add max_tokens to all LLM calls; fix reasoning card contrast 2026-05-27 22:23:36 -07:00
models.py feat: domain-view mapping for patterns and diagnose output (#32) 2026-06-01 19:57:16 -07:00
nl_source.py feat: bundle PII sanitization, onboarding wizard, NL source addition (#51, #52, #53) 2026-05-29 14:14:28 -07:00
pihole.py feat(blocklist): 6 REST endpoints + Pi-hole settings fields 2026-05-15 21:15:09 -07:00
search.py feat: dual-backend SQLite/Postgres + multi-tenant source namespacing 2026-06-08 08:37:54 -07:00