Case study · In production · 7 help videos shipped
Script-to-Video Pipeline & Vision Critic Eval
Our CEO asked how we could produce product walkthrough videos without a person manually recording every screen—and re-recording from scratch every time the UI changed. AI video generators fumble exact product screens and labels, so I built a deterministic Playwright pipeline where code runs the sequence, models only compile and repair, and humans approve at fixed gates. To catch visual defects that code checks cannot see, I added an LLM vision critic evaluated against planted defects and a human-labeled gold set—then moved the one defect class vision could not see into deterministic code at zero model cost.
Treating a walkthrough video as executable code turned a hand-recorded maintenance burden into a tested software pipeline. Putting a real eval in front of the vision critic showed both what a model can judge for $0.017 a moment and what belongs in plain code instead.
01The problem and the architecture
Help videos have to show the real interface with exact button labels. Hand-recorded videos go stale after every UI release, and generative video tools hallucinate UI controls.
Playwright solved the recording problem: express a script as browser steps, replay it in a real browser against a dedicated demo environment with synthetic records (zero customer data), and capture the screen.
Code runs the sequence, models do two narrow jobs
An early draft let an agent orchestrate the entire run. A dedicated simplicity review cut 45% of the spec (4,300 words down to 2,450) by moving orchestration into a TypeScript runner (runner/pipeline.ts). Models only compile scripts into step files and repair broken locators—nothing else.
Safety by structure
Every non-GET network request fails closed unless an action explicitly declares a write and pairs it with a reset step. Every run executes in an isolated git worktree (run/<slug>-<date>), resets before and after, and prohibits the repair agent from editing write-capable actions. Every guard has a test that failed first.
Voice-first timing (Version 2)
Version 1 shipped in one day with 142 tests and passed automated acceptance—then failed human review immediately. Watching the output showed up to 87 seconds of frozen frames while narration ran at speech speed and clicks ran at browser speed. Version 2 inverted the pipeline: generate narration first (ElevenLabs with word-level timestamps), then have Playwright wait on cue words. A timing probe matched real pauses within ~40 ms before any code was written.
Upstream from help articles
Rather than starting from hand-written scripts, an article-to-script module fetches published Help Center documentation via API, checks every UI label against the product source code, drafts a structured scene table, and hands off to a browser-based script review page.
-
Draft
Fetch Help Center article, verify labels against source, draft scene table. Owner: Code + LLM draft.
-
Script review
Reviewer approves or sends back with inline block notes. Owner: Human gate 1.
-
Compile & record
Compile steps, run reset/setup/rehearsal/record, repair broken locators. Owner: Code + constrained repair agent.
-
Assemble & check
Align audio/video, add brand intro/outro/music, run code checks + vision critic. Owner: Code + vision model.
-
Take review & deliver
Director reviews flagged moments, approves, replaces video in place. Owner: Human gate 2.
02Evaluating the vision critic
Code checks caught timing drift, loudness spikes (-16 LUFS, true peak <= -1.5 dBTP), and stalled pages, but they could not tell whether a highlight ring pointed at the right control or whether the narrator named a button that never appeared.
An earlier reviewer had produced 36 flags on a take with ~15 real defects—stamping flags at scene start and reporting single events 2–3 times. The new critic had to fix precision without losing recall.
Measurement before architecture
The first spec selected video frames by ffmpeg scene-change score. Measuring the signal first killed that design: drawing a highlight ring scored 0.001 to 0.016, while ordinary scrolling scored 0.04 to 1.0. Rings were nearly invisible to scene detection. Revision 2 switched to sampling 2–3 frames around each spoken step's timestamps—one vision call per spoken moment.
Synthetic recall bars (startup check)
Before trusting the critic on live takes, I planted known defects in an approved video and required every recall bar to pass:
| Synthetic test | Target bar | Result |
|---|---|---|
| Swapped moments (sentence i + 1 paired with frames from sentence i) | >=80% flagged | 7 of 8 (87.5%) |
| Highlight rings painted over empty space | >=4 of 5 flagged | 5 of 5 (100%) |
| Real leftover ring on an approved pilot sign-off | Flagged | Pass |
The single missed swap paired two sentences describing the exact same screen—a hard negative rather than a blind spot.
Human gold set and rule iteration
I labeled all 18 flags raised across two approved takes (6 ring checks, 9 missing-control flags, 3 page-load flags) and tracked agreement as dismissal patterns turned into human-approved prompt rules:
| Run | Change | Agreement with 18 human votes |
|---|---|---|
| Run 1 | First prompt (rings 6/6, noise concentrated in missing-control and page-load checks) | 13 of 18 (72%) |
| Run 2 | Added narration mantra + narrowed page-load rule to flashes | 15 of 18 (cleared all 5 false positives, lost 3 confirmed) |
| Run 3 | Narrowed control rule to instructions only + moved white flashes to code check P7 | 17 of 18 (all synthetic recall bars still green) |
Knowing when not to use a model
Run 2 dropped a confirmed white flash at 0:19.5. Re-running the vision model three fresh times on that moment flagged it 0 of 3. In a still frame, a brief white flash looks indistinguishable from a normal loading page. Because a flash is an event across time, still-frame vision recall was zero—no prompt edit could fix it.
I moved white-flash detection to a free deterministic code check (P7, frame-brightness spike detection). It caught both confirmed flashes reliably at $0 model cost.
Precision gate and cost discipline
- No blocking without proof: Every critic finding stays minor ("learning") until its check reaches >=15 human votes at >=75% confirmed precision and receives explicit approval to promote.
- Learn as you go: An upfront calibration sweep was estimated at $45–65. Replacing it with the targeted synthetic startup check plus ongoing take votes dropped startup verification to $1.86 (~$0.017 per spoken moment, ~$0.41–$1.16 per full video take).
- Limits stated plainly: 17 of 18 measures agreement on the training labels that produced the rules, not held-out precision on unseen takes. Run-to-run variance is still being tracked, and no finding has crossed the promotion gate yet.
03Root-cause debugging over symptom patches
Shipping seven real videos surfaced subtle failures across audio, browser capture, auth, and test reliability. Each time, tracing the real cause beat layering on workarounds.
Audio "hiccups" (25 renders checked)
Human review heard micro-stutters at sentence cuts. Word timestamps from TTS ran 100–300 ms late, slicing inside spoken words rather than at short pauses. Updating the silence snapper to choose the longest quiet run within 800 ms landed 25 of 25 renders in >=230 ms silence—and prompted correcting an earlier written lesson that had named the wrong cause.
Flaky capture test under CPU load (3/6 failing → 16/16 passing)
An earlier patch moved the recording sync flash later, and the test still failed under load. Running a controlled experiment proved the measured lag moved lockstep with the flash (1.6 s → 2.0 s)—under CPU load, recording began inside the head flash, losing its black-start edge. Measuring from the flash's end edge (markerOffMs, matching clean start-edge timings within 50 ms) took loaded runs to 16/16 passing and 5 consecutive clean full suites.
A/B testing our own features off
After building per-scene recording-offset measurement (replacing an assumed 0 ms lag with real 43–85 ms measurements), I built a configurable picture-lead feature and A/B-tested it on unbroken clips. When human listening heard zero difference, I switched the feature off and pinned it off with a test.
Confirmed flags as code-enforced fix requests
When confirmed review flags recurred across takes because votes only updated the critic tally, I hardened the loop so every confirmed flag writes a structured fix request, accept enforces a fix ledger with commit-ancestry verification, repeat confirms escalate to blockers, and a new code check (P8) catches narration running >2.5 s ahead of the screen.
Self-renewing test logins
Rather than manually refreshing demo cookies every 14 days, I traced session extension to the app's sliding-expiration middleware and added atomic cookie persistence on every preflight plus a daily background refresh job.
04Multi-model adversarial review and scaling to a team
Every major module ran through independent adversarial reviews across multiple models (Claude, Codex, and Gemini) checking specs and plans against the live codebase before Task 1 began.
Opening reviews beyond one terminal (Hosted Review Pages)
Once the pipeline reliably produced videos in 3–6 takes, the bottleneck shifted from recording to review: only I could review scripts and takes locally from a terminal. I designed and shipped a lightweight hosted review workflow so teammates can review scripts and takes from desktop or phone while preserving director control.
- Static review bundles (zero staff emails,
robots.txtdisallowed,no-referrer, unguessable link with a SHA-256 hashed key) deploy to temporary static hosting. - Answers post to a lightweight Apps Script store. A 15-minute local background job validates payloads in Node, writes results back into pipeline files, tears down the temporary host (verifying HTTP 404 after a live spike caught a CLI quirk returning
Unauthorizedon already-removed domains), and fires a desktop notification.
What adversarial reviews caught before code was written
- Joint Claude + Codex review cut unnecessary host adapters and polling, and caught a data-loss bug where saving a reviewer's take feedback through the existing
saveNotespath would have wiped the director's own flag verdicts and critic votes. Reviewer feedback now lands in a separatereviewer-notes.jsonwith a read-only reviewer card and deduplicated one-click copy. A cross-origin disagreement between reviewers was settled with one live POST test. - Second codebase review (Gemini) caught 7 blocking defects before Task 1, including missed take-folder markers, missing mobile note controls, unrendered checklist answers, a draft-collision bug where a director's draft would block reviewer answers, and stranded temporary sites—producing ~20 fixes before a single task ran.
- Task 1 live spike proved HTTP/2
206byte-range video seeking, cross-origin POST, and bare-environment background teardown across Chrome and Safari before Tasks 2–11 shipped cleanly (647/647 tests).
05Outcomes
| Metric | Result |
|---|---|
| Production videos shipped | 7 final help videos delivered to the live library (including replacing a hand-made orientation video in place via file ID so existing links never broke) |
| Iteration efficiency | Takes per video dropped from 18 on the pilot to 3–6 |
| Test suite | 647 of 647 automated tests passing, parallelized from 375 s to ~130 s |
| Vision critic economics | $1.86 startup eval vs. $45–65 estimated calibration, ~$0.017/moment live |
| Team leverage | First non-terminal teammate onboarded as reviewer via hosted mobile/desktop review pages |
06What this demonstrates
- Formulating ambiguous problems into concrete systems. Taking an open-ended CEO question ("how do we automate feature walkthroughs?") and separating what deterministic code should own from what models should do.
- Eval design under real constraints. Synthetic recall bars, signal measurement before architecture, human gold sets, explicit precision gates, honest disclosure of training-set limits, and moving zero-recall classes out of the LLM into code.
- Multi-model adversarial verification. Treating specs and plans as hypotheses tested against the real codebase before building—cutting 30–45% of complexity while catching data-loss and edge-case bugs early.
- Root-cause engineering discipline. Controlled experiments on flaky tests, A/B listening tests willing to turn built features off, and closing repeat failures in code rather than process reminders.