videogen/docs/reelforge/PLAN_COVERAGE.md
caelum0x d56639a594
Some checks are pending
build-images / api (push) Waiting to run
build-images / worker-gpu (push) Waiting to run
build-images / web (push) Waiting to run
codeql / Analyze (javascript-typescript) (push) Waiting to run
codeql / Analyze (python) (push) Waiting to run
perf / API hot-path micro-smoke (budgeted) (push) Waiting to run
perf / Desktop engine crates (release build check) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (comfy-workflow-schema) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (effects-core) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (eventbus-types) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (growth-analytics) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (trends-schema) (push) Waiting to run
vision2026-ci / API phase modules (ruff + pytest) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (provider-adapter-kit) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (publishing-connectors) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (render-core) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (shot-template-schema) (push) Waiting to run
vision2026-ci / Python SDK resource tests (push) Waiting to run
vision2026-ci / Desktop engine crates (test + clippy + fmt) (push) Waiting to run
vision2026-ci / Alembic upgrade + drift check (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (caption-engine) (push) Waiting to run
Menivor — open source release (MIT), free to use and fork
Paid, hosted product at menivor.com, now retired as a company project.
Fresh squashed history of the cleaned working tree (secret-scanned,
no .env, no customer data, no outreach logs). Built on
MoneyPrinterTurbo (MIT, harry0703) — see NOTICE.
2026-12-04 02:10:26 +03:00

29 KiB
Raw Permalink Blame History

ReelForge — Plan Coverage Audit

Read-only audit mapping every deliverable/spec in the two plans to the actual code in this repo.

  • Sources: ugc-video-tool-build-plan.md (build-plan) and ugc-tool-cto-plan.md (CTO plan), plus the growth features shipped this phase (see the "This-phase features" section below).
  • Verified against: app/services/*, app/workers/*, app/controllers/v1/*, app/models/db/*, web/, mobile/, tests/reelforge/, migrations/, Makefile.reelforge (the local quality gate).
  • Verification anchor: python -m pytest tests/reelforge → 1709 passed, 3 skipped (local .venv, py3.11, env NEON_DATABASE_URL=SQLite, R2_*=dummy, SOCIAL_TOKEN_KEY set, stubbed providers); real-ffmpeg compose/caption integration tests + a real libass TR-glyph render test included (they auto-skip on a box without libass).
  • Quality gate is local, not CI: there is no .github/workflows/ (GitHub Actions is intentionally omitted as a cost constraint). The gate runs on the developer's machine — ruff --select F,E9 + pytest + alembic upgrade head / alembic check + the golden acceptance run — via Makefile.reelforge.

Status legend

  • Implemented — code present, wired, and test-covered.
  • Partial — core present but a named sub-spec is missing or structurally diverges from the plan.
  • Gap-needs-keys — code path exists but cannot be exercised/accepted without live provider keys or licensed assets.
  • Gap — not implemented.

build-plan §8 — Deliverables checklist (1–8)

# Deliverable Status Evidence / reason
1 Forked repo, stock-footage path removed, config-driven pipeline Partial In-place fork; ReelForge pipeline (app/services/reelforge.py) never touches stock footage — it consumes params.screen_recording_key. BUT legacy MPT stock code is not deleted: app/services/material.py:search_videos_pexels / Pixabay still present, and config.example.toml still lists pexels_api_keys/pixabay_api_keys. Disabled-by-non-use, not removed.
2 ElevenLabsTTSProvider with timestamp support Implemented app/services/tts/elevenlabs_timestamps.py:elevenlabs_tts_with_timestamps → /with-timestamps, eleven_multilingual_v2, char alignment → .words/.characters. Dispatched via app/services/voice.py:tts. Tests: tests/reelforge/test_reelforge_stages.py.
3 AvatarProvider interface + HeyGen implementation Implemented app/services/avatar/base.py (registry + get_avatar_provider), app/services/avatar/heygen.py:HeyGenProvider (audio-driven; provider-level ±0.25s sanity check on HeyGen's self-reported render duration — distinct from the authoritative stage-level strict <0.15s drift gate in reelforge.py, see §5 Stage 3), plus Tier-B app/services/avatar/latentsync_runpod.py:LatentSyncProvider.
4 ASS karaoke caption generator (TR/EN fonts bundled) Implemented app/services/captions/ass_karaoke.py:build_ass (\k + pop), words.py:group_words_into_phrases. Fonts bundled: resource/fonts/Montserrat-ExtraBold.ttf, Inter-Bold.ttf (+ OFL license files). TR-glyph coverage test: tests/reelforge/test_fonts.py.
5 FFmpeg composition service (3 layouts, hw-accel) Implemented app/services/compose/compose_ffmpeg.py — pip/hook_intro/split layouts, libass burn, hw-accel via video._get_effective_video_codec + libx264 runtime fallback. "Smart screen-recording handling" (§3.5) now present: _probe_video (ffprobe pre-analysis), _speed_factor/_setpts_node speed-ramp (≤1.6×), freezedetect leading-frame trim, _blur_pad_node/_needs_blur_pad fallback, plus _build_audio_graph bg-music sidechaincompress ducking + loudnorm −3 LUFS. Covered by tests/reelforge/test_compose_smart.py (see §5-Stage-5 row).
6 Async job API + Redis workers + R2 storage, Dockerized Implemented API app/domains/reels/router.py; Celery chain app/workers/{pipeline,tasks,celery_app}.py; R2 app/platform/storage/r2.py; docker-compose.reelforge.yml (api/worker/redis).
7 Per-job cost/timing telemetry Implemented app/telemetry/events.py:record_event writes append-only job_events; progress in app/telemetry/progress.py; duration-drift warning events recorded. job_events now carries typed cost_usd/duration_ms columns (migration 20260811_0828_..._job_events_cost_columns); app/telemetry/cost.py provides estimate_llm_cost/estimate_tts_cost/estimate_avatar_cost and app/workers/tasks.py populates per-stage USD spend (LLM tokens / TTS chars / avatar seconds). Tests: test_cost.py.
8 10-video golden test set (5 TR / 5 EN) passing acceptance criteria Partial Golden harness exists: tests/golden/manifest.yaml (5 TR + 5 EN reference jobs, thresholds encoding §8.1), tests/golden/acceptance.py (checks), a synthetic mechanical acceptance suite tests/reelforge/test_golden_acceptance.py wired as a step of the local gate (Makefile.reelforge golden). The real 10-video render set (with the ≥8 Mbps assertion on real renders) still needs live Anthropic/ElevenLabs/HeyGen keys + a libass ffmpeg — make -f Makefile.reelforge golden auto-detects provider keys and runs the real set, else the synthetic suite.

CTO §0 — Locked technology decisions

Layer Decision Status Evidence / reason
Backend Python 3.11 + FastAPI (MPT fork) Implemented .python-version, app/asgi.py, app/router.py.
Job queue Celery 5 + Redis 7 Implemented app/workers/celery_app.py; celery[redis]==5.5.3; redis:7-alpine in compose.
DB Neon Postgres + SQLAlchemy 2 + Alembic Implemented app/models/db/base.py (reads NEON_DATABASE_URL), models.py (Mapped[]), migrations/versions/*_reelforge_initial_schema.py.
Object storage Cloudflare R2 (S3 API, presigned) Implemented app/platform/storage/r2.py:R2Client (SigV4, presign_upload/get).
LLM (script) Claude Sonnet 4.6, structured JSON Partial app/services/script/ugc.py produces enforced structured JSON via MPT's llm._generate_response; model is whatever [app] LLM config selects — no hard-pin to claude-sonnet-4-6 (there is an anthropic config section but the script service dispatches through MPT's generic provider layer).
TTS ElevenLabs eleven_multilingual_v2 /with-timestamps Implemented app/services/tts/elevenlabs_timestamps.py (_DEFAULT_MODEL_ID = "eleven_multilingual_v2", output_format=mp3_44100_128).
Avatar Tier A HeyGen API v2 Implemented app/services/avatar/heygen.py (v2 /video/generate, external audio).
Avatar Tier B LatentSync on RunPod Serverless Implemented app/services/avatar/latentsync_runpod.py:LatentSyncProvider; runpod config section.
Captions ASS karaoke via FFmpeg libass Implemented ass_karaoke.py + compose_ffmpeg._build_final_node (ass= node, libass preflight ffmpeg_has_filter).
Compose/render Pure FFmpeg filter graph (no MoviePy in prod) Implemented compose_ffmpeg.py single -filter_complex pass; MoviePy not on this path.
Frontend (P2) Next.js 15 App Router + Tailwind + shadcn on CF Pages Implemented web/ (Next 15 app router, next.config.mjs, tailwind.config.ts); CF Pages deploy is documented, not verified here.
Auth Clerk (email + Google) Partial Web uses Clerk (web/middleware.ts:clerkMiddleware). Backend does not verify a Clerk JWT — it authenticates per-user via x-api-key SHA-256 (jobs.py:_resolve_user). Clerk→API JWT bridge is not implemented (diverges from §4 "Clerk JWT verified in FastAPI middleware").
Payments Stripe + iyzico, credit ledger in Postgres Implemented (needs-keys to run) app/services/billing/{stripe_client,iyzico_client,plans,service}.py; credit_ledger table + CreditRepository.
Deploy Docker Compose on Hetzner + CF Tunnel Partial docker-compose.reelforge.yml, Dockerfile, docker/worker-entrypoint.sh, Makefile.reelforge. Cloudflare Tunnel not codified (doc-level).
Errors/monitoring Sentry (API+workers) + per-job telemetry table Implemented app/telemetry/sentry.py:init_sentry; API init in app/asgi.py, worker init in celery_app.py; sentry-sdk[fastapi,celery]==2.42.0; test_sentry.py; NO-OP when DSN unset. (STATUS.md now reflects this — the earlier "Sentry is a TODO" note has been corrected.) Per-job telemetry table present (job_events) and USD cost is now populated via app/telemetry/cost.py + app/workers/tasks.py — see §3/§5-Stage-6 rows.
CI GitHub Actions: ruff, pytest, Docker build, golden-video regression Implemented as a LOCAL gate (GitHub Actions intentionally omitted) GitHub Actions is intentionally omitted (cost constraint) — there is no .github/workflows/. The equivalent quality gate runs locally via Makefile.reelforge: ruff check (F/E9), pytest, alembic upgrade head + alembic check (drift-free), and the golden acceptance run (make -f Makefile.reelforge golden → synthetic tests/reelforge/test_golden_acceptance.py, or the real 10-job set when provider keys are set). Any earlier "REQUIRED CI gate" wording here is corrected to this intentional local gate.

CTO §2 — Repository structure

Planned path Status Evidence / reason
app/api/ routers (jobs, assets, avatars, voices, health) Partial Lives under app/controllers/v1/ (MPT convention), not app/api/. jobs.py covers jobs/presign/avatars/voices/me; studio.py covers avatars/publish; ping.py = health. No dedicated assets router (assets handled via presign + reconstruction).
app/core/ config, security, logging Partial Config in app/config/config.py, logging in app/utils/logging_utils.py, security helpers in app/utils/file_security.py — not consolidated under app/core/.
app/models/ (User, Job, JobEvent, Asset, CreditLedger, AvatarPreset) Implemented app/models/db/models.py defines all six.
app/services/script/ (Claude client, hook library, schema) Implemented app/services/script/ugc.py; hooks in resource/hooks/{tr,en}.yaml (12 each).
app/services/tts/ (base + elevenlabs + edge fallback) Partial tts/elevenlabs_timestamps.py present; no tts/base.py or tts/edge.py (edge fallback lives in legacy app/services/voice.py).
app/services/avatar/ (base + heygen + latentsync) Implemented base.py, heygen.py, latentsync_runpod.py.
app/services/captions/ Implemented captions/{words,ass_karaoke}.py.
app/services/compose/ Implemented compose/compose_ffmpeg.py.
app/services/storage/ Implemented storage/r2.py.
app/workers/ (celery_app, tasks + chain) Implemented celery_app.py, tasks.py, pipeline.py, context.py.
app/telemetry/ (cost/timing recorder) Implemented telemetry/{events,progress,sentry,cost}.py — timing/progress recorded; cost.py computes LLM/TTS/avatar USD and tasks.py writes it to job_events.cost_usd/duration_ms.
resource/fonts/ (licensed bold TT-supporting) Implemented Montserrat ExtraBold + Inter Bold with OFL files.
migrations/ (Alembic) Implemented migrations/env.py + initial revision.
tests/ unit + golden/ Implemented tests/reelforge/ rich unit+integration suite (incl. real-ffmpeg + libass render tests) plus tests/golden/ (manifest.yaml 5 TR + 5 EN, acceptance.py thresholds) and the test_golden_acceptance.py gate.
web/ (Next.js) Implemented Present.
docker-compose.yml (api, worker, redis) Implemented docker-compose.reelforge.yml (the base docker-compose.yml is MPT's).
.github/workflows/ci.yml Intentionally omitted (local gate instead) No .github/workflows/ — GitHub Actions omitted as a cost constraint. The equivalent gate (ruff + pytest + alembic upgrade/check + golden) runs locally via Makefile.reelforge.

CTO §3 — Data model (Postgres)

Planned table/columns Status Evidence / reason
users(id, clerk_id unique, email, created_at) Partial models.py:User has id, email, display_name, api_key_hash, credits, created_at. No clerk_id (auth is api-key based); adds denormalized credits cache.
jobs(...) status/language/layout/avatar_preset_id/voice_id/input_video_key/prompt/app_context/script_json/output_key/error/timestamps Partial models.py:Job stores these inside params JSON + stages/state(int)/result_key/failed_stage/error/celery_task_id. Functionally equivalent; structurally it does not use discrete typed columns (language, layout, input_video_key, script_json, output_key) the plan lists.
job_events(id, job_id, stage, status, duration_ms, cost_usd, meta, created_at) Implemented models.py:JobEvent has id, job_id, stage, status, message, payload, cost_usd, duration_ms, created_at (typed cost_usd/duration_ms columns added by migration ..._job_events_cost_columns, both default 0; meta maps to payload JSON).
assets(id, user_id, kind, r2_key, bytes, duration_s, created_at) Implemented models.py:Asset (adds job_id, content_type, meta).
avatar_presets(id, name, provider, provider_ref, thumb_key, active) Implemented models.py:AvatarPreset (fields renamed: display_name, provider_avatar_id, thumbnail_url, is_active; adds voice_name, config).
credit_ledger(id, user_id, delta, reason, job_id, stripe_ref, created_at) Partial models.py:CreditLedger has id, user_id, job_id, delta, reason, balance_after, created_at. No stripe_ref column (adds materialized balance_after).

CTO §4 — API contract (v1)

Endpoint Status Evidence / reason
POST /v1/uploads/presign Implemented jobs.py:presign_upload → R2 put/get URLs.
POST /v1/jobs → 202 {job_id} Partial jobs.py:create_job — atomic credit debit + enqueue. Returns MPT envelope {job_id,state,progress} (HTTP 200), not a bare 202. The variants: 1..3 batch field is now honored (_resolve_variants, _MAX_VARIANTS=3): variants>1 fans out into a batch_id-linked group, debiting per variant; the residual divergence is only the envelope/HTTP-200 shape.
GET /v1/jobs/{id} Implemented jobs.py:get_job (status/stage/progress/result_url/error, ownership-scoped).
GET /v1/jobs?limit=&cursor= Partial jobs.py:list_jobs uses limit/offset (not cursor).
GET /v1/avatars Implemented jobs.py:list_avatars (presets + live HeyGen).
GET /v1/voices (3 TR + 3 EN curated) Implemented jobs.py:list_voices now serves the curated resource/voices.yaml (3 TR-capable multilingual-v2 + 3 EN, with id/name/language/gender/description) as the default, falling back to the live ElevenLabs list (voice.get_elevenlabs_voices) when the file is missing/invalid (test_api.py). IDs ship as verifiable public-demo defaults, flagged overridable.
POST /v1/jobs/{id}/retry Implemented jobs.py:retry_job (row-locked FAILED→PROCESSING CAS, resume from failed_stage).
GET /v1/me → {email, credits} Implemented jobs.py:me.
Auth: Clerk JWT in FastAPI middleware; P1 static API key Partial Per-user x-api-key (SHA-256) implemented (_resolve_user); Clerk JWT verification in FastAPI not implemented; also not a single static key but per-user keys.
(extra, not in §4) POST /v1/studio/*, /v1/billing/* Implemented studio.py (publish, create photo→avatar), billing.py (plans, checkout, stripe/iyzico webhooks).

CTO §5 — Pipeline stage specs (1–6)

Stage Status Evidence / reason
1 — Script (Claude, native TR/EN personas, 12 hooks/lang, enforced JSON + retry, clamp 25–60s) Implemented script/ugc.py: _TR_PERSONA/_EN_PERSONA, _load_hooks (12 per lang), _parse_ugc_script (retry on invalid JSON), duration clamp. Output schema keys hook/segments/cta/full_text/est_duration_s. Note: model not pinned to Claude; temperature-0.9 batch-variants not present (single script).
2 — TTS (ElevenLabs with-timestamps, persist audio to R2, word timings as single source of truth) Implemented reelforge.py:stage_tts derives authoritative audio_duration + flat words from the SubMaker, uploads mp3 to R2. Curated resource/voices.yaml (3 TR-capable multilingual + 3 EN) now backs GET /v1/voices (live fallback).
3 — Avatar (HeyGen v2, external audio, green-screen, poll, R2 re-host, abs(Δduration)<0.15s else fail-retry) Implemented avatar/heygen.py + reelforge.py:stage_avatar: external audio, poll to completion, R2 re-host, and the drift gate now honors the spec — _AVATAR_DRIFT_TOLERANCE_S=0.15 with a strict >= compare that records a warning JobEvent and raises (retryable stage failure), not merely warns (test_reelforge_stages.py boundary test at Δ=0.15s, test_heygen_duration.py). Minor residual: green-screen background is not forced in the generate call (relies on avatar defaults).
4 — Captions (word groups on punctuation / >0.8s gap; ASS style Montserrat 88 top-center MarginV 380, \k, pop; TR-glyph CI test) Implemented (Partial on QA method) captions/words.py grouping + ass_karaoke.py style matches spec (fontsize 88, Alignment 8, MarginV 380, Outline 5, \k, \t pop). TR-glyph QA is a font-cmap coverage test (test_fonts.py), not the specified "render frame + pixel-diff non-tofu" assertion.
5 — Compose+render (ffprobe analyze, scale/crop to 1080×1920, freezedetect trim, setpts speed-ramp ≤1.6×, blur-pad, layouts, bg-music sidechain duck, −3 LUFS, libx264 crf19 / nvenc / videotoolbox, faststart, AAC192k, ≤90s) Implemented compose_ffmpeg.py: crop-to-fill scale, 3 layouts, libass burn, hw-accel + libx264 fallback, yuv420p, AAC 192k, +faststart, plus the smart-handling suite — _probe_video (ffprobe pre-analysis), freezedetect leading-frame trim, _speed_factor/_setpts_node speed-ramp (≤1.6×), _blur_pad_node/_needs_blur_pad fallback, and _build_audio_graph bg-music sidechaincompress ducking + loudnorm −3 LUFS (_clamp_loudnorm_i, _LOUDNORM_TP). Covered by test_compose_smart.py. The ≤90s render-time benchmark still needs a live worker (DoD §2).
6 — Upload + finalize (R2 output, presigned 7-day GET, status=done, credit deducted, telemetry per stage) Implemented Final → R2 (stage_compose), result URL now uses the 7-day presign — r2.py:_RESULT_URL_EXPIRES = 7*24*3600 via presign_result_get (config-overridable result_url_expires_s), while uploads keep the 900s _DEFAULT_EXPIRES (test_api.py). status/complete + per-stage telemetry via tasks (now including per-stage cost_usd/duration_ms, app/telemetry/cost.py); publish/cross-post in stage_upload + studio.publish. Documented deviation: credit is deducted at job creation (create_job) not at finalize, with refund on failure — functionally equivalent, safer against free runs.

CTO §6 — Sprint exits

Sprint exit Status Evidence / reason
S1: prompt → script → TTS audio in R2 via API Implemented stage_script + stage_tts + R2 upload; enqueue via POST /v1/jobs. Runtime needs Anthropic+ElevenLabs keys.
S2: full pipeline produces acceptance-quality video, TR+EN (Phase-1 internal launch) Gap-needs-keys All six stages coded + chained (pipeline.build_chain); real end-to-end video needs HeyGen/ElevenLabs/Anthropic keys + libass ffmpeg. Not demonstrated.
S3: non-technical user ships a video from the browser (Clerk auth, presign upload, wizard, dashboard, previews, mobile-responsive) + golden set gated (≤50ms drift) + Sentry + batch variants Implemented Web app present (web/app/{new,dashboard,jobs}), Clerk, Sentry wired. Golden set runs in the local acceptance gate (test_golden_acceptance.py; caption-drift ≤50ms among the encoded thresholds). Batch variants now shipped: POST /v1/jobs accepts variants: 1..3 and fans out a batch_id group (_resolve_variants, job_batch_id migration). Residual: golden run is local (no GitHub Actions), by design.
S4: a stranger can pay and generate (Stripe+iyzico, Free/Starter/Pro plans, rate limits, ToS/AI-disclosure toggle, landing, CF Pages) Partial Billing services + plans (Free 3 / Starter 30 / Pro 120 in plans.py), rate limits (ratelimit.py, job + publish limits), marketing/pricing pages present. AI disclosure is applied on publish (upload_post.py sets containsSyntheticMedia=true). Needs live Stripe/iyzico keys; an explicit user-facing ToS-acceptance toggle is still not wired into the compose/upload path (only a UI summary label in apps/web/src/features/reel-create/Wizard.tsx).

CTO §8 — Definition of Done (1–5)

# Criterion Status Evidence / reason
1 10/10 golden jobs pass in the gate (language, hook ≤2.5s, drift ≤50ms, avatar/audio Δ≤150ms, 1080×1920 ≥8 Mbps) Partial Golden harness + local acceptance gate exist: tests/golden/manifest.yaml (5 TR + 5 EN), tests/golden/acceptance.py (thresholds encode §8.1: 1080×1920, h264+faststart, drift ≤50ms, hook ≤2.5s, avatar/audio Δ≤0.15s), and test_golden_acceptance.py runs the synthetic/mechanical acceptance suite as part of make -f Makefile.reelforge golden (no GitHub Actions — local gate by design). The real 10-job set (with the ≥8 Mbps assertion on real renders) still needs live Anthropic/ElevenLabs/HeyGen keys + licensed avatars + a libass ffmpeg.
2 60s video ≤5 min p95 on Hetzner CPX41 Gap-needs-keys Not measured; needs deployed worker + live providers. Render path is single-pass.
3 Any stage failure → clean failed, retryable, no credit burned Implemented First-failure guard + on_failure→mark_failed (workers/tasks.py); retry CAS + refund-on-enqueue-failure (jobs.py:create_job/retry_job); resume from failed_stage (pipeline.retry_pipeline). Tested in test_workers.py/test_phase3.py.
4 Fresh-machine deploy from README in ≤30 min (docker compose up) Partial (docs) docs/reelforge/README.md + docker-compose.reelforge.yml + Makefile.reelforge; unverified on a clean box.
5 Zero secrets in repo; all config via env; Sentry receiving Implemented All keys via env in config.py (heygen/elevenlabs/r2/neon/stripe/iyzico/runpod/sentry/SOCIAL_TOKEN_KEY); .env.reelforge.example template; Sentry wired API+worker (NO-OP until DSN set). Live Sentry ingest needs a DSN.

This-phase features — beyond the original CTO/build plans

Nine growth features shipped this phase that neither plan specified. All are wired into app/router.py (22 included routers, 109 endpoints total), backed by dedicated tables in the single-head migration chain (head d4e8c1b9f6a2, 22 migrations / 22 tables), and covered by the local test gate (part of the 1709 passed, 3 skipped run).

# Feature Status Evidence / reason
1 Creator Analytics Implemented controllers/v1/analytics.py (GET /me/analytics — funnel/cost/credits/render BI); tables job_performance/credit_ledger sources. Tests: test_analytics.py, test_analytics_api.py.
2 Template Marketplace Implemented controllers/v1/marketplace.py (GET /marketplace, GET /marketplace/{id}, POST /marketplace/publish, POST /marketplace/{id}/clone, POST /marketplace/{id}/rate, DELETE /marketplace/{id}); tables marketplace_templates/template_ratings. Tests: test_marketplace.py, test_marketplace_api.py.
3 Marketplace win-score ranking Implemented sort=top|new|clones|proven|most_remixed on GET /marketplace; deterministic scoring in services/hook_performance.py (WIN_SCORE_ENGAGEMENT_WEIGHT 0.6 / WIN_SCORE_RETENTION_WEIGHT 0.4 / WIN_SCORE_SCALE 100). Tests: test_marketplace_ranking.py.
4 Marketplace remix trees Implemented GET /marketplace/{id}/lineage (ancestors + direct children); parent_template_id/remix_count provenance fields; table marketplace_templates remix links (migration ..._marketplace_remix_trees). Tests: test_marketplace_remix.py.
5 Hook Performance Loop (feeds Spark) Implemented controllers/v1/performance.py (POST/GET /jobs/{id}/performance, GET /me/performance, GET /me/winning-hooks, GET /me/winning-templates); services/hook_performance.py win-scores feed the Spark idea engine (test_ideas_performance_bias.py); table job_performance. Tests: test_hook_performance.py, test_performance_api.py.
6 Per-API-key quotas + rate limits (429) Implemented controllers/v1/api_keys.py (POST/GET /me/api-keys, GET /me/api-keys/usage, DELETE /me/api-keys/{id}) with per-key rate_limit_per_min/monthly_quota; services/apikey_quota.py enforces a 429 on breach; tables user_api_keys/api_key_usage. Tests: test_api_keys_api.py, test_apikey_quota.py, test_auth_apikeys.py.
7 OAuth direct-publish account-connect Implemented controllers/v1/connections.py (GET /me/connections, GET /connections/{provider}/authorize, GET /connections/{provider}/callback, DELETE /me/connections/{provider}, POST /jobs/{id}/publish/{provider}) for the TikTok/IG/YT seam; services/oauth_connect.py; tokens Fernet-encrypted at rest via services/crypto_tokens.py keyed by SOCIAL_TOKEN_KEY; table social_accounts. Tests: test_oauth_connect.py, test_connections_api.py.
8 Public watermarked share pages Implemented controllers/v1/share.py — owner POST /jobs/{id}/share + DELETE /me/shares/{token}, and the public GET /public/r/{token} serving only the WATERMARKED preview (never result_key); services/share.py; table share_links; rate-limited via reelforge_share_{write,view}_rate_* config. Tests: test_share.py, test_share_api.py.
9 Creator profiles + follow graph + leaderboards Implemented controllers/v1/creators.py (GET /creators/leaderboard, GET /creators/{handle_or_id}, POST/DELETE /creators/{id}/follow, GET /me/following, PATCH /me/profile); tables creator_follows (+ profile fields on users). Tests: test_creators.py, test_creators_api.py.

Remaining work (prioritized)

Landed since the last audit (previously listed here, now removed): Stage-5 smart screen handling (ffprobe/freezedetect/setpts/blur-pad), Stage-5 audio finishing (sidechaincompress duck + loudnorm −3 LUFS), curated resource/voices.yaml on GET /v1/voices, avatar drift fail+retry at strict <0.15s, 7-day result-URL presign, the TR-glyph rendered-frame QA test (test_turkish_glyphs.py), the golden acceptance local gate, the STATUS.md Sentry-TODO correction, per-job USD cost telemetry (job_events.cost_usd/duration_ms + app/telemetry/cost.py), batch variants (N=1..3) (_resolve_variants + batch_id fan-out), and the nine growth features catalogued in the "This-phase features" section below.

  1. Stock-footage removal. Physically delete/disable Pexels/Pixabay code in material.py and the stock keys in config.example.toml (build §8.1) rather than relying on non-use — pexels_api_keys/pixabay_api_keys still ship in config.example.toml.
  2. Explicit ToS-acceptance toggle. AI disclosure is applied on publish (upload_post.py containsSyntheticMedia=true), but a user-facing ToS/disclosure toggle is only a display label in apps/web/src/features/reel-create/Wizard.tsx (CTO §6 Sprint 4).

B. Key-required gaps (blocked on accounts/assets — config only, no new code)

  1. Real 10-video golden run + p95 benchmark — the harness, thresholds, and synthetic local gate are in place (tests/golden/, test_golden_acceptance.py); the real render pass (with the ≥8 Mbps assertion) needs Anthropic + ElevenLabs + HeyGen keys, licensed avatars, a libass-enabled ffmpeg, and a CPX41 worker (DoD §1, §2; run via make -f Makefile.reelforge golden).
  2. End-to-end acceptance video (TR+EN) — same provider keys (Sprint 2 exit).
  3. Live Sentry ingestion — set SENTRY_DSN (DoD §5).
  4. Payments live — Stripe + iyzico keys/price IDs to exercise billing/* webhooks and Checkout (Sprint 4).
  5. Clerk→API JWT bridge (design decision). If §4's "Clerk JWT verified in FastAPI middleware" is required, add JWT verification to the backend; currently the frontend is Clerk-gated but the API trusts per-user x-api-key only.
  6. Fresh-box deploy timing — verify docker compose up ≤30 min on a clean machine with keys filled (DoD §4).