Skip to content

feat(cli): print the render's reference_background as an @hf-result line - #7203

Merged
jerrai-bot-heygen merged 1 commit into
mainfrom
jerrai/hf-render_result_reference_background-11052026
Nov 5, 2026
Merged

jerrai-bot-heygen merged 1 commit into
mainfrom
jerrai/hf-render_result_reference_background-11052026

Conversation

@jerrai-bot-heygen

Copy link
Copy Markdown
Contributor

What

A piped, non-quiet local render now prints one @hf-result JSON line after it succeeds, carrying the reference_background the render already measured. Batch manifest rows carry the same reference_background value.

@hf-result {"version":1,"operation":"render","reference_background":{"kind":"solid","rgb":[12,34,56]}}

reference_background is exactly one of {"kind":"solid","rgb":[r,g,b]}, {"kind":"none"}, {"kind":"unsupported_non_solid"}, {"kind":"unknown"}: the object renderLocal / renderRange already return, re-projected through referenceBackgroundResult at the writer. No new computation.

Why

renderLocal returns reference_background, but nothing printed it: the single-render path discarded the returned object and batch rows copied only durationMs and renderTimeMs. A caller that runs hyperframes render as a subprocess (piped stdout, no --json) could not read the measured background. This is the same transport as @hf-diagnostic and @hf-progress, so it needs no new flag.

Related work

Builds on the measurement merged in #7007. Refs: Cut Room harness row D56-24 (blank scan should compare against the composition's own background).

How

  • packages/cli/src/ui/renderResult.ts: renderMachineResult, written like renderMachineDiagnostic: silent on a terminal or when HYPERFRAMES_STDOUT_IS_TTY=1, silent in quiet mode (including batch JSON), one line, version 1.
  • executeHeldRender prints it once from the value the single-render executor returns. A failed render throws before the call, so a failure never prints it. A --docker launcher gets no field back and prints nothing.
  • BatchManifestRow.reference_background is null until the row completes and stays null for a failed row. Manifest version stays 1 (additive key).
  • packages/cli/README.md documents the line next to @hf-diagnostic.

Changeset / release note: none needed for the PR; release notes are drafted by release:prepare.

Test plan

  • Unit tests added/updated
  • Manual testing performed: not done beyond tests (no real browser render, see below)
  • Documentation updated (if applicable)
  • Comments follow CONTRIBUTING.md "Comments"

Tests that fail on the old code and pass on this head (checked by restoring only execute.ts and batchRender.ts to origin/main):

  • execute.test.ts > "the machine result line after a single render" > prints the render's reference background once (solid, none, unsupported_non_solid, unknown): expected one line, got none.
  • batchRender.test.ts > "copies each row's reference background into the manifest and leaves a failed row null".

Also covered, passing on both: no line on a failed render, no line in quiet mode, no line when a Docker render reports no background (execute.test.ts); line shape, single line, malformed value re-projected to unknown, silent on terminal / HYPERFRAMES_STDOUT_IS_TTY=1 / quiet (renderResult.test.ts, new module).

Ran locally: renderResult.test.ts, execute.test.ts, batchRender.test.ts (38 tests pass), oxfmt, oxlint, tsc --noEmit on the cli package (only pre-existing @hyperframes/inspector/live errors from an unbuilt package), check-comment-citations.mjs.

Could not verify

  • No real browser render was run, so the line was not observed from a live hyperframes render process; the single-render test drives executeRenderPlan with a stub executor that returns each of the four kinds.
  • comment-ratchet.mjs needs full history; CI runs it.

Authored by Jerrai.

…ine and in batch manifest rows

A piped, non-quiet local render now writes one versioned @hf-result JSON line
after success. Batch manifest rows carry the same reference_background value.

Co-Authored-By: Jerrai <[email protected]>
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 267 (base branch 267), smooth 113 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (8)

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE · 0 blocker · 0 important · 0 nits · head b07d99fa

The writer only re-emits the reference_background that renderLocal/renderRange already return, and passes it through referenceBackgroundResult again first. It uses the same TTY, HYPERFRAMES_STDOUT_IS_TTY and quiet gates as @hf-diagnostic. A failed render throws before the writer runs.

Scope

Read all 7 files. Checked:

  • effectiveQuiet = quiet || args.json (plan.ts:644), so a single --json render prints no extra stdout line.
  • Batch rows get the field through executeBatchRender, not executeHeldRender, so a batch run prints no per-row @hf-result lines from the host.
  • Docker rows/launcher return no field, so rows stay null and the launcher prints nothing. A non-quiet container inherits stdout and its own CLI may emit the line, which matches what the README says.
  • The manifest change only adds a key, so keeping version 1 is fine.

All 8 Actions workflows on this head are green.

@jerrai-bot-heygen
jerrai-bot-heygen added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit 58b9ec0 Nov 5, 2026
84 checks passed
@jerrai-bot-heygen
jerrai-bot-heygen deleted the jerrai/hf-render_result_reference_background-11052026 branch November 5, 2026 02:36
SanHsien added a commit to SanHsien/hyperframes that referenced this pull request Nov 5, 2026
…eview

Adopts heygen-com#7199 (delivery-PCM duration normalization), heygen-com#7194 (browser
install retries while Windows holds a file), the Studio marquee and
timeline range-selection series, waapi initial-state, lint media and
CLI check/contrast fixes, and skills docs. Not adopted with ledger
reasons: heygen-com#7203, heygen-com#7207, heygen-com#7202, heygen-com#7197; limitDeliveryPeaks and the
neverStyledStarts cache are left out because the fork lacks their
prerequisites. Watermark advances to aa34cff / PR heygen-com#7190.

Co-authored-by: WaterrrForever <[email protected]>
Co-authored-by: Miguel Ángel <[email protected]>
Co-authored-by: kevin <[email protected]>
Co-authored-by: Jason <[email protected]>
Co-authored-by: cooleryu <[email protected]>
Co-authored-by: Vincent Yip <[email protected]>
Co-authored-by: Vance Ingalls <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

1 participant