|
| 1 | +# Demo capture review |
| 2 | + |
| 3 | +Reviewed on 2026-10-07. Use AgentStation VHS for terminal SVG demos. |
| 4 | +Update the existing timing PR before release. Keep GIF fallbacks for README embeds. |
| 5 | +Use browser recordings for the Starport Console. |
| 6 | + |
| 7 | +## Source comparison |
| 8 | + |
| 9 | +| Source | Reviewed revision | Finding | |
| 10 | +| --- | --- | --- | |
| 11 | +| AgentStation main | `038df4f741b658981a9176671cd14850ff859d8c` | Supports native animated SVG, GIF, MP4, and WebM. | |
| 12 | +| Charm main | `24fa2254a9806091e6ee6a980e9f3bcfe0a9ba53` | Release v0.12.1. Supports raster recordings and has no native SVG output. | |
| 13 | +| Charm module | Go 1.26.7 | Includes dependency and browser updates absent from the fork. | |
| 14 | +| AgentStation module | Go 1.24.1 | Retains 17 fork commits and lacks 31 upstream commits. | |
| 15 | + |
| 16 | +The counts compare the two revisions above. They do not include this local patch. |
| 17 | +[AgentStation source](https://github.com/agentstation/vhs/tree/038df4f741b658981a9176671cd14850ff859d8c) |
| 18 | +and [Charm source](https://github.com/charmbracelet/vhs/tree/24fa2254a9806091e6ee6a980e9f3bcfe0a9ba53) support this comparison. |
| 19 | + |
| 20 | +Charm still captures raster frames at the requested frame rate. |
| 21 | +It encodes those frames at that rate, even when capture is slower. |
| 22 | +The local patch preserves visible elapsed time for all supported recording formats. |
| 23 | + |
| 24 | +Charm added encoder error propagation in |
| 25 | +[PR #788](https://github.com/charmbracelet/vhs/pull/788). |
| 26 | +The local patch also returns encoder failures. |
| 27 | +Charm added browser startup and Windows rendering fixes in |
| 28 | +[PR #781](https://github.com/charmbracelet/vhs/pull/781). |
| 29 | +This patch keeps the current launcher and adds an explicit browser path. |
| 30 | +Chrome passed local capture checks. Windows remains unverified. |
| 31 | + |
| 32 | +Port PR #781 before a Windows release. |
| 33 | +Its bounded DevTools probe addresses a startup hang, separate from frame timing. |
| 34 | +The current product captures target macOS, so a bulk upstream merge is unnecessary for this rollout. |
| 35 | + |
| 36 | +The fork also lacks upstream viewport scrolling, Ctrl+arrow support, and rows/columns settings. |
| 37 | +These features are not prerequisites for the product demos. |
| 38 | +A separate upstream synchronization needs compatibility and release checks. |
| 39 | + |
| 40 | +## Existing AgentStation PRs |
| 41 | + |
| 42 | +| PR | Reviewed revision | Decision | |
| 43 | +| --- | --- | --- | |
| 44 | +| [#6: timing](https://github.com/agentstation/vhs/pull/6) | `1e430f095a75a8dce41ed8f3b37d076a93b697df` | Update this PR with the timing and error fixes. | |
| 45 | +| [#7: grid](https://github.com/agentstation/vhs/pull/7) | `ee7844d7d6516a95dc6998387d87ebb75b43eaab` | Optional viewport adjustment. Does not fix font portability. | |
| 46 | +| [#8: fonts](https://github.com/agentstation/vhs/pull/8) | `fb3666d439234c95a7804703a1214bfc4fd16829` | Prefer an exact font file for reproducible capture. | |
| 47 | +| [#9: progress](https://github.com/agentstation/vhs/pull/9) | `3b7b233e9eb594e9804d8e7b748f224147a6db93` | Optional feature. Not needed for accurate demos. | |
| 48 | + |
| 49 | +PR #6 uses elapsed timestamps for SVG keyframes. |
| 50 | +It estimates an average raster frame rate only when SVG frames also exist. |
| 51 | +An average rate cannot preserve uneven capture intervals. |
| 52 | +The PR also uses the last capture timestamp as the recording duration. |
| 53 | +That omits the final visible hold. |
| 54 | + |
| 55 | +PR #6 still captures PNG layers for SVG output. |
| 56 | +It detects hidden spans only during capture ticks. |
| 57 | +It logs capture failures and continues. |
| 58 | +The local patch addresses these cases and tests their behavior. |
| 59 | + |
| 60 | +PR #8 resolves fonts through `fc-match` and optionally subsets them through `pyftsubset`. |
| 61 | +A fallback font from `fc-match` can differ from the font that Chrome selects. |
| 62 | +Without those tools, the PR can omit the embedded font. |
| 63 | +The local option loads the same exact font into Chrome and the generated SVG. |
| 64 | +Glyphs absent from that font still require fallback rendering. |
| 65 | + |
| 66 | +## Local capture contract |
| 67 | + |
| 68 | +- SVG capture skips raster layers unless another output or screenshot requires them. |
| 69 | +- Capture timestamps measure visible elapsed time. |
| 70 | +- `Hide` and `Show` exclude hidden time at command transitions. |
| 71 | +- SVG duration includes the final visible hold. |
| 72 | +- Raster output repeats captured states at the requested playback rate. |
| 73 | +- Close SVG timestamps retain distinct CSS keyframes after state deduplication. |
| 74 | +- Capture and encoder failures return errors. |
| 75 | +- Evaluate checks capture failures between commands. |
| 76 | +- The browser remains open until the active command finishes and Evaluate closes it. |
| 77 | +- `LoopOffset` uses a percentage for SVG and raster output. |
| 78 | + |
| 79 | +Select Chrome through `--browser-path` or `VHS_BROWSER_PATH`. |
| 80 | +The command-line option takes precedence. |
| 81 | +Without either value, VHS retains automatic browser discovery. |
| 82 | +[Charm issue #88](https://github.com/charmbracelet/vhs/issues/88) records browser-dependent timing reports. |
| 83 | + |
| 84 | +The original reporter saw no improvement after switching to Chrome. |
| 85 | +[2022 report](https://github.com/charmbracelet/vhs/issues/88#issuecomment-1295874027) |
| 86 | + |
| 87 | +A later reporter said the Chrome change fixed their issue. |
| 88 | +[2026 report](https://github.com/charmbracelet/vhs/issues/88#issuecomment-5388034558) |
| 89 | +These reports do not establish Brave as the only cause. |
| 90 | +A browser choice alone does not prove correct playback timing. |
| 91 | + |
| 92 | +Use `--svg-font-file` or `VHS_SVG_FONT_FILE` for an exact font file. |
| 93 | +Supported formats are WOFF2, WOFF, TrueType, and OpenType. |
| 94 | +This option overrides `Set FontFamily` for capture and SVG output. |
| 95 | +The caller must supply a font whose license permits embedding. |
| 96 | +The file loads before capture, without `fc-match` or `pyftsubset`. |
| 97 | + |
| 98 | +## Validation |
| 99 | + |
| 100 | +The Go suite and race checks pass. Focused regressions cover slow capture, hidden spans, |
| 101 | +invalid frame rates, capture errors, raster repetition, screenshots, and sparse SVG timestamps. |
| 102 | +Tests also cover exact font bytes and encoder failure propagation. |
| 103 | +A browser integration test forces a frame write failure during typing. |
| 104 | +Evaluate returns that capture error and stops before the next command. |
| 105 | + |
| 106 | +All 103 example tapes outside `examples/errors` pass syntax validation. |
| 107 | + |
| 108 | +The welcome tape now invokes `gum spin` and declares its Gum dependency. |
| 109 | +The meta tape declares its nested VHS and Gum dependencies. |
| 110 | +[Current Gum source](https://github.com/charmbracelet/gum/blob/main/gum.go) defines `spin` as a subcommand. |
| 111 | +The other external programs in inherited examples did not receive a complete runtime audit. |
| 112 | + |
| 113 | +A mixed GIF/SVG capture with a two-second hidden span produced a 3.09-second SVG. |
| 114 | +The GIF lasted 3.04 seconds, within one 100-millisecond frame interval. |
| 115 | +The PNG screenshot contained the terminal command output. |
| 116 | +An SVG-only capture also passed. |
| 117 | + |
| 118 | +A repeat capture with the exact Geist Mono WOFF2 produced an embedded font rule. |
| 119 | +Its SVG lasted 3.10 seconds and its GIF lasted 3.12 seconds. |
| 120 | +The capture browser was Google Chrome with ttyd 1.7.7. |
| 121 | + |
| 122 | +The final build also passed the same tape with Brave and Chrome on macOS. |
| 123 | +Each browser produced a 4.69-second SVG and a 4.64-second GIF. |
| 124 | +Both excluded a two-second hidden span and used the embedded Geist Mono font. |
| 125 | +These results qualify the selected local browser builds. They do not close upstream issue #88. |
| 126 | + |
| 127 | +The installed golangci-lint is v2.13.1. CI pins v2.3.0. |
| 128 | +The full local lint reports 50 existing findings. |
| 129 | +The changed-code lint and `go vet ./...` pass. |
| 130 | +GitHub image rendering still needs direct verification for each final asset. |
| 131 | +Keep the GIF fallback until that check passes. |
| 132 | + |
| 133 | +## GitHub recommendation |
| 134 | + |
| 135 | +Update the existing timing PR with the tested local fixes. |
| 136 | +Review the explicit font option with the existing font PR. |
| 137 | +Run the repository checks and structured review before publishing a revision. |
| 138 | +Publish a tested release, then bind demo generation to its immutable revision and binary hash. |
| 139 | +This review does not publish a PR, push a branch, merge changes, or create a release. |
0 commit comments