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
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.
131 lines
12 KiB
JavaScript
131 lines
12 KiB
JavaScript
export const meta = {
|
|
name: 'wave3-port-clipfarm-oss',
|
|
description: 'Port the permissive clip-farm OSS from external/ INTO apps/api as renamed, improved, wired ReelForge modules (clipping from ai-shorts-generator, trends from tiktok-api + hashtag-analysis), then DELETE the external copies. TDD.',
|
|
phases: [
|
|
{ title: 'Recon' },
|
|
{ title: 'Design' },
|
|
{ title: 'Build' },
|
|
{ title: 'Integrate' },
|
|
{ title: 'Review' },
|
|
{ title: 'Retire' },
|
|
],
|
|
}
|
|
|
|
const ROOT = '/Users/arhansubasi/videogen'
|
|
const API = `${ROOT}/apps/api/app`
|
|
|
|
const NOTE = `GOAL: these MIT/Apache projects must become FIRST-CLASS ReelForge product code under apps/api (renamed + improved + wired to our compose/captions/wallet/publishing), NOT stay in external/. After porting, the external/ copies are DELETED. Retain LICENSE attribution by updating docs/reelforge/VENDORED-OSS.md to "ported into product source" (like MoneyPrinterTurbo). Adapt the code (allowed under MIT/Apache) — improve it, don't just paste. No GPL involved (those were already excluded).`
|
|
|
|
// ---------------------------------------------------------------- Recon
|
|
phase('Recon')
|
|
const RECON_SCHEMA = {
|
|
type: 'object', required: ['summary', 'reusable_parts', 'port_target', 'integration_notes'],
|
|
properties: {
|
|
summary: { type: 'string' },
|
|
reusable_parts: { type: 'array', items: { type: 'string' }, description: 'concrete files/functions worth porting' },
|
|
port_target: { type: 'string', description: 'where in apps/api it should live + the renamed module name' },
|
|
integration_notes: { type: 'array', items: { type: 'string' } },
|
|
},
|
|
}
|
|
const recon = await parallel([
|
|
() => agent(
|
|
`Recon ${ROOT}/external/ai-shorts-generator (MIT) for a long→short AUTO-CLIPPING port. Read its pipeline (transcription, viral-moment/segment detection, reframe/crop-to-vertical, caption burn, export). Identify the concrete reusable logic and how to adapt it into a NEW ReelForge domain apps/api/app/domains/clipping/ that reuses OUR services (services/captions/WhisperX, services/compose FFmpeg, wallet). ${NOTE} Read-only.`,
|
|
{ label: 'recon:clipping', phase: 'Recon', schema: RECON_SCHEMA }),
|
|
() => agent(
|
|
`Recon ${ROOT}/external/tiktok-api (MIT) and ${ROOT}/external/tiktok-hashtag-analysis (MIT) for a TRENDS port. Read the data-pull + hashtag-analysis logic. Identify what to port into apps/api/app/domains/trends/providers/ (a tiktok pull worker + hashtag analysis) feeding the EXISTING trends scorer (domains/trends/scoring.py). Note ToS-gating (consent + allowlist). ${NOTE} Read-only.`,
|
|
{ label: 'recon:trends', phase: 'Recon', schema: RECON_SCHEMA }),
|
|
() => agent(
|
|
`Recon the ReelForge wiring seams (read-only): ${API}/router.py (how domain routers mount — motion/templates/series/stories already added by Wave 2), ${API}/domains/trends/ (existing scoring + repository + router to extend, NOT replace), ${API}/services/captions + ${API}/services/compose (to reuse in clipping), and ${API}/workers/ (Celery task registration). Report exactly how a NEW clipping domain + trends providers mount + register without colliding with Wave 2's stories/series work. Read-only.`,
|
|
{ label: 'recon:seams', phase: 'Recon', schema: RECON_SCHEMA }),
|
|
])
|
|
|
|
// ---------------------------------------------------------------- Design
|
|
phase('Design')
|
|
const DESIGN_SCHEMA = {
|
|
type: 'object', required: ['clipping_files', 'trends_files', 'delete_paths', 'test_plan'],
|
|
properties: {
|
|
clipping_files: { type: 'array', items: { type: 'object', required: ['path', 'purpose'], properties: { path: { type: 'string' }, purpose: { type: 'string' } } } },
|
|
trends_files: { type: 'array', items: { type: 'object', required: ['path', 'purpose'], properties: { path: { type: 'string' }, purpose: { type: 'string' } } } },
|
|
delete_paths: { type: 'array', items: { type: 'string' }, description: 'external/ dirs to remove after porting' },
|
|
test_plan: { type: 'array', items: { type: 'string' } },
|
|
},
|
|
}
|
|
const design = await agent(
|
|
`Architect Wave 3: port the vendored clip-farm OSS into ReelForge product code. Recon:\nCLIPPING: ${JSON.stringify(recon[0])}\nTRENDS: ${JSON.stringify(recon[1])}\nSEAMS: ${JSON.stringify(recon[2])}\n\n` +
|
|
`Design: (1) apps/api/app/domains/clipping/ — long→short auto-clipping ported+improved from external/ai-shorts-generator, reusing OUR captions/compose (router+service+pure logic). (2) apps/api/app/domains/trends/providers/ — tiktok pull + hashtag analysis ported from external/tiktok-api + tiktok-hashtag-analysis, feeding the existing scorer (extend, don't replace trends). (3) Which external/ dirs to DELETE after porting. Partition: builder-CLIPPING owns domains/clipping/**; builder-TRENDS owns domains/trends/providers/** (new files only, don't rewrite existing trends). Give file lists + a TDD plan (injectable transports for tiktok/network; pure clipping logic; 80%+). ${NOTE}`,
|
|
{ label: 'design:wave3', phase: 'Design', effort: 'high', schema: DESIGN_SCHEMA })
|
|
log(`Design: ${design.clipping_files.length} clipping files, ${design.trends_files.length} trends files`)
|
|
|
|
// ---------------------------------------------------------------- Build
|
|
phase('Build')
|
|
const BUILD_SCHEMA = {
|
|
type: 'object', required: ['files_written', 'tests_written', 'public_symbols', 'notes'],
|
|
properties: {
|
|
files_written: { type: 'array', items: { type: 'string' } },
|
|
tests_written: { type: 'array', items: { type: 'string' } },
|
|
public_symbols: { type: 'array', items: { type: 'string' } },
|
|
notes: { type: 'string' },
|
|
},
|
|
}
|
|
const built = await parallel([
|
|
() => agent(
|
|
`Build the CLIPPING port, TDD, in ${ROOT}. Own domains/clipping/** ONLY. Files: ${JSON.stringify(design.clipping_files)}.\n` +
|
|
`Port + IMPROVE the long→short auto-clipping from external/ai-shorts-generator into a ReelForge domain: transcribe (reuse services/captions/WhisperX) → detect viral moments/segments → reframe to vertical → burn captions (reuse services/compose) → export a draft. Adapt the MIT code; improve structure to match ReelForge conventions. Network/ML calls behind injectable seams (fake in tests). Tests first: a transcript → ranked clip segments; segment → vertical-reframed RenderSpec draft; edge cases (no speech, very long input). Run: cd ${ROOT} && python -m pytest apps/api tests -k 'clipping' -q. Report files + public symbols.`,
|
|
{ label: 'build:clipping', phase: 'Build', effort: 'high', schema: BUILD_SCHEMA }),
|
|
() => agent(
|
|
`Build the TRENDS port, TDD, in ${ROOT}. Own domains/trends/providers/** ONLY (new files; do NOT rewrite existing trends scoring/repository). Files: ${JSON.stringify(design.trends_files)}.\n` +
|
|
`Port + IMPROVE the tiktok pull + hashtag analysis from external/tiktok-api + tiktok-hashtag-analysis into trends providers that feed the EXISTING scorer (domains/trends/scoring.py). All network calls behind an injected transport (fake in tests — never hit TikTok). ToS-gate behind a consent/allowlist flag. Tests first: fake tiktok payload → TrendSignal list → feeds score_trend; hashtag analysis recipe; consent-gate blocks when disabled. Run: cd ${ROOT} && python -m pytest apps/api tests -k 'trend' -q. Report files + public symbols.`,
|
|
{ label: 'build:trends', phase: 'Build', effort: 'high', schema: BUILD_SCHEMA }),
|
|
])
|
|
|
|
// ---------------------------------------------------------------- Integrate
|
|
phase('Integrate')
|
|
const integrated = await agent(
|
|
`Integrate Wave 3 in ${ROOT}. Built:\nCLIPPING: ${JSON.stringify(built[0])}\nTRENDS: ${JSON.stringify(built[1])}\n` +
|
|
`Mount the clipping router + any trends-provider routes in apps/api/app/router.py (mirror existing domain mounts; do NOT disturb Wave 2's stories/series mounts). Register any Celery tasks. Verify clipping reuses our captions/compose and trends feeds the existing scorer. Run: cd ${ROOT} && python -m pytest apps/api tests -k 'clipping or trend' -q. Fix wiring with MINIMAL edits; do not weaken tests. Note pre-existing unrelated failures separately. Report.`,
|
|
{ label: 'integrate', phase: 'Integrate', effort: 'high', schema: {
|
|
type: 'object', required: ['router_mounted', 'tests_pass', 'output_tail', 'remaining_issues'],
|
|
properties: { router_mounted: { type: 'boolean' }, tests_pass: { type: 'boolean' }, output_tail: { type: 'string' }, remaining_issues: { type: 'array', items: { type: 'string' } } } } })
|
|
log(`Integrate: mounted=${integrated.router_mounted} tests_pass=${integrated.tests_pass}`)
|
|
|
|
// ---------------------------------------------------------------- Review
|
|
phase('Review')
|
|
const FINDINGS_SCHEMA = {
|
|
type: 'object', required: ['findings'],
|
|
properties: { findings: { type: 'array', items: {
|
|
type: 'object', required: ['severity', 'file', 'summary', 'fix'],
|
|
properties: { severity: { type: 'string', enum: ['critical', 'high', 'medium', 'low'] }, file: { type: 'string' }, line: { type: 'integer' }, summary: { type: 'string' }, fix: { type: 'string' } } } } },
|
|
}
|
|
const reviews = await parallel([
|
|
() => agent(`Adversarial correctness review of Wave 3 clipping+trends in ${ROOT} (${[...built[0].files_written, ...built[1].files_written].join(', ')}). Does clipping handle no-speech / very-long / non-vertical inputs? Any network/ML call not behind an injectable seam? Does trends respect the ToS consent-gate and not crash on malformed TikTok payloads? Report real defects + failing input + minimal fix.`,
|
|
{ label: 'review:correctness', phase: 'Review', effort: 'high', schema: FINDINGS_SCHEMA }),
|
|
() => agent(`Review Wave 3 for license + integration hygiene in ${ROOT}. Confirm ported code is adapted into ReelForge conventions (not a raw dump), reuses our captions/compose/scorer rather than duplicating, and that MIT/Apache attribution is preserved. Confirm it does NOT duplicate or conflict with Wave 2's stories/series. Report real defects + fixes.`,
|
|
{ label: 'review:integration', phase: 'Review', effort: 'high', schema: FINDINGS_SCHEMA }),
|
|
])
|
|
const allFindings = reviews.filter(Boolean).flatMap(r => r.findings || [])
|
|
const mustFix = allFindings.filter(f => f.severity === 'critical' || f.severity === 'high')
|
|
let fixResult = { applied: [], note: 'none' }
|
|
if (mustFix.length > 0) {
|
|
fixResult = await agent(`Fix these CONFIRMED critical/high Wave 3 findings in ${ROOT}, minimal edits, don't weaken tests. Re-run the clipping/trend tests. Report.\n${JSON.stringify(mustFix, null, 2)}`,
|
|
{ label: 'fix', phase: 'Review', effort: 'high', schema: { type: 'object', required: ['applied', 'note'], properties: { applied: { type: 'array', items: { type: 'string' } }, note: { type: 'string' } } } })
|
|
}
|
|
|
|
// ---------------------------------------------------------------- Retire external copies
|
|
phase('Retire')
|
|
const retire = await agent(
|
|
`Finalize Wave 3 in ${ROOT}: the OSS is now ported into apps/api, so RETIRE the external copies. (1) Delete these dirs: ${JSON.stringify(design.delete_paths)} (only the ones actually fully ported — keep any not yet ported and say so). Use rm -rf on the specific external/ paths. (2) Update ${ROOT}/docs/reelforge/VENDORED-OSS.md: move the ported projects from "vendored in external/" to a "PORTED INTO PRODUCT SOURCE (apps/api)" section, keeping the MIT/Apache attribution intact (like the MoneyPrinterTurbo entry in THIRD_PARTY_NOTICES.md). Do NOT delete anything still referenced. Report what was deleted and what remains.`,
|
|
{ label: 'retire', phase: 'Retire', effort: 'medium', schema: {
|
|
type: 'object', required: ['deleted', 'kept', 'notes'],
|
|
properties: { deleted: { type: 'array', items: { type: 'string' } }, kept: { type: 'array', items: { type: 'string' } }, notes: { type: 'string' } } } })
|
|
|
|
return {
|
|
wave: 'Wave 3 — port clip-farm OSS into ReelForge',
|
|
clipping_files: built[0].files_written,
|
|
trends_files: built[1].files_written,
|
|
router_mounted: integrated.router_mounted,
|
|
tests_pass: integrated.tests_pass,
|
|
critical_high_fixed: fixResult.applied,
|
|
external_deleted: retire.deleted,
|
|
external_kept: retire.kept,
|
|
}
|