feat(cli): measure a composition against a reference with compare --against

lint and check only ever audit a composition against its own rules, so a
scene that renders nothing like the artifact it reproduces still passes
both. compare --against adds the outward-looking gate: per-time SSIM (via
ffmpeg's ssim filter), ink bounding-box deltas, a reference-over-replica
contact sheet, a red/cyan deviation overlay, and --fail-under to exit
non-zero on a measured floor.

Skills now route reference-bearing briefs to it, and the entry skill says
to read only the routed workflow's SKILL.md.
This commit is contained in:
Miguel Angel Simon Sierra
2026-08-07 18:33:55 -07:00
parent d9b00e57eb
commit a70644ffc6
12 changed files with 856 additions and 17 deletions
+1
View File
@@ -37,6 +37,7 @@ remains authoritative: run `npx hyperframes <command> --help`.
| List compositions | `npx hyperframes compositions` |
| Inspect keyframe behavior | `npx hyperframes keyframes` |
| Compare two or more versions | `npx hyperframes compare v1/ v2/` |
| Measure against a reference video | `npx hyperframes compare . --against reference.mp4 --at 0,4,10` |
## Rendering and automation
+23
View File
@@ -729,6 +729,29 @@ npx hyperframes compare ./variant-a ./variant-b --labels "A,B"
| `--timeout` | Render-ready timeout per variant (default 5000 ms) |
| `--json` | Machine-readable results |
With `--against`, `compare` measures one composition against an external
reference video or still instead of against sibling variants. `lint` and
`check` only ever audit a composition against its own rules, so this is the
gate that catches a scene which passes everything and still looks nothing like
the thing it reproduces.
```bash
npx hyperframes compare . --against reference.mp4 --at 0,4,10,21 --fail-under 0.95
```
| Flag | Description |
| -------------- | ------------------------------------------------------------------------------ |
| `--against` | Reference video or image to measure against (requires FFmpeg) |
| `--at` | Up to 8 comma-separated sample times, sampled in both reference and replica |
| `--fail-under` | Exit non-zero when the worst sampled SSIM falls below this threshold |
| `--out` | Contact sheet path; overlays are written next to it as `<out>-overlay-NN.png` |
Each run writes a reference-over-replica contact sheet, a red/cyan deviation
overlay per sampled time (agreement grey, reference-only ink red, replica-only
ink cyan), and per-time numbers: `ssim`, `meanAbsDiff`, and ink bounding-box
deltas `dw` / `dh` / `dcx` / `dcy` / `scale`. There is no default threshold:
measure a known-good state first, then gate slightly below it.
`grade-compare` does the same for colour: candidate grades or LUTs applied to
one reference frame.