Clone any viral video with AI agents. Not just a script, the whole workflow: swap the face, the words, the B-roll, ship 100 variants in one command, and get your 100M views.
TypeScript agentic-aiaiai-agentsai-videocompilerdslffmpeggenerative-aillmmarkup-languagemonorepoplugin-systemprogramming-languagetext-to-videotypescriptvideovideo-automationvideo-clonevideo-editingvideo-generation
Make the build gate satisfiable again, and say what it proves
rpone0956d0f3d12f
diff --git a/.agents/skills/hypit/references/local-author-package.md b/.agents/skills/hypit/references/local-author-package.mdindex 87e73d75..b69a7f6d 100644--- a/.agents/skills/hypit/references/local-author-package.md+++ b/.agents/skills/hypit/references/local-author-package.md@@ -192,17 +192,21 @@ pnpm hypit check path/to/recipes.svspnpm hypit check path/to/build.svrun```-A package that cannot be *seen* is not done. `hypit check` proves the Source is legal, and nothing-more; it will not tell you that the track a package produces fails to build when Studio-renders it. Run the preview check and repair until it passes with no failures — a build failure is-not a difference to weigh, it is work that is not finished, and it is not bounded by the loop's-attempt ceiling:+A package that cannot be *wired* is not done. `hypit check` proves the Source is legal, and nothing+more; it will not tell you that the track a package produces cannot be traced to a Film at all. Run+the preview check and repair until it passes — a graph failure is not a difference to weigh, it is+work that is not finished, and it is not bounded by the loop's attempt ceiling:```bash# from the repository root: tsx is the repository's dependency-node --import tsx .agents/skills/hypit/scripts/preview-check.mjs path/to/main.svml path/to/build.svrun+node --import tsx .agents/skills/hypit/scripts/preview-check.mjs path/to/build.svrun```-Use existing `--workspace` or `--package-root` options only when the project layout requires them.+It takes the Run Source, not the `.svml`. A pass here means the graph reaches a Film and a semantic+spine; it exits zero while the Providers are still unrun, and says which capabilities it is waiting+on. See `reconstruction/final-sources.md` for what that does and does not prove — notably, a+Producer that refuses the media kind it is handed is not caught here, because nothing is handed to+it until the Build runs.+Do not continue to final authoring until the package and sources pass the existing checks and the-preview builds every track.+graph traces.diff --git a/.agents/skills/hypit/references/playbooks/craft/production-gates.md b/.agents/skills/hypit/references/playbooks/craft/production-gates.mdindex e99f58ac..df347ed6 100644--- a/.agents/skills/hypit/references/playbooks/craft/production-gates.md+++ b/.agents/skills/hypit/references/playbooks/craft/production-gates.md@@ -38,13 +38,21 @@ and every take that ran before the step that broke, and resubmitting without pinsame bytes again. Run `--pin` against the failed Build before touching the cause.**Pin what a Provider was paid to make, and nothing the Source computes.** `--pin` emits a line for-every accepted output, including the ones the Script's own structure produced: `speech.space`,-`speech.visual`, `timing.map`, the caption plan. Those are free to rebuild and they are measured-*against the Script as it was*. Paste them back after editing a Segment — renaming one, merging two —-and the Build pins a map whose anchors describe a program that no longer exists. It does not fail.-Every Track times itself against those stale anchors and the delivery is quietly wrong, which is the-one failure this whole gate sequence exists to prevent. Keep the pictures, the takes and the voices;-let everything downstream of them recompute.+every accepted output, including the ones the Script's own structure produced: `speech.semantic`,+`speech.visual`, `speech.audio`, the caption plan. Those are projections of the Takes — free to+rebuild, and measured *against the Script as it was*. Paste them back after editing a Segment —+renaming one, merging two — and the Build pins a skeleton whose anchors describe a program that no+longer exists. It does not fail. Every Track times itself against those stale anchors and the+delivery is quietly wrong, which is the one failure this whole gate sequence exists to prevent.++**A `SemanticTake` is both.** Alignment is a served capability, so `<take>-semantic.take` is work+something was paid for and is worth pinning — but its tokens and anchors are keyed to the Script+Segment it aligned, so it goes stale on a Segment edit exactly as the projections above do. Pin it+while the Script is untouched; drop it for the Takes whose Segment you edited, and let those+re-align. This is the one line where "keep what was paid for" and "drop what the Script invalidated"+disagree, and the Script wins.++Keep the pictures, the takes and the voices; let everything downstream of them recompute.**A Build that failed downstream may still hold the good draw from a model that does not repeatitself.** The caption Planner is a language model: the same Source gives a valid plan on one run anddiff --git a/.agents/skills/hypit/references/reconstruction/final-sources.md b/.agents/skills/hypit/references/reconstruction/final-sources.mdindex 95e8f688..bb419ae2 100644--- a/.agents/skills/hypit/references/reconstruction/final-sources.md+++ b/.agents/skills/hypit/references/reconstruction/final-sources.md@@ -72,39 +72,47 @@ image, a reference that does not resolve. Find that now, not on the author's scr```bash# from the repository root: tsx is the repository's dependency-node --import tsx .agents/skills/hypit/scripts/preview-check.mjs path/to/main.svml path/to/build.svrun+node --import tsx .agents/skills/hypit/scripts/preview-check.mjs path/to/build.svrun```-It reports every track that failed to build, and every track waiting on a Provider it cannot reach,-and exits non-zero when either exists. The failures it reports are the Producer's own messages — the-track name, the Producer, and why it failed, down to the offending value (a schedule frame outside a-window, a media edge whose artifact is not an image). This is not a guessing problem: the error says-what is wrong, and you repair that. A track that cannot be built is not done, and this is not the-loop: the two-attempt ceiling governs how *well* a buildable element is tuned to the reference; it-does not govern whether the element builds at all. Every failure this check reports must be repaired-until the check passes — the author should never open Studio and find that something they-were delivered cannot be seen. Repair as many times as the failure needs, then re-run the check.--One failure is not a defect, and it is worth knowing before spending repairs on it. The preview has-to draw outputs nothing has produced yet, so it substitutes a stand-in — a black video frame as long-as the shot. **A stand-in is not the kind of thing the real output will be**, so a Producer that-validates the kind of media it receives can refuse it and be entirely correct at build time. A still-Media Item is the case that bites: it requires image bytes, the stand-in for an unbuilt `gpt:Image`-is `video/mp4`, and the preview reports a media edge whose artifact is not an image — the same-sentence it would use for a genuine wiring mistake.--Tell them apart before repairing. It is a stand-in artifact when the edge points at an output this-Source generates rather than at supplied material, and the message is about the media *kind* rather-than a value. Pinning does not settle it either: preview-check reads a Run Source but cannot open-pinned Records without a Runtime, and the script does not offer one. Everything else it reports is-still a real failure and still has no attempt ceiling.--Two ways out, in order. In a component you own, decide the element kind from the Artifact's own-`mediaType` instead of hard-coding it — the component then draws the stand-in as video and the real-picture as an image, and the preview passes honestly. Against an installed Producer that legitimately-demands one kind, the check cannot pass until the output exists: say so plainly, and verify that-track on the real Build instead. Do not report the check as passed, and do not let it stand in for-the delivery measurements in `../playbooks/craft/production-gates.md`.+It takes the Run Source, not the Author SVML — Studio's unit of work is the Run, and it reads the+`.svml` back out of it.++It exits non-zero when the graph itself is wrong, and it names what refused — a target that is not a+Film or Render output of the current SVML, a Film with no traceable composition, a Film with no+`SemanticTake` / Speech Track chain. This is not a guessing problem: the error says what is wrong,+and you repair that.++A graph that does not trace is not done, and this is not the loop: the two-attempt ceiling governs+how *well* a wired element is tuned to the reference; it does not govern whether the element is+wired at all. Every failure this check reports must be repaired until the check passes. Repair as+many times as the failure needs, then re-run the check.++**One refusal is a pass, and it is the one you will see most.** Studio does not degrade: it has no+stand-ins, no black frames and no estimated timing, so a Source that still declares generation+cannot be opened at all. That is the ordinary state of a reconstruction nobody has paid a Build for,+and treating it as a failure would make this gate unsatisfiable.++So the check separates the two. When every issue is `the Studio projection closure requires+unresolved capabilities: …`, the graph traced all the way to a Film and a semantic spine and what+remains is work a Provider has to do — the script prints the waiting capabilities and exits zero:++```+preview-check: the graph is sound, waiting on 6 capabilities.+ - @hypit/seedance@1#seedance-2-mini+ - @hypit/whisperx@1#whisperx-alignment+ ...+```++Any other refusal means the graph is wrong and no amount of generation will fix it — no Film or+Render target, a target that is not an output of the current SVML, no traceable Film composition, no+`SemanticTake` / Speech Track chain. Those exit non-zero and have no attempt ceiling.++What this gate therefore proves is narrower than it used to be: that the graph is **wired**, not that+every track **draws**. A Producer that refuses the media kind it is handed will not be caught here,+because it is never handed anything until the Build runs. Verify those on the real Build, say so+plainly rather than reporting the check as more than it is, and do not let it stand in for the+delivery measurements in `../playbooks/craft/production-gates.md`.What this check cannot see is equally important: a track that *builds* but looks wrong — a typefacethat does not match, a colour that is off, a shape that is misplaced — reports no error here, becausediff --git a/.agents/skills/hypit/references/reconstruction/index.md b/.agents/skills/hypit/references/reconstruction/index.mdindex cb33070d..0ba4dee3 100644--- a/.agents/skills/hypit/references/reconstruction/index.md+++ b/.agents/skills/hypit/references/reconstruction/index.md@@ -7,13 +7,17 @@ visual and audio evidence only.## What this route delivers, and what it does notThe deliverable is **the components the video needs, the three source files, and the Runtime Profile-that binds what they demand**, and it must be **visible**: the preview check builds every track the-sources declare, so the author can open Studio and see what was reconstructed. Every-generation the Source declares is declared, not performed: no Build is submitted for the pictures,-and no video generation, speech synthesis, alignment or final render is run. Those belong to a later-step that the author starts deliberately, after reading what was written. What is *not* deferred is-that the declared tracks build — the author should never open Studio to find that something-delivered cannot be seen.+that binds what they demand**, and it must be **wired**: the preview check proves every track the+sources declare traces to the Film, so the author's first Build is not spent discovering that it+never could have. Every generation the Source declares is declared, not performed: no Build is+submitted for the pictures, and no video generation, speech synthesis, alignment or final render is+run. Those belong to a later step that the author starts deliberately, after reading what was+written.++Because nothing has been generated, the author cannot open the delivered sources in Studio — Studio+has no stand-ins and refuses a Source whose shots are still declared. Seeing the reconstruction is+what the author's first Build is for. What is *not* deferred is that the graph traces, which is the+part a Build cannot repair.One exception, because it is not a generation of the video: a component's own surface — the field itselements are drawn on, whatever that is — is produced while the package is authored, withdiff --git a/.agents/skills/hypit/references/reconstruction/reconstruction-loop.md b/.agents/skills/hypit/references/reconstruction/reconstruction-loop.mdindex 3417cc92..3052d305 100644--- a/.agents/skills/hypit/references/reconstruction/reconstruction-loop.md+++ b/.agents/skills/hypit/references/reconstruction/reconstruction-loop.md@@ -5,13 +5,17 @@ reference. A newly written package can resolve, activate, decode and pass everysomething the reference never contained. Close that gap deliberately.This loop is about how an element *looks* against the reference, and it is bounded. Whether an-element *builds at all* is a different gate with a different rule: `preview-check` (in-`final-sources.md`) must pass with no failures before this loop is even reached, and its failures are-repaired until they pass without any attempt ceiling. A build failure is not a difference to weigh;-it is work that is not done.+element is *wired at all* is a different gate with a different rule: `preview-check` (in+`final-sources.md`) must pass before this loop is even reached, and its failures are repaired+without any attempt ceiling. A graph that does not trace is not a difference to weigh; it is work+that is not done.-The difference between the two gates is what each reports. `preview-check` names the build failure —-the Producer and why it failed, down to the offending value — so its repairs are not guessing. This+Note what that gate no longer covers. Studio has no stand-ins, so nothing is drawn before a Build+and `preview-check` proves the graph is wired rather than that every track draws. A Producer that+refuses the media it is handed surfaces on the real Build, not here.++The difference between the two gates is what each reports. `preview-check` names the graph failure —+the target that does not trace, the chain that is missing — so its repairs are not guessing. Thisloop names the appearance difference: `compare_reconstruction` sends the rendered element and thereference frame to Gemini and returns what differs in words, and a repair aims at a difference thecomparison named. Neither gate expects the agent to guess; each one tells you what is wrong, and youdiff --git a/.agents/skills/hypit/references/reconstruction/workflow.md b/.agents/skills/hypit/references/reconstruction/workflow.mdindex 0cda6a0e..d6e88b42 100644--- a/.agents/skills/hypit/references/reconstruction/workflow.md+++ b/.agents/skills/hypit/references/reconstruction/workflow.md@@ -23,8 +23,9 @@ list_svml_packages→ read final-sources.md, then author complete main.svml, recipes.svs, build.svrunand the hypit.runtime.json that binds every capability they demand→ use existing checks and repair until legal-→ run preview-check (final-sources.md) and repair until every track builds —- this has no attempt ceiling; a track Studio cannot show is not done+→ run preview-check (final-sources.md) and repair until the graph traces —+ this has no attempt ceiling; a target Studio cannot trace is not done.+ Waiting on unrun Providers is a pass, not a failure→ read reconstruction-loop.md, then render each authored element and compare it```diff --git a/.agents/skills/hypit/scripts/preview-check.mjs b/.agents/skills/hypit/scripts/preview-check.mjsindex 4a16a251..6568a2a7 100644--- a/.agents/skills/hypit/scripts/preview-check.mjs+++ b/.agents/skills/hypit/scripts/preview-check.mjs@@ -7,8 +7,9 @@* the same way when the author opens Studio, so find out now.** Usage: node --import tsx .agents/skills/hypit/scripts/preview-check.mjs <build.svrun> [<hypit.runtime.json>]- * Exit: 0 when Studio opens and every Track resolved.- * 1 otherwise, naming what refused and why.+ * Exit: 0 when the graph is sound — either Studio opened and every Track+ * resolved, or the only thing missing is Providers that have not run.+ * 1 when the graph itself is wrong, naming what refused and why.** The argument is the Run Source, not the Author SVML. Studio's unit of work is* the Run — it reads the Author SVML back out of it — so a check that took the@@ -18,6 +19,15 @@* projection is missing it refuses to open and names the issue, so preflight* throwing is itself the failure report rather than something to inspect around.*+ * That refusal alone would make this gate unsatisfiable, because a Source that+ * still declares generation always has unresolved capabilities — which is the+ * ordinary state of a reconstruction before anybody has paid for a Build. So the+ * two are separated here: an unresolved *capability* means the graph is sound+ * and waiting for a Provider, while every other issue means the graph is wrong+ * and no amount of generation will fix it. Only the second kind fails this+ * check. `StudioPreflightError` carries `issues` as an array precisely so the+ * two can be told apart rather than matched out of one joined message.+ ** Run it from the repository root. `tsx` is the repository's own dependency, so* a working directory outside the repository fails to resolve it before this* script runs at all — the error names `tsx`, not the source being checked.@@ -48,8 +58,11 @@ const workspaceRoot = dirname(runPath);const domain = await loadStudioDomain({ run: runPath, workspaceRoot, packageRoot });const archive = await openStudioArchive(runtimePath, packageRoot);+const AWAITING = "the Studio projection closure requires unresolved capabilities:";+let session;let refusal;+let awaiting;try {const run = await loadStudioRun({run: runPath,@@ -66,7 +79,12 @@ try {revision: 0,});} catch (error) {- refusal = error instanceof Error ? error.message : String(error);+ const issues = Array.isArray(error?.issues) ? error.issues : undefined;+ if (issues !== undefined && issues.every((issue) => issue.startsWith(AWAITING))) {+ awaiting = issues.flatMap((issue) => issue.slice(AWAITING.length).split(",").map((c) => c.trim()));+ } else {+ refusal = error instanceof Error ? error.message : String(error);+ }} finally {// Close before reporting: `process.exit` in a `try` skips the `finally`, and// a runtime archive left open outlives the check.@@ -78,6 +96,16 @@ if (refusal !== undefined) {process.exit(1);}+if (awaiting !== undefined) {+ // The graph traced all the way to a Film and a semantic spine; what is left is+ // work a Provider has to do. That is a pass for this gate, and the delivery+ // measurements happen on the real Build either way.+ const noun = awaiting.length === 1 ? "capability" : "capabilities";+ console.log(`preview-check: the graph is sound, waiting on ${awaiting.length} ${noun}.`);+ for (const capability of awaiting) console.log(` - ${capability}`);+ process.exit(0);+}+const problems = [];for (const track of session.snapshot.tracks) {const { status, errors, output } = track.provenance;