Commit graph

161 commits

Author SHA1 Message Date
jlightner
c6cbb09dd3 feat: Created PromptVariantGenerator (LLM-powered prompt mutation) and…
- "backend/pipeline/quality/variant_generator.py"
- "backend/pipeline/quality/optimizer.py"

GSD-Task: S03/T01
2026-04-01 09:08:01 +00:00
jlightner
15a7afdaff feat: Added VoiceDial class with 3-band prompt modification and ScoreRu…
- "backend/pipeline/quality/voice_dial.py"
- "backend/pipeline/quality/scorer.py"
- "backend/pipeline/quality/__main__.py"

GSD-Task: S02/T02
2026-04-01 08:57:07 +00:00
jlightner
5223772756 feat: Built ScoreRunner with 5-dimension LLM-as-judge scoring rubric, C…
- "backend/pipeline/quality/scorer.py"
- "backend/pipeline/quality/__main__.py"
- "backend/pipeline/quality/fixtures/sample_moments.json"
- "backend/pipeline/quality/fixtures/__init__.py"

GSD-Task: S02/T01
2026-04-01 08:53:40 +00:00
jlightner
c27cd77ae6 test: Built pipeline.quality package with FitnessRunner (9 tests, 4 cat…
- "backend/pipeline/quality/__init__.py"
- "backend/pipeline/quality/__main__.py"
- "backend/pipeline/quality/fitness.py"

GSD-Task: S01/T01
2026-04-01 08:45:05 +00:00
jlightner
3c1f7a83fb fix: Retrigger button now uses clean-retrigger (wipes events + re-runs from scratch)
The plain trigger endpoint short-circuits on status=complete — 'nothing to do'.
Retrigger must use clean-retrigger to reset pipeline state first.
2026-04-01 07:34:01 +00:00
jlightner
3c2441ae38 fix: Rename 'Trigger (debug)' button to 'Retrigger' 2026-04-01 07:25:20 +00:00
jlightner
fd1fd6c6f9 fix: Pipeline LLM audit — temperature=0, realistic token ratios, structured request_params
Audit findings & fixes:
- temperature was never set (API defaulted to 1.0) → now explicit 0.0 for deterministic JSON
- llm_max_tokens=65536 exceeded hard_limit=32768 → aligned to 32768
- Output ratio estimates were 5-30x too high (based on actual pipeline data):
  stage2: 0.6→0.05, stage3: 2.0→0.3, stage4: 0.5→0.3, stage5: 2.5→0.8
- request_params now structured as api_params (what's sent to LLM) vs pipeline_config
  (internal estimator settings) — no more ambiguous 'hard_limit' in request params
- temperature=0.0 sent on both primary and fallback endpoints
2026-04-01 07:20:09 +00:00
jlightner
d58194ff96 feat: Store LLM request params (max_tokens, model, modality) in pipeline events
- _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
2026-04-01 07:01:57 +00:00
jlightner
a673e641b8 fix: Parallel search with match_context, deterministic Qdrant IDs, raised embedding timeout
- 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
2026-04-01 06:54:34 +00:00
jlightner
8272da430b fix: Variable ordering bug and stage 5 truncation recovery
Two fixes:

1. page_moment_indices was referenced before assignment in the page
   persist loop — moved assignment to top of loop body. This caused
   "cannot access local variable" errors on every stage 5 run.

2. Stage 5 now catches LLMTruncationError and splits the chunk in
   half for retry, instead of blindly retrying the same oversized
   prompt. This handles categories where synthesis output exceeds
   the model context window.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 01:51:28 -05:00
jlightner
c0df8a7908 chore: auto-commit after complete-milestone
GSD-Unit: M012
2026-04-01 06:41:52 +00:00
jlightner
baef500de6 feat: Created SortDropdown component and useSortPreference hook, integr…
- "frontend/src/components/SortDropdown.tsx"
- "frontend/src/hooks/useSortPreference.ts"
- "frontend/src/pages/SearchResults.tsx"
- "frontend/src/pages/SubTopicPage.tsx"
- "frontend/src/pages/CreatorDetail.tsx"
- "frontend/src/api/public-client.ts"
- "frontend/src/App.css"

GSD-Task: S02/T02
2026-04-01 06:41:52 +00:00
jlightner
e0c73db8ff feat: Added sort query parameter (relevance/newest/oldest/alpha/creator…
- "backend/routers/search.py"
- "backend/routers/topics.py"
- "backend/routers/techniques.py"
- "backend/search_service.py"

GSD-Task: S02/T01
2026-04-01 06:41:52 +00:00
jlightner
b68775ebfb feat: Added partial_matches fallback UI to search results — shows muted…
- "frontend/src/api/public-client.ts"
- "frontend/src/pages/SearchResults.tsx"
- "frontend/src/App.css"

GSD-Task: S01/T03
2026-04-01 06:41:52 +00:00
jlightner
fa82f1079a feat: Enriched Qdrant embedding text with creator_name/tags and added r…
- "backend/pipeline/stages.py"
- "backend/pipeline/qdrant_client.py"
- "backend/routers/pipeline.py"

GSD-Task: S01/T02
2026-04-01 06:41:52 +00:00
jlightner
84e7a9906c feat: Refactored keyword_search to multi-token AND with cross-field mat…
- "backend/search_service.py"
- "backend/schemas.py"
- "backend/routers/search.py"
- "backend/tests/test_search.py"

GSD-Task: S01/T01
2026-04-01 06:41:52 +00:00
jlightner
c344b8c670 fix: Moment-to-page linking via moment_indices in stage 5 synthesis
When the LLM splits a category group into multiple technique pages,
moments were blanket-linked to the last page in the loop, leaving all
other pages as orphans with 0 key moments (48 out of 204 pages affected).

Added moment_indices field to SynthesizedPage schema and synthesis prompt
so the LLM explicitly declares which input moments each page covers.
Stage 5 now uses these indices for targeted linking instead of the broken
blanket approach. Tags are also computed per-page from linked moments
only, fixing cross-contamination (e.g. "stereo imaging" tag appearing
on gain staging pages).

Deleted 48 orphan technique pages from the database.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 00:34:37 -05:00
jlightner
9b2db11095 feat: Enrich in-progress stage display and memoize pipeline page
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>
2026-03-31 22:10:07 -05:00
jlightner
e80094dc05 feat: Truncation detection, batched classification, and pipeline auto-resume
Three resilience improvements to the pipeline:

1. LLMResponse(str) subclass carries finish_reason metadata from the LLM.
   _safe_parse_llm_response detects truncation (finish=length) and raises
   LLMTruncationError instead of wastefully retrying with a JSON nudge
   that makes the prompt even longer.

2. Stage 4 classification now batches moments (20 per call) instead of
   sending all moments in a single LLM call. Prevents context window
   overflow for videos with many moments. Batch results are merged with
   reindexed moment_index values.

3. run_pipeline auto-resumes from the last completed stage on error/retry
   instead of always restarting from stage 2. Queries pipeline_events for
   the most recent run to find completed stages. clean_reprocess trigger
   still forces a full restart.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 17:48:19 -05:00
jlightner
5984129e25 fix: Inflate LLM token estimates and forward max_tokens on retry
Stage 4 classification was truncating (finish=length) because the 0.15x
output ratio underestimated token needs. Inflated all stage ratios,
bumped the buffer from 20% to 50%, raised the floor from 2048 to 4096,
and fixed _safe_parse_llm_response to forward max_tokens on retry
instead of falling back to the 65k default.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 17:28:58 -05:00
jlightner
0817e6e957 style: Custom dark-theme checkboxes on pipeline admin page
Replace default browser checkboxes with custom styled versions that blend
with the dark UI — transparent background, muted border, cyan accent on check.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 17:23:33 -05:00
jlightner
9bc253f2c9 feat: Add real-time text search filter on pipeline admin page
Filters video list by filename or creator name as you type. Works
alongside the existing status and creator dropdown filters. Includes
a clear button when text is entered.
2026-03-31 17:38:31 +00:00
jlightner
11f7ca4fbf feat: Change global search shortcut from Cmd+K to Ctrl+Shift+F 2026-03-31 17:33:09 +00:00
jlightner
44f2fbd4d6 feat: Add tooltips to stage timeline dots showing stage name on hover 2026-03-31 17:30:45 +00:00
jlightner
c1583820ea feat: Add context labels to multi-call pipeline stages
Stage 3 (extraction) LLM calls now show the topic group label (e.g.,
'Sound Design Basics') and Stage 5 (synthesis) calls show the category
name. Displayed as a cyan italic label in the event row between the
event type badge and model name. Helps admins understand why there are
multiple LLM calls per stage.
2026-03-31 17:27:40 +00:00
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
jlightner
cd3b57a156 fix: Clean retrigger preserves transcript_segments (pipeline input data)
Deleting transcript_segments left the pipeline with nothing to process —
all stages would skip immediately. Segments come from the ingest step,
not from pipeline stages 2-6. Only pipeline_events and key_moments
(pipeline output) are deleted during clean reprocess.
2026-03-31 16:32:25 +00:00
jlightner
6f1c7dae00 fix: Auto-refresh EventLog every 10s for processing/queued videos
Previously the event log only loaded once when the row was expanded,
so mid-pipeline videos only showed start events. Now the EventLog
component accepts a status prop and polls every 10s when the video is
processing or queued, silently updating without showing a loading spinner.
2026-03-31 16:23:33 +00:00
jlightner
b0ad4c2dfc feat: Add real-time pipeline visibility — auto-refresh, stage timeline, activity feed, bulk log
- Backend: Video list now includes active_stage, active_stage_status, and
  stage_started_at fields via DISTINCT ON subquery
- Backend: New GET /admin/pipeline/recent-activity endpoint returns
  latest stage completions/errors with video context
- Frontend: 15-second auto-refresh with change detection — video rows
  flash when status changes
- Frontend: Stage timeline dots on processing/complete/error videos
  showing progress through stages 2-5, active stage pulses
- Frontend: Collapsible Recent Activity feed at top showing last 8
  stage completions/errors with duration and creator
- Frontend: Bulk operation scrollable log showing per-video results
  as they complete
- Frontend: Auto-refresh checkbox toggle in header
2026-03-31 16:12:57 +00:00
jlightner
e17132bd60 feat: Add bulk pipeline reprocessing — creator filter, multi-select, clean retrigger
- Backend: POST /admin/pipeline/clean-retrigger/{video_id} endpoint that
  deletes pipeline_events, key_moments, transcript_segments, and Qdrant
  vectors before retriggering the pipeline
- Backend: QdrantManager.delete_by_video_id() for vector cleanup
- Frontend: Creator filter dropdown on pipeline admin page
- Frontend: Checkbox selection column with select-all
- Frontend: Bulk toolbar with Retrigger Selected and Clean Reprocess
  actions, sequential dispatch with progress bar, cancel support
- Bulk dispatch uses 500ms delay between requests to avoid slamming API
2026-03-31 15:24:59 +00:00
jlightner
ee927da426 chore: auto-commit after complete-milestone
GSD-Unit: M011
2026-03-31 09:02:53 +00:00
jlightner
261fe91f0b feat: Created useDocumentTitle hook and wired descriptive, route-specif…
- "frontend/src/hooks/useDocumentTitle.ts"
- "frontend/src/pages/Home.tsx"
- "frontend/src/pages/TopicsBrowse.tsx"
- "frontend/src/pages/SubTopicPage.tsx"
- "frontend/src/pages/CreatorsBrowse.tsx"
- "frontend/src/pages/CreatorDetail.tsx"
- "frontend/src/pages/TechniquePage.tsx"
- "frontend/src/pages/SearchResults.tsx"

GSD-Task: S04/T02
2026-03-31 08:56:16 +00:00
jlightner
5e5961fa92 feat: Demoted nav brand to span, promoted page headings to h1, added sk…
- "frontend/src/App.tsx"
- "frontend/src/App.css"
- "frontend/src/pages/Home.tsx"
- "frontend/src/pages/SearchResults.tsx"
- "frontend/src/pages/TopicsBrowse.tsx"
- "frontend/src/pages/CreatorsBrowse.tsx"
- "frontend/src/pages/SubTopicPage.tsx"
- "frontend/src/pages/AdminReports.tsx"

GSD-Task: S04/T01
2026-03-31 08:52:48 +00:00
jlightner
089435a990 feat: Added mobile hamburger menu with 44px touch targets, Escape/outsi…
- "frontend/src/App.tsx"
- "frontend/src/App.css"

GSD-Task: S03/T02
2026-03-31 08:45:33 +00:00
jlightner
50675db557 feat: Refactored SearchAutocomplete from heroSize boolean to variant st…
- "frontend/src/components/SearchAutocomplete.tsx"
- "frontend/src/App.tsx"
- "frontend/src/App.css"
- "frontend/src/pages/Home.tsx"
- "frontend/src/pages/SearchResults.tsx"

GSD-Task: S03/T01
2026-03-31 08:42:15 +00:00
jlightner
adc86446f1 feat: Created shared TagList component with max-4 overflow, applied acr…
- "frontend/src/components/TagList.tsx"
- "frontend/src/pages/Home.tsx"
- "frontend/src/pages/SearchResults.tsx"
- "frontend/src/pages/SubTopicPage.tsx"
- "frontend/src/pages/CreatorDetail.tsx"
- "frontend/src/pages/TopicsBrowse.tsx"
- "frontend/src/App.css"

GSD-Task: S02/T03
2026-03-31 08:35:07 +00:00
jlightner
caa55381ab feat: Replaced run-on dot-separated topic stats on CreatorDetail with c…
- "frontend/src/pages/CreatorDetail.tsx"
- "frontend/src/App.css"

GSD-Task: S02/T02
2026-03-31 08:32:09 +00:00
jlightner
41bf06e431 feat: Topics page loads with all categories collapsed; expand/collapse…
- "frontend/src/pages/TopicsBrowse.tsx"
- "frontend/src/App.css"

GSD-Task: S02/T01
2026-03-31 08:30:55 +00:00
jlightner
717f6c0785 feat: Added GET /api/v1/techniques/random endpoint returning {slug}, fe…
- "backend/routers/techniques.py"
- "frontend/src/api/public-client.ts"
- "frontend/src/pages/Home.tsx"
- "frontend/src/App.css"

GSD-Task: S01/T02
2026-03-31 08:24:38 +00:00
jlightner
d94995453e feat: Added scale(1.02) hover to all 6 card types, cardEnter stagger an…
- "frontend/src/App.css"
- "frontend/src/pages/Home.tsx"
- "frontend/src/pages/TopicsBrowse.tsx"
- "frontend/src/pages/CreatorDetail.tsx"
- "frontend/src/pages/SubTopicPage.tsx"
- "frontend/src/pages/SearchResults.tsx"

GSD-Task: S01/T01
2026-03-31 08:22:37 +00:00
jlightner
9296cd4df8 chore: auto-commit after complete-milestone
GSD-Unit: M010
2026-03-31 06:46:25 +00:00
jlightner
2a8b0b3a84 feat: Extracted inline typeahead from Home.tsx into shared SearchAutoco…
- "frontend/src/components/SearchAutocomplete.tsx"
- "frontend/src/api/public-client.ts"
- "frontend/src/pages/Home.tsx"
- "frontend/src/pages/SearchResults.tsx"
- "frontend/src/App.css"

GSD-Task: S04/T02
2026-03-31 06:39:01 +00:00
jlightner
1254e173d4 test: Added GET /api/v1/search/suggestions endpoint returning popular t…
- "backend/schemas.py"
- "backend/routers/search.py"
- "backend/tests/test_search.py"

GSD-Task: S04/T01
2026-03-31 06:35:37 +00:00
jlightner
ec7e07c705 feat: Added @keyframes pageEnter (opacity 0→1, translateY 8→0, 250ms ea…
- "frontend/src/App.css"

GSD-Task: S03/T02
2026-03-31 06:27:12 +00:00
jlightner
4e12689523 feat: Extracted catSlug to shared utility; added category accent border…
- "frontend/src/utils/catSlug.ts"
- "frontend/src/pages/TopicsBrowse.tsx"
- "frontend/src/pages/SubTopicPage.tsx"
- "frontend/src/pages/SearchResults.tsx"
- "frontend/src/App.css"

GSD-Task: S03/T01
2026-03-31 06:26:06 +00:00
jlightner
6de5317416 feat: Replaced plain list rendering of related techniques with a respon…
- "frontend/src/api/public-client.ts"
- "frontend/src/pages/TechniquePage.tsx"
- "frontend/src/App.css"

GSD-Task: S02/T02
2026-03-31 06:15:25 +00:00
jlightner
5d0fd05b98 feat: Added scored dynamic related-techniques query returning up to 4 r…
- "backend/schemas.py"
- "backend/routers/techniques.py"
- "backend/tests/test_public_api.py"

GSD-Task: S02/T01
2026-03-31 06:13:59 +00:00
jlightner
5e52dd5e9c feat: Added SubTopicPage with breadcrumbs and creator-grouped technique…
- "frontend/src/pages/SubTopicPage.tsx"
- "frontend/src/api/public-client.ts"
- "frontend/src/App.tsx"
- "frontend/src/pages/TopicsBrowse.tsx"
- "frontend/src/App.css"
- "frontend/src/pages/Home.tsx"

GSD-Task: S01/T02
2026-03-31 06:03:18 +00:00
jlightner
8661549ab1 test: Added GET /topics/{category_slug}/{subtopic_slug} endpoint filter…
- "backend/routers/topics.py"
- "backend/tests/test_public_api.py"

GSD-Task: S01/T01
2026-03-31 05:59:36 +00:00
jlightner
5d71f9825d chore: auto-commit after complete-milestone
GSD-Unit: M009
2026-03-31 05:52:28 +00:00