Commit graph

41 commits

Author SHA1 Message Date
jlightner
a5d3af55ca feat: Built Redis sliding-window rate limiter, ChatUsageLog model with…
- "backend/rate_limiter.py"
- "backend/models.py"
- "backend/routers/chat.py"
- "backend/chat_service.py"
- "backend/config.py"
- "alembic/versions/031_add_chat_usage_log.py"

GSD-Task: S04/T01
2026-04-04 13:36:29 +00:00
jlightner
51e3e75cf8 feat: Added onboarding_completed flag to User model, UserResponse schem…
- "backend/models.py"
- "backend/schemas.py"
- "backend/routers/auth.py"
- "alembic/versions/030_add_onboarding_completed.py"

GSD-Task: S03/T01
2026-04-04 13:13:05 +00:00
jlightner
34a45d1c8e chore: Added SMTP config, User notification_preferences JSONB, EmailDig…
- "backend/config.py"
- "backend/models.py"
- "backend/schemas.py"
- "backend/services/email.py"
- "alembic/versions/029_add_email_digest.py"

GSD-Task: S01/T01
2026-04-04 12:11:13 +00:00
jlightner
fa493e2640 feat: Built ffmpeg-based card renderer with concat demuxer pipeline and…
- "backend/pipeline/card_renderer.py"
- "backend/pipeline/shorts_generator.py"
- "backend/pipeline/stages.py"
- "backend/models.py"
- "alembic/versions/028_add_shorts_template.py"
- "backend/pipeline/test_card_renderer.py"

GSD-Task: S04/T02
2026-04-04 11:17:38 +00:00
jlightner
125983588d feat: Created ASS subtitle generator with karaoke word-by-word highligh…
- "backend/pipeline/caption_generator.py"
- "backend/pipeline/shorts_generator.py"
- "backend/pipeline/stages.py"
- "backend/models.py"
- "alembic/versions/027_add_captions_enabled.py"
- "backend/pipeline/test_caption_generator.py"

GSD-Task: S04/T01
2026-04-04 11:12:19 +00:00
jlightner
5f4b960dc1 feat: Added share_token column with migration 026, wired token generati…
- "backend/models.py"
- "alembic/versions/026_add_share_token.py"
- "backend/pipeline/stages.py"
- "backend/routers/shorts.py"
- "backend/routers/shorts_public.py"
- "backend/main.py"

GSD-Task: S01/T01
2026-04-04 10:33:00 +00:00
jlightner
dfc5aa2ae7 chore: Added GeneratedShort model with FormatPreset/ShortStatus enums,…
- "backend/models.py"
- "backend/config.py"
- "docker/Dockerfile.api"
- "docker-compose.yml"
- "alembic/versions/025_add_generated_shorts.py"

GSD-Task: S03/T01
2026-04-04 09:43:36 +00:00
jlightner
f0f36a3f76 feat: Added MinIO Docker service, Post/PostAttachment models with migra…
- "docker-compose.yml"
- "backend/config.py"
- "backend/minio_client.py"
- "backend/models.py"
- "backend/schemas.py"
- "backend/requirements.txt"
- "docker/nginx.conf"
- "alembic/versions/024_add_posts_and_attachments.py"

GSD-Task: S01/T01
2026-04-04 09:02:40 +00:00
jlightner
10cd175333 feat: Added personality_profile JSONB column to Creator model with migr…
- "backend/models.py"
- "backend/schemas.py"
- "backend/routers/creators.py"
- "alembic/versions/023_add_personality_profile.py"

GSD-Task: S06/T01
2026-04-04 08:24:44 +00:00
jlightner
243a7a3eb6 feat: Follow system + tier config page (M022/S02)
- CreatorFollow model + pure SQL migration 022
- Follow router: POST/DELETE /follows/{creator_id}, GET /follows/me, GET /follows/{id}/status
- follower_count on creator detail endpoint
- Follow button on CreatorDetail (authenticated users only)
- CreatorTiers page with Free/Pro/Premium cards, Coming Soon modals
- Tiers link in creator sidebar nav
- Route /creator/tiers (protected)
2026-04-04 07:34:03 +00:00
jlightner
56920ae7c5 fix: remove leftover op.add_column/create_index calls from migration 020 2026-04-04 07:22:41 +00:00
jlightner
ed8bdedbc9 fix: make migrations 019/020 fully idempotent with IF NOT EXISTS guards 2026-04-04 07:20:48 +00:00
jlightner
f8fecf79ac fix: use pure SQL for migrations 019/020 — bypasses all SQLAlchemy enum hooks 2026-04-04 07:19:01 +00:00
jlightner
9c307c663d fix: use String column + ALTER TYPE cast for enum migrations (avoids SQLAlchemy before_create hook) 2026-04-04 07:17:34 +00:00
jlightner
b9f042f400 fix: use raw SQL for enum creation in migrations 019/020 to avoid SQLAlchemy double-create 2026-04-04 07:16:22 +00:00
jlightner
198170d999 fix: prevent double enum creation in migrations 019/020 (create_type=False) 2026-04-04 07:14:16 +00:00
jlightner
c05e4da594 feat: Add creator-scoped highlight review endpoints (list/detail/status…
- "backend/models.py"
- "alembic/versions/021_add_highlight_trim_columns.py"
- "backend/routers/creator_highlights.py"
- "backend/main.py"

GSD-Task: S01/T01
2026-04-04 06:58:28 +00:00
jlightner
ed9aa7a83a feat: Added ChapterStatus enum, sort_order column, migration 020, chapt…
- "backend/models.py"
- "backend/schemas.py"
- "alembic/versions/020_add_chapter_status_and_sort_order.py"
- "backend/routers/creator_chapters.py"
- "backend/routers/videos.py"
- "backend/main.py"

GSD-Task: S06/T01
2026-04-04 06:03:49 +00:00
jlightner
289e707799 feat: Added HighlightCandidate ORM model, Alembic migration 019, and Py…
- "backend/models.py"
- "alembic/versions/019_add_highlight_candidates.py"
- "backend/pipeline/highlight_schemas.py"

GSD-Task: S04/T01
2026-04-04 05:30:36 +00:00
jlightner
17b43d9778 feat: Added LightRAG /query/data as primary search engine with file_sou…
- "backend/config.py"
- "backend/search_service.py"

GSD-Task: S01/T01
2026-04-04 04:44:24 +00:00
jlightner
0fc0df1d29 feat: Added GET /api/v1/creator/dashboard returning video_count, techni…
- "backend/routers/creator_dashboard.py"
- "backend/schemas.py"
- "backend/main.py"
- "alembic/versions/016_add_users_and_invite_codes.py"

GSD-Task: S02/T01
2026-04-04 00:09:19 +00:00
jlightner
8487af0282 feat: Added VideoConsent and ConsentAuditLog models with ConsentField e…
- "backend/models.py"
- "alembic/versions/017_add_consent_tables.py"

GSD-Task: S03/T01
2026-04-03 22:09:27 +00:00
jlightner
a06ea946b1 chore: Added User/InviteCode models, Alembic migration 016, auth utilit…
- "backend/models.py"
- "backend/auth.py"
- "backend/schemas.py"
- "backend/requirements.txt"
- "alembic/versions/016_add_users_and_invite_codes.py"

GSD-Task: S02/T01
2026-04-03 21:47:01 +00:00
jlightner
7d4168c048 feat: Added .section-heading utility class to unify four heading styles…
- "frontend/src/App.css"
- "frontend/src/pages/Home.tsx"

GSD-Task: S06/T02
2026-04-03 06:22:11 +00:00
jlightner
0743d80b6a feat: Moved Table of Contents from main prose column to sidebar top; re…
- "frontend/src/pages/TechniquePage.tsx"
- "frontend/src/components/TableOfContents.tsx"
- "frontend/src/App.css"

GSD-Task: S04/T01
2026-04-03 05:52:47 +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
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
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
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
127919565a feat: Added hidden boolean column to Creator model, migration marking T…
- "backend/models.py"
- "backend/routers/creators.py"
- "alembic/versions/009_add_creator_hidden_flag.py"

GSD-Task: S02/T01
2026-03-31 05:13:17 +00:00
jlightner
7127237afe fix: drop server_default before dropping enum type in migration 008 2026-03-31 02:46:30 +00:00
jlightner
63225a3559 fix: migration 008 — use text column conversion to avoid PG enum transaction restriction 2026-03-31 02:45:54 +00:00
jlightner
35fc699098 fix: correct PG enum type name in migration 008 — processing_status not processingstatus 2026-03-31 02:45:06 +00:00
jlightner
720c2f501f feat: meaningful pipeline status lifecycle — Not Started → Queued → In Progress → Complete/Errored
Replace stage-level statuses (pending/transcribed/extracted/published) with
user-meaningful lifecycle states (not_started/queued/processing/error/complete).

Backend:
- ProcessingStatus enum: not_started, queued, processing, error, complete
- run_pipeline sets 'processing' before dispatching Celery chain
- stage5 sets 'complete' (was 'published')
- stage3 no longer sets intermediate status (stays 'processing')
- New mark_pipeline_error task wired as link_error on chain
- _set_error_status helper marks video on permanent failure
- Ingest sets 'queued' (was 'transcribed')
- Migration 008 renames all existing values

Frontend:
- StatusFilter shows fixed-order lifecycle tabs: Not Started | Queued | In Progress | Errored | Complete
- Per-video badges show friendly labels instead of raw enum values
- Badge colors mapped to new statuses
2026-03-31 02:43:49 +00:00
jlightner
52e7e3bbc2 feat: remove review workflow — unused gate that blocked nothing
773 key moments sat at 'pending' with 0 approved/edited/rejected.
review_status was never checked by any public-facing query — all content
was always visible regardless of review state.

Removed:
- backend/routers/review.py (10 endpoints)
- backend/tests/test_review.py
- frontend ReviewQueue, MomentDetail pages
- frontend client.ts (review-only API client)
- frontend ModeToggle, StatusBadge components
- Review link from AdminDropdown, Moments link from pipeline rows
- ReviewStatus, PageReviewStatus enums from models
- review_mode config flag
- review_status columns (migration 007)
- ~80 lines of mode-toggle CSS

Pipeline now always sets processing_status to 'published'.
Migration 007 drops columns, enums, and migrates 'reviewed' → 'published'.
2026-03-31 02:34:12 +00:00
jlightner
4b0914b12b fix: restore complete project tree from ub01 canonical state
Auto-mode commit 7aa33cd accidentally deleted 78 files (14,814 lines) during M005
execution. Subsequent commits rebuilt some frontend files but backend/, alembic/,
tests/, whisper/, docker configs, and prompts were never restored in this repo.

This commit restores the full project tree by syncing from ub01's working directory,
which has all M001-M007 features running in production containers.

Restored: backend/ (config, models, routers, database, redis, search_service, worker),
alembic/ (6 migrations), docker/ (Dockerfiles, nginx, compose), prompts/ (4 stages),
tests/, whisper/, README.md, .env.example, chrysopedia-spec.md
2026-03-31 02:10:41 +00:00
jlightner
7aa33cd17f fix: Fixed syntax errors in pipeline event instrumentation — _emit_even…
- "backend/pipeline/stages.py"

GSD-Task: S01/T01
2026-03-30 08:27:53 +00:00
jlightner
5c3e9b83c8 feat: Added TechniquePageVersion model, Alembic migration 002, pipeline…
- "backend/models.py"
- "alembic/versions/002_technique_page_versions.py"
- "backend/pipeline/stages.py"

GSD-Task: S04/T01
2026-03-30 07:27:40 +00:00
jlightner
b49326147f fix: alembic env.py sys.path includes parent dir for Docker compatibility 2026-03-30 01:22:30 +00:00
jlightner
ad3bccf1f2 fix: Created SQLAlchemy models for all 7 entities, Alembic async migrat…
- "backend/models.py"
- "backend/database.py"
- "alembic/versions/001_initial.py"
- "alembic/env.py"
- "alembic.ini"
- "alembic/script.py.mako"
- "docker-compose.yml"
- ".gsd/KNOWLEDGE.md"

GSD-Task: S01/T02
2026-03-29 21:48:36 +00:00