Expand description
Generic feature demo builder: scenario execution with GIF generation.
FeatureDemo bundles PTY scenario execution, proof collection, and
hash-cached VHS GIF generation into one reusable entry point. The caller
decides what to do with the FeatureResult artifacts — testty itself
has no opinion on static-site generators, README formats, or artifact
directories beyond GIF output.
§Freshness mode
FeatureDemo::gif_mode selects between three behaviors:
GifMode::GenerateIfStale(default) — preserves the historical behavior: skip VHS when the on-disk hash sidecar matches, otherwise regenerate.GifMode::CheckOnly— runs the scenario, computes the would-be hash, and reports whether the on-disk GIF isGifStatus::FreshorGifStatus::Stalewithout invoking VHS. This path never mutates the filesystem, so it is safe on read-only CI mounts and when the GIF output directory does not exist yet. Useful for an agent or CI tool that wants to detect drift without paying VHS cost.GifMode::AlwaysGenerate— bypasses the hash cache and always re-runs VHS.
§Redaction
The freshness hash only works when the same UI hashes the same way on every
run. Temp roots are normalized for free, but an application that paints its
own generated identifiers — session hashes, worktree names, short commit
ids — must declare them with FeatureDemo::redact so they stop counting
as UI drift.
Structs§
- Feature
Demo - Generic feature demo builder: scenario + GIF with hash caching.
- Feature
Meta - Metadata describing a feature demonstration.
- Feature
Result - Artifacts produced by a
FeatureDemorun. - Redaction
- Caller-supplied rule that rewrites a generated hash before hashing a frame.
Enums§
- GifMode
- Selects how
FeatureDemo::runhandles GIF artifacts. - GifStatus
- Outcome of GIF generation during a
FeatureDemorun.
Functions§
- compute_
frame_ hash - Compute a content hash from all proof capture frame bytes.
- hash_
sidecar_ path - Return the on-disk sidecar path that
FeatureDemouses to cache the content hash for a feature with the givenname.