chrysopedia/alembic/versions
jlightner f0d0b8ac1a feat: add pipeline iteration tooling — offline test harness, stage re-runs, chunking inspector
Drops prompt iteration cycles from 20-30 min to under 5 min by enabling
stage-isolated re-runs and offline prompt testing against exported fixtures.

Phase 1: Offline prompt test harness
- export_fixture.py: export stage 5 inputs from DB to reusable JSON fixtures
- test_harness.py: run synthesis offline with any prompt, no Docker needed
- promote subcommand: deploy winning prompts with backup and optional git commit

Phase 2: Classification data persistence
- Dual-write classification to PostgreSQL + Redis (fixes 24hr TTL data loss)
- Clean retrigger now clears Redis cache keys (fixes stale data bug)
- Alembic migration 011: classification_data JSONB column + stage_rerun enum

Phase 3: Stage-isolated re-run
- run_single_stage Celery task with prerequisite validation and prompt overrides
- _load_prompt supports per-video Redis overrides for testing custom prompts
- POST /admin/pipeline/rerun-stage/{video_id}/{stage_name} endpoint
- Frontend: Re-run Stage modal with stage selector and prompt override textarea

Phase 4: Chunking inspector
- GET /admin/pipeline/chunking/{video_id} returns topic boundaries,
  classifications, and synthesis group breakdowns
- Frontend: collapsible Chunking Inspector panel per video

Phase 5: Prompt deployment & stale data cleanup
- GET /admin/pipeline/stale-pages detects pages from older prompts
- POST /admin/pipeline/bulk-resynthesize re-runs a stage on all completed videos
- Frontend: stale pages indicator badge with one-click bulk re-synth

Phase 6: Automated iteration foundation
- Quality CLI --video-id flag auto-exports fixture from DB
- POST /admin/pipeline/optimize-prompt/{stage} dispatches optimization as Celery task

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 15:47:46 +00:00
..
001_initial.py fix: restore complete project tree from ub01 canonical state 2026-03-31 02:10:41 +00:00
002_technique_page_versions.py fix: restore complete project tree from ub01 canonical state 2026-03-31 02:10:41 +00:00
003_content_reports.py fix: restore complete project tree from ub01 canonical state 2026-03-31 02:10:41 +00:00
004_pipeline_events.py fix: restore complete project tree from ub01 canonical state 2026-03-31 02:10:41 +00:00
005_content_hash.py fix: restore complete project tree from ub01 canonical state 2026-03-31 02:10:41 +00:00
006_debug_columns.py fix: restore complete project tree from ub01 canonical state 2026-03-31 02:10:41 +00:00
007_drop_review_columns.py feat: remove review workflow — unused gate that blocked nothing 2026-03-31 02:34:12 +00:00
008_rename_processing_status.py fix: drop server_default before dropping enum type in migration 008 2026-03-31 02:46:30 +00:00
009_add_creator_hidden_flag.py feat: Added hidden boolean column to Creator model, migration marking T… 2026-03-31 05:13:17 +00:00
010_add_pipeline_runs.py feat: Pipeline runs — per-execution tracking with run-scoped events 2026-03-31 17:13:41 +00:00
011_classification_cache_and_stage_rerun.py feat: add pipeline iteration tooling — offline test harness, stage re-runs, chunking inspector 2026-04-02 15:47:46 +00:00