Commit Graph
100 Commits
Author SHA1 Message Date
Vance Ingalls 17e79740e0 docs(prompting): revert capstone prompt to the pre-audit film 2026-07-28 01:30:31 -07:00
Vance Ingalls 8ce65d03ce docs(prompting): coil carries the wire stroke, anchors to the diving wire, world turns 2026-07-28 01:02:48 -07:00
Vance Ingalls 4d5953c12c docs(prompting): sync capstone prompt — chip rides the coil, peel needs room, pulses repeat 2026-07-28 00:37:36 -07:00
Vance Ingalls 01e993c353 docs(prompting): fill gaps — vo-paced reveals, density contract, mount thread, sfx 2026-07-27 16:25:57 -07:00
Vance Ingalls 8f2e0541da docs(prompting): capstone threads quote the verbatim prompt clause that buys each region 2026-07-27 14:54:51 -07:00
Vance Ingalls bd8437f7e4 docs(prompting): thread capstone regions through the guide as each chapter's worked example 2026-07-27 14:42:55 -07:00
Vance Ingalls 79525f954b docs(prompting): capstone honesty note + depth technique row cover 3D occlusion clauses 2026-07-23 15:54:57 -07:00
Vance Ingalls 871b8f2ec3 docs(prompting): capstone depth region — chip occlusion + coil taper in printed prompt 2026-07-23 15:26:09 -07:00
Vance Ingalls 74346e18c8 docs(prompting): sync prompt to fixes — screen-fixed mural, ring-only iris, stable map pulses 2026-07-23 00:30:05 -07:00
Vance Ingalls ef62ebd37a docs(prompting): lower-third renders behind the subject — match film behavior 2026-07-23 00:14:38 -07:00
Vance Ingalls 6df2647004 docs(prompting): close prompt gaps — chip path-binding and mural iris-reveal clauses 2026-07-22 21:39:17 -07:00
Vance Ingalls b13457be93 docs(prompting): capstone v4 — dwell-and-sweep rhythm, real brand frame.md, text-behind-subject 2026-07-22 21:11:44 -07:00
Vance Ingalls a90e343e8e docs(prompting): capstone v3 — The Timeline, one continuous camera journey 2026-07-22 20:30:01 -07:00
Vance Ingalls 87b2ec6329 docs(prompting): capstone v2 — OSS Wrapped all-techniques film, two-render templating demo 2026-07-22 17:50:03 -07:00
Vance Ingalls e6bea18b95 docs(prompting): rebuild capstone film with density contract — chrome, roles, scale 2026-07-22 16:20:36 -07:00
Vance Ingalls 48e359bd1b docs(prompting): fix stale six-rules references to match the seven-rule grammar 2026-07-22 15:45:14 -07:00
Vance Ingalls 6a6adb9f2d docs(prompting): final QA pass for the guide arc 2026-07-22 15:30:48 -07:00
Vance Ingalls e0164105f1 docs(prompting): fix capstone exit bridge to the literal template 2026-07-22 15:25:06 -07:00
Vance Ingalls 6a2d506f75 docs(prompting): capstone chapter + overview rewritten as the arc's map 2026-07-22 15:23:41 -07:00
Vance Ingalls b14545a23e docs(prompting): remove non-sequitur anatomy link from rule 1 2026-07-22 14:21:25 -07:00
Vance Ingalls 00c6fd238e docs(prompting): appendix cheat sheet + post-guide lint rules as prompt guidance 2026-07-22 14:16:44 -07:00
Vance Ingalls de96c0594c docs(prompting): embed validated storyboard-mini render 2026-07-22 13:37:30 -07:00
Vance Ingalls 630ad482c6 docs(prompting): add storyboards chapter — prompting the plan, not the scenes 2026-07-22 13:29:27 -07:00
Vance Ingalls fe09437c6a docs(prompting): level 6 — scale chapters + variables CSS-shadow correction 2026-07-22 13:20:21 -07:00
Vance Ingalls 9eaf62ebfa docs(prompting): embed validated proxy-footage render 2026-07-22 13:11:58 -07:00
Vance Ingalls c76354351d docs(prompting): level 5 — voice, sound, and automatic media proxies 2026-07-22 13:03:18 -07:00
Vance Ingalls 16224fd2fb docs(prompting): fix misquoted caption-color phrase in captions-catalog bridge 2026-07-22 12:40:55 -07:00
Vance IngallsandClaude Sonnet 5 cd8c98e92d docs(prompting): level 4 — capability chapters framed as additive
Add entry bridges (each naming a specific Level 1-3 artifact the
capability slots into) and literal exit bridges across the 7 Level 4
Substance pages, per the novice-to-advanced restructure plan.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-22 12:36:20 -07:00
Vance Ingalls 2ab72e5d14 docs(prompting): level 3 — life chapters with bridges 2026-07-22 12:28:29 -07:00
Vance IngallsandClaude Sonnet 5 c8a64a29bd docs(prompting): level 2 — control chapters with bridges + structure mandate note
Level 2 (anatomy, specification-dial, vocabulary, visual-specs, examples)
gets entry/exit bridges tying it into the Level 1 -> Level 3 arc, plus a
short note on the composition-structure mandate (0aaac7aa3 / PR #2599)
showing the framework enforces its own version of the prompt skeleton.
All existing prompts, renders, and tables are untouched.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-22 12:22:00 -07:00
Vance Ingalls 68ab776113 docs(prompting): fix Level 1 exit bridges to the plan's literal template 2026-07-22 11:59:09 -07:00
Vance Ingalls 8de8545f20 docs(prompting): embed validated changelog-video render 2026-07-22 11:26:10 -07:00
Vance Ingalls 04b0b75a21 docs(prompting): level 1 — reframe workflow pages as first-win rides + changelog-video 2026-07-22 09:55:57 -07:00
Vance Ingalls a47889824c docs(prompting): regroup Prompt Guide nav into novice-to-advanced levels 2026-07-22 09:21:23 -07:00
Vance Ingalls b71ce85c2c chore: format prompt-guide-expansion plan (fixes Format CI) 2026-07-22 09:18:44 -07:00
Vance IngallsandClaude Fable 5 54051c2c0e docs(prompting): implementation plan for the guide arc restructure
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-22 09:08:31 -07:00
Vance IngallsandClaude Fable 5 c222b1742c docs(prompting): approved design for novice-to-capstone guide arc
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-22 00:59:24 -07:00
Vance IngallsandClaude Opus 559dd0e659 chore: merge main into fix/prompt-guide-validation-bugs, resolve conflicts
Two real conflicts:

- docs/guides/prompting.mdx: modify/delete. This branch already deleted
  it (383dd3568, replaced by the docs/prompting/* multi-page structure);
  main separately fixed one line in the old file (cf7c1d760: lint+validate
  -> the new consolidated `check` command). Kept the deletion — a
  redirect to /prompting/overview already exists in docs.json — and
  ported the same check-command fix forward into the two new-structure
  pages that still had the stale lint+validate phrasing
  (examples.mdx, rules-and-anti-patterns.mdx), so main's fix isn't lost.

- skills-manifest.json: auto-generated, regenerated fresh via
  packages/cli/scripts/gen-skills-manifest.ts rather than hand-resolving
  the JSON conflict markers.

Everything else auto-merged cleanly (no conflicts) — this pulls in
main's independent work since the branch diverged (media-use v2, the
check command consolidation, studio timeline updates, etc).

Co-Authored-By: Claude Opus <noreply@anthropic.com>
2026-07-13 15:46:47 -07:00
Vance IngallsandClaude Opus ba37b53efb docs(prompting): add rule 7 — seeded + two-frame-hold motion for handmade-but-deterministic feel
Learned from a strong example prompt (not reused verbatim — different
subject, same technique): a stop-motion/hand-animated look wants
irregular timing, but true unseeded randomness breaks HyperFrames'
determinism guarantee (same seek must always render the same frame).
The correct pattern is a PRNG seeded once at composition start, stepping
elements between held positions rather than tweening continuously —
distinct from rule 1's continuous ambient idle, which is a different
tool for a different texture.

Kept separate from "The grammar, measured" (rules 1-6, empirically
videoed) since there's no rendered proof for rule 7 yet — the new
section and example are illustrative, not claimed as verified.

Co-Authored-By: Claude Opus <noreply@anthropic.com>
2026-07-13 15:39:18 -07:00
Vance IngallsandClaude Opus ead4341c7c docs(prompting): add Porting from Remotion page — the one workflow with zero prompting coverage
Every other creation workflow gets either a dedicated page or an
explicit routing/contrast section inside a related one (website-to-
video inside product-launch.mdx, slideshow inside music-and-
slideshows.mdx). /remotion-to-hyperframes had neither — its only
mention anywhere in the 29-page guide was one line in overview.mdx's
install table.

Covers what to hand the agent (the exact source file, since a Remotion
project can register several Compositions), the one-way/no-reverse-
export scope, the lint-blocker categories that make the skill refuse
rather than approximate (useState/useEffect state machines, third-
party UI kits), and why SSIM validation against the Remotion original
is part of the deliverable, not optional. Added to the "By video type"
nav group in docs.json.

Co-Authored-By: Claude Opus <noreply@anthropic.com>
2026-07-13 15:01:31 -07:00
Vance Ingalls 9b71bc2103 Merge pull request #2361 from heygen-com/via/flake-fix-manager-progress-notice
test(cli): stabilize flaky install-lock wait-notice test with fake timers
2026-07-13 14:37:40 -07:00
Vance Ingalls e47af77c5a test(cli): stabilize flaky install-lock wait-notice test with fake timers
Adopt the fake-timer pattern the sibling "recovers when a crashed reclaimer
leaves both lock directories" test in the same file already uses. Without
fake timers, if the dynamic `import("./manager.js")` beat between
`installFsMocks({ initialMtimeMs: Date.now() })` and the `withInstallLock`
call exceeds `staleMs` (50 ms on a busy shared runner with `vi.resetModules()`
per beforeEach), the new immediate-stale short-circuit added in #2328 fires
on iteration 1, breaks out before `waitedMs` reaches `waitNoticeMs=20`, and
no "Waiting for another hyperframes process" warn ever emits — the assertion
at `manager.test.ts:428` (`expected false to be true`) then fails.

Under fake timers, `Date.now()` is frozen at the mtime seed, so the lock
stays non-stale across the dynamic import and the wait-notice branch
observes real polling; `vi.advanceTimersByTimeAsync(staleMs + pollMs * 5)`
then drives the loop past both the wait-notice threshold and the stale
deadline so the reclaim + acquisition still resolves.

Test-only change; no production-code diff. Verified 27/27 in
`packages/cli/src/browser/manager.test.ts` under `vitest run`.
2026-07-13 21:30:44 +00:00
Vance Ingalls c830aa83c5 chore: release v0.7.55 2026-07-12 11:52:53 -07:00
Vance Ingalls 27eec5be6c Merge pull request #2301 from heygen-com/07-12-feedback-skill-bug-repro-guidance
docs(skills): tell agents to file reproducible render bugs, not paraphrases
2026-07-12 11:51:10 -07:00
Vance Ingalls 2a0c603430 Merge pull request #2300 from heygen-com/07-12-fix-software-video-beyond-viewport
fix(producer): stop clipping the bottom edge of software-GPU video renders
2026-07-12 11:50:56 -07:00
Vance IngallsandClaude Opus 4.8 6a3da1f624 docs(skills): tell agents to file reproducible render bugs, not paraphrases
The `hyperframes feedback` convention only prompted for a free-text
`--comment` "with the failing composition pattern and what you tried".
Agents dutifully filed vague reports (blank CJK text, mid-run exit, 4K
timeout) with no error string, no failure-mode, and — critically — no
published composition, so none could be reproduced or root-caused.

Two additions to the CLI skill:
- Lead bug reports with `--file-issue` (+ `--dir`), which publishes a
  minimal repro of the project to a public URL. A comment alone almost
  never lets a maintainer reproduce; the composition is what does.
- Give the `--comment` a concrete bug checklist: exact error string
  verbatim + whether output was produced / fell back / hard-exited; the
  isolated trigger; exact command + HF_*/PRODUCER_* env; frame/timestamp +
  visual defect. Drop the "repeat env" ask (the CLI already attaches it).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-12 11:28:09 -07:00
Vance IngallsandClaude Opus 4.8 de95daa096 fix(producer): stop clipping the bottom edge of software-GPU video renders
resolveVideoCaptureBeyondViewport gated Chrome's beyond-viewport screenshot
path to hardware-GPU captures, to skip the full-surface software
re-rasterization tax. But without beyond-viewport, the viewport-bound
capture clips the bottom edge of any frame containing a native video
surface (the same #1094 tall-portrait guard the alpha capture paths already
hardcode) — leaving ~87 bottom rows black.

This hit two cohorts: software-GPU macOS/Linux hosts, and — worse — EVERY
distributed chunk render, which hardcodes browserGpuMode "software", so the
whole distributed fleet shipped video renders with a black bottom band.
Reporter confirmed forcing resolveVideoCaptureBeyondViewport=true fixes it.

Correct output wins over the software perf optimization: enable
beyond-viewport for any render with a native video surface, regardless of
GPU mode. Drops the now-vestigial browserGpuMode parameter (and its type)
and updates both call sites.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-12 11:28:09 -07:00
Vance Ingalls 534286a17b fix(producer): fall back fast when the parallel DE streaming capture stalls (#2298)
## Stack
1. **#2298 — DE router stall watchdog** ← you are here
2. #2300 — video bottom-edge clip
3. #2301 — feedback bug-report guidance

## Problem
The DE parallel router auto-enables the interleaved parallel-**streaming** capture for the ≥24 GB macOS trial cohort. If a worker wedges mid-capture (a hung seek/screenshot at an early frame), the render makes **zero frame progress** yet sits until the per-frame CDP `protocolTimeout` (~5 min) fires before the pinned self-verify fallback can run — a silent multi-minute hang shipped to real users.

Reported: stuck at frame 2/2031 for 6+ min, no fallback, until the user manually set `HF_DE_PARALLEL_ROUTER=false` (71 s clean).

## Fix
Add a no-frame-progress watchdog to the parallel branch of `runCaptureStreamingStage`:

- Ticks off `executeParallelCapture`'s progress callback. If no **new** frame lands within `HF_DE_PARALLEL_STALL_MS` (default **60 s** — well under the 5-min protocol timeout, ≫ the 15–32 ms/frame budget), it fires.
- On trip: aborts the **reorder buffer** (so peer workers parked in `waitForFrame` reject instead of deadlocking the `Promise.all` pool) and aborts the pool via a **separate** `AbortController` linked to the parent abort.
- The parent `abortSignal` stays un-aborted, so the orchestrator reads the failure as a generic `capture_error` (not a cancellation) and re-renders on the pinned screenshot path — the same fallback a verify failure already uses.

## Test
- Watchdog trips on no progress → rethrows a stall error (routes to fallback).
- A genuine parent-abort is **not** relabeled as a stall (stays a cancellation).
2026-07-12 11:25:39 -07:00
Vance IngallsandClaude Opus 4.8 07fb35c375 fix(producer): fall back fast when the parallel DE streaming capture stalls
The DE parallel router auto-enables the interleaved parallel-streaming
capture for the >=24GB macOS trial cohort. If a worker wedges mid-capture
(a hung seek/screenshot at an early frame) the render made no frame
progress yet sat until the per-frame CDP protocolTimeout (~5 min) fired
before the pinned self-verify fallback could run — a silent multi-minute
hang shipped to real users (report: stuck at frame 2/2031 for 6+ min,
no fallback, until HF_DE_PARALLEL_ROUTER=false).

Add a no-frame-progress watchdog to the parallel branch of
runCaptureStreamingStage. It ticks off executeParallelCapture's progress
callback; if no NEW frame lands within HF_DE_PARALLEL_STALL_MS (default
60s, well under protocolTimeout and >> the 15-32ms/frame budget), it
aborts the reorder buffer (unsticking peer workers parked in waitForFrame
so the pool doesn't deadlock) and aborts the pool via a SEPARATE
controller linked to the parent abort. Because the parent abortSignal
stays un-aborted, the orchestrator reads the failure as a generic
capture_error (not a cancellation) and re-renders on the pinned screenshot
path — the same fallback a verify failure already uses.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-12 10:35:21 -07:00
Vance Ingalls ae4946e624 chore: release v0.7.54 2026-07-11 17:15:24 -07:00
Vance Ingalls bd86fb803d Merge pull request #2266 from heygen-com/07-11-fix-cli-check-detect-invisible-text
fix(cli): flag text with an effectively transparent fill in check
2026-07-11 17:10:44 -07:00
Vance Ingalls 1a9c1b66b0 Merge pull request #2264 from heygen-com/07-11-fix-cli-localize-remote-fonts-in-audit-capture
fix(cli): localize remote fonts in snapshot/check capture to match render
2026-07-11 17:05:35 -07:00
Vance Ingalls fa902400c9 fix(cli): only exclude clipped text when a background actually paints the glyphs
Addresses review on #2266: the gradient-text exclusion was too broad — any
background-clip:text skipped the invisible-text check, so a broken/missing
gradient (clip:text with no image and a transparent background, which paints
nothing) went unreported. Now exclude only when a real background fills the
glyphs (background-image != none, or an opaque background-color). Expands the
test suite to the reviewer's full case set: direct transparent fill, inherited
transparent fill over an opaque child color, color:transparent fallback, opaque
baseline, gradient-over-real-background exclusion, broken-gradient still flagged,
and empty-text no-op.
2026-07-11 17:04:30 -07:00
Vance Ingalls a8fd8562a8 fix(cli): read effective text fill by property, not getPropertyValue
The layout-audit test mock returns computed styles as plain camelCase
properties (no getPropertyValue), so the invisible-text detector threw
'cs.getPropertyValue is not a function' and broke the whole audit in CI. Read
webkitTextFillColor/webkitBackgroundClip/backgroundClip by property to match
the rest of the script (works in a real browser too). Adds tests: flags
transparent -webkit-text-fill-color, ignores opaque color, ignores gradient
text (background-clip:text).
2026-07-11 17:00:40 -07:00
Vance Ingalls 9ae84c652c fix(cli): flag text with an effectively transparent fill in check
Wild report (5th in cluster, CLI 0.7.53): snapshots omitted all text while
check passed — text painting with a transparent -webkit-text-fill-color (which
overrides `color` for the glyph fill AND inherits, so a parent's transparent
fill silently blanks descendant text that has its own opaque `color`) renders
invisible, but every geometry/occlusion/contrast audit missed it. Contrast in
particular reads `color`, not the fill that actually paints, so white-`color`
+ transparent-fill text scored as high-contrast and passed.

Add an invisible-text detector to the layout audit: flag any text element whose
effective fill (computed -webkit-text-fill-color, which already resolves to
`color` when unset) is transparent. Gradient/clipped text (background-clip:text)
legitimately uses a transparent fill and is excluded. Verified: check now fails
on an inherited-transparent-fill fixture (text_not_painted) while gradient text,
body-inherited color, sub-composition color, and real registry examples stay
clean.
2026-07-11 16:52:24 -07:00
Vance Ingalls fc2b905837 fix(cli): distinguish producer-absent from injector failure in font localization
Addresses review on #2264: the localization helper had one broad catch around
both dynamic producer resolution and injector execution, so it couldn't tell a
benign 'producer not in this environment' from a real injector/fetch failure,
and emitted no diagnostic. Split into loadFontInjector() (returns null when the
module is absent — silent fail-open) and localizeWithProducer() (warns ONCE per
distinct message when the injector itself throws, then fails open). Per-family
resolution failures remain the injector's own responsibility (producer's
warnUnresolvedFonts). The localizer seam is injectable; tests now cover success,
producer-unavailable, injector-throw, warn dedup, and call-site integration.
2026-07-11 16:39:50 -07:00
Vance Ingalls aa10d49234 fix(cli): resolve producer font-localization at runtime so vitest transform doesn't fail
The CLI test job builds with --filter '!@hyperframes/producer', and render.ts
imports producer only as a type — so a static import("@hyperframes/producer")
in the font-localization helper failed Vitest's transform-time module
resolution ("Failed to resolve entry for package"), breaking checkBrowser
tests and the helper's own test. Keep the specifier out of the static module
graph (@vite-ignore + variable specifier) so it resolves at runtime only:
production/installed CLI has producer in node_modules and localizes fonts;
the test env fail-opens to the plain bundle. Localizer is now injectable so
the helper's unit tests cover it without needing producer resolvable.
2026-07-11 16:30:13 -07:00
Vance Ingalls f53a75bfe8 Merge pull request #2224 from heygen-com/parallel-streaming
feat(producer): stream parallel screenshot/beginframe capture to the encoder
2026-07-11 16:15:49 -07:00
Vance Ingalls ad0d2393fe fix(cli): localize remote fonts in snapshot/check capture to match render 2026-07-11 16:14:36 -07:00
vanceingalls 591235f05c feat(producer): emit eligible_off cohort-sizing signal when parallel-stream router is off 2026-07-11 22:38:04 +00:00
vanceingalls 88c21ccd8b feat(cli): capture_parallel_stream telemetry on success and failure paths 2026-07-11 22:37:25 +00:00
Vance Ingalls 35c231e35f Merge pull request #2255 from heygen-com/07-11-fix_cli_surface_video_frame-injection_failures_in_snapshot_output
fix(cli): surface video frame-injection failures in snapshot output
2026-07-11 15:36:41 -07:00
vanceingalls 6d5a7711f3 feat(producer): route eligible parallel screenshot/beginframe renders to streaming 2026-07-11 22:34:46 +00:00
vanceingalls 2416e9bcd5 feat(producer): routing predicate for non-drawelement parallel streaming 2026-07-11 22:34:13 +00:00
Vance Ingalls fecd7dc1d3 Merge pull request #2248 from heygen-com/bf-reuse-telemetry
feat(producer): surface beginframe no-damage reuse counters in perf summary and telemetry
2026-07-11 15:31:58 -07:00
Vance Ingalls 76f4d2e02f Merge pull request #2254 from heygen-com/07-11-fix_shader-transitions_pin_cloned_scene_roots_to_composition_dimensions
fix(shader-transitions): pin cloned scene roots to composition dimensions
2026-07-11 15:25:13 -07:00
Vance Ingalls 28f492df52 Merge pull request #2253 from heygen-com/07-11-fix_cli_fold_canvas_pixel_hashes_into_the_frozen-sweep_fingerprint
fix(cli): fold canvas pixel hashes into the frozen-sweep fingerprint
2026-07-11 15:24:51 -07:00
Vance Ingalls edc0a1624b fix(cli): surface video frame-injection failures in snapshot output 2026-07-11 14:42:44 -07:00
Vance Ingalls b3d851d65a fix(shader-transitions): pin clones to their measured live box, not composition size
Addresses review feedback on #2254: the previous fix hardcoded every clone
to the full composition width/height regardless of the source scene's own
sizing, silently overriding any authored explicit width/height. Measuring
each scene's getBoundingClientRect() while still live in the document (its
inset:0 already resolves correctly against the real ancestor chain there)
and reapplying that exact box to the clone fixes the 0x0 collapse without
ever clobbering an author's own layout.
2026-07-11 14:42:43 -07:00
Vance Ingalls 3338a6f350 fix(cli): fold canvas pixel hashes into the frozen-sweep fingerprint 2026-07-11 14:42:43 -07:00
Vance Ingalls 9e3ff630f4 fix(shader-transitions): pin cloned scene roots to composition dimensions 2026-07-11 14:42:43 -07:00
Vance Ingalls 1dfb016f3b Merge pull request #2256 from heygen-com/07-11-fix_producer_disk-headroom-gate-before-hdr-pre-extraction
fix(producer): disk-headroom gate before hdr raw frame pre-extraction
2026-07-11 14:38:12 -07:00
Vance Ingalls 676af2bd51 Merge pull request #2252 from heygen-com/07-11-feat_cli_preview_--browser-no-gpu_for_gpu-unstable_hosts
feat(cli): preview --browser-no-gpu for gpu-unstable hosts
2026-07-11 14:28:58 -07:00
Vance Ingalls 68690e63ce Merge pull request #2251 from heygen-com/07-11-fix_cli_settle_post-seek_font_subset_loads_before_audit_screenshots
fix(cli): settle post-seek font subset loads before audit screenshots
2026-07-11 14:28:40 -07:00
Vance Ingalls c252a75e22 Merge pull request #2250 from heygen-com/07-11-fix_engine_densify_drawelement_self-verify_with_parallel_worker_count
fix(engine): densify drawelement self-verify with parallel worker count
2026-07-11 14:28:25 -07:00
Vance Ingalls 9582be9804 Merge pull request #2249 from heygen-com/07-11-fix_producer_withhold_de_parallel_router_below_a_machine_ram_floor
fix(producer): withhold de parallel router below a machine ram floor
2026-07-11 14:25:09 -07:00
Vance Ingalls c20e20235b refactor(producer): stop coupling the hdr disk-headroom gate's control flow to error-string matching
Addresses non-blocking review feedback on #2256: the previous shape used
err.message.includes(...) inside a catch to distinguish a real headroom
violation from a statfsSync failure — a future message tweak would silently
fail open (statfs-unsupported and headroom-violation would take the same
code path). Now statfsSync failure returns early (skip the gate) and the
headroom check/throw happens in plain control flow outside any try/catch.
2026-07-11 14:14:09 -07:00
Vance Ingalls 9a1afce43c fix(producer): disk-headroom gate before hdr raw frame pre-extraction 2026-07-11 14:14:09 -07:00
Vance Ingalls 3dc08c0868 feat(cli): preview --browser-no-gpu for gpu-unstable hosts 2026-07-11 14:14:08 -07:00
Vance Ingalls 8bbd5a6496 fix(cli): settle post-seek font subset loads before audit screenshots 2026-07-11 14:14:08 -07:00
Vance Ingalls 1b95af8bbb fix(engine): densify drawelement self-verify with parallel worker count 2026-07-11 14:14:08 -07:00
Vance Ingalls ddcd380a1a fix(producer): withhold de parallel router below a machine ram floor 2026-07-11 14:14:08 -07:00
Vance Ingalls e37ebe7999 fix(producer,engine): gate drawelement on ancestor background-image + tail verify sample (#2247)
## What

Two fixes from adversarial testing of the DE parallel router (10 hostile comps, routed vs screenshot-baseline PSNR). The router itself held — both bugs are in general drawElement fast capture, and one slipped past self-verify.

### 1. Compile gate: ancestor background-image (`producer`)

`drawElementService`'s per-frame ancestor fill replicates what lies behind the captured subtree by walking up the DOM for the nearest non-transparent **`backgroundColor`**. A background-**image** (`linear-gradient`, `url()`) on `body`/`html`/a wrapper reads as transparent in that scan, so a deeper ancestor's solid color paints instead wherever the subtree leaves pixels uncovered.

Measured repro: body `linear-gradient` + html solid color + an element shrinking late in the comp → DE paints the html purple instead of the body gradient. 30.9 dB min frame vs baseline, visually unmistakable. Identical damage single-worker and parallel — general DE bug, in every wild DE render matching this (very common) authoring pattern.

Fix: `detectAncestorBackgroundImage()` in the compiler (DOM-aware — inline styles on the root's ancestor chain + `<style>` rules resolved via `querySelectorAll`, so class-selected wrappers are covered; backgrounds *inside* the root are deliberately not matched). New compile gate `ancestor_background_image`, same shape as the 3D/mix-blend gates, bypass `HF_FAST_CAPTURE_ANCESTOR_BG=true`.

### 2. Self-verify tail sample (`engine`)

The verify grid sampled at `(i+1)/(k+1)` → [20/40/60/80]% of the timeline. The damage above starts at ~79% and peaks after the last sample — verification **passed** on output that bottomed at 30.9 dB (threshold 32 dB would have caught it, it just never looked there).

Fix: `computeDeVerifySampleFractions()` — first k−1 samples evenly spaced, last pinned at 95%. Default k=4 grid becomes [25/50/75/95]%. Kills the whole late-onset damage class, not just this repro.

## Validation

- Repro comp (body gradient + shrink reveal): now gates → baseline route, 54.7 dB avg vs ground truth (was 41.6 avg / 30.9 min with the purple surround)
- Control comp (nested stacked fades, routed): still routes, verify grid `[90, 180, 270, 342] of 360`, passes, 60.6 dB avg — unchanged
- Full adversarial matrix context: 6/10 comps routed clean (49–68 dB min), blend/3D gated correctly, animated-canvas damage caught by verify at 16.5 dB with clean revert, video comps route legitimately (frames pre-extracted)
- Tests: 7 new detection cases (`htmlCompiler.test.ts`), 5 new grid cases (`frameCapture-verifySampleFractions.test.ts`); `compileStage.test.ts` + `frameCapture.test.ts` suites green

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-07-11 14:13:09 -07:00
vanceingalls 2cd8a750e3 docs(producer): note attempt-scoped beginFrameReuse semantics after partial retries 2026-07-11 20:32:20 +00:00
vanceingalls dde3afb72e feat(producer): surface beginframe no-damage reuse counters in perf summary and telemetry 2026-07-11 19:44:24 +00:00
Vance Ingalls 0809c98518 fix(producer,engine): gate drawelement on ancestor background-image + tail verify sample 2026-07-11 12:00:25 -07:00
Vance Ingalls 7498eb4a3a chore: release v0.7.52 2026-07-10 19:47:59 -07:00
Vance Ingalls 469cfb3a32 Merge pull request #2115 from heygen-com/de-parallel-router-failure-telemetry
feat(producer,cli): full telemetry visibility for DE parallel-router/inversion failures
2026-07-10 18:24:11 -07:00
Vance Ingalls 2d17e34b90 Merge pull request #2189 from heygen-com/fix/sdk-template-gsap-resolver-parity
fix(sdk): include template GSAP scripts in resolver parity
2026-07-10 18:22:34 -07:00
Vance Ingalls 392dd410a5 Merge remote-tracking branch 'origin/main' into de-parallel-router-failure-telemetry
# Conflicts:
#	packages/cli/src/telemetry/config.ts
2026-07-10 18:15:12 -07:00
Vance Ingalls a61f7de8d7 fix(sdk): align template script traversal 2026-07-10 17:36:09 -07:00
Vance IngallsandClaude Opus 4.8 b02703b7c9 fix(cli,producer): opt-in trial polarity + narrowed-fallback-flag docs (review)
Two non-blocking review notes from Rames, both addressed:

1. Trial polarity inverted to OPT-IN: disableDeParallelRouterTrial →
   enableDeParallelRouterTrial. renderLocal is exported, so any programmatic
   consumer (future studio-server path, test harness, distributed runner)
   previously inherited the trial and its process-wide env-var/module-latch
   state without knowing to disable it — and concurrent invocation races
   that state. Now only the CLI's own sequential call sites opt in (the
   single top-level render, and batch at concurrency 1); everyone else gets
   no trial by default. The doc comment names the sequential-invocation
   assumption explicitly.

2. deSelfVerifyFallback semantic narrowing documented at both declarations
   (RenderCaptureObservability + RenderPerfSummary.drawElement): since the
   pinned-fallback retry was widened, the flag means verify-triggered
   SPECIFICALLY — OOM/capture_error fallbacks report false with
   deFallbackReason carrying the reason. Dashboards keyed on
   de_self_verify_fallback=true as "any fallback fired" must migrate to
   de_fallback_reason IS NOT NULL (also called out in the PR body for the
   observability rebuild to pick up).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-10 17:24:13 -07:00
Vance Ingalls 46602d75f4 fix(sdk): include template GSAP scripts in resolver parity 2026-07-10 16:55:19 -07:00
Vance IngallsandClaude Fable 5 6172d79dc2 fix(cli): atomic config writes, gated trial warning, and write-failure signal
Five findings from a fifth (final scoped) max-effort review of the previous
commit, all local:

1. writeConfig now writes atomically (pid-suffixed temp file + renameSync —
   rename within one directory is atomic on POSIX). This closes the real
   hazard behind the review's torn-read finding: readConfig's corrupted-file
   catch RESETS the config to defaults (telemetry re-enabled, anonymousId
   rotated, trial fields wiped), so a concurrent reader catching a
   non-atomic write mid-flight would silently destroy the user's config —
   and the previous commit's per-render readConfigFresh() at the arm site
   multiplied exposure to exactly that window. Verified against a real
   filesystem, not just the mocked unit tests.

2. writeConfig now returns whether the write landed (errors still swallowed
   — telemetry must never break the CLI). persistDeParallelRouterTrialFired
   uses it to stop immediately on a genuine fs failure (retrying an
   unwritable file is pointless) and reserve its retries for actual
   concurrent clobbers, instead of 3 blind write attempts + 4 disk reads.

3. The persistence-failure console.warn is now !quiet-gated like every
   other trial message — a quiet/batch-json render on an unwritable
   ~/.hyperframes no longer emits unexpected stderr that CI wrappers
   asserting empty stderr would misread as a render failure. The in-process
   latch already guarantees the safety behavior whether or not the warning
   prints.

4. The arm site short-circuits on the in-process fired latch BEFORE the
   fresh config read — post-fired batch rows no longer pay a per-row config
   read + parse + shared-cache invalidation for an answer module state
   already knows.

5. Replaced the new `as T` assertions in render.test.ts's config-state
   factory with an explicitly typed vi.hoisted return (repo TypeScript
   convention: no `as T`).

config.test.ts: node:fs mock gains renameSync (faithful to the new atomic
write); new test covers the success/failure return and asserts no temp file
survives a write.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 14:51:11 -07:00
Vance IngallsandClaude Fable 5 2542e94277 fix(cli): stale-cache arm reads, retry double-count, and unwritable-config re-arm in DE trial
Three root causes from a fourth max-effort review (15 raw findings deduped;
the synthesize step died on a session limit so they arrived unmerged):

1. The previous commit's telemetryEnabled fix was ineffective: the arm site
   passed readConfig() — the process-lifetime cache — into
   isDeParallelRouterTrialBlocked, making it exactly as stale as the
   shouldTrack() memoization it claimed to bypass. A mid-batch
   `hyperframes telemetry off` (or another process persisting fired=true)
   was never observed. Now reads readConfigFresh() at the arm site; the
   test mock previously hid this because readConfig/readConfigFresh were
   behaviorally identical views over one shared object.

2. The verify-and-retry write loop double-counted a render whenever OUR
   write landed but a concurrent writer advanced the file before our
   verify read — the retry re-applied the increment on top (two renders
   → three counts), tripping the 25-render exposure cap early and
   permanently killing the trial with less telemetry than the cap was
   designed to allow. Reworked: the render COUNTER is written exactly
   once, unverified (a lost increment under-counts by one — benign); only
   the FIRED flag is verified and re-asserted, which is idempotent, so
   retries can no longer corrupt anything
   (persistDeParallelRouterTrialFired).

3. writeConfig swallows all fs errors, so on an unwritable ~/.hyperframes
   a reverted outcome could never persist — the trial would re-arm and
   re-fail on every subsequent render forever, silently. Added an
   in-process fired latch (set at decision time, before persistence is
   attempted) consulted by the blocked-check, plus a one-time console
   warning when persistence exhausts its attempts. Later processes still
   re-arm (disk is the only cross-process channel), but each process now
   stops after at most one failure it couldn't record.

Test infrastructure fix enabling all of the above to be tested: the config
mock now models disk vs cache SEPARATELY (readConfig serves the cache,
readConfigFresh re-reads "disk", writeConfig updates both) with a
failWrites hook simulating the real writeConfig's silent error swallowing.
The old single-shared-object mock made cached-vs-fresh mis-routing and
retry iterations untestable by construction.

3 new regression tests: mid-batch opt-out observed through the cache;
fired flag re-asserted after a lost write WITHOUT re-counting the render;
unwritable-config latch blocking re-arm. 56 tests total across
render.test.ts + config.test.ts.

Not fixed (by design): the widened pinned-fallback retry paying a doubled
render on deterministic mid-stream failures (e.g. ENOSPC) — the accepted
tradeoff of the fallback design; cancellation and OOM are special-cased.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 13:59:57 -07:00
Vance Ingalls 6152437d2a chore: release v0.7.49 2026-07-10 09:57:48 -07:00
Vance IngallsandClaude Sonnet 5 dc6df93de5 fix(cli): fix concurrency race, none-vs-undefined bug, and 3 more DE trial gaps
Six findings from a third max-effort code review, focused on the previous
commit's fixes:

1. --batch-concurrency N>=2 runs genuinely concurrent renderLocal() calls
   (Promise.all workers in batchRender.ts), which can't safely share the
   trial's one process-wide env var + module flag — a row finishing first
   could tear down the env var/flag mid-render for a sibling row still in
   flight. Rather than attempt to make shared process-global state safe
   under real concurrency, added RenderOptions.disableDeParallelRouterTrial
   and set it whenever batchConcurrency > 1 — the trial simply isn't
   offered when it can't be evaluated safely.

2. maybeConsumeDeParallelRouterTrial's "outcome === undefined" no-op guard
   almost never fired: aggregateDrawElement (perfSummary.ts) defaults
   parallelRouter to the string "none" for every render, whether or not
   drawElement/the router ever engaged — never undefined. Every ordinary
   render below the router's own frame threshold (the common case) was
   ticking the render-count backstop, tripping
   DE_PARALLEL_ROUTER_TRIAL_MAX_RENDERS after 25 completely unrelated
   renders that never touched the router. Now treats "none" the same as
   undefined.

3. isDeParallelRouterTrialBlocked relied solely on shouldTrack(), which
   memoizes its verdict once per process — during a long --batch run, a
   `hyperframes telemetry off` issued from another terminal mid-batch would
   never be observed. Restored a direct config.telemetryEnabled check
   (read fresh every call, unlike shouldTrack()'s cache) alongside it.

4. maybeConsumeDeParallelRouterTrial's config write had no way to detect a
   losing race against a concurrent process — added a verify-and-retry
   loop (write, re-read fresh, retry up to 3x if a concurrent writer
   landed in between) that narrows the window further without a full
   file-locking rewrite.

5. The trial could arm before the first-run telemetry disclosure
   (showTelemetryNotice) was guaranteed to have printed — that notice runs
   via a fire-and-forget, unawaited dynamic import in cli.ts with no
   ordering guarantee relative to the render command. Rather than touch
   that pre-existing async bootstrap chain, gated the trial on
   config.telemetryNoticeShown: it simply never offers itself on a fresh
   install's very first invocation.

6. Added a dedicated config.test.ts exercising readConfig/readConfigFresh/
   writeConfig through the REAL module (node:fs mocked with an in-memory
   fake, not a HOME-env hack) — readConfigFresh's cache-bypass and the
   type-guarded boolean/number parsing had zero coverage through the real
   implementation before this.

Also fixed the test fixture that was supposed to cover finding #2 but used
an unrealistic `drawElement: {}` shape instead of the real
`{ parallelRouter: "none" }` aggregateDrawElement actually produces.

Extracted applyDeParallelRouterOutcome to keep maybeConsumeDeParallelRouterTrial
under the repo's complexity gate after adding the retry loop.

11 new/updated tests in render.test.ts (56 total) + 7 new tests in
config.test.ts. Verified against fallow's audit gate clean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-10 00:31:11 -07:00
Vance IngallsandClaude Sonnet 5 532dad7cc7 fix(cli): fix batch re-entrancy, config race, exposure cap, and shouldTrack gap in DE trial
Four confirmed findings from a max-effort code review of the CLI trial
mechanism:

1. maybeEnableDeParallelRouterTrial's `process.env.HF_DE_PARALLEL_ROUTER
   !== undefined` guard couldn't distinguish "the user set this" from "an
   earlier renderLocal() call in this same process already armed it" — so
   in --batch (all rows share one process), only row 1's outcome could
   ever reach maybeConsumeDeParallelRouterTrial. A revert on any later row
   was silently never persisted. Added a module-level
   deParallelRouterTrialManagedByUs flag to disambiguate, with a test-only
   reset export since it's process-lifetime state a real CLI invocation
   never needs to reset but a test suite sharing one module instance does.

2. writeConfig is a non-atomic whole-file overwrite with no locking, and
   readConfig's cache never invalidates — a concurrently running second
   CLI process (another terminal, a parallel script; doesn't even need to
   be a render, any command calls incrementCommandCount) could silently
   clobber a just-persisted deParallelRouterTrialFired:true with its own
   stale snapshot. Added readConfigFresh (bypasses the cache) and use it
   immediately before the trial's read-modify-write, narrowing the race
   window without a full config-subsystem locking rewrite.

3. The prior commit's semantics flip removed the only exposure cap — a
   healthy router that never reverts now force-enabled the experimental
   path on every eligible render forever. Added
   DE_PARALLEL_ROUTER_TRIAL_MAX_RENDERS (25) as a backstop: the trial turns
   off after this many engaged renders even absent an actual failure.

4. maybeEnableDeParallelRouterTrial only checked config.telemetryEnabled,
   not shouldTrack() — so a dev-mode run or a DO_NOT_TRACK/
   HYPERFRAMES_NO_TELEMETRY user got the experimental path silently armed
   while telemetry was simultaneously blocked underneath it. Now gates on
   shouldTrack() (a strict superset).

Also fixed, lower severity: readConfig's deParallelRouterTrialFired/
deParallelRouterTrialRenderCount parsing now validates the JSON type
explicitly instead of a bare truthy/nullish read, so a hand-edited or
corrupted config can't have the string "false" misread as truthy.

Refactored maybeEnableDeParallelRouterTrial into three smaller functions
(isDeParallelRouterTrialBlocked, stopManagingDeParallelRouterTrial) to
bring cyclomatic/cognitive complexity back under the repo's threshold —
also de-duplicates the "stop managing the env var" logic shared with
maybeConsumeDeParallelRouterTrial.

14 new/updated tests (43 total in render.test.ts), including a direct
regression test for the batch re-entrancy scenario and a loop test for the
render-count cap. Verified the config primitives end-to-end against a real
file, not just the mocked unit tests.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-09 22:55:29 -07:00
Vance IngallsandClaude Fable 5 2f958d1197 docs(prompting): complete plan — variant validation, vocab clips, worked specs, measured motion
Validates 16 more published prompts end-to-end (variants across every
video type, caption styles, overlays with proven alpha, code diff and
highlight, edit verbs against the real attribute map, a generated-avatar
talking-head through embedded-captions, a presented slideshow deck) and
fixes every prompt flaw the builds surfaced. Adds keyword-to-render
grids for the easing, camera, and marker vocabulary; two more worked
visual specs with renders; a measured before/after pair proving the
motion grammar (frozen frames vs all-alive, 211KB vs 2.5MB); before/
after render pairs on editing and generated-artwork pages; and proof
renders on the overview.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 22:21:12 -07:00
Vance IngallsandClaude Fable 5 99ff79bc60 docs(prompting): polish pass — verify facts against sources, fix staleness
Five-way review of the section against docs.json, catalog pages, and
skills. Fixes: stale /hyperframes-media skill row (real name /media-use)
plus missing music-to-video and slideshow workflow rows; caption
identity misattributions (keynote/documentary are scene-embedded, stomp
carries no rail); prompts violating the guide's own ambient-idle rule;
grounded keying rationale (u2net_human_seg); broken forward references;
nested-backtick code spans; brand casing and frontmatter dash
consistency throughout.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 22:21:12 -07:00