Commit Graph
6043 Commits
Author SHA1 Message Date
zhengqiuyang 401991669d fix(lint): derive the root duration with the parser's timing reader (#8032)
* fix(lint): derive the root duration with the parser's timing reader

`deriveDurationFromClips` read `data-start` with a raw `Number()`, so a clip
authored at `data-start="-2"` produced an end of `-1`. `resolveCompositionDuration`
only counts positive ends, so the clip vanished from the derivation and the
composition was reported as having no duration source at all — a hard error that
blocks strict renders, even though the parser clamps the same start to zero and
renders the clip for its full length.

Read the start through `readClipTiming`, the same contract parser the renderer
uses, and keep the media-duration default for untimed images.

* fix(lint): derive the root duration with the parser's timing reader

`deriveDurationFromClips` read `data-start` with a raw `Number()`, so a clip
authored at `data-start="-2"` produced a negative end and vanished from the
derivation. Read the start through `readClipTiming`, which clamps it to zero,
and keep `readAuthoredDurationSeconds` for the authored length so a valid
`data-end` still backs an unparseable `data-duration`.
2026-11-17 17:08:08 +00:00
Michael Wang 90de9b6196 fix(cli): a project .env provider key prints a note when it is used (#8056)
A provider key from a project .env is still used when no own credential
competes. Capture vision (OpenRouter, Gemini, Google and both Vertex parts),
snapshot --describe, Gemini speech and Lyria music now print one note per key
before it is first used, naming the variable and the escaped .env path, as
the ElevenLabs note does. The ignoring notes escape the path too, and the
media-use skill gets a generated copy of the CLI's terminal-text helper.
2026-11-17 16:52:55 +00:00
zhengqiuyang c84c30fd8d fix(lint): read a sub-composition mount's timing through the parser (#8037)
`subcomposition_blanks_before_host` read `data-start` and `data-duration` with a
raw `Number()`, so a mount with a reference start (`intro + 0.5`) looked like it
started at 0 and was reported as leaving a blank tail that may not exist. A
negative start was measured from the raw value, so the reported gap and the
`data-duration` fix hint were wrong in the other direction.

Read the mount through `readClipTiming`, the same contract parser the renderer
uses: a runtime-resolved start is skipped (its end cannot be known statically),
and a negative start is measured from zero.
2026-11-17 16:49:33 +00:00
Miguel Ángel cda94eb0f6 fix(studio): timeline rows in a sealed preview know their element, source file and audio group (#8078)
* test(studio): a sealed preview's timeline rows bind to their elements

* fix(studio): timeline rows in a sealed preview know their element, source file and audio group
2026-11-17 16:49:19 +00:00
James RussoandClaude Opus 5.5 4bea3e79c2 fix(cli,studio): refuse ?hf-proxy when a request carries no same-site signal (#8066)
A media-proxy request with neither Sec-Fetch-Site nor a Referer naming the
host was treated as same-site. Play, the static project server and Studio now
require a positive signal and refuse the request otherwise. The check
command's own re-request of failed media sends a Referer for its origin so it
keeps working.

— Rames

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 16:45:34 +00:00
Miguel Ángel a56fa2caf3 fix(studio): scrubbing the playhead plays the music track in a sealed preview (#8082)
* test(studio): scrubbing a sealed preview plays the music track

* fix(studio): scrubbing the playhead plays the music track in a sealed preview

* fix(core): the scrub uses the runtime's wall-clock timers and media-time writer
2026-11-17 16:25:29 +00:00
Santhi Prakash 9797faea05 fix(core): drop motion-blur state on __hfRuntimeTeardown (#7996)
The blur's filter <svg> is appended to <html>, outside the body swap a
same-document re-init performs. A torn-down run left it (and
window.__hfMotionBlur) behind, so the next run's hf-mb-0 collided with
the stale id and url(#hf-mb-N) drew movers through the old filter
region, rendering them blank.

Fixes #7986
2026-11-17 16:13:03 +00:00
Miguel Ángel e86594759c chore: release v0.9.63 (#8080) 2026-11-17 15:55:44 +00:00
Miguel Ángel 5f8b7a6eee fix(studio): the edit bench reads a sealed preview through its editing port (#8010)
* test(studio): the edit bench measures an element inside a sealed preview

* fix(studio): the edit bench reads a sealed preview through its editing port

* fix(studio): the edit bench drops a preview reply that lands after a release or the next drag

* fix(studio): the edit bench pairs each frame's pushed geometry with the pointer at that moment

* fix(studio): the edit bench pairs Studio's outlines and the watched element by time, not arrival

* fix(studio): the edit bench starts a drag only once the preview has measured the element
2026-11-17 14:36:04 +00:00
Miguel Ángel 0be1a0719c fix(producer): frames start drawing while the audio mix finishes (#7985)
* fix(producer): frames start drawing while the audio mix finishes

* fix(producer): keep the encode stage's comment share

* fix(producer): on machines with under 4 CPUs frames wait for the audio mix

* test(producer): a mix that fails during capture is reported as the audio stage's failure

* fix(producer): a mix that fails during capture names the audio stage as where the render failed
2026-11-17 14:35:07 +00:00
Miguel Ángel 72925380cc fix: render, capture and inspector servers never serve a service worker's script (#8073)
* fix(engine): the render file server never serves a project file as a service worker's script

* fix(producer): render, capture and inspector servers never serve a service worker's script
2026-11-17 14:15:52 +00:00
Miguel Ángel fbcdf4cad7 chore: release v0.9.62 (#8075) 2026-11-17 14:15:36 +00:00
Miguel Ángel df31ce2b15 fix(studio): a layer reorder is one undo step again (#8072)
* fix(studio): a layer reorder is one undo step again

* fix(studio): a lane drag's save still paints back at once inside a reorder gesture
2026-11-17 13:35:06 +00:00
Miguel Ángel 93a4d29c03 fix(studio): audio meters and audio groups work in a sealed preview (#8011)
* test(studio): audio meters and group volume in a sealed preview

* fix(studio): audio meters and audio groups work in a sealed preview

* chore(inspector): raise the unpacked size budget for the preview's audio editing kinds

* test(studio): the sealed audio test serves a Studio-marked preview, as the editing port now requires
2026-11-17 13:26:15 +00:00
Miguel Ángel b064e40e13 fix(studio): adding a track no longer remounts every clip on the timeline (#8068)
* test(studio): adding a track keeps every existing timeline clip mounted

* fix(studio): adding a track no longer remounts every clip on the timeline
2026-11-17 12:37:23 +00:00
Miguel Ángel b4acc1a1da fix(studio-server): a project file is never served as a service worker's script (#8064) 2026-11-17 12:36:14 +00:00
Miguel Ángel f9c5ed07bf feat(core): the preview can stream an element's geometry to the editor every frame (#8052)
* feat(core): the preview can stream an element's geometry to the editor every frame

* refactor(core): the editing client hands unasked pushes to one function

* fix(core): geometry watches are capped per page; a lost port or failed measure stops nothing else

* fix(core): the preview measures watched geometry after the frame renders, not inside rAF

* fix(core): watched geometry is measured in the frame's resize-observer step, just before paint

* docs(core): a hidden preview's geometry pushes pause until it has a size

* test(core): keep the fake resize observer's note within the line limit
2026-11-17 12:35:23 +00:00
Miguel Ángel 8ec97da011 perf(engine): check still frames on several pages at once so text films start sooner (#7997)
* perf(engine): check still frames on several pages at once so text films start sooner

* fix(engine): parallel still-frame check keeps its full time budget

* test(engine): give the Bun download check the minute its spawn already allows
2026-11-17 12:21:00 +00:00
Miguel Ángel 43e5b7cecd fix(core): a held video picture is drawn through a VideoFrame closed after the draw (#7971)
* test(core): a held picture is drawn through a closed VideoFrame

* fix(core): a held video picture is drawn through a VideoFrame closed after the draw

* test(core): read the held frame's closed flag only once it is a VideoFrame
2026-11-17 12:09:33 +00:00
Miguel Ángel 34f98e6a04 test(core): the reloaded-video playhead test builds a smaller film so busy CI never times it out (#8069)
* test(core): the reloaded-video playhead test builds a smaller film so busy CI never times it out

* test(core): keep the playhead fixture note inside the comment line limit
2026-11-17 11:53:32 +00:00
James RussoandClaude Opus 5.5 fbb4838525 fix(producer): leave outside links out of site listings by default and warn SDK callers (#8065)
A bare listSiteFiles now leaves out files and folders linked in from outside
the project; a caller that wants them passes "include". listSiteFilesForUpload
warns on the console when the caller passes no onNotice, so SDK callers learn
that files were left out. The regression harness keeps its fixtures' outside
links with "include".

— Rames

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 11:35:51 +00:00
Miguel Ángel 7a0bec6828 fix(studio): a service worker a project left behind is gone before a preview frame loads (#8067)
* fix(studio): a service worker a project left behind is gone before a preview frame loads

* fix(cli): the player page's inlined script list is escaped for a script tag
2026-11-17 11:05:40 +00:00
Miguel Ángel 3599623f92 chore: release v0.9.61 (#8051) 2026-11-17 10:56:12 +00:00
Miguel Ángel d317abcdba fix(cli): cloud render --json reports re-encode progress and times out a stalled cache check (#7755)
* fix(cli): cloud render --json reports re-encode progress and times out a stalled cache check

* refactor(parsers): share the ffmpeg progress reader from ff-binaries

The reader lived in a new studio-server entry point, which pushed its packed size over budget and left package.json out of step with package-subpaths.json. Both callers already depend on parsers. The re-encode now gets a progress callback only when someone listens.

* style(cli): format the offload test
2026-11-17 10:30:43 +00:00
Andy CheighandClaude Opus 5.5 524ea46bf9 fix(producer,parsers): render compile never looks for a scene's assets on another computer (#8063)
A scene mounted as `\\host\share/scene.html` read its own file from inside the
project, but its sibling assets were looked up next to `\\host\share`, which on
Windows connects to that host and sends the user's login. The compile's asset
checks now report any path outside the project as missing without touching the
disk, and a data-composition-src with a leading `\` or `./` is rewritten to the
project file it names before its assets are resolved.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 09:41:24 +00:00
Miguel Ángel c8df284b2e feat(engine): render telemetry says why a page cannot reuse still frames (#7993)
* feat(engine): render telemetry says why a page cannot reuse still frames

* fix(engine): keep the ineligible cause's comment on its one owner
2026-11-17 09:37:22 +00:00
James RussoandClaude Opus 5.5 f97e289058 fix(cli): refuse media-proxy copies another site asks for in play and the static server (#8058)
A `?hf-proxy=` request makes this machine run ffmpeg. Studio already refuses
one that comes from another site; the `play` composition route and the static
project server (used by check, snapshot and capture) still served it. Both now
answer 403 to a cross-site or same-site `?hf-proxy=` request before any probe
or transcode starts. Their own pages and plain asset requests are unchanged.

— Rames

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 09:32:18 +00:00
James RussoandClaude Opus 5.5 4721739ee7 fix(producer): readers re-check outside-linked compositions, and the refusal names a step every surface can take (#8034)
- parseSubCompositions and the inliner's disk fallback check again right before they
  read a composition, so a file swapped for an outside link after the pre-flight is
  refused too. recompileWithResolutions carries the outside-file policy.
- The refusal says any scripts in the file would run, which holds whether or not it
  has any, and offers moving the file into the project, which Studio and benchmark
  renders can do without the CLI flag.

— Rames

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 09:26:17 +00:00
James RussoandClaude Opus 5.5 39347da9de fix(cli): leave files from outside the project out of Lambda and Cloud Run site uploads (#8060)
* fix(cli): leave files from outside the project out of Lambda and Cloud Run site uploads

A site upload for `lambda` or `cloudrun` followed every symlink in the project and
shipped what it pointed at, wherever that was on the machine. `publish` and `cloud
render` already ask first. Site uploads now leave a file or folder linked in from
outside the project out and name each one; `--include-outside-files` (or
`includeOutsideFiles` in the SDK's deploySite, renderToLambda and renderToCloudRun)
uploads them. publishProjectArchive called without a prepared archive now leaves
outside files out too, since nothing approved them.

— Rames

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

* fix(producer): drop the new option comments the comment ratchet refuses

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 09:25:25 +00:00
Miguel Ángel efc91fc877 feat(studio): an element's source-parsed animations are part of Studio's API (#8061) 2026-11-17 09:03:19 +00:00
Xuanru Li 5ea86450a2 fix(cli): a host can name projects whose received files are expected or all received (#8025)
* fix(cli): a host can name projects whose received files are expected or all received

HYPERFRAMES_RECEIVED_STATE_FILE points at a JSON file a host app keeps,
listing project folders (by path, and optionally by device and inode) as
"expected" or "all". For an expected project, a missing received-files
record counts every file as received and is not started afresh; for an
all project, every file counts as received whatever the record lists. A
state file that is named but cannot be read counts every file as received.

A record lock dated in the future is taken over like a stale one.

* fix(cli): read host provenance state through one file handle

* fix(cli): canonicalize host state paths like record writes

* test(cli): expect canonical received warning paths
2026-11-17 08:54:39 +00:00
Miguel Ángel 55291c00c2 fix(core): only Studio's own preview pages get the editing port, and undo sets only safe attributes (#8057)
* fix(core): only Studio's own preview pages get the editing port, and undo sets only safe attributes

restore-attributes now changes only class, style and the editor's timing, layout, audio and label data- attributes, and drops only data- ones; any other change answers applied: false and Studio reloads the preview. The editing agent hands its port over only when the page carries Studio's preview mark and not the another-site mark, so a page no Studio marked never offers it.

* fix(core): undo on a lazily loaded image still applies in place

The preview server adds loading="lazy" to timed images and the saved file does not have it, so the restore now may drop loading; dropping it loads nothing new.

* style(core): keep the restore plan's doc comment within the line limit
2026-11-17 08:46:24 +00:00
Ular Kimsanov 3e01f691db fix(lint): match a timed wrapper's close tag literally (#8028)
* fix(lint): match a timed wrapper's close tag literally

The parser keeps any tag name up to whitespace, / or >, so a wrapper's
name can hold regex syntax. closeTag built its pattern from the raw name:
an unbalanced name threw a SyntaxError that rejected the whole lint, and a
nested-quantifier name backtracked exponentially over the text before a
nested video. Escape the name with the file's own escapeRegExp.

* refactor(lint): name the escaped close-tag pattern instead of commenting it

The comment ratchet keeps a file's comment share from rising.
2026-11-17 08:44:40 +00:00
Miguel Ángel 647bdd4d7c fix(studio): each drag shows as its own undo step once its save lands (#8033)
* test(studio): three quick drags give three undo entries in the history list

* fix(studio): each drag shows as its own undo step once its save lands

* test(studio): the edit bench fails a gesture missing from the history list

* refactor(studio): the held-entry close is a plain function, and the bench helper stays private

* chore(studio): mark the history hook's existing complexity the way other large hooks are

* fix(studio): a drag's history claim waits for the previous drag's close to land
2026-11-17 08:08:46 +00:00
Miguel Ángel 53080581cb fix(cli): a refused reverse start reports whether HeyGen sent the refusal (#8053)
* fix(cli): a refused reverse start reports whether HeyGen sent the refusal

* fix(cli): a refusal body that is not JSON is never read

* refactor(cli): drop the comments the names already say

* refactor(cli): reading a refusal's source lives in one helper
2026-11-17 08:04:58 +00:00
Michael Wang b29e40d707 fix(producer): cap a render's total sub-composition expansion (#8045)
* fix(producer): cap a render's total sub-composition expansion

The 16 MB limit checked each composition file alone, so a few small files
that mount each other many times assembled a page far larger, and the
pre-flight walk and sub-composition compile redid their work for every mount.

The pre-flight walk now reads each file once and charges every mount to one
budget: 32 MB of composition HTML across at most 10,000 mounts. Past either
limit the render fails with the existing non-retryable COMPOSITION_TOO_LARGE
error, before compiling. Sub-composition compilation handles each path once,
and the inliner charges each mount to the same budget as it builds the page.

* docs: describe the total sub-composition expansion limit

* fix(producer): check each mount path and read each fallback file once

The pre-flight walk resolved and checked a mount's path on disk for every
mount, and the inliner's disk fallback did the same for every mount it
inlined. Both now do it once per path, so a refused fan-out costs about
half a second instead of several. The test now covers both a fan-out the
pre-flight refuses and one inside templates, which only the inliner sees.

* fix(producer): the pre-flight charges mounts inside templates to the budget

The pre-flight walk could not see mounts inside a <template>, so a
template-wrapped fan-out was only refused by the inliner, after seconds of
work. The walk now charges those mounts to the same budget without
reporting them, since the inliner still only warns about a broken one.
The refusal now names which limit it passed, and the tests assert the
mount count instead of a time.
2026-11-17 07:55:06 +00:00
Miguel Ángel f91bbf0dac fix(inspector): the inspector's Chrome starts as root or in a container (#8050)
* test(inspector): the inspector's Chrome follows the host sandbox rule, and probes retry without it

* fix(inspector): the inspector's Chrome starts as root or in a container

* test(producer): the page check and the inspector retry Chrome without the sandbox when it refuses

* fix(producer): the page check retries Chrome without the sandbox when it refuses, like the inspector

* chore(inspector): raise the packed size budget for the shared sandbox rule
2026-11-17 07:43:53 +00:00
Michael Wang fe93f9cd47 fix: refuse media paths that ffmpeg's image2 demuxer would read as a pattern (#8047)
* fix: refuse media paths that ffmpeg's image2 demuxer would read as a pattern

ffmpeg's image2 demuxer reads %d, %03d, %% and a % before a wildcard in an
input path as a pattern of other files, folders included. Every project,
private-file and received-file check approves the literal path, so a
composition could name a placeholder whose pattern reaches images outside
the project and get them back as video frames.

Every ffmpeg and ffprobe input built from a project file now goes through
assertLiteralMediaInput, which refuses such a local path before ffmpeg runs.
The engine's urlInputArgs, the parsers' mediaInputFormatArgs and the
studio-server's new mediaInputArgs all take the input path, so the CLI
snapshot and cloud offload, lint, core grade analysis and studio-server
callers are covered too. URLs and other percent signs, such as %20, are
read as before.

* build(parsers): declare the literal-media-input subpath

* build: raise the parsers packed-size budget for the literal-media-input subpath

The new subpath adds its own built entry, type file and export map rows,
about 2.7 KB packed. It is a separate module so test suites that mock
ff-binaries still run the real path check.

* test(parsers): a harmless name shaped like a pattern is refused too
2026-11-17 07:28:09 +00:00
Michael Wang 14c4e4c268 fix(cli): a project .env provider key gives way to the person's own credential (#8041)
* fix(cli): a project .env provider key gives way to the person's own credential

A project .env could set OPENROUTER_API_KEY, GEMINI_API_KEY, GOOGLE_API_KEY,
the Vertex settings or ELEVENLABS_API_KEY and outrank a credential the person
set in their shell or saved settings. The earlier rule covered only received
projects; a cloned or downloaded project still won.

Now every project .env provider key is unset, with a note naming the file,
when a competing provider has a credential from a surer source: the shell or
saved settings first, then the person's own project .env, then a received
one. A project key with no competing credential is still used, model and
timeout settings still apply, and the media-use scripts note an ElevenLabs
key from any project .env before speech starts.

In the CLI process an own-project key yields only within the vision choice;
the media-use scripts remake the Gemini audio choice from the passed key
origins.

* fix(cli): weigh an own project's provider key only against credentials its feature can use

Review found that the global yield removed a person's own project keys where
the shell credential could not do the job: snapshot's Gemini key next to a
shell OpenRouter key, and a Gemini key that music needs next to a shell
service account.

- Startup keeps the received-project rule only.
- Capture drops a project .env vision key only when the shell or settings
  hold another complete vision credential; the two Vertex parts are one
  credential and are not weighed against each other.
- A key dropped once is not brought back when capture re-reads the same .env,
  so its note prints once.
- In the audio scripts, an own project's Gemini key gives way only to the
  other Gemini API key, which speech and music both accept, and an own
  ElevenLabs key stays for an explicit provider choice.
2026-11-17 07:20:22 +00:00
Michael Wang c4439890cf fix(cli): escape audio and media-use output, pin model files (#8013)
* fix(cli): audio and media-use print control characters from project files as visible escapes

hyperframes audio, audio --read and media-use resolve (including
--candidates) printed file names, element ids, transcript words, model
descriptions and media manifest fields as they were. They now pass
through terminalText, so a control character shows as a visible \xNN
escape. The media-use engine runs without the CLI's packages, so it
carries a small copy of the helper. --json output is unchanged.

* fix(engine): playlist check refuses drive-relative and other colon-prefixed entries

ffmpeg reads an HLS or ffconcat entry with a colon before its first
separator as a URL or a drive, and opens it apart from the list's
folder. The folder check read entries such as C:Videos\a.mp4 or c:x.mp4
as names inside the folder and approved them. It now refuses any entry,
raw or percent-decoded, whose colon comes before its first /, \, ? or #,
as it already refuses absolute and parent-folder paths. http and https
segments are still kept.

* fix(cli): background-removal and Kokoro TTS model files are pinned to a sha256

The u2net_human_seg weights and the Kokoro model and voices files were
downloaded from release URLs and used whatever bytes arrived, and any
cached copy was trusted because it existed. Each file now has a pinned
size and sha256. A cached copy is checked before it is loaded and
downloaded again when it does not match. A download that does not
match is discarded with a message that names the file.

* fix(engine): playlist check reads entries from the folder ffmpeg uses

ffmpeg resolves a list's entries against its path cut at the first ? or
#. A list at proj/h#z/list.m3u8 naming ../h#z/x.ts was judged against
proj/h#z and approved, while ffmpeg opened proj/../h#z/x.ts. Entries are
now judged against the same cut folder. A list in a folder such as
"Take #2" still passes when its entries resolve inside that folder.

* fix(cli): a pinned model's cached copy is checked and removed under the download lock

ensurePinnedFile removed a cached copy that failed its check before the
download lock was taken, so a concurrent run could delete a file another
run had just published. downloadFile now takes a keepExisting check and
runs it under the lock: a copy that passes is kept, one that fails is
removed and downloaded again. The mismatch error now says the file does
not match its expected checksum, and that a retry helps only if the
download was interrupted or corrupted.

* fix(cli): audio escapes each field's line breaks, and media-use escapes recipe and stats output

The audio formatters escaped their output line by line, so a newline
inside a src, warning or transcript still printed as a real line break.
Each output line is now escaped whole with terminalText, which shows a
newline inside a field as \x0a. media-use resolve also escapes its
recipe lines and its --stats lines, which print recipe names, paths and
missed intents.

* fix(cli): media-use error messages show control characters as visible escapes

resolve printed error messages as they were, and some name project or
cache data, such as the known recipe names when a recipe is not found.
Every error: line now passes through terminalText, as the success lines
already do.

* ci: the edit accuracy filter includes the CLI model file check

The CLI's pinned model download now imports whisper/modelFile.ts, so a
change to it must run the edit accuracy bench too.

* test(cli): pinned model tests use private temp folders and rename like downloadFile

The tests wrote fixtures under fixed names in the shared temp folder,
and their download stand-in checked for a file before replacing it.
Each test now works in its own mkdtemp folder, and the stand-in asks
keepExisting directly and renames the part file into place, as
downloadFile does.

* test(cli): the media-use terminalText copy is checked against core's

The media-use engine keeps its own copy of terminalText. A CLI test now
compares the two over U+0000 to U+00A0, so a change to either fails
until both match. keepsDest moves above downloadFile's doc comment,
which belongs to downloadFile.
2026-11-17 07:16:03 +00:00
Michael Wang e21f56dcad fix(producer): keep the probe stage's media pre-checks linear in page size (#8044)
* fix(producer): keep the probe stage's media pre-checks linear in page size

hasRuntimeMediaChanges now collects the page's media elements in one walk,
answers id lookups from a set, de-duplicates selectors and checks them only
against media elements. Past a fixed number of checks it lets the browser
probe decide.

hasVariableBoundMedia parses each element's variable attributes once per scan
and shares one step budget across the ancestor walks. Past the budget it gives
the conservative answer and probes in the browser.

* fix(producer): bound the media-source scan by selector length, and walk every top-level element

The selector budget now counts selector characters times media elements,
since each match parses the selector again. A selector with a sibling
combinator goes to the browser probe. The media walk starts from every
top-level element, so a page written without the html tag is still scanned.
Tests now count lookups and JSON parses instead of timing them.
2026-11-17 07:01:38 +00:00
Miguel Ángel d7d416124f fix(studio): colour grading works in a sealed preview (#7999)
* test(studio): colour grading previews and status on a sealed preview

* fix(studio): colour grading reads a sealed preview through the editing port
2026-11-17 07:00:14 +00:00
Michael Wang 06b632017c fix(engine): bound the proxied host pre-check by the download's timeout (#8048)
The local lookup that runs before a proxied download took no abort signal,
so a stalled resolver held the request past its timeout. It now settles
when the request's signal aborts.

Its pass-through list now matches what dns.lookup reports: ENOTFOUND,
EAI_AGAIN and EAI_FAIL go to the proxy; ENODATA and ESERVFAIL, which the
lookup never returns, are gone.

Adds a test that runs the real GIF step on a source saved in Studio's
private downloads folder.
2026-11-17 06:54:23 +00:00
Miguel Ángel 7b27fbc84a fix(engine): the GPU, host-ceiling and HDR launches keep the sandbox where the host allows it (#8038)
* test(engine): the GPU, host-ceiling and HDR launches keep the sandbox where the host allows it

* fix(engine): the GPU, host-ceiling and HDR launches keep the sandbox where the host allows it

* test(engine): the host-ceiling stub shell runs only where /bin/sh does
2026-11-17 06:49:28 +00:00
Michael Wang 70820b386f fix(studio-server): cache reads never follow a link the project ships (#8039)
* fix(studio-server): cache reads never follow a link the project ships

The waveform and peaks caches, the thumbnail cache, the stored preview
documents and the preview proxy copies all live in folders inside the
project, which its author controls. Their reads opened entries with
link-following calls, so a project could ship a link at a predictable cache
name and have Studio return the file it pointed at.

Each of these reads now goes through readProjectCacheFile or
isProjectCacheFile: the entry must be a plain file, reached with no link
from the project folder down, and is opened without following links.
Anything else is a miss, and the entry is rebuilt.

- Waveform and peaks entries must also parse as an array of numbers.
- A proxy copy, its fast and content index files, and the pieces of a
  chunked copy count only as plain files.
- Stored preview documents carry an HMAC under the user's private preview
  token, so a document the project shipped is never served. Without a
  token, nothing is stored.

* fix(studio-server): the proxy copy lock treats a link at the copy name as not made

The copy lock tested "the copy already exists" with a link-following check,
and the transcoder returned the copy path unchecked when the lock said
another process had made it. A link at the copy name was then served.

- acquireCopyLock takes the caller's "copy made" test; the transcoder
  passes isProjectCacheFile and re-checks the path before returning it.
- Copy index files are written by rename, so a link at an index name is
  replaced instead of written through.
- Chunk pieces are checked from the project folder down, like every other
  cache entry.
- A cache entry with more than one name (a hard link) is a miss.
2026-11-17 06:31:06 +00:00
Michael Wang 5fcce21a64 fix(engine): check proxied download hosts; keep raw GIF downloads private (#8040)
* fix(engine): check proxied download hosts against local DNS; keep raw GIF downloads private

Behind an env proxy (HTTPS_PROXY with NODE_USE_ENV_PROXY=1 or
--use-env-proxy), composition downloads skipped the resolved-address check
and relied on the literal-host check alone. An internal DNS name passed, and
NO_PROXY hosts were dialled directly.

Now the downloader resolves the host on this machine first and refuses it
when any answer is non-public. A name this machine cannot resolve is still
left to the proxy, so proxy-only networks keep working.

Studio's remote GIF prep now picks only URLs whose path ends in .gif,
discards a downloaded body that does not start with a GIF signature, and
the raw downloads folder is no longer served to the page; only the converted
output is.

* fix(cli): read the downloaded GIF's header through a bounded read stream

CodeQL read the openSync call as a temp-file creation. The file sits in the
project's .hyperframes folder and is only read, but a six-byte read stream
does the same check without a file descriptor of our own.
2026-11-17 06:09:42 +00:00
Miguel Ángel 915021265f fix(studio): caption editing works in a sealed preview (#8002)
* test(studio): caption overlay shows and edits words in a sealed preview

* fix(studio): caption editing reads and moves words through the editing port in a sealed preview

* style(studio): format the caption port change and trim its comments

* fix(studio): keep the caption port change inside its files and under the size checks

* fix(studio): keep late caption frame answers from writing after Studio moves on

A caption detection, nudge or drag still waiting on a sealed preview no longer
writes after its effect is gone, and a frame-reported word transform past the
frame's own write bound is refused instead of stored. Each has a test against
the real editing agent that holds the frame's answer open.

* refactor(studio): move the sealed caption nudge queue next to the frame word helpers

Keeps the caption overlay under the studio file size limit and its comment share at the base. No behaviour change.

* refactor(studio): keep the sealed caption nudge request inside its helper file
2026-11-17 06:02:22 +00:00
zhengqiuyang f89f6d3d4b fix(producer): cap the software encoder to the cores capture leaves free (#8019)
`canEncodeWhileCapturing` started an H.264 export beside the capture workers
whenever `workerCount < cpuCount`, but `appendSoftwareEncoderThreadsArg` gave the
encoder every usable core, so the overlap spawned a full-width x264 pool next to
the capture workers (#7458).

The overlap now reserves the cores capture is using: `softwareEncoderThreads =
max(1, cpuCount - workerCount)` travels through the streaming encoder options to
ffmpeg's `-threads`, while the post-capture encode keeps the old default.
2026-11-17 05:56:12 +00:00
Miguel Ángel 9daa7e876d fix(studio): a sealed preview's reload shows in a fraction of a second, not after 8 s (#8015)
* fix(studio): a sealed preview's reload shows in a fraction of a second, not after 8 s

* fix(studio): the sealed reload's frame sits under the live one, so clicks stay on the live frame

* fix(studio): the sealed reload's frame stays on top but inert, so clicks reach the live frame

Under the live frame (z-index -1) the reload's frame was left unpromoted in a traced run; on top and inert it renders and swaps in, and hit testing skips it, its own frame included.

* refactor(studio): name the sealed reload's style for what it does, not in comments

* fix(studio): the reload code marks a sealed reload's player inert until it is promoted

Player keeps main's shape: the hook that owns the reload sets inert on the hidden frame's player element when its frame arrives and clears it at promotion.

* test(studio): keep the reload-inert test's comment under the line limit
2026-11-17 05:55:20 +00:00
terencecho 8a13b2cafa feat(producer): enforce expected output dimensions before capture (#7871) 2026-11-17 05:37:05 +00:00