chrysopedia/backend/routers
jlightner c2db9aa011 feat: Pipeline runs — per-execution tracking with run-scoped events
Data model:
- New pipeline_runs table (id, video_id, run_number, trigger, status,
  started_at, finished_at, error_stage, total_tokens)
- pipeline_events gains run_id FK (nullable for backward compat)
- Alembic migration 010_add_pipeline_runs

Backend:
- run_pipeline() creates a PipelineRun, threads run_id through all stages
- _emit_event() and _make_llm_callback() accept and store run_id
- Stage 6 (final) calls _finish_run() to mark complete with token totals
- mark_pipeline_error marks run as error
- Revoke marks running runs as cancelled
- Trigger endpoints pass trigger type (manual, clean_reprocess)
- New GET /admin/pipeline/runs/{video_id} — lists runs with event counts
- GET /admin/pipeline/events supports ?run_id= filter

Frontend:
- Expanded video detail now shows RunList instead of flat EventLog
- Each run is a collapsible card showing: run number, trigger type,
  status badge, timestamps, token count, event count
- Latest run auto-expands, older runs collapsed
- Legacy events (pre-run-tracking) shown as separate collapsible section
- Run cards color-coded: cyan border for running, red for error,
  gray for cancelled
- EventLog accepts optional runId prop to scope events to a single run
2026-03-31 17:13:41 +00:00
..
__init__.py fix: restore complete project tree from ub01 canonical state 2026-03-31 02:10:41 +00:00
creators.py feat: Added hidden boolean column to Creator model, migration marking T… 2026-03-31 05:13:17 +00:00
health.py fix: restore complete project tree from ub01 canonical state 2026-03-31 02:10:41 +00:00
ingest.py feat: meaningful pipeline status lifecycle — Not Started → Queued → In Progress → Complete/Errored 2026-03-31 02:43:49 +00:00
pipeline.py feat: Pipeline runs — per-execution tracking with run-scoped events 2026-03-31 17:13:41 +00:00
reports.py fix: restore complete project tree from ub01 canonical state 2026-03-31 02:10:41 +00:00
search.py test: Added GET /api/v1/search/suggestions endpoint returning popular t… 2026-03-31 06:35:37 +00:00
techniques.py feat: Added GET /api/v1/techniques/random endpoint returning {slug}, fe… 2026-03-31 08:24:38 +00:00
topics.py test: Added GET /topics/{category_slug}/{subtopic_slug} endpoint filter… 2026-03-31 05:59:36 +00:00
videos.py fix: restore complete project tree from ub01 canonical state 2026-03-31 02:10:41 +00:00