README media

The README carries short animated GIFs. Each one is a recording of a real execution of the prototype, or a playback of a committed record of one, and one command regenerates all of them. This file says what is built, how a clip is recorded, which rules every clip follows and how to add one. Issue 57 tracks the work. One clip, core-story, is kept on this page and not in the README (see the terminal-only clip).

Clips

ClipKindWhat it showsState
heroterminal and browser, scripts/readme-media/hero.record.sha real shell and the 3D viewer side by side: the sweep reads no_failure_found and the viewer shows four poses, the search finds the 0.8 mm gap and the viewer moves the pin into the clearance shell, the replay ends on replay: match (the hero clip)recorded, first in the README
core-storyterminal, scripts/readme-media/core-story.tapearena sweep on four angles reads no_failure_found, arena search finds the 0.8 mm gap at 45 degrees, arena replay of the stored bundle prints replay: matchrecorded, kept on this page and not in the README
real-cadterminal, scripts/readme-media/real-cad.tapearena assembly validate, search and replay on the STEP sample latch-hook (bring your own STEP). The search runs 100 evaluations with the OCCT kernel and the clip cuts the waitrecorded, in the README
viewer-posebrowser, scripts/readme-media/viewer-pose.record.shthe real built viewer (web/dist) served by arena serve: the angle slider goes from 0 to 45 degrees and the gap readout falls below 1.5 mm, Run verification moves the two pieces of the 3D view to that pose, Replay run prints Replay: matchrecorded, in the README
gap-mapbrowser, scripts/readme-media/gap-map.record.shthe gap map of the whole measured box (the lattice arena export-lattice wrote to web/public/data/lattice/lattice.json), and a click on the cell marked as the first stored violation, which jumps the live scrubber to that pose and reads 0.7999999999999959 mm against the 1.5 mm requirementrecorded, in the README
analystbrowser, scripts/readme-media/analyst.record.shthe coverage map of the recorded analyst run of 2026-12-02, one point per request in the order the run made them, ending on the result ID of the one violationrecorded, in the README. It is a playback of the committed record assets/recorded/analyst-2026-12-02-none-failure-found-14-poses.json: no model is called
prose-fixturebrowser, scripts/readme-media/prose-fixture.record.shthe description of a mechanism in words, each quantity a model read from it with the phrase it quoted, and the value measured on the fixture the run built, ending on the confirmation hashrecorded, in the README. It is a playback of the committed record assets/recorded/fixture-2026-12-03-live-completed.json: no model is called. A live recording would need a key and a network call, and a second run would read another proposal

A clip that depends on a feature that does not exist stays unrecorded. The missing feature is reported, never imitated.

A playback is not a recording of a live run. The page that plays it is generated from the record by scripts/readme-media/clips.cjs, says on screen that it plays back a record and that no model is called, and the caption says the same.

Regenerate

bash scripts/readme-media/build.sh            # every clip, GIF and poster into assets/media/
bash scripts/readme-media/build.sh --only core-story
bash scripts/readme-media/build.sh --mp4      # also keep full-resolution masters in runs/readme-media/masters/

runs/ is not committed, so the masters stay local, for example for a demo video. The committed GIFs and posters are the artifact.

The build needs these tools. None is a repository dependency.

ToolFor
ffmpeg, ffprobeevery clip: the GIF, the poster, the length and the flash check
vhs, ttyd and a Chromium browser (google-chrome, chromium, chromium-browser or chrome) on PATHthe terminal clips (NAME.tape)
node, the playwright module and a Chromium browserthe browser clips (NAME.record.sh). The module is found in the global npm folder (npm root -g)

The build looks for each tool before it records anything, prints every missing tool as !! missing tool: NAME and exits with status 3. A browser is named a Chromium browser (one of: ...), and a missing node is named in place of playwright, which runs on it. The build makes no network call of its own and needs a browser that is already installed: it refuses to start without one instead of leaving vhs or Playwright to look for one. The clips were recorded with vhs v0.11.0, ffmpeg 8.0.1, Playwright 1.63.0 on node v22.20.0 and Google Chrome 158.

Exit status: 0 built, 1 a clip failed, 2 bad arguments, 3 a tool is missing.

How a terminal clip is recorded

  1. The build empties runs/readme-media/work/NAME/ and runs NAME.setup there. The setup file lists one step per line: an allowlisted arena command (for core-story, arena fixture rotating-pin --output ., which writes mechanism.yaml) or copy assets/step-samples/FILE, which puts one committed STEP sample into the folder (for real-cad, the sidecar and the STEP file of latch-hook). Setup output never reaches the screen.
  2. vhs records NAME.tape with the working directory set to that folder. The recording environment is built with env -i: a fixed PATH (a folder holding arena, ttyd and the browser, then /usr/bin and /bin), HOME set to the empty working directory, the prompt $ , and no other variable. The environment holds no API key, so the replay in core-story cannot reach a model, and arena replay imports no model code.
  3. The tape types real commands into a real shell. The wait for each result sits between Hide and Show, so the GIF skips it.
  4. The build reads the terminal text that vhs dumps next to the video. It refuses the clip when the text holds a home path, the repository path, the user name, the host name, PATH=, HOME=, an API_KEY name or a string shaped like a key, and when a line of NAME.expect is absent. Each line of that file is a result the caption names, so a clip cannot claim something the run did not print. vhs breaks a long line at 80 columns, so the scan and the expectations also run on the dump with its line breaks removed.
  5. ffmpeg scales the recording to at most 960 px wide, resamples it to 12 frames per second, builds a 64-colour palette with palettegen and applies it with paletteuse. The poster is the last frame of the recording as a PNG of the same size.
  6. The GIF is exactly as long as the line # length: SECONDS at the top of the clip file says. A busy machine types and records at slightly different speeds, so two recordings of one tape differ by up to a few seconds. The build holds the last frame of a shorter recording, and cuts the end of the final hold from a longer one. It refuses the clip unless the picture is identical from 1.5 s before the cut to the end, so a cut never removes anything that moved, and the result stays on screen for at least 1.5 s. Two builds therefore give the same frame count and duration.
  7. The build reads the finished GIF for flashing (see Limits) and refuses the clip when it flashes.

The tape of core-story draws the terminal at the size of the GIF (960 by 560 px, font size 14), and the tape of real-cad at 960 by 640 px (font size 13) because its output is longer. A larger canvas made vhs miss frames on a busy machine, and the clip came out shorter than its script. The master that --mp4 keeps is the unscaled recording at 25 frames per second, and the GIF is that recording at 12 frames per second.

How a browser clip is recorded

A clip that is not a terminal recording is NAME.record.sh, a script that writes the master video itself. The build runs it in an empty working directory with these variables:

VariableMeaning
RM_NAMEthe clip name
RM_MASTERthe mp4 the script must write
RM_TEXTthe text of what was on screen, one block per step. The build checks it against NAME.expect and scans it like a terminal text
RM_ROOTthe repository
RM_SHIMa folder that holds arena
RM_BROWSERthe browser to drive

Three header lines in its first 20 lines, besides # length:, bind the script:

  • # needs: node playwright chromium names the tools the build must find before anything is recorded. chromium is any browser of the list above and playwright is the node module.
  • # caption: words obliges the README caption of the clip to say those words (page load cut, playback of a recorded run, no model call). The contract test enforces each line.
  • NAME.expect must exist, as for a tape.

The four scripts share scripts/readme-media/clips.cjs, one Playwright script with one story per clip (viewer-pose, gap-map, analyst, prose):

  • viewer-pose serves web/dist with arena serve on a free loopback port (picked with node, because --port 0 breaks the host check of the server) and stops the server by its process ID when the script ends. One verification and one run go through before the recording starts, so the first start of the CAD kernel is not on screen, and the caption says kernel start cut. The slider is dragged with the mouse in 45 steps. The viewer keeps one query to the real kernel in flight and sends the newest pose when it returns, so the readout follows the slider with a delay and some positions are never measured. The 3D view shows the committed sample pose until a run finishes, so the two pieces move when Run verification completes and not while the slider moves. The mouse pointer is not part of a screencast, so the clip shows the page reacting and no pointer.
  • gap-map serves the same build the same way and does the same cuts (page load cut, kernel start cut). It scrolls to the gap map, a heat map of the lattice arena export-lattice wrote (web/public/data/lattice/lattice.json), every cell coloured by its own stored verdict and gap, never by a formula in the viewer. A real click (page.click, not a synthetic DOM event) on the cell marked as the first stored violation calls the same click handler a mouse would, which jumps the live scrubber to that pose: one query to the real kernel, then the scroll follows the scrubber back into view and the clip holds on its result.
  • analyst and prose generate one HTML page from a committed record and show its rows in order. They read the record and nothing else: no network, no model, no kernel.
  • The recording is the DevTools screencast. Every frame the browser draws arrives as a lossless PNG with its time, and ffmpeg joins them into the master. The video that Playwright records by itself is lossy VP8; its noise made the GIF of the viewer clip 4.96 MB, against 1.5 MB with the screencast.
  • Headless Chromium needs a software WebGL path to draw the three.js scene reliably. chromium.launch always passes the same flags web/scripts/demo-browser-check.mjs uses (--use-gl=angle --use-angle=swiftshader --enable-unsafe-swiftshader --ignore-gpu-blocklist --enable-webgl), and CHROMIUM_PATH overrides the browser build.sh found on PATH when one is set.

Only the page load is cut, and the caption names it.

Encoding options

A clip file (tape or recorder) may declare how its GIF is encoded, one comment line each. scripts/readme-media/options.sh reads and validates them and the build refuses a value out of range before it records anything. An undeclared option keeps the value the first clips used.

LineRangeDefault
# colors: N2 to 256. Above 64 the dither is Bayer64
# fps: N1 to 1512
# width: N1 to 1600 pixels960
# max-bytes: N1 to 9 000 000. The build refuses a larger GIF3 000 000
# mp4-max-bytes: N0 to 6 000 000. A value above 0 also keeps assets/media/NAME.mp4 within N bytes0 (no MP4)

The hero clip

hero puts a real terminal and the 3D viewer side by side in a 1600 by 720 master, with a thin title bar over each side (arena and viewer). scripts/readme-media/hero.timeline.json is the one timeline both sides read. hero_timeline.py turns it into the vhs tape (the commands, the lines to wait for, the pauses) and into the frame schedule (the tour time the viewer shows at each video frame), so a result that moves in the timeline moves in both. The shell of vhs keeps no exact clock, so the build reads the times at which the results really appeared from the terminal video and moves the viewer with them.

hero-frames.cjs serves the demo page built from the current tree (vite.demo.config.ts), runs the page on a controlled clock, asks it for the frame at each time with window.__arenaClip.seek and writes one PNG per frame, so software WebGL never drops a frame. hero.record.sh composes both sides with ffmpeg. The build then writes hero.gif (192 colours, Bayer dither, 15 fps, 960 pixels, at most 9 000 000 bytes), hero.png (the last frame) and hero.mp4 (at most 6 000 000 bytes). It refuses the clip when a line of hero.expect is missing from the terminal text or when the last viewer frame lacks the violation colour (hero_pixels.py). social.sh makes assets/social-preview.png and assets/devpost-thumbnail.png from one frame of the same capture. Rebuild everything after a change of the viewer with bash scripts/readme-media/build.sh --only hero.

A command wider than the terminal (43 characters at font size 25) is typed on several lines. Each line but the last ends in a space and a backslash, the timeline file separates the lines with \n, and the shell shows its > prompt on the continuation lines, so no word is cut by the width of the terminal. continue_ms is the pause before each of those Enter keys. A test refuses a line wider than the terminal and a line that breaks the continuation rule.

The terminal-only clip

core-story is the first recording of the project: the terminal alone, with no viewer. The README leaves it out because the hero clip tells the same story with the viewer beside the terminal. The GIF stays in assets/media/core-story.gif and bash scripts/readme-media/build.sh still builds it with the others.

Terminal recording. A sweep over four angles prints no_failure_found. A search with a budget of 12 evaluations prints failure_found with a gap of 0.8 mm at 45 degrees and -1.2 mm. A replay of the stored bundle prints replay: match.

Terminal recording of real runs, waiting cut: the recording skips the seconds each command takes. arena sweep --angles-deg 0,30,60,90 --offsets-mm=-1.2 reads no_failure_found on four angles. arena search --spec mechanism.yaml --budget 12 --seed 42 --output bundle finds the 0.8 mm gap at 45 degrees. arena replay bundle re-measures the stored scenario in a fresh process, with no model code and no key, and ends on replay: match for the scenario ID scenario-bddcb450a86a87761837efc7837bc40304a3d6944919096373918f7ba478e396. Recorded by scripts/readme-media/core-story.tape.

What counts as the result ID

The caption of every clip names the ID of the result it ends on, and NAME.expect must hold the same string, so the ID is on screen in the recording.

ClipIDWhy
core-storythe scenario ID that arena replay printsthe CLI names the stored scenario
real-cadthe sha256 of the sidecar, as validate and search print itthe assembly commands print no result ID, so the clip is identified by the digest of the input
viewer-posethe result ID of the run in the findings panelthe viewer prints it
gap-mapthe result ID the live scrubber reads after the jumpthe viewer prints it
analystthe res- ID of the lowest gap in the recordthe record holds one per request
prose-fixtureconfirmation_sha256: 2ed4f3c8fb0dthe run prints its confirmation hash, 12 hex digits

Colours

The terminal uses the dark tokens of web/src/theme/tokens.css, which .kiro/steering/design.md makes the design source: background #101418, text #e6eaef, muted #a7b0ba, border #2b333d, the gap colour #4cc2ff and the violation colour #ff7a70. There is no pure black, no pure white, no window frame and no logo. The CLI prints no colour codes, so the two signal colours stay unused in the terminal clips. The viewer clip uses the viewer's own dark theme, and the two playback pages use the same tokens.

Rules every clip follows

  • A clip is a real run or a labelled playback of a committed record. A tape holds no fabricated output, and Set PlaybackSpeed is the only way to change speed. A playback page shows the rows of its record and adds no row of its own.
  • A cut or a speed change is named in the caption. A tape with Hide needs the words waiting cut, and Set PlaybackSpeed 4 needs sped up 4x. A script names its own phrases with # caption: lines. The contract test enforces both.
  • No on-screen sentence claims that a model beats numerical search. The tapes type only the commands of the allowlist, so the screen holds what the CLI printed. The captions of the two playbacks say that the record is one run and claim no rate and no accuracy.
  • No secret, home path, user name, host name or environment dump appears. The recording environment, the allowlists and the terminal-text scan above exist for this.
  • No third-party logo, trademark or music.
  • The caption names the command or action and the ID of the result the clip ends on, and links the script that records it. The alt text describes the content.
  • No claim that a person reviewed a clip. A reader can say so in the commit message after watching it.

Limits

LimitValue
Widthat most 960 px
Lengthat most 20 s
Frame rateat most 15 frames per second (the shortest allowed frame delay is 7 centiseconds)
One GIFat most 3 MB
All GIFs togetherat most 12 MB
Flashingnone faster than 3 Hz, checked by the build on every GIF
Loopforever

The flash check is scripts/readme-media/flashes.awk. ffmpeg prints the mean luma of every frame of the GIF, and a change of at least 12 levels (of 255) between two frames counts as a transition. A flash is two opposing transitions, so the build refuses a GIF with more than six transitions in any one second. A mean over the whole frame stands in for the area rule of the usual flash guidance: a flash that fills the frame moves it by far more than 12 levels. A GIF with fewer than two frames, or output that has no time for a luma line, is refused instead of passed.

tests/test_readme_media.py reads each GIF in pure Python and checks width, length (within 0.1 s of the declared # length:), frame delays, loop, size and the posters. It also fails on a GIF the README does not reference, a README image without a file, an em dash or en dash in the README block or in the files of scripts/readme-media/, a home path, user name or host name in them, a tape that types a command outside the allowlist, a setup line that copies a file outside assets/step-samples, a recorder that runs a network tool, dumps the environment, reads a system file or runs an arena command other than serve, a clip file without its length, its # needs: line or its expectation file, and a caption without alt text of 40 characters, a command, a result ID, a link to its script, the phrases its script declares, or an ID that NAME.expect does not hold. It runs build.sh on stub tools to check that the build names each missing tool and exits 3, reads build.sh to check that every check runs before a GIF reaches assets/media, and feeds flashes.awk luma tables to check its limits and its refusals.

The tape allowlist covers verify, sweep, search, replay, reduce, report, omissions, assembly validate, assembly inspect, assembly search and assembly replay. serve, doctor and fixture-from-prose stay out of tapes: the first starts a server, the second prints the environment and the third calls a model. A recorder may start arena serve and nothing else.

The test needs no recording tool. It does not decode a frame, so it cannot see flashing or a path in a picture: the build checks both when it records. The mutations that prove each guard are listed in docs/progress.md.

Add a clip

  1. Write scripts/readme-media/NAME.tape (or NAME.record.sh) with a # length: SECONDS line, NAME.setup when the run needs files, and NAME.expect with the strings the run must print. A script also needs # needs: and the # caption: lines it owes. End the recording with a hold of at least 2.5 s on the final result.
  2. Run bash scripts/readme-media/build.sh --only NAME and read frames of the GIF at full size.
  3. Add a block to the README between <!-- readme-media:start --> and <!-- readme-media:end -->: a <picture> with the poster for prefers-reduced-motion, the GIF with alt text, and a caption that holds the command in a <code> span, the result ID in a <code> span and a link to the script.
  4. Run .venv/bin/python -m pytest tests/test_readme_media.py.