Skip to main content

Module feature

Module feature 

Source
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 is GifStatus::Fresh or GifStatus::Stale without 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§

FeatureDemo
Generic feature demo builder: scenario + GIF with hash caching.
FeatureMeta
Metadata describing a feature demonstration.
FeatureResult
Artifacts produced by a FeatureDemo run.
Redaction
Caller-supplied rule that rewrites a generated hash before hashing a frame.

Enums§

GifMode
Selects how FeatureDemo::run handles GIF artifacts.
GifStatus
Outcome of GIF generation during a FeatureDemo run.

Functions§

compute_frame_hash
Compute a content hash from all proof capture frame bytes.
hash_sidecar_path
Return the on-disk sidecar path that FeatureDemo uses to cache the content hash for a feature with the given name.