Commit Graph
1106 Commits
Author SHA1 Message Date
James RussoandClaude Opus 5.5 faff4e16a8 feat(studio): read overlay geometry from an opaque preview over its channel (#7628)
* feat(studio): read overlay geometry from an opaque preview over its channel

The runtime's editing channel gains a `geometry` request: per element
handle its client rect, the corners it paints at when rotated, whether it
renders, its clip-path, its source boundary's size, a group wrapper's
member rects, and optionally one element's descendant boxes. On a preview
frame Studio cannot script, the selection, child, group and hover boxes,
the root scale (from the mirrored stage size) and a press held across a
preview change read that geometry, with one read in flight at a time.
Same-origin frames keep reading the DOM directly; the measuring code they
use now lives in core so both paths share one rule.

Also from the review of #7613: opaque selections carry `hasAudio` and
`src` read off the description, a description with a cut attribute or
inline style builds no selection, a failed computed-styles or root read
builds none either, and the group refresh threads its frame and leaves a
group the user changed meanwhile. `findClosestByAttribute`, left without
a caller by #7613, is removed.

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

* chore(producer): raise the packed size budget for the runtime's geometry read

The producer ships the preview runtime, which now carries the editing
channel's `geometry` request and the measuring code it shares with Studio.
The packed tarball measured 888,810 bytes in CI against an 880,000 budget.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 00:26:30 +00:00
James RussoandClaude Opus 5.5 aed4c18feb feat(studio): timeline select and selection refresh read an opaque preview over its channel (#7613)
* feat(studio): timeline select and selection refresh read an opaque preview over its channel

On a preview frame Studio cannot script, timeline select, a selection
refresh and a group refresh build the selection from the runtime's element
descriptions. The rules that pick the element (group capture and drill-in,
the clip ancestor, the walk to an addressable element, timeline-locked, the
lookups and the master-view root fallback) move to a pure module over an
ancestor chain, used by both paths, so both select the same element.
Same-origin frames keep their direct reads.

The editing port gains `ancestors` (each handle's chain, parent first) and
`query` (a selector's matches with their source facts), and
`computed-styles` also names its element by handle. An opaque selection
carries the element's handle; its `element` is a tag-only stand-in in a
document with no window.

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

* chore(studio): keep the selection rules' comment share at the package's

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 22:39:47 +00:00
James RussoandClaude Opus 5.5 e1ddb2e162 feat(core): runtime element handles for the editing channel (#7603)
* feat(core): runtime element handles for the editing channel

The runtime gives each element a numeric handle for one page load and
answers two new editing-port requests: `elements-at-point` (the stack under
a viewport point) and `describe` (handles to plain-data descriptions). Each
description carries the element's stable selector, the source facts Studio
resolves to a file, earlier class-selector matches counted per source,
attributes, inline styles, text, child handles and its client rect.

The stable-selector rule and source-attribute read move to core so Studio
and the runtime address elements one way; Studio re-exports them and
resolves a description's source file and selector index with its own map.

Studio adds `PreviewElement` (a checked description) and client helpers.
Every channel read now gives up after the agent probe when the frame's
runtime has no editing agent, as the seek wait already did. `computed-styles`
accepts custom property names with any case or `_`.

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

* fix(core): per-load element handles and a light elements-at-point reply

Handles are now "<load>:<n>" strings, where the load id is random per page
load, so a handle from an earlier load reads as null like a removed
element. `describe` checks the exact format.

`elements-at-point` returns only {handle, tag, rect}; callers describe the
one they keep. Descriptions cap each attribute and inline-style value, keep
only a `data:` value's header, leave <script> and <style> text out, and say
when anything was cut. A handle's entry goes once its element is collected
or found disconnected.

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

* fix(core): draw the element-handle load id on first use

A render seeds crypto.getRandomValues from virtual time, so drawing the
load id when the runtime loads shifted every random value the composition
drew after it, and the random-stagger-workers render no longer matched its
baseline. The id is now drawn the first time a handle is made, which a
render never does.

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

* fix(core): keep a parked element's handle, and cut data: headers only from values

A scene the preview parks and puts back keeps its element handles: an entry
now goes only once its element is garbage-collected. Text that starts with
"data:" is no longer cut to a header; that rule applies to attribute and
inline-style values.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 14:13:18 +00:00
James RussoandClaude Opus 5.5 01618d504a feat(studio): picker styles and composition size read an opaque preview over its channel (#7602)
First slice of moving Studio's selection and overlay readers off the
preview frame's DOM. Same-origin frames keep their direct reads; only a
frame Studio cannot script takes the new paths.

- Runtime editing port: a validated computed-styles request, answered
  with the same logical opacity Studio reads (moved to core).
- Element picker: on an opaque frame, the picked element's computed
  styles come from the runtime. Picker posts are taken only from an
  origin the posting frame can have.
- Composition rect: an opaque frame's declared size comes from the
  runtime's stage-size post, mirrored only for registered frames and
  their origins.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 10:59:31 +00:00
James RussoandClaude Opus 5.5 940963afaa feat(studio): playback and timeline reads go over the preview's message channel (#7561)
* fix(core): a later connect from the preview parent gets a fresh editing port

A parent that disposes its editing client and creates a new one for the same
frame (a remount that keeps the iframe) used to wait forever: the runtime
handed its port over once per page load. Each valid connect from the parent
now closes the previous port and hands over a new one. Connects from any
other sender are still ignored.

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

* feat(studio): playback and timeline reads go over the preview's message channel

Prepares Studio's preview to run on an opaque origin, where the parent cannot
read the frame's window.

- previewChannel: one editing-port client per frame load, plus the loop start,
  seek-painted and clip-manifest reads over it.
- bridgePlayback: a playback adapter that sends play, pause and seek as
  control-bridge messages and mirrors the runtime's state and timeline posts.
  It is used only for a frame Studio cannot script; a same-origin frame keeps
  the direct adapter.
- The loop start and the state-tick manifest recovery now always use the
  editing port. The shadow reload's seek-painted wait uses it for a frame
  Studio cannot script.

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

* refactor(core,studio): trim comments back under each file's comment share

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

* fix(studio): keep the direct loop-start and manifest reads for frames Studio can script

A host can pair this Studio with a runtime older than the editing port. The
loop start and the state-tick manifest recovery now read a same-origin frame
directly, exactly as before; only a frame Studio cannot script uses the port.
previewFrameOpaque replaces previewFrameScriptable and treats a frame with no
window as not opaque, so a detached frame keeps its old no-op path too.

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

* fix(core,studio): keep every editing port the parent receives working on an opaque preview

The runtime posts ready before it installs its editing agent, so a client can
connect twice and receive two ports. Closing the earlier port on each connect
left a client that took the first one with a dead channel for the rest of the
frame load. The agent now keeps earlier ports open (a disposed client closes
its own end) and closes all of them on teardown.

For an opaque preview:
- the restore-seek wait gives up after a 1 s probe when no editing port
  arrives, so a runtime without the agent no longer holds a reload for 15 s;
- the bridge playback mirror keeps a seek until the runtime confirms it, so
  a state posted before the seek cannot undo a quick frame step;
- sceneSwapFor returns no swap instead of reading the frame's window, so a
  reload falls back to a full reload.

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

* fix(studio): call a frame opaque only when its window refuses a read

previewFrameOpaque treated any frame whose contentDocument was null as opaque.
A same-origin window can still report a null contentDocument (an iframe that is
not in the document), and that sent it down the opaque path. A frame is opaque
now only when reading its window's document throws, as it does across origins.

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

* fix(studio): mirror playback only from preview frames Studio built, at frame precision

The bridge playback mirror took a state or timeline post from any window and
made a mirror for it. It now takes a post only from a frame Player registered
(watchPreviewFrame, called before the frame loads, so the boot-time timeline
is not missed), and only when the post's origin is one that frame can have:
null for an opaque sandbox or a data: URL, the parent's origin for srcdoc,
about: or no src, else the origin of its src.

A pending seek now counts as confirmed by the frame the runtime lands it on,
the frame at or before it, rather than by a 1 ms match. An off-grid seek used
to drop every state post for 500 ms, freezing the playhead and its play state.

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

* test(studio): keep the editing-client tests' fake frame detached from the document

Main's test harness now attaches its fake iframe, and happy-dom then fires
that frame's about:blank load on its own, which ends the editing client's
frame load mid-test. These tests build their own detached frame instead.

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

* test(studio): share the detached fake frame with the manifest router test

The manifest router test had the same race: the attached harness frame's own
about:blank load ended the editing client before the port answered, which
lost on the slower Windows runner. The harness now exports
detachedFakeIframe, which makeFakeIframe builds on, and both opaque-frame
test files use it.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 09:45:33 +00:00
Miguel Ángel 303a4c4771 fix(core): show a paused video frame with the same color as the playing video on Mac (#7584)
* fix(core): show a paused video frame with the same color as the playing video on Mac

On macOS Chromium the video layer shows 8-bit SDR video with Apple's video gamma while a canvas shows the decoded pixels as sRGB, so a paused frame looked lighter-to-darker than the playing video. One module now owns the conversion and the paused stand-in canvas is displayed through it.

* fix(core): drop a comment line to keep the file's comment share down

* fix(core): correct a paused frame only for a source the scan reports as 8-bit, on both hold paths

Source facts now come from the shared media lookup (origin-aware, exact then longest suffix then normalized), unknown depth is left alone, and the native-only seek hold gets the same display helper.

* fix(core): shorten two comments to the line limit
2026-11-12 05:44:27 +00:00
Vance IngallsandClaude Opus 5.5 6cc734fd24 feat(core): motion blur preview draws fewer filter copies at lower preview quality (#7547)
* feat(core): motion blur preview draws fewer filter copies at lower preview quality

The filter tier's preview draws 16 copies at preview quality 1/2 and 8 at 1/4 and
below; renders keep 32. Preview facts now list those levels in lighterAt once the
filter tier has movers, so a host that steps quality down on choppy playback can do
so for a film whose only load is blur.

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

* refactor(core): name the blur preview copies instead of commenting them

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 23:01:58 +00:00
Michael WangandClaude Opus 5.5 a243169f8a fix: keep private project files out of preview bundles and local sharing (#7563)
* fix(core): keep git metadata and env files out of bundled HTML

The bundler now checks every file it reads against the project's private
paths (git metadata and env files, spelled directly or through a link)
and leaves a refused reference as authored instead of inlining it.
Bundle options gain a canRead predicate; Studio's preview passes its own
private-file rule so the preview document matches what the file routes
serve.

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

* fix(studio-server): check capture read grants against the decoded path

A capture page's read grant now looks at the path the way the static
preview route decodes it, including encoded separators, so a URL that
resolves to a dotfile or into a dot-folder gets no CORS grant. Ordinary
project files keep loading in thumbnails.

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

* fix(cli): accept local share requests only from loopback connections

The local share routes already require loopback Host and same-origin
headers. They now also require the connection itself to come from this
machine, so a Studio bound to a network address still keeps sharing
local to the person running it.

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

* fix(studio-server): ask the bundler for Studio's private-file rule as plain data

The preview route passed a fresh `canRead` callback on every build. A host that builds on a
worker thread cannot send a function across, so it built on its own thread, and it could no
longer share one build between two same-content requests.

The bundler now takes `privateFiles: "studio"`, a plain string, and applies Studio's
private-file rule itself. That rule (git metadata, env files, and the app's records under
`.hyperframes/`) now lives in `@hyperframes/core/safe-path`, and studio-server reuses it.
The `canRead` option is removed.

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

* fix(studio-server): do not serve a preview main file linked to a private file

When index.html (or <id>.html) is a link to an env file or into git metadata, the
bundler refuses it and the route falls back to reading the main file from disk. That
fallback now skips a candidate that is a private project file, by the same rule the
file routes use. A main file linked from outside the project is still served.

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

* fix(producer): never inline git or env files as render sub-compositions

The render compiler resolved data-composition-src and inlined the file it named, so
`data-composition-src=".env"` put the env file's text into the render page. It now
refuses git metadata and env files with the same shared rule the bundler uses. The
pre-render check names the refused reference and stops the render.

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

* chore: raise the inspector unpacked size budget to 3,722,000 bytes

The inspector already sat about 36.8 KB over its 3,684,092 budget, just inside the 1%
tolerance. Moving Studio's private-file rule into core added a few hundred bytes to the
bundles it ships, which pushed it to 3,721,419 bytes and over the tolerance.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 19:31:24 +00:00
James RussoandClaude Opus 5.5 ef5cdeb0a0 feat(core): give the preview parent a typed editing port to prepare for an opaque frame (#7556)
* feat(core): give the preview parent a typed editing port to prepare for an opaque frame

Studio reads the preview frame's window and document directly, which stops
working once the preview runs in an opaque origin. This adds the runtime half
of the replacement, with no Studio consumer changed yet:

- runtime/editingPort.ts: a versioned request/reply protocol, a validator
  that turns any bad request into a typed error, and a promise-based parent
  client with request ids, timeouts and dispose. Exported as
  @hyperframes/core/runtime/editing-port.
- runtime/editingAgent.ts: on the parent's connect, the runtime hands
  window.parent a MessagePort once and answers hello, runtime-snapshot,
  wait-for-seek and set-loop-start on it. A connect from anything but the
  parent is ignored and does not use up the handoff.

Playback transport stays on the existing control protocol.

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

* fix(core): type the handed-off port under the runtime's strict index checks

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

* fix(core): emit the editing-port module so the published subpath resolves

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

* chore(producer): raise the packed size budget for the runtime's editing agent

The producer ships the preview runtime, which now carries the editing agent
and its request validator. The packed tarball measured 878,763 bytes in CI
against an 870,000 budget.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 16:54:46 +00:00
Miguel Ángel f312fca7e2 feat(producer): fail a render whose variables the page does not declare (#7548)
* feat(producer): fail a render whose variables the page does not declare

* chore(producer): keep the comment share and the dead-code audit clean for the variables check
2026-11-11 08:46:13 +00:00
Miguel Ángel f36463e292 fix(core): fall back to a direct write when link() is denied with EACCES (#7474)
* fix(core): fall back to a direct write when link() is denied with EACCES

On Android app data (Termux, SELinux enforcing), link(2) fails with
EACCES in a folder the temp file was just written to. createFileAtomically()
and the studio history owner lock treated that as fatal, so
`hyperframes init` left a half-scaffolded project and every render logged
a recordRenderSuccess failure. Both now take their existing exclusive
direct-write path, as they already do for EPERM.

Fixes #7473

* fix(share): treat EACCES as no hard links in the project share lock

Same Termux/SELinux link() denial as core and the studio history lock:
the share lock's link-then-exclusive-create fallback now covers it too.
Folds the Android note into the existing comment so no file's comment
share rises.
2026-11-11 08:17:42 +00:00
Miguel Ángel 789d281211 fix(producer): render variable-bound media at the bound clip's length and loudness (#7529) 2026-11-11 03:15:45 +00:00
Michael WangandClaude Opus 5.5 b8bb491900 fix(studio-server): harden preview paths, cache folders and local servers (#7510)
* fix(studio-server): keep cache writes inside the project and canonicalize preview paths

- The tool's own folders (.hyperframes records, backups, preview documents,
  .thumbnails, .transcode-cache) are no longer written, pruned or emptied
  through a link that points outside the project. Thumbnails are still
  served when their cache folder is a link; they are just not cached.
- The hf-id stamp record and the history id are replaced atomically instead
  of written through an existing link.
- Sub-composition previews and thumbnails use the composition's canonical
  project-relative path, and the path is attribute-encoded in the document.
- Thumbnail requests from another site are refused before any capture.
- Saved GSAP scripts escape a `</script` sequence so the script element
  keeps its contents.

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

* fix(core): refuse a UNC or device path on another root before any disk access

isSafePath now rejects a target whose root is a UNC or device root other than
the project's own before it calls realpath or lstat. Projects on a share keep working.

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

* fix(studio): answer WebMCP clients only from Studio's own page

The polyfill now starts with its tab transport limited to Studio's origin and
its frame transport off, so a page that frames Studio cannot list or call its tools.

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

* fix(inspector): check Host on the per-session preview server

The preview page server applies the inspector API's loopback Host rule, so a
rebound DNS name cannot read the bundled composition or project files.

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

* revert(studio-server): keep writing media proxies through a linked .transcode-cache

Refusing the folder made every proxied video in such a project answer 502.
A linked cache folder now receives copies again; it is still never swept,
so nothing already in the folder it points at is removed.

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

* chore(studio-server): drop a comment the comment ratchet refuses

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

* fix(cli): skip HEIF and GIF preview prep when .hyperframes/prepared-assets is a link

The preview transform wrote converted images into .hyperframes/prepared-assets
through a link, so a project shipping .hyperframes as a link to another folder
had files written there. Such a project now gets its preview with the images
as written in the composition, unconverted, and nothing is written.

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

* fix(studio-server): never sweep a linked .transcode-cache, from Studio or hyperframes clean

The link check moves into cleanupProxyCache, which both Studio's cache
maintenance and `hyperframes clean` call, so neither removes files from the
folder a linked .transcode-cache points at.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 20:26:12 +00:00
Michael WangandClaude Opus 5.5 24508ce2da fix: harden docs snippets, SVG sanitizer, lint regexes, GSAP writers and registry pins (#7512)
* fix(docs): escape catalog preview values and the install command's --vars argument

The catalog preview embeds variable values as JSON that cannot close a
script element or attribute, accepts value messages only from the page
that embeds it, and reads only declared ids with primitive values from
the link. The install command shell-quotes its --vars JSON and keeps
only variable-id keys with primitive values.

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

* fix(core): fold CSS line endings before decoding escapes in the SVG sanitizer

A browser folds CR LF, CR and form feed into one newline before it reads
CSS escapes, so the whitespace after a hex escape can be a CR LF pair.
The sanitizer now does the same, so an escaped function name split by a
line ending is checked under its real name. The media-use bundle is
regenerated from the source.

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

* fix(lint): match template ids and CSS rules in linear time

A getElementById template literal is matched against document ids with
an in-order indexOf scan instead of a regex of joined wildcards, so the
time no longer grows with the number of placeholders. The CSS rule
scanners only start a match at the beginning of a brace-free run, which
finds the same rules without rescanning long brace-less text. Lint
results on every HTML file in the repository are unchanged.

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

* fix(parsers): keep GSAP writer output inside its script element

String literals and quoted keys the GSAP writers emit now encode a
script closer or comment opener as \u003c, so a value can no longer end
the inline script that holds the timeline. Strings without those
sequences are written exactly as before. The writers also refuse a tween
method outside set, to, from and fromTo, and a motion path whose
coordinates or curviness are not numbers, since both are emitted as code.

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

* fix(scripts): confine registry asset hosting to files inside the item

The asset hosting script now refuses a manifest path that leaves the
item directory or reaches its file through a symlink, before anything is
read, staged, uploaded or removed. A repository test fails when the
registry tracks a symlink or a manifest path that leaves its item.

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

* fix(registry): pin the map blocks' d3 and atlas files to exact versions

The five map blocks load d3 7.9.2, the build the d3@7 range serves today,
with a subresource integrity hash, and fetch us-atlas 3.0.1 and
world-atlas 2.0.2, the files their ranges serve today. The bytes are
unchanged, so the blocks render the same. A repository test fails when a
registry item names an npm CDN package by range, tag or no version.

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

* fix(registry): pin map blocks to d3 7.9.0

7.9.0 has been the stable release since 2024; 7.9.1 and 7.9.2 were published days ago. Pin the
long-standing version, with its subresource integrity hash.

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

* fix(registry): keep the map block PR source-only and formatted

Restore the generated catalog pages and payloads, which the catalog
publish job regenerates from the item sources. Name the us-atlas URL
in us-map-flow so the call fits on one line and formatting is unchanged.

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

* refactor(scripts): check registry asset containment with one prefix test

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

* fix(lint): scan simple CSS rules in linear time

The two CSS-rule scans in the gsap rules took a body that could cross
'{', so a closed style of many '{' with no '}' rescanned to its end from
every brace. A scanner now returns the same selector and body pairs and
remembers the next '}', so each scan is linear. Findings are identical
on every tracked HTML file.

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

* test(core): label the form-feed sanitizer case as a guard

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 20:01:29 +00:00
Miguel Ángel cda84222aa fix(core): Safari keeps a small file's preload and leaves a playing clip's source alone (#7498)
* fix(core): Safari keeps a small file's authored preload and never holds a clip already playing

* fix(core): Safari still holds a long file's later clips that were parsed before the runtime

The sweep sets preload none on them again and gives a clip its authored preload back once its file turns out not to be long.

* fix(core): Safari leaves the src of a long file's clip that is already playing or seeking

Its file's size can arrive after the clip started; writing an in-point src then restarted its load and sent it back to the in-point.
2026-11-10 15:18:22 +00:00
Miguel Ángel fecde9992f perf(core): Safari stops a long video's clips from loading the whole file at once (#7436)
* perf(core): Safari clips open at their in-point and are fetched ahead

* perf(core): Safari opens a long file's clips at their in-point and leaves short files as they were

* perf(core): Safari holds a long file's later clips with no source until each one is due

* perf(core): Safari plays a long file's sound from its element instead of fetching the whole file

* perf(core): Safari holds a later clip of a long file even when WebKit began reading it at parse

* style(core): fit the long-file comments to the comment budget and the formatter

* refactor(core): one proxy trigger path, and the producer budget at its measured size

* perf(core): Safari opens a later clip WebKit read at parse at its in-point rather than holding it

* build: the producer size budget at its measured 3162274 bytes

* refactor(core): name the condition that holds a long file's later clip
2026-11-10 12:38:47 +00:00
Miguel Ángel b59fa20833 fix(cli): staging folders beside a project path no longer fail past 260 characters on Windows (#7338)
* fix(cli): staging folders beside a project path no longer fail past 260 characters on Windows

mkdtemp does not get the long-path prefix that mkdir does, so every staging folder
made beside a project or output path failed once its full path passed 260 characters.
They now come from one helper, createStagingDir in @hyperframes/core/atomic-file, and a
scan test fails on a new mkdtemp beside a path.

* fix(cli): give mkdtemp the long-path form instead of replacing it

CodeQL treats mkdtemp as the safe way to make a folder under the system temp dir and
flagged every file written into a folder from the mkdir-based helper. createStagingDir
now calls mkdtemp with the long-path form of the path on Windows, so both hold.

* fix(cli): leave non-Windows paths alone when making a staging folder

The long-path form is now chosen by the shape of the path, not process.platform,
so tests that pretend to be Windows keep working and the comment share does not rise.

* fix(core): a staging folder keeps a Windows path that already names its namespace

* fix(core): a staging folder keeps a Windows device path as the caller gave it

* fix(core): the staging folder helper's comment fits the line limit
2026-11-09 17:16:08 +00:00
Jerrai caa62fe68b fix(core): detect template entries structurally (#7249)
* fix(core): detect template entries structurally

isTemplateEntry only matched a raw file that starts with <template>, so the
full-document sub-composition shape (<!doctype html><html><body><template>
<div data-composition-id>...</template></body></html>) was not recognised and
resolveEntryHtmlPath compiled the raw file, whose root sits in an inert
template: no timeline, no duration, "Composition has zero duration".

A template entry is now a document whose <template> holds the composition
root with no live composition root outside it. Detection and extraction share
one lookup (locateSceneRoot), the same one readSceneRoot uses.

— Jerrai

* fix(core): drop comments from the template lookup

The comment ratchet allows no net rise in a file's comment share; the PR
description carries the explanation.

— Jerrai

* fix(core): find the scene template among several templates

locateSceneRoot read only the first <template>, so a scene template that
follows another template was treated as not a template entry. Scan every
template and take the first whose content holds a composition root.

* fix(core): drop the added comment (comment ratchet)

* chore: raise the inspector unpacked size budget by 0.5%

The inspector bundles core; the multi-template scene lookup added a few
hundred bytes and put it 10 bytes over the 1% tolerance.

* fix(core): refuse a file with several scene templates, naming them

* chore: trim the inspector size budget bump to what is needed

* fix(core): render the first scene template and lint the ambiguity instead of failing

A file with several scene templates and no live root rendered its first one
before; locateSceneRoot threw and stopped such projects rendering. It returns
the first again, and the multiple_scene_templates lint warning names each.

Co-authored-by: Jerrai <jerrai@heygen.com>

* chore(core): drop the locateSceneRoot comment line the comment ratchet counts

Co-authored-by: Jerrai <jerrai@heygen.com>

* fix(core): one shared scene-template pick for the compiler, the inliner and the loader

A scene template after a card template was detected by locateSceneRoot but
mounted from the first template of any kind, so it rendered blank.
findSceneTemplate picks the first template holding a composition root and
locateSceneRoot, resolveSubCompositionContent and the loader all use it.

Co-authored-by: Jerrai <jerrai@heygen.com>
2026-11-09 15:09:04 +00:00
Miguel Ángel a73572c3b7 fix(core): a video held on its tail is seeked once, not every frame (#7442)
* fix(core): a video held on its tail is seeked once, not every frame

* fix(core): seek a held tail again when the element was moved off it

* fix(core): the held-tail skip applies only while playing

* style(core): format the held-tail change

* refactor(core): drop a comment that repeats its neighbour
2026-11-09 10:46:44 +00:00
5e8abd7574 feat(cli): add 1440p resolution presets to --resolution (#7418)
* feat(cli): add 1440p resolution presets to --resolution

Adds landscape-1440p (2560x1440), portrait-1440p (1440x2560) and
square-1440p (1440x1440) next to the existing 4K, 720p and 480p tiers,
with the aliases 1440p, 2k and qhd plus 1440p-portrait and 1440p-square.
1440p joins the aspect-agnostic aliases, like 720p and 480p.

Every validator derives from CANVAS_DIMENSIONS, so no logic changes: a 4K
composition renders down to 1440p through the existing smaller-preset
path, and a 1280x720 composition supersamples to 1440p at an exact 2x.
A 1920x1080 composition is still refused by the non-integer-scale check
(4/3); fractional scale factors are not part of this change.

Refs #6309

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

* fix(cli): clarify 1440p aliases and repair skill validation

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: James <james.russo@heygen.com>
2026-11-08 23:16:17 +00:00
Miguel Ángel fa2e63515f fix(core): a muted video's picture no longer waits on its own audio track at a cut (#7412)
* fix(core): a muted video's picture no longer waits on its own audio track at a cut

A muted video takes its clock from its audio track in Safari; a late start of that track stalls the picture after the cut. The runtime now switches the track off.

* test(core): a video muted by script and unmuted later keeps its audio track

* fix(core): type the audio track loop so it passes the strict index check
2026-11-08 18:48:55 +00:00
Miguel Ángel 12906e0bfb fix(core): capture pages load only the clips on screen (#7402)
* fix(core): capture pages load only the clips on screen

* fix(core): name the capture page media rule instead of commenting it
2026-11-08 12:18:11 +00:00
Miguel Ángel 75fe18c621 fix(core): a set written before its tween no longer erases the tween's end (#7397)
* fix(core): a set written before its tween no longer erases the tween's end

* fix(core): shorten two comment lines to the limit

* fix(core): the stamp takes any GSAP the runtime types, so the runtime typecheck passes
2026-11-08 06:03:31 +00:00
James Russo 3151fd2133 fix(studio): bound recovery and verify full-quality playback (#7393)
* fix(studio): bound recovery and verify full-quality playback

* fix(studio): compare preview pixels with captured HTML clock
2026-11-08 02:29:57 +00:00
Miguel Ángel fd05a3860c feat(core): preview health names the media element that held play (#7159) 2026-11-08 02:26:53 +00:00
James Russo b7157bdabb feat(studio): scrub full-quality video with decoded preview frames (#7379)
* feat(studio): scrub full-quality video with decoded preview frames

* fix(studio): release scrub decoders before native playback

* fix(studio): bound paused fallback and tolerate decoder load failure

* fix(studio): recover stalled native preview handoffs

* fix(runtime): recognize cross-realm preview video elements

* fix(studio): bound Play handoffs and drain transparent preview samples

* fix(preview): recover retained video without chasing playback clock

* fix(studio): drain finite alpha queries before disposing readers
2026-11-08 00:17:12 +00:00
James Russo b87a01f6a8 fix(core): retain complete preview pictures during native seeks (#7378)
* fix(core): retain complete preview pictures during native seeks

* fix: settle failed seeks and preserve coherent progress
2026-11-07 23:29:21 +00:00
Miguel Ángel 942893eb2c fix(core): preview playback moves every frame between an audio track's time updates (#7373) 2026-11-07 22:50:52 +00:00
Miguel Ángel 841e90ffe2 fix(core): Safari video picture lands on the cut again, undoing the hidden pre-roll (#7383)
* fix(core): Safari video picture lands on the cut again, undoing the hidden pre-roll

Reverts the one-second hidden video pre-roll (#7265): on Safari the pre-rolled video is still behind at the cut and trails it by 30 to 150 ms in every measured run, and some cut flashes never show.

* fix(core): shorten a restored comment line to the 120-column limit
2026-11-07 22:09:06 +00:00
Miguel Ángel a595755a35 fix(core): a film moves on past a video the browser never starts loading (#7368) 2026-11-07 18:16:25 +00:00
Miguel Ángel 59c2065d63 fix(producer): page timers during a render run on film time (#7362)
* fix(producer): page timers during a render run on film time

* test(producer): a regression film whose timer bars must follow film time

* test(producer): schedule the timers regression film in CI shards

* fix(producer): keep setup timers on the wall clock until the page reports ready

* fix(producer): keep the renderer's own waits and deadlines on the wall clock

* test(engine): fail CI on a bare timer in code the engine runs in the page

* fix(core): type the wall-clock timers like the global timers they replace

* chore(engine): drop the comment on the shim's window type
2026-11-07 18:06:55 +00:00
Miguel Ángel 9058fd1a7a fix(core): skip a video the browser can't decode instead of freezing the film (#7355)
* fix(core): skip a video the browser can't decode instead of freezing the film

* fix(core): keep waiting on a clip whose play the browser refused; drop the codec-map skip
2026-11-07 09:16:39 +00:00
Miguel Ángel 1ddd425587 fix(core): words in a scene the preview mounts later keep their spaces (#7342)
* fix(core): words in a scene the preview mounts later keep their spaces

* fix(core): a scene laid out for its scripts ignores clicks until it shows
2026-11-07 02:46:21 +00:00
Muzzy5150 f004622a6b feat(studio): improve element picker cancellation feedback (#6900) 2026-11-07 00:10:08 +00:00
Miguel Ángel 539c70ceea fix(core): a render no longer rewinds when a set sits beside a tween on another property (#7339) 2026-11-06 22:46:38 +00:00
Miguel Ángel 3e3ba8d0d0 fix(core): a set that interrupts a tween holds in a real render at any worker count (#7318) 2026-11-06 15:45:28 +00:00
Vance IngallsandClaude Sonnet 5.5 a874a6324a feat(core): motion blur reports what a composition holds, as counts (#7306)
* feat(core): motion blur reports what a composition holds, as counts

The runtime scans a composition once per blur scan, on both tiers, and reports
counts of what it holds (canvases, video, frames, custom elements, clips, masks,
scroll containers, 3D, blend modes, and movers that overflow, sit under other
content, hold fixed children or carry pseudo-elements outside their box), plus
whether pose reads need callbacks. Counts only: no ids, classes, text or URLs.

The engine puts the non-zero counts on its [motion-blur] line and hands the
parsed report to the perf summary; the producer aggregates workers (first report
wins, failed frames sum) and the CLI sends motion_blur_* properties on
render_complete, from the CLI and from Studio renders.

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

* fix(cli): disclose blur counts in telemetry docs, raise inspector budget

The runtime fingerprint code is bundled into @hyperframes/inspector, which
puts its unpacked size 2.2 KB past the 1% tolerance. The telemetry docs now
list the composition counts the CLI sends with a blur render.

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

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 15:03:34 +00:00
Miguel Ángel cb8e02e826 fix(core): a decoded buffer's handover leaves the routed element silent (#7309)
* fix(core): a decoded buffer's handover leaves the routed element silent

* fix(core): a handed-over element sounds again when playback stops
2026-11-06 10:17:47 +00:00
Miguel Ángel 3e86def58e fix(core): video starts a second early and catches up hidden, so the picture meets the cut (#7265)
* fix(core): video starts a second early and catches up hidden, so the picture meets the cut

* fix(core): a video that plays from the start of its file also starts early

* fix(core): a from-file-start clip leads by half the lead hold so a fast start is not paused

* fix(core): steering for hidden video is its own function; trim comments and format

* chore(player): raise the packed size budget for the picture pre-roll
2026-11-06 08:51:57 +00:00
Miguel Ángel 6011d9d0dd fix(core): accented Latin letters draw in a bundled family at its bundled weights (#7299)
* fix(core): accented Latin letters draw in a bundled family at its bundled weights

* fix(core): trim the comment added with the bundled-weight faces
2026-11-06 07:17:21 +00:00
Vance IngallsandClaude Sonnet 5.5 e2bb7da25d feat(core): auto motion blur draws with the filter tier (#7288)
* feat(core): auto motion blur draws with the filter tier

Capture stays available as data-motion-blur-tier="capture". auto now draws with the
filter tier (reasonCode tier-auto), so the capture-only defects leave the default path.
Removes the translation-only hand-off and its Discovery field, adds a filter arm to the
differential, and updates the check, guide, skill and Blur panel label.

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

* docs(core): measured cost and known limits of the filter tier, the new auto default

spacex-launch (77 movers) takes 2.9x the CPU of no blur on the filter tier and 1.7x on
capture; say so, and list the filter tier's measured limits (sweep D, E, F, I, O, B).

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

* docs(core): word the filter tier's cost and limits as measured, not as mechanism

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

* docs(core): do not say every filter-tier limit is pinned by a sweep test

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

* test(engine): split the blur differential so each file fits the flake gate's 120 s run

The filter arm moves to its own file and skips fixtures that already draw with the filter
tier; inside cases get their own file; a fixture's blur-off page is opened once per file.
Shared helpers live in __fixtures__/motionBlur/differentialPage.ts.

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

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 05:27:36 +00:00
Vance IngallsandClaude Sonnet 5.5 4bee04e4a1 fix(core): a mover's ::before and ::after outside its box stay in the blur (#7295)
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 05:07:56 +00:00
Vance IngallsandClaude Sonnet 5.5 b6f2bec165 fix(core): a mover holding a fixed child stays sharp in the filter tier (#7292)
* fix(core): a mover holding a fixed child stays sharp in the filter tier

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

* fix(core): a fixed-child mover is skipped only on frames it is not already a containing block

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

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 05:07:48 +00:00
Vance IngallsandClaude Sonnet 5.5 2066a2ff54 fix(core): the filter tier's svg no longer changes which child is last in the root (#7293)
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 04:33:20 +00:00
Vance IngallsandClaude Sonnet 5.5 cd7e93baa0 fix(core): blur quiets discrete callbacks instead of undoing what they wrote (#7271)
* fix(core): blur quiets discrete callbacks instead of undoing what they wrote

#7191 undid the DOM a callback wrote during the blur scan with a mutation journal. That
regressed once-guarded and memoized timeline callbacks: the callback ran, its guard flipped,
and the journal put the DOM back, so the real seek never wrote it again.

Mute GSAP's onStart, onComplete, onReverseComplete and onRepeat for the scan and for eventful
pose reads, then restore them. onUpdate keeps firing, so movers driven from it are still found.
muteDiscreteCallbacks replaces a callback with a no-op rather than clearing it
(hasZeroDurationCallbackTween reads typeof vars.onComplete), walks tween.timeline for staggers
and keyframes, and skips an animation already muted because scene timelines nest in the root.
The journal (journalDom, landThenUndoDom, putBack) is deleted. The loud rewind through 0 stays.

Measured in the spike (mute-spike-report.md, "Probe matrix and fresh worker"): every GSAP
pattern matches blur off in label and fire count; 8 of 300 comparisons differ, all the non-GSAP
row, against 248 of 300 on main. This supersedes the limit #7191 accepted. Mute and restore over
2002 animations is 0.2 ms.

Limits:
- A mover that exists only because a muted callback set it up is found only if that callback
  fired before the scan. A worker starting before the call leaves that mover sharp while a later
  worker blurs it; positions stay right.
- tl.call(() => gsap.to(...)) movers are never found and stay sharp.
- A non-GSAP adapter that ignores suppressEvents (adapters/animejs.ts) and writes DOM on a
  once-only completion shows it early. Pinned by a KNOWN LIMIT test.

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

* test(producer): drop the once-guard-label block-start guard that pins a block that cannot fail

The guard required a block start in [1, 15], the worker at frame 9, and the comment said it
paints on both sides of the call at 16. Its frames after the call (16, 17) sit inside the
trail mask at the label, so that block cannot show the bug. The outside-the-trail case on the
7-worker partition is what catches the mutant; the fixture stays in FIXTURE_NAMES.

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

* test(engine): split the callbacks matrix in three and share one blur-off run per row

The matrix file took 247 s on an idle Mac and timed out at the flake gate's 120 s in all 10 reruns.
Each row now compares the arms against one blur-off page painted in order and one fresh page, not
a new blur-off page per arm and sequence; the in-order sequence is the first paints of the page that
goes back to the first time; rows run their pages together; the paint skips the full-frame PNG that
only the pixel tests read. Only the two arms with an onUpdate mover stay (both tiers): they run the
scan's mute and the per-frame mute, which the arms without a mover do not.

The rows and harness move to __fixtures__/motionBlur/callbackRows.ts and the matrix is split over
three files so each run fits the gate. Rows a to y, the three sequences, both tiers, row y and the
KNOWN LIMIT test are all kept; no assertion changed.

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

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 04:15:22 +00:00
Miguel Ángel 6abc62a179 fix(core): a render lands where preview does when a set interrupts a tween (#7283)
* fix(core): a render lands where preview does when a set interrupts a tween

* fix(core): the settling helper carries no comment, its name says it
2026-11-06 01:40:40 +00:00
Miguel Ángel 256b84a41b fix(core): check's no-draw seeks no longer upload graded images to the GPU (#7264) 2026-11-05 20:44:35 +00:00
Miguel Ángel b108f85120 fix(core): two scenes drawing SVGs with the same ids each show their own (#7251)
* fix(core): two scenes drawing SVGs with the same ids each show their own

* fix(core): the runtime's scene scopes typecheck as mounted scopes
2026-11-05 17:20:51 +00:00
Miguel Ángel 600bfa451b fix(core): decode WebKit sources by memory budget, not by length (#7232) 2026-11-05 16:53:59 +00:00
Miguel Ángel 5377b756b5 fix(core): snapshot and preview show a clip on the frame render shows it (#7238)
* fix(core): snapshot and preview show a clip on the frame render shows it

* fix(cli): snapshot pulls a video's frame on the same on-screen rule

* refactor(cli): drop two doc lines the names already carry
2026-11-05 16:21:24 +00:00