Skip to content

fix(embedded-captions): support heroless themes - #3632

Merged
miga-heygen merged 1 commit into
mainfrom
bugfix/1787766784.915709-heroless-hero
Sep 4, 2026
Merged

miga-heygen merged 1 commit into
mainfrom
bugfix/1787766784.915709-heroless-hero

Conversation

@heygengenesis

@heygengenesis heygengenesis Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

What

Omitting documented-optional theme.hero now compiles every shipped theme as a pure-body caption timeline rather than emitting -999 hero timings. Hero-present timelines retain their existing behavior.

Why

Reported by @miguel-heygen

Fixes #3628.

How

The generator previously used -999 only as an internal absent-hero sentinel, but body-yield and front-FX emitters still consumed it. This keeps the sentinel internal by omitting hero-coupled emitters in pure-body mode and guarding the two optional-hero accesses; ordinary body/furniture generation remains intact.

Exact source map — base defect → published fix

make-theme.cjs (every changed source hunk):

New regression assets (no base counterpart): test L1-L82, theme fixture L1-L11, and transcript fixture L1-L10.

Test plan

  • node --test skills/embedded-captions/scripts/make-theme.test.mjs — PASS: 26 tests, 25 theme subtests, 0 failures.
  • npx --yes [email protected] --check skills/embedded-captions/scripts/make-theme.cjs skills/embedded-captions/scripts/make-theme.test.mjs skills/embedded-captions/scripts/fixtures/heroless/theme.json skills/embedded-captions/scripts/fixtures/heroless/transcript.json — PASS.
  • node --check skills/embedded-captions/scripts/make-theme.cjs — PASS.
  • git diff --check — PASS.
  • Direct compiler matrix — PASS: all 25 themes, including terminal, spectrum, and background-layer lastpage; generated HTML has no -99x sentinel values.
  • Full Bun CI was not run because Bun is unavailable; the dedicated skills test is Node-only.
  • Runtime browser assertion was not claimed. Blocker command/error: node skills/embedded-captions/scripts/preview-frames.cjs <compiled-project> 2.4 → timeline never registered in <page>; open embedded-captions: preview-frames.cjs is broken by a gsap SRI mismatch (hard-coded 3.14.2 vs installed 3.15.0) #3629 is a GSAP SRI mismatch—preview interception returns workspace 3.15.0 against the generated page's 3.14.2 integrity, so window.__timelines.main does not register. No runtime video/frame evidence occurred.

Durable generated-output evidence: BEFORE arcade rail · AFTER arcade rail · compile matrix.

  • Manual testing performed (blocked as above; no runtime artifact is represented as evidence).
  • Documentation updated (not applicable).
Reviewer notes (1) · Forensics
  • [0.96] Permanent Node test lacks runtime duration/visibility coverage at make-theme.test.mjs:76.

Memory: video-rendering, text-editor

## Evidence audit (2026-09-04)

Base defect permalinks (the source map above links every published hunk at head):

Durable compiler e2e artifacts (generated pages/logs):

The browser-preview command could not produce screenshots in this compiler-only sandbox: node skills/embedded-captions/scripts/preview-frames.cjs /tmp/bugfix-3628-artifacts/stage5/after/arcade 2.4 exited 0 with [preview] need puppeteer+sharp — set HYPERFRAMES_ROOT. No screenshot is claimed. The separate #3629 SRI mismatch remains outside this PR.

Regression fails on the unfixed base: after checking the committed test and fixture into a detached 19a512c05a5929a9860ef97ee47812c5e7108e57 worktree, node --test skills/embedded-captions/scripts/make-theme.test.mjs exited 1 on the emitted -999 positions; full failing output.

@miga-heygen miga-heygen 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.

Reviewed at 4e610359a6. Looks correct and complete — approving.

What I checked:

  • All 17 b.yield blocks are gated behind !HEROLESS && — the main source of hero-coupled GSAP emitters that were leaking the -999 sentinel.
  • frontFx() bypassed entirely in heroless mode: HEROLESS ? { css: "", html: "", js: "" } : frontFx().
  • Both null-access crashes guarded: terminal and spectrum themes' hero.start/hero.end dereferences are now behind hero &&.
  • lastpage paradigm fields (CSS/HTML/JS) all wrapped in !HEROLESS blocks.
  • Setpieces already gated at L8495 via !heroInline && !HEROLESS, so heroIn/heroOut refs inside setpiece functions are unreachable in heroless mode.
  • lockT (computed from heroIn at L773) is harmless — only consumed in a hero && redactLinkage ternary that short-circuits to 0 when hero is null.
  • Hero-present themes are unaffected — all guards are !HEROLESS && prefixes that pass through normally.

Test quality: Strong. The -99\d regex assertion across all 25 themes' generated pages catches any leaked sentinel. The heroless fixture is minimal and well-scoped.

One CI note: Skills: manifest in sync is failing — likely needs the new test file registered in the manifest. Not a code defect.

— Miga

@heygengenesis
heygengenesis Bot force-pushed the bugfix/1787766784.915709-heroless-hero branch from 4e61035 to 225a880 Compare September 4, 2026 13:40
@miga-heygen
miga-heygen enabled auto-merge (squash) September 4, 2026 13:52
@heygengenesis
heygengenesis Bot force-pushed the bugfix/1787766784.915709-heroless-hero branch from 225a880 to 32275a1 Compare September 4, 2026 18:17
@heygengenesis
heygengenesis Bot requested a review from miga-heygen September 4, 2026 18:19

@miga-heygen miga-heygen 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.

Re-approved at 32275a1 after rebase. Manifest regenerated (142 embedded-captions files), CI green. Same fix — heroless themes skip hero-derived emitters, both null accesses guarded, 25-theme regression fixture intact. Auto-merge enabled.

— Miga

@miga-heygen
miga-heygen merged commit 62d3304 into main Sep 4, 2026
77 checks passed
@miga-heygen
miga-heygen deleted the bugfix/1787766784.915709-heroless-hero branch September 4, 2026 18:27
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.

embedded-captions: a heroless theme.json silently corrupts the timeline in 18 of 25 themes (2 crash)

2 participants