* fix: warnings that name project files print control characters as visible escapes
The CLI already escaped control characters in the text its own commands
print, but warnings from core, producer and engine went to the terminal
raw. A composition whose sub-composition path held ESC or BEL still
drove the terminal through the bundler's "Skipping sub-composition"
warning in `info --media` and `snapshot`.
terminalText moves to core so there is one sanitiser, the CLI imports it
from there, and the library warnings that carry project text (the
bundler, the producer logger, the file server, render path skips, asset
load failures, FrameCapture, the import map, fonts, figma and atomic
file warnings) pass that text through it.
* fix: every library warning that carries project text escapes control characters
* fix(hdr): bound HDR image decode and resample sizes
The native HDR image path sized its host buffers from the PNG header and
the element's page-measured layout box, with no ceiling.
- PNG decode checks IHDR dimensions and bit depth before allocating,
inflates with maxOutputLength = height * (stride + 1), and rejects image
data whose inflated length does not match the header.
- HDR images are limited to 8192x8192 pixels; resampleRgb48leObjectFit
refuses targets above that.
- A layout box larger than the output frame is shrunk uniformly to fit it.
- Decoded and resampled HDR image buffers count against the HDR extraction
budget (HDR_EXTRACTION_MAX_BYTES / cgroup limit) for the render's lifetime.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* build(engine): raise the packed size budget to 510000 bytes
The PNG header checks and bounded inflate add about 500 bytes to the
packed engine, which was already within a few hundred bytes of its
1% tolerance over the 500000-byte budget.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(engine): give each superset extraction a folder of its own
A superset group extracted into a folder named from the group index and the
process id, and deleted and recreated it by that name in the cache root that
every render shares. Two renders in one process could share the folder and
remove each other's frames.
Partial folders are now created with mkdtemp, so each extraction writes only
into a folder it made. A cache entry is published only when its frame count
is the one the extraction wrote.
* fix(engine): make the partial folders with createStagingDir; raise the engine size budget
* wip: paused before review
* test: cover credential files on the preview routes and the deploy notice
* refactor: name the inspector's file lookup for what it serves
* fix(cli): a link to a private file outside the project keeps its own left-out reason
* fix: escape the upload notice and skip private files from old manifests
The static-dedup and at-risk predictors turn each GSAP tween into a frame
range and wrote every frame of every range into a Set. The page decides how
many tweens there are and how long they claim to run, so stacked tweens
multiplied the loop and the at-risk predictor never clamped a range's end at
all: one tween ending at 1e9 s walked billions of frames.
Ranges are now clamped to the frames the render captures, merged before any
frame is written, and the interval list is capped. Past the cap, static dedup
is skipped and every frame is treated as at risk (screenshot capture), so
output never changes for the worse.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(engine): a cached browser is used only when its files match the pinned build
* ci: install the pinned headless shell for the engine and producer test jobs
* ci: record the producer test job's new setup step for test reachability
* chore: release v0.9.55
* chore: release v0.9.55 notes include #7830
* chore: release v0.9.55 notes include #7859 and #7867
* chore: release v0.9.55 notes name the docs change and cloud render
* chore: release v0.9.55 notes include #7866 and #7801
* chore: release v0.9.55 notes match the style bar
* fix(cli): the static project server answers only loopback and marks pages another site loads
check, snapshot, validate, layout, compare, grade-compare and motion-shot serve the
project from a loopback server. It now refuses any Host other than loopback or its
in-process name before reading a file. A page or file that another site loads comes
back sandboxed, and its documents carry the another-site mark, so the runtime offers
that site no editing port. The capture browser's own loads are unchanged.
* fix(producer): the render file server answers only loopback and offers no editing port
The render file server now refuses any Host other than loopback before it opens a
file; the capture browser asks for localhost. Every HTML page it serves carries the
another-site mark, so its runtime answers no editing connect. A render never sends
one, so capture is unchanged.
* fix(engine): the exported file server answers only its own host and offers no editing port
createFileServer from @hyperframes/engine now refuses any Host other than loopback or
the hostname it was bound to (on a wildcard bind, this machine's own addresses too)
before it reads a file. Every HTML page it serves carries the another-site mark, so
its runtime answers no editing connect.
* fix(engine): extraction-time video downloads get the not-media check
A video src that is still remote at frame extraction is downloaded again and
then probed. That copy now gets the checks other media downloads get before
anything reads it as media:
- the not-media sniff, so an HTML, XML or JSON body (including a DASH
manifest) is refused with the existing NotMediaPayloadError, classified as
invalid_media;
- on a render service (PRODUCER_RESTRICT_PAGE_NETWORK), the same
-format_whitelist an https input gets, so a playlist, manifest or concat
list fails to open whatever its bytes say, and no file it names is read.
Real mp4, mov and webm downloads extract the same frames as before.
* fix(engine): the download format check stops when the render is cancelled
* fix(engine): the not-media sniff keeps mp4 files whose box size reads as text
An ISO BMFF file opens with a 4-byte box size and a box type. A size of 60
is the byte `<`, so after the leading NULs were skipped a valid mp4 with a
60-byte ftyp was refused as a text document. The sniff now recognises an
mp4/mov box header (size 0, 1 or at least 8, then ftyp, styp, moov, moof,
mdat, free, skip, wide, sidx or pdin) before it skips NULs. HTML, XML,
JSON and playlist refusals are unchanged.
* fix(engine): the mp4 exception in the not-media sniff needs a box that fits the file
The sniff only skips its document check for an mp4/mov opening when the
first box is ftyp or styp, its declared size (including a 64-bit size) fits
the file length, and the next box header, when the sniff window holds it, is
a known media box that also fits. A document that only spells a box header
falls through to the document and playlist checks as before.
* fix(engine): the not-media sniff keeps mp4 files with leading padding or extension boxes
An mp4 or QuickTime file may open with free, skip, wide, uuid, pdin, moov,
mdat or moof as well as ftyp or styp, and may carry any box type after it.
The sniff now accepts any of those first boxes, then walks every box header
the sniff window holds: each needs a printable four-character type and a
size that fits the file. A document that only spells a box header still
falls through to the document and playlist checks.
The outside-project media check skipped any src starting with data:, blob:,
about: or http(s): in any letter case, while the readers resolve everything
but exact http:// and https:// URLs as a local path. A src such as
data:x/../../outside/clip.mp4 passed the check and the readers opened the
file it named.
The check and the media type preflight now use the readers' remote test,
isHttpUrl, and check every other src with a shared containment helper,
isInsideAssetRoots. Frame extraction, the audio mix, and the HDR and video
sound probes also refuse a local source outside the project, compiled and
download folders on their own when outside files are not allowed.
The CLI static project server and the producer and engine file servers bind
127.0.0.1, but answered any Host header. They now refuse a request whose Host
is not 127.0.0.1, localhost or [::1] at their own port (or the in-process
origin the CLI hands out when listen is refused), and their responses carry
frame-ancestors 'self' and X-Frame-Options: SAMEORIGIN so another site cannot
frame the served page.
A download whose response declares a Content-Length re-arms its attempt
timeout on every chunk, so a server that trickles just above the throughput
floor was never cut off by time. Parallel downloads also had no shared limit
on the disk they could fill.
- Each download attempt now has a deadline that incoming data never moves:
30 minutes by default, HYPERFRAMES_MAX_DOWNLOAD_MS to change it. Passing it
fails the download without a local retry.
- The default per-file cap drops from 20 GiB to 8 GiB
(HYPERFRAMES_MAX_DOWNLOAD_BYTES still overrides it).
- Downloads keep 512 MiB free on their volume
(HYPERFRAMES_DOWNLOAD_MIN_FREE_BYTES, 0 turns it off). A declared size is
claimed before the body is read and counted against every parallel
download on the same device, and free space is measured again every 4 MiB
as bytes arrive. Free space that cannot be measured does not block.
- docs/packages/engine.mdx lists the download limits and their variables.
Render, capture and the HTML bundler used a narrow private-file rule that
only refused Git data and env files. A composition's script could read the
app's own records under .hyperframes/ (chat history, hand-off, comments,
job log) from the file server, or a data-composition-src could inline one.
Every file server a composition reaches now uses the rule Studio, play and
present already use: Git, env, and .hyperframes/ apart from Studio's own
files and the prepared-assets and requests folders. The rule now matches
Windows spellings too: any case, trailing dots or spaces, backslashes and
stream suffixes.
* fix(engine): restricted downloads use the capture proxy's address rule
With PRODUCER_RESTRICT_PAGE_NETWORK on, remote asset downloads now go
through the same transport and host check as the render page's capture
proxy:
- An IPv6 literal host, or a name the capture proxy refuses, is not
permitted, on the first request and on every redirect hop.
- Names resolve to IPv4 answers only, every answer must be public, and
the download dials the checked address. A name with only IPv6 answers
does not download, as in the capture proxy.
- Proxy variables (HTTPS_PROXY, NO_PROXY) are not used in this mode, so
no host is dialled without the address check. HYPERFRAMES_CAPTURE_PROXY
still routes downloads, as it does for the page.
With the setting off, downloads keep the existing transport.
* fix(engine): restricted downloads keep undici's transport with the capture resolver
The capture transport refuses any compressed response and sends no
User-Agent, and its socket and parse errors were not retried. Restricted
downloads now use the same undici agent as before, with a connect lookup
that calls the capture proxy's resolvePublicAddress: IPv4 answers only,
every answer public, and the checked address is the one dialled.
This keeps the old request headers (User-Agent, Accept: */*), gzip, br
and deflate unpacking for text fetches under the existing byte cap, the
asset path's refusal of compressed bodies, "fetch failed" retry handling,
and connection reuse. Non-public destinations stay non-retryable refusals.
* fix(engine): the media playlist check reads HLS lines and attributes as ffmpeg does
The folder check now finds every name ffmpeg's hls demuxer would open:
- lines end at CR, LF or NUL, and a line is also read cut at ffmpeg's
4095-byte limit;
- URI attributes are split like ff_parse_key_value: quoted or bare values,
with backslash escapes removed;
- leading ID3v2 tags are skipped before the playlist signature, and a file
behind more than 16 of them is refused.
Each refused shape is checked against ffprobe 8 in the test: ffprobe opens
the outside file, and playlistLeavesItsFolder now refuses the list.
* fix(cli): snapshot never hands FFmpeg a project video that is a document or an escaping playlist
`hyperframes snapshot` decodes held project videos with FFmpeg and FFprobe.
It now runs the engine's media check first: a file that is a document, or an
HLS or ffconcat list naming files outside its folder (under any extension),
is skipped with a "not media" warning and never reaches FFprobe or FFmpeg.
Real clips and HLS lists of segments beside them snapshot as before.
* fix(engine): playlist check reads lines as bytes and refuses unreadable nested lists
- Playlist text is read as latin1, one character per byte, so a line is cut
at 4095 bytes exactly where ffmpeg cuts it, even when it holds bytes that
are not UTF-8. Nested names are opened by those same bytes.
- A nested name that exists but cannot be read is refused; a name that does
not exist, or is too long to exist, is still kept.
- Each name is checked once, each file is opened once (ID3 header and head
in one read), and each file's verdict is reused within a call: 100k
segments naming one file drop from seconds to tens of milliseconds.
* perf(cli): snapshot checks each project video once and warns once when it is refused
* test(engine): the ffprobe playlist proof ends its options with -- before the input
* chore(engine): raise the packed size budget to 500000 bytes
The byte-exact HLS playlist parser adds about 6 KB to the packed engine
(496647 in CI against a 490452 budget).
* fix(engine): media inspection never waits on a FIFO or device
The document sniff and the playlist walk open with O_RDONLY|O_NONBLOCK where
the platform has it, fstat the descriptor, and refuse anything that is not a
regular file before reading; a folder still fails as it did. A FIFO with no
writer, as a media source or named in a list, is refused at once.
* fix(cli): snapshot inspects project videos within the probe deadline and its cleanup scope
The held-video hints are gathered inside the capture's cleanup scope, and
every media inspection gives up after the same 30 s limit as the FFprobe
call it guards, treating the file as not media.
* fix(engine): read PRODUCER_RESTRICT_PAGE_NETWORK's usual spellings and restrict on an unknown value
true, 1, yes and on turn the render network restriction on and false, 0,
no and off leave it off, in any letter case and with surrounding
whitespace. Unset or blank stays off for local renders. Any other value
now restricts and logs a warning once, instead of leaving the render
browser and ffmpeg URL inputs unrestricted.
* fix(producer): on a render service the audio probe reads a composition URL from a downloaded copy
With PRODUCER_RESTRICT_PAGE_NETWORK on, a video URL the composition
names is fetched through the shared downloader (resolved-address check,
pinned connection, per-hop redirect checks) before ffprobe reads it, and
skipped if the download is refused. In a distributed audio step the copy
lands in the mixer's work folder, so the mix reuses it instead of
downloading again. Without the flag the probe reads the URL as before.
* fix(engine): on a render service a URL that ffmpeg reads in place must be a self-contained container
With PRODUCER_RESTRICT_PAGE_NETWORK on, every https input ffmpeg or
ffprobe opens directly (such as a signed storage URL for a project's
video or audio sidecar) also gets -format_whitelist with the same
self-contained containers the Studio media helpers allow. A playlist,
manifest or concat list stored under a media file name can no longer
make ffmpeg open other network locations. Local renders are unchanged.
* fix(producer): the render-service audio probe skips only refused URLs and downloads once
A composition URL is skipped, with one warning, only when the download
address rules refuse it. Timeouts, HTTP errors and a cancelled render
fail the probe as before. Videos without sound, muted or hidden are not
downloaded. The in-process extract stage passes the render's abort
signal and the mixer's work folder, so the mix reuses the copy.
* fix(producer): unit tests load the orchestrator again; raise the engine size budget
audioWorkDir moves to render/shared.ts, so tests that replace the audio
stage module still load the orchestrator. The format-whitelist test
probe ends its options with -- as the ffprobe argv contract requires.
The engine packed size budget rises to 500000 bytes.
* fix(gcp-cloud-run): render pages cannot reach the service's own dispatch endpoint
The Cloud Run image now sets PRODUCER_RESTRICT_PAGE_NETWORK=true, so a
rendered page reaches only its own project server and public addresses,
not loopback ports or the metadata server. The dispatch endpoint also
refuses any POST that carries an Origin header: browsers send one on every
POST and Cloud Workflows never does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(engine): the default frame cache folder is private to the user who renders
The default extraction cache sits in the shared temp folder. It is now
created with mode 0700, an existing one owned by the same user is closed
to others (its entries stay, so cache hits carry over), and one that is a
link or belongs to another user is not used: that render runs without the
cache and prints a warning. The animated GIF cache under the same folder
follows the same rule. A folder set with HYPERFRAMES_EXTRACT_CACHE_DIR is
left as it is.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat(gcp-cloud-run): a Terraform variable turns the page network restriction off
restrict_page_network (default true) sets PRODUCER_RESTRICT_PAGE_NETWORK on
the service. The package README and docs say what the restriction refuses
and how to turn it off for trusted compositions that need private hosts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(engine): restore an unset TMPDIR as unset after the cache-root tests
Assigning undefined to process.env stores the string "undefined", so on a
runner with no TMPDIR every later test made its temp folder under ./undefined.
* test(engine): the frame-extractor link test also restores an unset TMPDIR as unset
* chore(engine): raise the packed size budget to 500000
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
When one capture worker fails, the pool aborts its peers and each of them
reports "Parallel worker cancelled". The pool message listed every worker in
id order, so the one real cause sat between cancellations:
Worker 0: Parallel worker cancelled; Worker 1: Parallel worker cancelled;
Worker 2: Disk capture may need ~2712.6 MB ...; Worker 3: Parallel worker cancelled
The message now carries the failures that are not cancellations and counts
the peers that were stopped because of them. A pool where every worker was
cancelled keeps the full list.
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* fix(engine): render refusals name the address an IPv6-mapped or NAT64 host carries
* chore(engine): raise the engine size budget for bounded downloads and refusal classes
downloadToTemp now refuses any Content-Encoding other than identity, caps each
download at 20 GiB (HYPERFRAMES_MAX_DOWNLOAD_BYTES) on the declared Content-Length
and while streaming, and aborts a transfer whose bytes over the last 60 s average
below 32 KiB/s (HYPERFRAMES_MIN_DOWNLOAD_BYTES_PER_SEC, 0 disables).
Compressed and over-limit responses are not retried. A throughput abort is a
retryable timeout like the stall timer, which is unchanged. A sized body that
trickles one chunk every 100 s is now cut by the floor instead of finishing.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(engine): NAT64 addresses count as non-public; producer exports the address rule
* chore(producer): drop the new section comment
* fix(engine): judge mapped and NAT64 addresses by the IPv4 address they carry
* test(engine): operator ranges hold through mapped and NAT64 addresses
* fix(cli): keep Chrome's sandbox on for website capture where the host supports it
`hyperframes capture` added --no-sandbox on every Linux host. It now uses the
engine's host check, the same one rendering uses: the sandbox stays on unless
the process runs as root, in a container or serverless runtime, or with user
namespaces restricted. HYPERFRAMES_CHROME_SANDBOX=0/1 still overrides, and a
launch Chrome refuses with the sandbox is still retried without it. When the
host check turns the sandbox off, capture prints a one-time warning.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(cli): drop the new comment block from the capture launch args
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(engine): start nvidia-smi, vm_stat, ps and tasklist from trusted folders only
The renderer resolves these helpers through the shared trusted lookup and runs the absolute path, so a program with the same name in a project folder is never started in their place.
* test(engine): memory and import tests follow helpers started by resolved path
* fix(engine): refuse media playlists that name files outside their folder
* refactor(producer): media preflight decides refusals in one helper
* fix(engine): read a playlist once, bounded, instead of sizing it first
* fix(producer): shown-box sampling stays within the validated render duration
Sampling where each oversized video is drawn stepped through the authored
start and end in 0.25 s float steps with no bound, before the render
duration was checked. An enormous start never advanced the step, and an
unbounded end grew the sample set until memory ran out.
The render duration is now validated first, each window is cut at the
composition's end, a window that is not finite is skipped, and the loop
counts integer steps. Building the sample list happens inside the
measurement's try, so any failure falls back to full-size extraction.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix: render and capture file servers refuse env files and Git data
The producer render file server, the engine file server and the CLI
static project server served every regular file under the project to the
page, including `.env*` files and anything under `.git`. Compile already
refuses to inline those files, and Studio preview and play refuse to
serve them.
All three now answer 404 for them through the shared isVcsOrSecretPath
rule, checked on the requested name and on a link's target, with the
case and Windows spelling variants it already covers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(producer): inline only public HTTPS scripts, under the download URL policy
The compile step fetched every external `<script src>` with a bare fetch:
any scheme, any host, redirects followed, body size unbounded.
It now fetches through the engine's download policy, the one remote
stylesheets and media already use: HTTPS only, literal and resolved
addresses public, every redirect hop checked again, connect pinned to the
checked address, and at most 16 MiB per script. A new engine helper,
fetchPublicHttpsBytes, returns the raw bytes so integrity metadata is still
checked before decoding; fetchPublicHttpsText now decodes its result.
A script outside the policy keeps its `<script src>` tag, and the capture
browser loads it as before; the log says so at info level instead of
warning that the render may fail. Scripts under the operator's
HYPERFRAMES_GSAP_BASE_URL mirror, which may be loopback HTTP, are still
inlined. An integrity mismatch still fails the render.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(producer): the audio probe skips remote video URLs outside the public HTTPS policy
A video whose remote src compile could not download keeps that URL, and
the probe-only audio pass handed it straight to ffprobe, which fetches any
scheme and host. A src that fails the literal public-HTTPS check (plain
HTTP, loopback, private, link-local or `.internal` hosts) is now skipped,
the same outcome frame extraction already gives it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(producer): the GSAP mirror exception covers only its dist folder
Scripts from the operator's HYPERFRAMES_GSAP_BASE_URL mirror are fetched
outside the public-HTTPS policy, because the mirror may be loopback HTTP.
That exception now covers only plain script file names in the GSAP dist
folder the compiler itself points at, refuses redirects and stops at
16 MiB, like every other inlined script. Any other path on the mirror's
origin follows the public-HTTPS policy and is left for the browser.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(engine): on a render service, https media inputs open only HTTPS
ffmpeg and ffprobe read some https sources in place. An https playlist
or manifest can name segments on any protocol, and the default protocol
list for an https input does not restrict them. With
PRODUCER_RESTRICT_PAGE_NETWORK=true, these inputs now pass
`-protocol_whitelist https,tls,tcp`, so segments and parts they name must
be HTTPS too. Local renders are unchanged.
A new test pins that local project files which are playlists, concat lists
or DASH manifests (with their own extension or named `.mp4`) are probed
and decoded without any request to the URLs they list: ffmpeg limits what
a local file input may open to file, crypto and data, and the concat
demuxer refuses URL entries in safe mode.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(engine): renders reach only public addresses from every part of the browser
* fix(engine): renders reach only public addresses from every part of the browser
* fix(engine): renders reach only public addresses from every part of the browser
* fix(engine): renders reach only public addresses from every part of the browser
* fix(engine): look a host up again after a failed lookup instead of refusing it for the whole page
* fix(engine): name the failed-lookup reset instead of commenting it
* fix(engine): hold the render page to the asset download address rules
With PRODUCER_RESTRICT_PAGE_NETWORK=true the render page reaches only its own project server and public addresses, checked by host and by resolved address, the rule asset downloads already follow. Unset, nothing changes for local renders.
* fix(engine): keep the page network filter comment within four lines
* fix(studio-server): check and render keep their history on a drive without hard links
The history lock had its own list of the errors that mean a drive cannot
hard-link, and it lacked EISDIR, which Windows returns on a Google Drive
folder. Every check report and render record there failed. The lock now
uses core's list, the one owner, which also gains ENOSYS from the lock.
* fix(engine): downloads and plan blobs publish on a drive without hard links
The producer's plan publisher kept a third list of no-hard-link errors
without EISDIR, and the downloader had no fallback, so both failed on a
Google Drive folder. Both now use core's cannotHardLink; the downloader
copies into an exclusively created file, so it still never overwrites.
* fix(engine): a download on a drive without hard links publishes atomically
Instead of copying into an exclusively created file, the fallback renames
the staged download into place under the cache path lock when nothing is
there yet, so a killed run never leaves a truncated file to reuse.
* fix(engine): an unrecognised capture failure is unknown, not the author's fault
* fix(engine): carry the extractor's disk-full words in a name, not a comment
A caller that runs several renders at once sets HYPERFRAMES_OWNER to a per-run id; every browser the CLI or
engine launches and the warm check server carry --hyperframes-owner=<id>, so the caller can tell one run's
leftovers from another's.