The load callback had expandedRunId in its dependency array, so collapsing
(setting expandedRunId=null) triggered a reload which re-expanded it.
Replaced with a useRef flag that fires once.
- Move key moments below prose as bibliography-style sources with [N] indices
- Move signal chains and related techniques to main column below key moments
- Sidebar now dedicated to ToC only, sticky with scroll tracking
- Replace position:fixed reading header with sticky title bar within content area
- ToC smooth-scrolls on click with history.replaceState for hash updates
- Featured technique card: solid cyan-to-purple gradient border (border-image)
- Remove ReadingHeader component (replaced by title bar)
- Hide sidebar ToC on mobile (single-column reading)
- Related techniques grid defaults to 2-column in main content area
M016 added useState/useMemo/useEffect hooks after conditional early
returns (loading/notFound/error), violating React rules of hooks.
Moved all hooks above the early returns so they execute on every render.
- Expanded runs now show horizontal stage tabs (Segment→Extract→Classify→Synthesize→Embed)
- Each tab has status indicator dot (idle/running/done/error) with pulse animation
- Clicking a tab shows that stage's events with summary stats (LLM calls, tokens, duration)
- Error events auto-expanded with monospace error detail block
- Auto-selects the error stage or latest active stage on expand
- Renamed 'stale pages' to 'orphaned pages' in admin header
Deletes all technique pages, versions, links, key moments, pipeline
events/runs, Qdrant vectors, and Redis cache while preserving creators,
videos, and transcript segments. Resets all video status to not_started.
Double-confirm dialog in the UI prevents accidental use.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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>
- _make_llm_callback now accepts request_params dict
- All 6 LLM call sites pass max_tokens, model_override, modality, response_model, hard_limit
- request_params stored in payload JSONB on every llm_call event (always, not just debug mode)
- Frontend JSON export includes full payload + request_params at top level
- DebugPayloadViewer shows 'Request Params' section even with debug mode off
- Answers whether max_tokens is actually being sent on pipeline requests
- Search now runs semantic + keyword in parallel, merges and deduplicates
- Keyword results always included with match_context explaining WHY matched
- Semantic results filtered by minimum score threshold (0.45)
- match_context shows 'Creator: X', 'Tag: Y', 'Title match', 'Content: ...'
- Qdrant points use deterministic uuid5 IDs (no more duplicates on reindex)
- Embedding timeout raised from 300ms to 2s (Ollama needs it)
- _enrich_qdrant_results reads creator_name from payload before DB fallback
- Frontend displays match_context as highlighted bar on search result cards
In-progress stages now show:
- Live elapsed time (ticks every second) next to the active stage dot
- Run-level token count so far
Performance: wrapped StageTimeline, StatusFilter, WorkerStatus, and
RecentActivityFeed with React.memo. Memoized filteredVideos with useMemo.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>