* Add OCR-based validation for TUI demos
TUI demos (Zellij, interactive UIs) can't be validated via text snapshots because
VHS only captures the outer terminal, not content inside multiplexers. Instead,
extract key frames from GIFs and use OCR (tesseract) to verify expected patterns.
Add `docs/demos/shared/validation.py` with checkpoint definitions and validation
logic. Update build script to validate TUI demos with defined checkpoints during
snapshot mode, skipping those without checkpoints. Document validation approach
in CLAUDE.md with requirements and checkpoint definitions for wt-zellij-omnibus.
* fix(demos): pre-populate Zellij permissions cache to avoid dialog
The zellij-tab-name plugin shows a permission dialog on first run,
which was appearing in recorded demos. Fix by pre-populating the
permissions.kdl cache file before Zellij starts.
Also simplifies the tape by removing the "y" keypress and clear
that were working around the permission dialog.
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(demos): re-enable OCR validation checkpoints, handle permission dialog race
The permission dialog timing is non-deterministic (depends on macOS cache state).
Handle both cases:
- If dialog appears: "y" dismisses it
- If no dialog (cache hit): "y" + Enter + clear cleans up the shell
Re-enables validation checkpoints with calibrated frame numbers:
- Frame 100: wt list output with branch table
- Frame 500: Claude UI with Opus indicator
- Frame 2000: Final wt list --full output
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
Add `--snapshot` flag to the demo build script that extracts wt/git
commands from VHS tapes and captures their output for regression testing.
This catches unexpected changes like new hints or warnings appearing
in demos, which would otherwise only be noticed by visually inspecting
GIFs.
Key features:
- Extracts commands from tape files (only after Show directive)
- Runs them in the demo environment and captures stdout/stderr
- Normalizes temp paths to <DEMO_DIR> for stable diffs
- Skips TUI demos (wt-select, wt-switch, etc.) automatically
- Documents expected vs regression-indicating changes
Usage: ./docs/demos/build docs --snapshot
Co-authored-by: Claude <noreply@anthropic.com>