feat(core): --phase record runs without a prior tts phase (#50)#61
Merged
Conversation
The TTS-free framing check (`--phase record --contact-sheet`, used to verify selectors + framing across a whole tutorial before paying for narration) threw "run the tts phase first" on a fresh work dir, because the record phase loaded tts.json unconditionally. Now, for `phase === 'record'` only, a missing tts.json falls back to silent placeholder timings (silentTTSResult) — the same null-audio/0-ms shape runTTSPhase emits for silent steps — so steps pace as silent and the record still reaches each step's state and screenshots it. `--phase post` stays strict (it needs real timings). A *corrupt* tts.json still errors (distinct from absent) via the new loadTTSResultIfPresent. - New exports: silentTTSResult, loadTTSResultIfPresent. - Unit tests for both helpers + the loadTTSResult error path. - e2e scenario: --phase record on a fresh work dir emits a contact sheet and writes no tts.json. - Docs: the TTS-free whole-tutorial check in writing-tutorials. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #50.
Problem
render --phase record --contact-sheetis the documented TTS-free way to verify selectors + framing across a whole tutorial before paying for narration — but on a fresh work dir it threwNo tts.json … run the tts phase first(tts.tsloadTTSResult, reached fromrender.ts). So the "cheap check" required first running--phase tts, which with a real provider costs money/time — exactly what it was meant to avoid. Surfaced by umami's #133 dogfood.Fix
For
phase === 'record'only, a missingtts.jsonnow falls back to silent placeholder timings (silentTTSResult— the sameaudioFile: null, audioDurationMs: 0shaperunTTSPhasealready emits for silent steps). Steps pace as silent, so the record drives the browser through each step's state and screenshots it without synthesizing any narration.--phase poststays strict (it genuinely needs real timings).tts.jsonstill errors — only a missing file is the clean fallback, via the newloadTTSResultIfPresent(returns null on ENOENT, rethrows otherwise).loadTTSResultnow delegates to it.silentTTSResult,loadTTSResultIfPresent.Tests
tts.test.ts):silentTTSResultshape;loadTTSResultIfPresentreturns null when absent, parses when present, throws on corrupt;loadTTSResultkeeps its clear "run the tts phase first" error.--phase recordrender on a fresh work dir asserts a contact sheet is produced and notts.jsonwas written (proves it was truly TTS-free).174 unit tests pass; build/typecheck clean. (I didn't run e2e locally to avoid skewing the performance-engineer's in-flight profiling; CI runs it.)
Docs
writing-tutorials.mdnow documents the TTS-free whole-tutorial check alongside the contact sheet.🤖 Generated with Claude Code