Skip to content

feat(cli): check warns on a blank stretch between two hard cuts - #9059

Merged
xuanruli merged 3 commits into
mainfrom
check-blank-span
Nov 29, 2026
Merged

xuanruli merged 3 commits into
mainfrom
check-blank-span

Conversation

@xuanruli

Copy link
Copy Markdown
Collaborator

What

hyperframes check gains blank_span, a craft warning: 0.5 s or more where nothing is visible, between two hard cuts. It never fails a run, --strict included.

Why

A gap in the timeline (a clip that ends before the next starts, a mistyped data-start) renders as a blank stretch, and nothing in check reports it today: dead_stretch needs 3 s of no change, first_frame_empty looks at frame 0 only. The rule is built so it does not warn on a composition that is blank on purpose; it would rather miss a gap than flag a deliberate one.

Related work

No open or closed PR covers this (gh pr list --search blank --state all). It ports the idea of an add-on a downstream agent already runs on its own renders, narrowed to have no false positives.

How

  • Candidates come from the craft grid already sampled (8 fps, its painted value): runs of unpainted samples of 0.5 s or more that touch neither end of the grid.
  • Each edge is re-read one grid step outside the run: content must be at 0.95 opacity or more on both sides, so a fade is never a cut.
  • Every sample in the run is then confirmed in the page (blank-span.browser.js): the stage has an opaque colour, no element under the root renders anything (text, pseudo-content, background, media tag), even off the canvas or covered, and the screenshot does not differ from a frame of the bare stage colour (framesDiffer, the motion-signature noise rule).
  • Whenever the page cannot say (an older driver, no presence, no film facts), the rule stays quiet.
  • data-layout-allow-blank on any element silences it, for the one deliberate case it cannot tell apart: an empty beat held between two hard cuts with nothing rendered.
  • filmFinding and ZERO_BBOX moved unchanged to craftFinding.ts so craftAudit and blankSpan share them without an import cycle. painted is now derived from a new presence value with the same result as before.

Deliberately quiet: blanks that open or end the film, a blank beside any fade, a solid card (with or without text), a black cover div, full-bleed media, unloaded assets, content slid off the canvas, a stage with no opaque background. A blank longer than 3 s also raises dead_stretch; both are kept.

Test plan

  • Unit tests added/updated: blankSpan.test.ts (interior vs opening/ending stretches); blankSpan.chromium.test.ts runs the real runAuditGrid with createPageDriver: 1 positive (a 2–3.5 s hard-cut gap) and 16 negatives (under 0.5 s, fade through black, fade out then cut in, cut out then fade in, opening blank plus end padding, card with and without text, black cover, text/pseudo-element/canvas slid off, never-loaded image, full-bleed canvas, paint outside the root, no opaque stage, the waiver). Each branch was mutated in turn and its test failed.
  • Manual testing performed: built dist and ran check --json on GSAP projects: a 1.5 s gap warns at [3, 4.375]; the same gap with fade out/in and a 0.2 s gap are quiet.
  • Documentation updated: docs/packages/cli.mdx, the hyperframes-cli and hyperframes skill references, skills-manifest.json.
  • Comments follow CONTRIBUTING.md "Comments".
  • Existing suites pass: craftAudit, check, checkBrowser, layout-audit.chromium, checkBrowser.chromium, checkSweep.chromium, motion-signature.browser.chromium. Locally, downloadStall.process, snapshotHdrFrame, studioServer.previewAssets and checkFindingInspect.chromium fail on this branch alone; none import the changed files, and I did not run them on a clean main.
  • tsc --noEmit, oxlint, oxfmt, fallow audit --base origin/main, the skills checks and the pre-commit hooks pass.

🤖 Generated with Claude Code

`blank_span` is a craft warning: 0.5 s or more where nothing is visible,
between two cuts with content at full opacity on both sides. It reuses the
craft grid's samples and painted value, and confirms each candidate sample
in the page: the stage has an opaque colour, nothing under the root
renders, and the screenshot matches a frame of the bare stage. Blanks that
open or end the film, sit beside a fade, or show a card, cover or
off-canvas content never fire; data-layout-allow-blank silences the rest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mintlify

mintlify Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
hyperframes 🟢 Ready View Preview Nov 29, 2026, 6:07 AM

💡 Tip: Enable Automations to automatically generate PRs for you.

@github-actions

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 275 (base branch 273), smooth 80 of those

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

Newly passing (2)

  • seqscaletwice-scale-px-r0-root-z100
  • seqscaletwice-scale-px-r0-nested-z100

Not banked yet, reported and not gated (bank a full-grid run's baseline.json) (2)

  • seqscaletwice-scale-px-r0-root-z100
  • seqscaletwice-scale-px-r0-nested-z100

Quarantined, measured but not gated (0)

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

APPROVE at 62284aef95.

blank_span is a conservative, warning-only rule: it never fails a run. I ran the real runAuditGrid + createPageDriver in Chromium on extra cases beyond the PR's 17. My results:

Quietness rules (false positives): I found none.

  • Fades on either side stay quiet, because both edges need content at 0.95 or more one grid step out.
  • Cards, cover divs, content moved off the canvas, never-loaded images and full-bleed canvases stay quiet, because any rendered element under the root silences the rule.
  • An empty <video> stays quiet too.
  • The waiver works on any element, not only the root.

False negatives worth knowing:

  • Effective floor is about 0.5 s plus one grid step, not 0.5 s. The length is measured from the first blank sample to the last. Results:

    • an exact 0.5 s gap (2.0–2.5) is quiet;
    • a 0.56 s gap off the grid (2.06–2.62) is quiet;
    • 0.6 s and 0.625 s gaps warn;
    • a 0.7 s gap off the grid warns as 2.125–2.75.

    The reported range also ends at the last blank sample, so a 2–3.5 s gap reads "2.00 s to 3.38 s". Measuring to last + step, or documenting the floor as up to 0.625 s, would match the docs.

  • A persistent background layer turns the rule off for the whole film. I tested a full-bleed #111 div and a vignette gradient overlay, each across the whole composition, with a 1.5 s hard-cut gap. Both stay quiet, because rendersAnything counts them as content. Many compositions carry a bg, grain or vignette layer. This matches the stated "rather miss than flag" aim, but it limits how often the rule can fire, and it may be worth a line in the docs.

  • The waiver is film-wide. One data-layout-allow-blank anywhere silences every gap in the film, including accidental ones elsewhere. That's as documented.

Seams between clips: a blank at a seam is caught when it lasts about 0.625 s or more and both neighbours hard-cut with text or media at full opacity. Two separate gaps in one film both warn. It misses a seam blank:

  • shorter than about 0.5 s plus one step;
  • next to any fade;
  • where either neighbour is shapes-only. presence counts only text and img/video/canvas/svg, so a scene made of plain divs never passes the edge check.

Probe determinism, cost, transparent and video-only frames:

  • Deterministic: the same film gave the same finding on repeat runs.
  • Cost:
    • With no candidate stretch, it takes zero extra screenshots. A film with no gap took 48 craft samples, the grid alone.
    • Each candidate adds 2 craft samples, plus one seek and screenshot per blank sample. A 1.5 s gap took 12 screenshots and a 5 s gap took 40.
    • When a bg layer silences the rule, it still spends 1 screenshot before the DOM check says no. Checking rendersAnything before capturing would save that, but it's minor.
  • With no opaque stage colour, as in a transparent render, the rule stays quiet. A visible video element always counts as content, so video-only frames are never called blank.

Tests: blankSpan, blankSpan.chromium, craftAudit and check: 265 passed locally. CI: 79 pass, none red.

Need: yes, a timeline gap isn't reported today · Size: right-sized · Reuse: reuses the craft grid, framesDiffer and filmFinding (moved, unchanged) · Simpler: no · Structure: good, the page half and the decision half are split
Risk: low. Warning only, quiet whenever the page can't answer, and no change to existing findings (painted is derived the same way as before).

— Rames

@xuanruli
xuanruli added this pull request to the merge queue Nov 29, 2026
Merged via the queue into main with commit bf582ad Nov 29, 2026
91 checks passed
@xuanruli
xuanruli deleted the check-blank-span branch November 29, 2026 06:44

This branch was successfully deployed

1 active deployment
staging - docs — 62284aef Deployed Nov 29, 2026 by mintlify[bot]
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