victorylap Devlog #3 (the ai wrote a video about a repo it has never seen)
TL;DR
- week 3 done, two weeks early. analyzer json goes to a free llm, the llm writes the script, the script renders to mp4
- the hardcoded demo frame is gone. video/index.html is generated fresh for every repo
- tested on site-slap, a repo victorylap had never seen. the video came out correct without me typing a word of it
The Brain
script.js sends the analyzer’s json to a free model on openrouter with three things: the facts, the exact json shape i want back, and rules. the rules do the heavy lifting. only use facts from the json. never invent numbers. no generic startup language.
for site-slap it wrote “Paste URL. Get roasted by AI.” as the hook and picked 15 commits, 11 ts files and 7 days built as the stats.
the 7 days one surprised me. i never gave it a duration. it read the first and last commit dates from the git data and did the math itself. that’s the whole idea of this project working on the first real run: give the model true facts and strict rules, and it stays honest.
The Template Became a Function
the frame i built by hand in week 1 was a dead end on purpose. now the whole page lives inside one javascript function as a template string, with slots where the hardcoded text used to be. the llm’s script fills the slots and the file gets written fresh each run.
the stats section is three lines of .map(). the ai sends an array, the template turns each entrinto a div, join glues them together. if it ever sends four stats instead of three, the template does not care.
.
What I Learned
there is a closing script tag inside my template string, because the template contains a full html page. anything parsing that file as html would see the tag and end the script early, right in the middle of the string. the fix is writing it as </script>. Inside a javascript string a backslash slash is just a slash, so the file that gets written out is normal html, but nothing scanning the template can mistake it for a real tag anymore. two characters of insurance against a genuinely confusing class of bug.
—.
next up: week 4. make it npx-able, so anyone can run this without cloning anything.
see y’all soon
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.