Skip to content

armgit / hypit

Public Imported from GitHub
0

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.

fix(hypit): close the gaps between the render scripts and the route

rpone77cdbf695b3c
diff --git a/.agents/skills/hypit/references/preview.md b/.agents/skills/hypit/references/preview.md
index 827c76f4..9cf86984 100644
--- a/.agents/skills/hypit/references/preview.md
+++ b/.agents/skills/hypit/references/preview.md
@@ -66,7 +66,24 @@ collide — lines that overlap, type too large for the plate it sits on — whil
drawn from different values, stays perfect. A route that compares the catalogue picture is answering
a question about the catalogue.
-The comparison render has one command, shared by every package:
+Each has its own command, and both are shared by every package.
+
+**The catalogue preview** is drawn from a Source the package ships — `preview/preview.svml`,
+`preview/recipes.svs` and `preview/build.svrun`, holding its own copy, its own Recipe values and its
+own Canvas:
+
+```bash
+node --import tsx .agents/skills/hypit/scripts/render-previews.mjs packages/<name>
+```
+
+Which element draws which file comes from the Manifest's naming: a Surface tagged `Track` declares
+`preview/Track.png`, so that picture is drawn from the element carrying that tag under the package's
+own import alias. It **overwrites the picture in place**, so run it when the package's drawing has
+changed and look at what came out before committing it. Anything the preview Run satisfies with a
+`<file>` of its own is carried through and never mocked over, which is how a preview shows the
+component holding a picture rather than a placeholder.
+
+**The comparison render** has one command too:
```bash
node --import tsx .agents/skills/hypit/scripts/render-element.mjs projects/<name>/build.svrun \
diff --git a/.agents/skills/hypit/references/reconstruction/reconstruction-loop.md b/.agents/skills/hypit/references/reconstruction/reconstruction-loop.md
index 5b4403d6..c8254d4c 100644
--- a/.agents/skills/hypit/references/reconstruction/reconstruction-loop.md
+++ b/.agents/skills/hypit/references/reconstruction/reconstruction-loop.md
@@ -45,11 +45,11 @@ card.
The thing compared is the element **as this video places it**: the Recipe values the Source actually
passes, the Script text the Source actually feeds it, and the windows the Source actually binds. A
-package's catalogue preview is a different picture with different inputs — the harness supplies its
-own sample copy and its own Recipe so a reader can see the Surface's range — and a Source can fill
+package's catalogue preview is a different picture drawn from different values — the package's own
+sample copy and sample Recipe, chosen to show a reader the Surface's range — and a Source can fill
every one of those parameters with values that collide while the preview stays perfect. Comparing the
-preview answers a question nobody asked. `../preview.md` renders both, from the same harness, with
-different arguments; this loop uses the Source-configured one.
+preview answers a question nobody asked. `../preview.md` keeps the two apart and says which command
+draws which.
One command produces it, and it is not written per package:
@@ -63,9 +63,17 @@ speech with the Source's own `estimate:Speech`, mocks every layer a Build has no
the package's Producer. Nothing is transcribed by hand, so nothing is transcribed one line at a time
— which is what made a caption system look correct while its lines collided.
-The window is named in words. `--segment` and `--selection` take a Script name, not a timestamp: a
-shot of the reference is found by the words spoken over it, and those words are where the Script
-says they are. No reference clock is read across.
+The window is named in words. `--segment` and `--selection` take a Script name, never a timestamp,
+and the way to find the right name for a given shot is:
+
+1. take the shot's `start_seconds` and `end_seconds` from the reference's `state.json`;
+2. read the words spoken over that stretch out of the reference's `transcript.json`, which carries
+ one entry per word with its own timings;
+3. find those words in the Script you wrote, and name the Selection or Segment that encloses them.
+
+The reference clock is read exactly once, at step 1, and only to index a table. Everything after it
+is words. The reconstruction's own frames come from estimated take lengths, so its clock and the
+reference's do not correspond and matching them would put the window in the wrong place.
### Mock the layers a Build has not made
diff --git a/.agents/skills/hypit/scripts/render-element.mjs b/.agents/skills/hypit/scripts/render-element.mjs
index 946d4371..d1512b29 100644
--- a/.agents/skills/hypit/scripts/render-element.mjs
+++ b/.agents/skills/hypit/scripts/render-element.mjs
@@ -91,7 +91,10 @@ const out = flag("out") ?? fail("--out is required");
const invokedFrom = process.env.INIT_CWD ?? process.cwd();
const runPath = resolve(invokedFrom, runArgument);
-const packageRoot = resolve(invokedFrom);
+// The repository, found from this file rather than from wherever it was called. Deriving it from the
+// working directory means the command works from the root and crashes anywhere else, on a missing
+// module rather than on anything a reader could act on.
+const packageRoot = fileURLToPath(new URL("../../../../", import.meta.url));
const projectRoot = dirname(runPath);
const outPath = resolve(invokedFrom, out);