19 KiB
SocialOps TODO
Companion to docs/ARCHITECTURE.md. Source: PLAN.md, PLAN1.md, VENDOR.md, GAPS.md.
Snapshot: 2026-05-26. Tests: 38/38 passing, type check clean, workspace check failing on lost services/comfyui/README.md (see Phase 0).
Legend: β¬ not started Β· π‘ partial Β· β
done Β· π΄ blocker Β· π high Β· π‘ medium Β· π’ low
Phase 0 β Recover baseline (1 day, π΄ blocker)
Mid-session, services/comfyui|postiz|pokee-research/ and VENDOR.md vanished from disk. Until these come back, the workspace consistency check fails and several documented service-boundary READMEs are missing.
- 0.1 Confirm whether the files exist anywhere recoverable (
~/Library, Time Machine, iCloud, other branches). If yes β restore. - 0.2 If not recoverable: regenerate from spec.
services/comfyui/README.mdβ copy the boundary text from VENDOR.md Β§2 and PLAN.md Β§AI Service Boundaries.services/postiz/README.mdβ AGPL boundary, reference-only.services/pokee-research/README.mdβ Apache-2.0 service.VENDOR.mdβ already in context this session; rewrite from the original content.
- 0.3 Add
infra/backups/snapshot.shβ daily tar of repo root excludingnode_modules,ComfyUI/models,postiz-app/.git,PokeeResearchOSS/.git. Output to~/socialops-backups/YYYY-MM-DD.tar.gz. Cron daily. - 0.4
pnpm run check:workspacepasses again.
Acceptance: workspace check green, VENDOR.md back at repo root, daily backup running.
Phase 1 β Make video pipeline real (3β5 days, π high)
Without real Remotion templates and real FFmpeg post-processing, every "rendered" video today is a metadata stub.
1.1 Remotion templates (apps/video-worker/src/remotion/)
- 1.1.1
CareerLessonVertical.tsxβ 9:16, 20β45s, hook title + 3 lesson cards + CTA. Composition + schema props. - 1.1.2
LinkedInProUpdate.tsxβ 4:5, 45β90s, title card β update body β reflection β question CTA. - 1.1.3
FounderWeeklyUpdate.tsxβ 16:9 + 4:5, 45β75s, shipped / broke / learned / next. - 1.1.4
ProductDemo.tsxβ 16:9 + 9:16, 30β90s, problem β action β result β CTA. Acceptsscreen_recording_urlandcursor_zoom_points. - 1.1.5
ProjectBuildLog.tsxβ 9:16, 30β60s, name β built β hard part β result β next. - 1.1.6 Register all 5 in
apps/video-worker/src/templates.tswith stabletemplate_keys matching the existing API contract. - 1.1.7 Vitest: render each template in dry-run mode, assert composition props + duration.
1.2 FFmpeg post-processing (apps/video-worker/src/ffmpeg.ts)
- 1.2.1 Caption burn-in from
caption_segments(style presets: Clean Pro, TikTok Bold, Startup Demo, Career Min, Dark Tech, White LinkedIn). - 1.2.2 Per-platform resize (9:16, 16:9, 1:1, 4:5) with safe-area cropping for TikTok UI.
- 1.2.3 Trim / stitch helper for multi-scene jobs.
- 1.2.4 CTA end-card append (optional, from job payload).
- 1.2.5 Hook the post-processor into
/renderafter Remotion finishes. UpdateVideoAsset.duration_seconds,width,heightfrom the actual output. - 1.2.6 Use LGPL-only FFmpeg build. Document in
packages/licensing/THIRD_PARTY.md.
1.3 Wire the worker into the API
- 1.3.1 Confirm
/v1/workspaces/:id/videos/jobs/:id/renderactually invokes the new pipeline end-to-end. - 1.3.2 Integration test using the existing mock VideoWorkerClient + a one-real-render Vitest behind
VIDEO_WORKER_REAL=1.
Risk: Remotion 4.x ships with React 18; bundle size on Mac builds is ~150MB. Mitigation: lazy-load templates per composition; cache the bundler.
Closes: Build-order #25 (real), AC #18 (real).
Phase 2 β OpenPost media bridge (2β3 days, π high)
Today the API has /content-drafts/:id/openpost and /videos/assets/:id/send-to-openpost but the per-resource bridge to OpenPost media is missing.
- 2.1 New package
packages/social-bridge/src/openpost.tsβ typed client over the existing OpenPost middleware token.uploadMedia({ workspaceId, mimeType, sourcePath, publicUrl }) β { openpost_media_id }createPost({ workspaceId, accountIds, text, mediaIds, scheduledAt }) β { openpost_post_id, status }schedulePost({ postId, scheduledAt, randomDelayMinutes }) β { status }
- 2.2 New API routes (mirroring PLAN.md Β§AI Service Boundaries):
POST /v1/workspaces/:id/social/openpost/upload-mediaPOST /v1/workspaces/:id/social/openpost/create-postPOST /v1/workspaces/:id/social/openpost/schedule-post
- 2.3
send-to-openpost(already a route) now actually calls the bridge: uploadVideoAssetβ upload to OpenPost β attach to draft β optionally schedule. Updatesvideo_post_bridgesrows transactionally. - 2.4 OpenPost fork: confirm
POST /api/v1/uploadsacceptsX-SocialOps-Internal-Tokenfor media; add migration if needed. - 2.5 Tests: mock OpenPost client returns success/failure; assert
video_post_bridges.statustransitions; assert idempotency on retries.
Risk: OpenPost Go fork hasn't been touched in months; the upload endpoint may need a small patch. Mitigation: keep the bridge thin so retries are safe.
Closes: V1 #21, #23 (fully); build-order #21, #27.
Phase 3 β PLAN1 local AI stack basics (4β6 days, π‘ medium)
Three concrete wins from PLAN1.md that unlock real workflows without GPU.
3.1 Whisper captions (services/whisper)
- 3.1.1 Tiny Python service: FastAPI +
faster-whisper(CTranslate2). EndpointPOST /transcribeaccepts audio file; returns JSON timed captions. - 3.1.2 Compose entry; CPU-only mode for Mac. Bench: 1min audio < 8s.
- 3.1.3 TS client in
packages/integrations/src/whisper.ts. - 3.1.4 API:
POST /v1/workspaces/:id/videos/captions/generateβ input{ video_asset_id | media_asset_id, language? }β writescaption_tracks+caption_segments.
3.2 OpenVoice / Piper voiceover (services/voice)
- 3.2.1 Python service exposing both OpenVoice V2 and Piper (Piper as fallback for fast TTS).
- 3.2.2
POST /ttsbody{ text, voice_key, provider: "openvoice"|"piper" }β MP3. - 3.2.3 TS client in
packages/integrations/src/voice.ts. - 3.2.4 API:
POST /v1/workspaces/:id/videos/voiceover/generateβ writesvoiceover_assets. - 3.2.5 Consent gate: cloning a voice via OpenVoice requires
consent_artifact_id(an uploaded signed consent file). Otherwise only Piper is allowed.
3.3 rembg cutouts (services/rembg)
- 3.3.1 Reuse the official MIT
rembgcontainer. - 3.3.2
POST /v1/workspaces/:id/visuals/cutoutβ input image β transparent PNG; writesvisual_assetsrow withmedia_kind = image,workflow_key = rembg-cutout.
Risk: Mac M-series Whisper accuracy varies. Mitigation: default to large-v3-turbo; allow tiny model toggle for cheap drafts.
Closes: V1 #20 first half; PLAN1 stack 3 β 6 done.
Phase 4 β Product demo capture (3β4 days, π‘ medium)
The most-promised SocialOps capability is "turn a SaaS URL into a TikTok demo". Today the table exists; the route doesn't.
- 4.1 New
apps/video-worker/src/playwright.tsβ controlled-viewport headless capture.- Viewport presets per PLAN.md Β§Video Engine: 1920Γ1080, 1080Γ1350, 1080Γ1920, 1080Γ1080.
- Screenshot capture per scene
url + action_description. - Optional
videoMode: 'screen_recording'for full-page record.
- 4.2 API routes (PLAN.md Β§Video Engine):
POST /v1/workspaces/:id/videos/product-demo/createPOST /v1/workspaces/:id/videos/product-demo/:id/planβ AI splits goal into scene plan + ProductDemoScene rows.POST /v1/workspaces/:id/videos/product-demo/:id/captureβ runs Playwright, stores screenshots.POST /v1/workspaces/:id/videos/product-demo/:id/renderβ feeds scenes + screenshots into RemotionProductDemo.tsx.
- 4.3 Cursor + zoom overlay in Remotion using
zoom_target_json. - 4.4 Tests: mock Playwright
chromium.launch(); assert ProductDemoScene rows match spec. - 4.5 Refuse to render against any URL not on a per-workspace allowlist (anti-abuse).
Risk: Browser-bot policies on some SaaS. Mitigation: allowlist + clear UA SocialOpsDemoBot/1.0.
Closes: V1 #19, build-order #29; AC for product demo.
Phase 5 β People-video upload + caption flow (3β4 days, π‘ medium)
Mode 1 of PLAN.md Β§Video Engine β user uploads raw video/audio, system transcribes, edits, captions, renders.
- 5.1 Upload route:
POST /v1/workspaces/:id/videos/people/uploadβ accepts multipart; stores in object storage; createsmedia_assetsrow. - 5.2 Transcribe:
POST /v1/workspaces/:id/videos/people/transcribeβ callsservices/whisper; createscaption_tracks+caption_segments. - 5.3 Edit suggestion:
POST /v1/workspaces/:id/videos/people/editβ LLM proposes cut points + scene boundaries from the transcript. - 5.4 Render:
POST /v1/workspaces/:id/videos/people/renderβ RemotionPeopleVideo.tsx(new) renders cuts + burned captions + optional title/b-roll. - 5.5 Mode 3 (avatar) β
POST /v1/workspaces/:id/videos/people/avatarβ HeyGen adapter gated behind paid plan + explicitis_consenting_user: true. Refuses public figures. - 5.6 FTC gate: people-video script generator refuses first-person testimony framing unless
ugc_brief.is_real_user = true. Addis_real_userto ugc_briefs schema.
Closes: V1 #20 second half; PLAN1 Workflow #2 ready.
Phase 6 β Shorts / captions / voiceover / b-roll API surface (2β3 days, π’ low)
Mechanical CRUD-and-orchestration, mostly. Tables and workers exist.
- 6.1
POST /v1/workspaces/:id/videos/shorts/scriptβ Level-1 TikTok/Reels/Shorts script. - 6.2
POST /v1/workspaces/:id/videos/shorts/renderβ choosesCareerLessonVerticalorProjectBuildLogtemplate. - 6.3
POST /v1/workspaces/:id/videos/broll/planβ writesbroll_plansrows from avideo_job_id. - 6.4
POST /v1/workspaces/:id/videos/broll/generateβ for each plan row withasset_type=ai_image|ai_video, enqueuevisual-worker; forscreenshot, enqueue Playwright. - 6.5
POST /v1/workspaces/:id/videos/jobs/:id/approveand/rejectβ convenience routes; today onlyvideo_assets/:id/approvalexists. - 6.6 Tests for each.
Closes: the remaining PLAN.md Β§Video Engine routes that aren't admin-facing.
Phase 7 β MiniClaw HTTP integration (4β5 days, π‘ medium)
Today generation happens inside apps/api via packages/prompts templates. PLAN.md Β§AI Service Boundaries says MiniClaw owns generation and enforces a first-party skill allowlist.
- 7.1
apps/claw/socialops/β implement skills as actual modules (today onlysocialops-generate-draft/SKILL.mddescription exists):capture_note,generate_linkedin_post,generate_x_post,generate_x_thread,generate_tiktok_script,generate_carousel_copy,generate_application_answer,generate_pitch_deck,generate_outreach_draft,generate_visual_prompt,generate_video_script,summarize_week,create_content_calendar,suggest_replies,create_follow_up,update_crm_lead.
- 7.2 MiniClaw HTTP server (Express or Fastify), endpoint
POST /skills/:skill_keywith allowlist enforcement. - 7.3 TS client in
packages/integrations/src/miniclaw.ts. - 7.4 Feature-flag
USE_MINICLAW_GENERATION=1to gradually shift generation routes off API-internal prompts. - 7.5 Source-of-truth pull: MiniClaw skills receive
personal_profile,career_profile,project,capture_notes,approved_claims,forbidden_claims,tone_profile,content_historyper skill call. - 7.6 ClawHub strictly disabled in production config.
- 7.7 Tests for each skill: real-source generation produces a draft; missing-source generation flags
missing_info.
Closes: V1 #8; build-order #3 and #12.
Phase 8 β Auth + token encryption + admin (4β5 days, π high)
Today auth is dev-headers and OAuth tokens aren't encrypted.
- 8.1
packages/security/src/crypto.tsβ AES-GCM encrypt/decrypt withSOCIALOPS_TOKEN_KEY(32-byte hex).encryptOauthToken,decryptOauthToken. - 8.2 Migrate
social_accounts.oauth_tokencolumn β encrypted blob. Backfill rotate playbook. - 8.3 Real auth:
- Email/password with bcrypt.
- Magic-link email login (Resend or SMTP via env).
- HTTP-only session cookie + CSRF.
POST /v1/auth/register,POST /v1/auth/login,POST /v1/auth/logout,POST /v1/auth/magic.
- 8.4 Onboarding state machine β
POST /v1/onboarding/start|step|complete. - 8.5 Admin routes:
GET /v1/admin/usersGET /v1/admin/workspacesGET /v1/admin/billingGET /v1/admin/usageGET /v1/admin/generationsGET /v1/admin/errorsPOST /v1/admin/billing/:id/grant-planPOST /v1/admin/billing/:id/revoke-planPOST /v1/admin/billing/:id/reset-usageGET /v1/admin/audit-logs?type=&since=
- 8.6 Admin role gate.
Closes: V1 #3, #4, #27, #28.
Phase 9 β Multi-account orchestration (3β4 days, π‘ medium)
The operator runs many handles across platforms. The schema supports this; the orchestration logic doesn't yet.
- 9.1
packages/content-engine/src/distribution.tsβ given aContentDraft, target identities, and target channels, compute per-account variants (no copy-paste cross-posting). - 9.2
POST /v1/workspaces/:id/content-drafts/:id/distributeβ generates platform-native variants, creates one draft per (identity, channel), groups under adistribution_plan_id. - 9.3
GET /v1/workspaces/:id/distribution-plans/:idβ shows status across all variants. - 9.4 Per-account cadence rules (minimum N hours between posts, max M per day) enforced at schedule time.
- 9.5 Tests cover: 3 X accounts + 1 LinkedIn + 2 TikTok from a single capture note β 6 distinct drafts in approval queue.
Closes: multi-account product gap; supports operator's actual workflow.
Phase 10 β Analytics aggregator + metric sync (3 days, π’ low)
- 10.1
GET /v1/workspaces/:id/analyticsβ rollup ofcontent_metricsby platform / channel / identity / time window. - 10.2
GET /v1/workspaces/:id/analytics/topβ best-performing drafts (impressions Γ engagement-rate score). - 10.3 Manual entry already done. Connected-account sync stubs for X (free tier β public counts) and LinkedIn (only via official API when available).
- 10.4 Feed metrics back into x-algorithm scoring loop (already accepts
metrics_json; ensure write-back path).
Closes: V1 partial #26; #34 build-order.
Phase 11 β Frontend decision (variable, π‘ medium)
Decide by 2026-06-15 between Path A (operator-only) and Path B (Next.js shell).
- 11.1 Compare bundled video pipeline UI vs. operator command bar UX with the actual operator (user).
- 11.2 If Path A: extend
apps/webwith calendar view, approval queue, multi-account variant browser, deck preview. - 11.3 If Path B: scaffold
apps/web-nextwith App Router, Tailwind, shadcn/ui; migrate routes incrementally; keepapps/webrunning until parity. - 11.4 Either way: implement multi-account dashboard cards.
Phase 12 β External AI video providers (paid, gated, 2β3 days, π’ low)
- 12.1 Adapter interface in
packages/video/src/providers/types.ts. - 12.2 Adapters:
runway.ts,luma.ts,pika.ts(via Fal.ai),heygen.ts,creatomate.ts,manual.ts. - 12.3 Routes pick
render_providerfrom job; refuse if plan disallows (canUseExternalVideoProvider(plan)helper). - 12.4 Per-plan monthly cap in
usage.tsalready exists for video renders; add provider-specific caps. - 12.5 Cost telemetry into
usage_events.
Phase 13 β Deploy / monitoring / backups (3β5 days, π‘ medium)
- 13.1 Verify
infra/compose/socialops.production.example.ymlboots end-to-end on a fresh Mac. - 13.2 Reverse proxy (Caddy or Traefik) with HTTPS; OpenPost served at
/social/*. - 13.3 Postgres + object storage (MinIO) services in compose.
- 13.4 Health endpoints for every service; one
/health/allaggregator. - 13.5 Backup cron from Phase 0; restore drill.
- 13.6 Sentry or Highlight for error tracking.
- 13.7 Per-service log streaming (Vector β Loki, or just JSON to disk).
- 13.8 Deploy doc in
infra/DEPLOY.md.
Critical-path ordering
Phase 0 (recover)
β
βββ Phase 1 (video pipeline real) ββββ
β β βββ> Phase 4 (product demo)
β β βββ> Phase 5 (people video)
β β βββ> Phase 6 (shorts/etc)
β β
β βββ Phase 2 (OpenPost bridge) ββ> Phase 9 (multi-account)
β
βββ Phase 3 (PLAN1 stack) βββββββββββββββ> Phase 5 (people captions)
β
βββ Phase 7 (MiniClaw)
β
βββ Phase 8 (auth/admin) ββ> Phase 12 (paid providers) ββ> Phase 13 (deploy)
β
βββ Phase 10 (analytics) ββ> Phase 11 (frontend decision)
Phases 0, 1, 2, 3, 7, 8 are the must-haves for "the operator can actually use this every day across all their accounts." Phases 4, 5, 6 deliver the differentiated video product. Phases 9, 10, 11, 12, 13 are scale / polish / launch.
Estimates
| Phase | Days | Owner-only? | Complexity |
|---|---|---|---|
| 0 | 1 | yes | Low |
| 1 | 3β5 | yes | Medium |
| 2 | 2β3 | yes | Medium |
| 3 | 4β6 | yes | Medium-High (Python services) |
| 4 | 3β4 | yes | Medium |
| 5 | 3β4 | yes | Medium |
| 6 | 2β3 | yes | Low |
| 7 | 4β5 | yes | Medium-High |
| 8 | 4β5 | yes | Medium-High |
| 9 | 3β4 | yes | Medium |
| 10 | 3 | yes | Low |
| 11 | 5β20 | depends | High if Path B |
| 12 | 2β3 | yes | Low |
| 13 | 3β5 | yes | Medium |
| Total | ~42β70 days |
Solo-operator realistic: ~10 weeks of focused work to V1 production.
Definition of Done (V1)
The 30 acceptance criteria in PLAN.md Β§Production V1 Scope, currently 18/30 done. Phases 1β8 close the remaining 12. Phases 9β13 are post-V1 polish.
Operator decisions (locked 2026-05-26)
- Lost files β operator deleted; they were empty. Phase 0 reduced to backup script only.
- Frontend β Path A (operator-only). Extend
apps/web. Defer Next.js shell. - Hardware β MacBook Air 24GB dev + Hetzner CPU server for prod. No GPU. Local AI stack = CPU-only (rembg, Whisper, Piper). Wan/LTX local skipped β route to external paid APIs in Phase 12 if needed.
- Whisper β
small.endefault +tiny.enfor drafts. RAM-light, CPU-friendly. - Auth β Clerk. Phase 8 simplifies: no own email/password, Clerk handles sessions + magic-link + RBAC.
Phase impact:
- Phase 0 reduced to backup script (skip 0.1, 0.2, keep 0.3, 0.4).
- Phase 3 β drop ComfyUI Wan2.2/LTX local install; CPU services only (Whisper, OpenVoice/Piper, rembg).
- Phase 8 β replace own auth + magic-link with Clerk middleware in apps/api; admin routes unchanged.
- Phase 11 β Path A confirmed; reduced to extending
apps/webwith calendar + approval queue + multi-account variant browser.