Commit graph

217 commits

Author SHA1 Message Date
jlightner
caedc9c224 fix: remove moments from recent cards, pin footer to bottom of card 2026-04-03 05:14:17 +00:00
jlightner
00cb865507 fix: admin dropdown hover gap bridge + recent card footer layout (creator left, moments, date right) 2026-04-03 05:07:06 +00:00
jlightner
c012afc0d3 chore: auto-commit after complete-milestone
GSD-Unit: M015
2026-04-03 04:44:59 +00:00
jlightner
4735463649 feat: Added hover-to-open with 150ms leave delay and matchMedia desktop…
- "frontend/src/components/AdminDropdown.tsx"

GSD-Task: S05/T01
2026-04-03 04:41:04 +00:00
jlightner
8b912e5a6f feat: Added Trending Searches section to homepage with real-time popula…
- "frontend/src/api/public-client.ts"
- "frontend/src/pages/Home.tsx"
- "frontend/src/App.css"

GSD-Task: S04/T01
2026-04-03 04:37:36 +00:00
jlightner
3c5985f012 feat: Homepage displays a stats scorecard showing live article and crea…
- "frontend/src/api/public-client.ts"
- "frontend/src/pages/Home.tsx"
- "frontend/src/App.css"

GSD-Task: S03/T02
2026-04-03 04:29:21 +00:00
jlightner
1f783c4216 feat: Added GET /api/v1/stats endpoint returning live technique_count (…
- "backend/routers/stats.py"
- "backend/main.py"

GSD-Task: S03/T01
2026-04-03 04:25:58 +00:00
jlightner
9f0b0922b0 feat: add GET /api/v1/stats endpoint with technique and creator counts 2026-04-03 04:24:58 +00:00
jlightner
b35082602f feat: Added "Last updated: Mon D" to creators browse rows and subtle da…
- "frontend/src/api/public-client.ts"
- "frontend/src/pages/CreatorsBrowse.tsx"
- "frontend/src/pages/Home.tsx"
- "frontend/src/App.css"

GSD-Task: S02/T02
2026-04-03 04:19:52 +00:00
jlightner
8d3f9fd74f feat: render last-updated dates on creators page and homepage cards 2026-04-03 04:17:53 +00:00
jlightner
18c76dd8ec feat: Added last_technique_at correlated subquery to creators API endpo…
- "backend/schemas.py"
- "backend/routers/creators.py"

GSD-Task: S02/T01
2026-04-03 04:16:47 +00:00
jlightner
8c81c472ea fix: pass last_technique_at through row unpacking 2026-04-03 04:15:39 +00:00
jlightner
acd0567e3c feat: add last_technique_at to creators API endpoint 2026-04-03 04:12:31 +00:00
jlightner
ea8a77be59 feat: Deployed search logging and popular searches endpoint to ub01, ra…
GSD-Task: S01/T02
2026-04-03 04:07:10 +00:00
jlightner
f64a0c1107 perf: Added SearchLog model, Alembic migration 013, Pydantic schemas, f…
- "backend/models.py"
- "backend/schemas.py"
- "backend/routers/search.py"
- "alembic/versions/013_add_search_log.py"

GSD-Task: S01/T01
2026-04-03 04:02:55 +00:00
jlightner
6940f172a3 fix: Serialize BodySection Pydantic models to dicts before JSONB storage
Stage 5 parses LLM output into list[BodySection] (Pydantic models) but
SQLAlchemy's JSONB column needs plain dicts. Added _serialize_body_sections()
helper that calls .model_dump() on each BodySection before DB write.
Fixes 'Object of type BodySection is not JSON serializable' errors.
2026-04-03 03:38:32 +00:00
jlightner
5a71539a2b fix: StageTabView limit 500→200 to stay within API max 2026-04-03 03:32:34 +00:00
jlightner
995d0c900d fix: StageTabView useCallback dependency loop — use ref for initial tab selection 2026-04-03 03:30:45 +00:00
jlightner
c7a4d8aa27 feat: Stage tab view for pipeline runs, rename stale→orphaned pages
- 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
2026-04-03 03:24:43 +00:00
jlightner
fd48435a84 fix: MCP server API URL patterns — path params not JSON body, stage name mapping 2026-04-03 03:07:39 +00:00
jlightner
f27c18b555 fix: MCP server SQL uses correct column names (video_id, not pipeline_run_id) 2026-04-03 03:05:59 +00:00
jlightner
6375ce667e fix: MCP server port 8097→8101 (8097 already allocated on ub01) 2026-04-03 02:58:57 +00:00
jlightner
567f69a480 feat: Chrysopedia MCP server — 25 tools for pipeline, infra, content, observability, embeddings, prompts
Runs as chrysopedia-mcp container in Docker Compose with direct DB, Redis,
Docker socket, and API access. Streamable HTTP transport on port 8097.
Clients connect via http://ub01:8097/mcp
2026-04-03 02:57:27 +00:00
jlightner
bbea843235 feat: Show article + creator count stats on admin techniques page 2026-04-03 02:38:09 +00:00
jlightner
baa2a87243 style: Admin technique pages — full CSS styling, description text 2026-04-03 02:33:23 +00:00
jlightner
8be26d5ad2 chore: auto-commit after complete-milestone
GSD-Unit: M014
2026-04-03 02:21:29 +00:00
jlightner
989ca41162 feat: Added technique_section result rendering with Section badge, deep…
- "frontend/src/api/public-client.ts"
- "frontend/src/pages/TechniquePage.tsx"
- "frontend/src/pages/SearchResults.tsx"
- "frontend/src/components/SearchAutocomplete.tsx"

GSD-Task: S07/T02
2026-04-03 02:15:07 +00:00
jlightner
57b8705e26 feat: Added per-section embedding to stage 6 for v2 technique pages wit…
- "backend/schemas.py"
- "backend/pipeline/stages.py"
- "backend/pipeline/qdrant_client.py"
- "backend/search_service.py"
- "backend/pipeline/test_section_embedding.py"

GSD-Task: S07/T01
2026-04-03 02:12:56 +00:00
jlightner
7d805b80e3 feat: Built AdminTechniquePages page at /admin/techniques with table, e…
- "frontend/src/pages/AdminTechniquePages.tsx"
- "frontend/src/api/public-client.ts"
- "frontend/src/App.tsx"
- "frontend/src/components/AdminDropdown.tsx"

GSD-Task: S06/T02
2026-04-03 01:59:49 +00:00
jlightner
495d1fa489 feat: Added paginated GET /admin/pipeline/technique-pages endpoint with…
- "backend/routers/pipeline.py"
- "backend/schemas.py"

GSD-Task: S06/T01
2026-04-03 01:55:35 +00:00
jlightner
5a5295ae3f fix: Deployed v2-aware frontend to ub01 and verified production site lo…
GSD-Task: S05/T02
2026-04-03 01:46:22 +00:00
jlightner
48bcf26bee feat: Added format-aware v2 body_sections rendering with nested TOC, ci…
- "frontend/src/api/public-client.ts"
- "frontend/src/pages/TechniquePage.tsx"
- "frontend/src/components/TableOfContents.tsx"
- "frontend/src/utils/citations.tsx"
- "frontend/src/App.css"

GSD-Task: S05/T01
2026-04-03 01:42:56 +00:00
jlightner
7070ef3f51 test: Added 12 unit tests covering compose prompt construction, branchi…
- "backend/pipeline/test_compose_pipeline.py"

GSD-Task: S04/T02
2026-04-03 01:33:16 +00:00
jlightner
d709c9edce feat: Added _build_compose_user_prompt(), _compose_into_existing(), and…
- "backend/pipeline/stages.py"

GSD-Task: S04/T01
2026-04-03 01:29:21 +00:00
jlightner
dc18d0a543 feat: Wired source_videos and body_sections_format into technique detai…
- "backend/routers/techniques.py"

GSD-Task: S03/T02
2026-04-03 01:19:32 +00:00
jlightner
bd0dbb4df9 feat: Added body_sections_format column, technique_page_videos associat…
- "alembic/versions/012_multi_source_format.py"
- "backend/models.py"
- "backend/schemas.py"

GSD-Task: S03/T01
2026-04-03 01:16:31 +00:00
jlightner
5cd7db8938 test: 16 unit tests covering compose prompt XML structure, citation off…
- "backend/pipeline/test_harness_compose.py"
- ".gsd/milestones/M014/slices/S02/tasks/T03-SUMMARY.md"

GSD-Task: S02/T03
2026-04-03 01:08:41 +00:00
jlightner
efe6d7197c test: Added compose subcommand with build_compose_prompt(), run_compose…
- "backend/pipeline/test_harness.py"

GSD-Task: S02/T02
2026-04-03 01:05:25 +00:00
jlightner
709d14802c feat: Created composition prompt with merge rules, citation re-indexing…
- "prompts/stage5_compose.txt"
- ".gsd/milestones/M014/slices/S02/tasks/T01-SUMMARY.md"

GSD-Task: S02/T01
2026-04-03 01:03:01 +00:00
jlightner
44197f550c test: Updated test_harness.py word-count/section-count logic for list[B…
- "backend/pipeline/test_harness.py"
- "backend/pipeline/test_harness_v2_format.py"

GSD-Task: S01/T03
2026-04-03 00:54:27 +00:00
jlightner
ca5aa3dec0 feat: Rewrote stage5_synthesis.txt with v2 body_sections (list-of-objec…
- "prompts/stage5_synthesis.txt"
- "prompts/stage5_synthesis.20260403_005044.bak"

GSD-Task: S01/T02
2026-04-03 00:52:48 +00:00
jlightner
15dcab201a test: Added BodySection/BodySubSection schema models, changed Synthesiz…
- "backend/pipeline/schemas.py"
- "backend/pipeline/citation_utils.py"
- "backend/pipeline/test_citation_utils.py"

GSD-Task: S01/T01
2026-04-03 00:50:30 +00:00
jlightner
293d1f4df4 feat: add wipe-all-output admin endpoint and UI button
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>
2026-04-02 22:17:48 +00:00
jlightner
06b8bdd6ac prompt: stage5 synthesis v4 — instructive voice, name discipline, merge thresholds
- Rewrote voice from third-person narrative ("Keota does X") to instructive
  ("Route the effect at 100% wet"). Body prose now reads like a lesson book.
- Hard rule: creator name appears in title/summary only, max once in body
  (for quote attribution). Fixed JSON example that modeled heavy name usage.
- Added orientation-first section rhythm: brief definition before diving into
  method, prevents run-on feel.
- Page minimum thresholds: 3+ sections, 400+ words, 3+ moments. Prevents
  stub pages from thin categories.
- Strengthened merge guidance: prefer fewer rich pages over many stubs.
- Updated all examples to model instructive phrasing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 22:14:43 +00:00
jlightner
f2efabcc99 fix: shorten alembic revision ID to fit varchar(32) column
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 16:59:52 +00:00
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
jlightner
29f6e74b4f pipeline: run stages inline instead of Celery chain dispatch
Each video now completes all stages (2→6) before the worker picks up the
next queued video. Previously, dispatching celery_chain for multiple videos
caused interleaved execution — nothing finished until everything went through
all stages. Now run_pipeline calls each stage function synchronously within
the same worker task, so videos complete linearly and efficiently.
2026-04-01 11:39:21 +00:00
jlightner
84e617ab64 stage5 prompt: make section ordering a hard constraint with explicit wrong/correct examples
Validation/quality-check sections can NEVER precede construction sections.
Added concrete wrong vs correct ordering example using the exact snare design
case that failed. Elevated from 'typically' guidance to non-negotiable rule.
2026-04-01 11:35:59 +00:00
jlightner
78c01b22ca stage5 prompt: reduce creator name repetition — use pronouns after establishing attribution 2026-04-01 11:25:45 +00:00
jlightner
9e1feae76d stage5 prompt: add explicit section ordering guidance — follow the workflow
Sections should mirror the actual production workflow: foundations before
finishing, construction before glue, sound sources before processing before
mix-bus treatment. Includes the test: 'would a producer follow these steps
in this sequence?' and a natural flow template (framework → construction →
combining/refining → quality checks).
2026-04-01 11:23:20 +00:00