Skip to content

test(producer): add variables-prod regression for the variables stack (PR 5/5)#604

Merged
jrusso1020 merged 2 commits intomainfrom
feat/get-variables-regression
May 4, 2026
Merged

test(producer): add variables-prod regression for the variables stack (PR 5/5)#604
jrusso1020 merged 2 commits intomainfrom
feat/get-variables-regression

Conversation

@jrusso1020
Copy link
Copy Markdown
Collaborator

What

End-to-end Docker regression test that exercises the full variables chain shipped in PRs #600-#603. Closes the loop between unit-tested seams and the actual rendered output.

This is PR 5 of 5, the regression cap. Stacked on feat/get-variables-skills (PR #603).

Why

PRs 1-4 ship unit tests that cover the seams independently:

  • Engine: `evaluateOnNewDocument` injection (mocked Puppeteer)
  • Helper: `getVariables()` merge (jsdom)
  • CLI: `parseVariablesArg` validation (pure function)
  • Loader: `__hfVariablesByComp` population (jsdom)
  • Validator: `validateVariables` type-checking (pure)

But none of those check that the chain actually works front-to-back inside the production Chrome+ffmpeg+harness combo. A type signature change on `CaptureOptions.variables`, a regression in `evaluateOnNewDocument` ordering, a bug in the runtime helper's attribute parsing — any of those could pass unit tests and silently render the wrong text. This regression catches it.

How

Fixture (`packages/producer/tests/variables-prod/`):

  • `src/index.html` — composition with three declared variables (`title`, `subtitle`, `bgColor`) read via `window.__hyperframes.getVariables()` and rendered as positioned text on a colored background. No animation — keeps the regression frame-stable so it isolates "did the variables flow through?" from motion concerns.
  • `meta.json` — tags `["variables", "composition"]` (runs in the existing fast shard's tag filter, no workflow YAML changes needed). `renderConfig.variables` provides override values that the baseline reflects ("Override Title", "Override subtitle", `#0a3d62`). If variables don't propagate, the rendered frame shows declared defaults ("Default Title", black) — visibly different from the baseline, so PSNR fails on dozens of frames.
  • `output/output.mp4` — Docker-generated baseline per the project's CLAUDE.md golden-baseline rule. Host renders drift across Chrome/font versions and would fail PSNR even on green code.
  • `src/silence.wav` — copied from `missing-host-comp-id`'s silence track to satisfy the audio-correlation check.

Harness change (`packages/producer/src/regression-harness.ts`):

Test plan

  • `docker:test variables-prod` PASSED — 100/100 visual checkpoints, audio correlation 1.000.
  • Defeated the bug it's meant to catch — generated a baseline against an old image (without the harness change) and confirmed it shows defaults. After the harness change + image rebuild, the baseline correctly shows overrides.
  • CI auto-includes — fast shard's `--exclude-tags slow,render-compat,hdr` lets `[variables, composition]` through. No `.github/workflows/regression.yml` edits needed.

Backwards compatibility

Additive. Existing fixtures don't set `renderConfig.variables` and behave identically. The harness validator only fires on the new field if it's present.

🤖 Generated with Claude Code

@jrusso1020 jrusso1020 force-pushed the feat/get-variables-regression branch 2 times, most recently from b6d1cd6 to 6ec2fc2 Compare May 3, 2026 16:39
@jrusso1020 jrusso1020 force-pushed the feat/get-variables-skills branch from 5543921 to 10b96b8 Compare May 4, 2026 19:42
@jrusso1020 jrusso1020 force-pushed the feat/get-variables-regression branch from 6ec2fc2 to 2a86ec0 Compare May 4, 2026 19:43
@jrusso1020 jrusso1020 force-pushed the feat/get-variables-skills branch from 10b96b8 to 4dea0a0 Compare May 4, 2026 20:06
@jrusso1020 jrusso1020 force-pushed the feat/get-variables-regression branch from 2a86ec0 to 57c250a Compare May 4, 2026 20:06
@jrusso1020 jrusso1020 force-pushed the feat/get-variables-skills branch 2 times, most recently from 524dbe0 to 21243b6 Compare May 4, 2026 20:26
@jrusso1020 jrusso1020 force-pushed the feat/get-variables-regression branch from 57c250a to 9fec75a Compare May 4, 2026 20:26
@jrusso1020 jrusso1020 changed the base branch from feat/get-variables-skills to graphite-base/604 May 4, 2026 20:33
…stack

End-to-end Docker regression test that exercises the full variables
chain: meta.json renderConfig.variables → harness → createRenderJob →
RenderConfig → CaptureOptions → engine evaluateOnNewDocument →
window.__hfVariables → getVariables() → DOM text → rendered pixels.

Fixture (packages/producer/tests/variables-prod/):
- src/index.html: composition with three declared variables (title,
  subtitle, bgColor) read via window.__hyperframes.getVariables() and
  rendered as positioned text on a colored background. No animation —
  keeps the regression frame-stable so it isolates "did the variables
  flow through?" from motion concerns.
- meta.json: tags ["variables", "composition"] (runs in the existing
  fast shard's tag filter), renderConfig.variables provides override
  values the baseline reflects ("Override Title", "Override subtitle",
  #0a3d62). Defaults would produce a visibly different frame, so a
  failing baseline that reflects defaults means the variables didn't
  propagate.
- output/output.mp4: Docker-generated baseline per the project's
  CLAUDE.md golden-baseline rule.

Harness change (packages/producer/src/regression-harness.ts):
- TestMetadata.renderConfig gains an optional variables field,
  validated as a JSON object in the meta.json validator.
- The createRenderJob call site forwards renderConfig.variables to
  RenderConfig.variables, which the engine already consumes via
  evaluateOnNewDocument (PR #600).

Verified: docker:test variables-prod passes 100/100 visual checkpoints
and audio correlation 1.000 against the committed baseline.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jrusso1020 jrusso1020 force-pushed the feat/get-variables-regression branch from 9fec75a to 9bf2494 Compare May 4, 2026 20:33
@graphite-app graphite-app Bot changed the base branch from graphite-base/604 to main May 4, 2026 20:34
Align the no-op timeline duration with the root's data-duration. The
fixture's root has data-duration="3" but the placeholder timeline tween
was still { duration: 2 } — leftover from when I bumped the duration
from 2s to 3s to dodge the PSNR-checkpoint-at-1.99s parse edge case.
The tween is a no-op (no targets, no visible effect) so rendered pixels
don't change; baseline still passes Docker regression at 100/100
checkpoints.

Reuse + efficiency reviews otherwise clean. Two findings deferred:
silence.wav duplication is real but only 2 fixtures share it today —
worth extracting to tests/_shared/ when the third fixture lands.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jrusso1020 jrusso1020 force-pushed the feat/get-variables-regression branch from 9bf2494 to c9d5fe6 Compare May 4, 2026 20:34
@jrusso1020 jrusso1020 merged commit f1d408e into main May 4, 2026
38 checks passed
Copy link
Copy Markdown
Collaborator Author

Merge activity

@jrusso1020 jrusso1020 deleted the feat/get-variables-regression branch May 4, 2026 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants