* fix(media-use): never write recipe files through links
A project folder can carry symbolic links inside .media/recipes/<name>/.
When recipe.json there did not parse, freezing a recipe under that name
reused the folder and wrote each recipe file through the link, which
could create or overwrite files outside the project. The user-tier copy
then carried those links into ~/.media/recipes, and using the recipe
copied them into other projects.
Freezing and using a recipe now refuse a link at .media, .media/recipes
or the recipe folder before anything moves or is written. Each recipe
file is written as a new file and renamed into place, so a link at its
name is replaced, never followed. Only the files a freeze just wrote
reach the user tier, and using a recipe imports only its regular recipe
files. Using a recipe also refuses a recipe whose frame.md is a link,
and replaces a frame.md link in the project instead of writing through it.
* fix(media-use): read user-tier recipe files through one no-follow handle
Checking a file with lstat and then reading it by path leaves a gap in
which the file can be swapped for a link. Importing a recipe from the
user tier and copying its frame.md now open each file once with
O_NOFOLLOW, and check that the open handle is a regular file before
reading it.
* fix(media-use): refuse recipe file links where Node has no O_NOFOLLOW
Node has no O_NOFOLLOW on Windows, so opening a recipe file there
followed a link and read its target. readRegularFile now checks the
path with lstat first and refuses anything but a regular file. After
the open, the handle must be a regular file with the same device and
inode that lstat saw, so a link swapped in between is refused on every
platform. O_NOFOLLOW stays as an extra guard where it exists, and
O_NONBLOCK keeps a FIFO from blocking the open.
A test passes 0 as the no-follow flag to check the Windows path on any
platform, and another checks that a FIFO is refused without blocking.
* refactor(media-use): compare the path with the handle after opening
readRegularFile now opens first, then requires that lstat of the path
shows a regular file with the same device and inode as the handle. A
link has its own inode, so it never matches the file an open reached
through it, with or without O_NOFOLLOW. O_NONBLOCK keeps a FIFO from
blocking the open. Checking after the open, instead of before it,
leaves no check-then-open gap on the path.
* test(studio): a sealed preview whose film boots after 8 s comes ready without an error
* test(studio): wait for the sealed player to mount before reading it
* fix(studio): a host can own the live preview's load deadline, so a slow sealed film isn't an error
* test(producer): a cancel stops the compile's media, image and font downloads
* fix(producer): pass the render's cancel to the compile's media, image and font downloads
* test(producer): keep the cancel test's fails-without line short
* test(producer): cap a compile's remote asset downloads and how many run at once
* fix(producer): download at most 1,000 remote assets per compile, 8 at a time
* test(producer): a cancel stops the compile's media, image and font downloads
* fix(producer): pass the render's cancel to the compile's media, image and font downloads
* test(producer): keep the cancel test's fails-without line short
Registration now reports whether the server created the project (201)
or answered one already bound to the record's studioProjectId (200).
A first share that gets an existing project back is refused with
review_project_changed and restores the record, before any audience
change, link reopening or upload. A retry after a lost registration
reply still reaches its project: the record holds the saved
registration and the project is still private, with its link never
turned off and no ready version.
Studio now passes the review the person confirmed through the share
job. The service refuses when the folder's review differs from it, and
shareForReview refuses a record whose project is not the confirmed one,
so every path to setReviewAccess, the first audience and addVersion
checks the confirmed review.
* fix(core): stop audio automation from crashing the preview renderer
Bent automation segments were booked with setValueCurveAtTime. When the audio thread
is mid-render and a curve's start lands after currentTime but before the next render
quantum, Chromium moves the curve's start to that quantum but leaves its end marker
where it was. The curve then runs past the next event, and if that event sits inside
the same quantum, AudioParamHandler::ValuesForFrameRangeImpl fails
CHECK_GE(fill_to_frame, write_index) and the renderer aborts.
Every segment is now a setValueAtTime at its start and linear ramps through the same
sampled points. A value curve interpolates linearly between its points, so the values
are the same. With no curves left, the refused-curve fallback (emitRamps) and the
curve-overlap tests go.
The set at each segment's start also fixes straight segments ahead of the playhead:
they ramped from the moment playback started instead of holding the first point's
value until the clip reached it.
* test(core): keep the clamping tests, aimed at ramp-only automation
The branch deleted audioFxAutomation.clamping.test.ts, which the no-deletions check refuses.
Its two cases still matter with ramps: a lane booked behind the audio clock finishes at its
last value, and one booked ahead of it books no value curve.
* test(engine): the browser automation test expects the bend the lane draws
The scheduledAt=0.024 case expected a straight 0.5 to 0.7 line after the playhead. That was
the old fallback: Chrome refused the clamped value curves and they were rebuilt as one ramp
per segment, flattening the bend. With ramps through the sampled points the bend is kept,
and the rendered output matches those points within the same 0.000001 tolerance.
Against the scheduler on main the updated case fails by 0.0685 (the flattened bend); here it
passes three runs in a row.
* fix(studio-server): saving history on a drive that stops answering no longer freezes the app
* test(studio-server): read the saved video state through one handle
* test(studio-server): open the silent state file by name only once
* fix(player): a sealed film shows when its timeline lands after the 8 s check
* fix(player): a navigation away from a sealed film keeps its missed check latched until the next load
* fix(player): the latch is set before the probe stops, so stop keeps it
* test(player): the sealed test reads the error event's detail as the player sends it
* test(studio): a sealed audio group's undo survives a reply of the wrong shape
* fix(studio): a sealed audio group's undo reads the frame's reply only in the shape it asked for
* fix(cli): preview answers unknown paths with an inert refusal, not the Studio shell
Studio routes by location.hash only, yet the preview server answered every
unknown GET with the Studio shell (200, same origin, query kept). An OAuth
redirect to the preview port (/oauth/callback?code=...&state=...) therefore
re-mounted the project, and project script read the code from the address.
The shell is now served only at / and /index.html. Any other path gets a
plain-text 404, and a request carrying `code` or `state` at any path (entry
and preview routes included) gets a plain-text 400. Both carry a sandbox CSP
(opaque origin), COOP same-origin, frame-ancestors 'none' / X-Frame-Options
DENY, nosniff, no-referrer and no-store, and never echo the request.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(studio): preview's Vite modes refuse an OAuth return too
`preview` from a source checkout (dev mode) and with the local studio
(HYPERFRAMES_LOCAL_STUDIO=1) run packages/studio/vite.config.ts, whose SPA
fallback served the Studio shell at /oauth/callback?code=... with no COOP or
sandbox. devProjectApi now refuses a `code` or `state` at any path as its
first middleware, with the same inert response as the embedded server.
The refusal moves to @hyperframes/studio-server so both servers share one
helper.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(studio): a sealed resize of a keyframed size keeps the box's other side
* fix(studio): say where a sealed resize's pre-gesture box comes from
* refactor(studio): read a resize's pre-gesture box one side at a time
* fix(studio): a sealed move, resize or turn takes GSAP's route when GSAP animates the layer
* fix(studio): a live layer's route is decided at once, and a turn the press routed keeps it
* fix(studio): a sealed resize's anchor move waits for the frame's GSAP read before choosing CSS
* fix(studio): a sealed resize, move or turn typed in or made by the agent shows in the preview
* test(studio): a sealed geometry save leaves the frame to a live drag draft
* fix(studio): agent tools read a sealed preview through its runtime
* test(studio): agent tool tests build selections from live elements
* test(studio): agent tools on a sealed preview look, select, inspect, write and read back
* test(studio): resolver and tool tests find elements through the preview read
* test(studio): the socket-pool walk waits for studio_look's ready scene
* fix(studio): a sealed crop of a turned or scaled layer saves the crop an unsealed one saves
* fix(studio): a sealed style edit shows on the selection at once, so a crop stays where it was let go
* fix(studio): a sealed undo restored in place re-reads the selection, so it shows the undone edit
* fix(core): a sub-composition's script re-run keeps the preview at its playhead
* fix(core): a rebind leaves a root that is not a timeline alone and renders a shortened root once
* fix(core): a redo in a sealed preview puts Studio's edit marks back in place instead of reloading
* fix(core): Studio's motion marks keep the reload; name the edit marks instead of commenting
* fix(core): a restore that needs the reapply script, or drops a motion mark, reloads
* fix(core): a restore waits for the reapply script to start, and any quoting finds its marks
* refactor(core): name the reapplied-mark check instead of commenting it
* fix(core): an in-place undo re-run refuses a reapplied mark until the reapply script started
* test(core): keep the soft-reload refusal test's comment under the line limit
* test(core): a rule of thousands of selectors must split its list a fixed number of times
* fix(core): split a rule's selector list once when rewriting svg id references
* fix(studio-server): preview copies of long clips with sound finish again
The piece join ran with ffmpeg's -xerror once it moved onto the shared concat input, which made the timestamp repair at each seam of a clip with sound fatal: the copy failed, its pieces stayed, and the clip waited for a copy that never came. The join opts out of -xerror; the video-only render joins keep it.
* fix(studio-server): a preview copy that joins short is refused and made again
Only a join of pieces with sound runs without -xerror, and every join is measured before it is kept: a copy shorter than its pieces is refused and its pieces are removed, so the next attempt makes them again. The sound test reads ffprobe's JSON so CRLF output parses too.
* fix(studio-server): a preview copy is measured against its own pieces
The join was compared with the source container's length, which counts tracks the copy leaves out, so a whole copy of a source with a longer subtitle or alternate audio track was refused on every try. It is now compared with the summed length of its pieces, which carry only the streams the copy maps; a piece that cannot be measured refuses the join.
* fix(studio-server): every piece of a preview copy is checked against its own stretch
The copy's length now comes from the picture and the sound it keeps (stream durations, or the Matroska DURATION tag), not the container, so its stretches end where those streams end. Each piece and the joined copy are measured against their own stretch, so a short piece can no longer lower the bar. A caller that leaves while the copy is measured stops the measuring, and a left copy is never written to the cache.
* fix(studio-server): long preview copies keep only the picture in pieces and add the sound once
AAC pieces overlap at every seam (each piece's priming frame reaches back into the one before), so a strict join refuses them. Pieces now carry only the picture and join strictly, exactly like the render joins; the sound is encoded once from the source and put with the picture by a stream copy that keeps both on the source's timeline. This replaces the length checks of the earlier commits, and old pieces with sound get a new name tag so they are never joined as picture-only pieces.
* fix(studio-server): each picture piece of a preview copy starts exactly where its stretch does
At a frame rate that does not divide 15 s, such as 29.97, every piece ran about 15 ms long and the join placed the next piece after it, so the picture drifted from the continuous sound (600 ms over 10 minutes). The join list now gives each piece its stretch's length (ffconcat duration), so pieces land on the source's timeline and the offset stays within a frame.
* fix(studio-server): a preview copy of a clip whose picture starts late keeps that start
On ffmpeg 8 the piece join moved the first piece to zero, so a picture that starts after the sound lost its lead against the sound added later. The join now keeps each piece's own timestamps (ffconcat inpoint 0 with each stretch's duration, and -copyts), on ffmpeg 7 and 8 alike. The long-source path moves into copyInPieces.
* fix(studio-server): a preview copy never keeps a short or broken piece from a stopped copy
A piece left by an earlier run is made again when it runs short of its stretch; when the join refuses one, every piece is dropped and made again once in the same run. A refused join no longer leaves its pieces or a picture temp behind; a stopped one keeps its pieces.
* fix(studio-server): a resumed preview copy remakes a piece a frame short and stops on cancel
A piece left by a stopped copy now has to run its stretch to within half a frame. The pieces are measured one at a time, and leaving the copy stops the running ffprobe (probeMediaMetadata takes a signal) and frees the copy.
* refactor(studio-server): read the piece check's frame rate outside the copy setup
* test(studio-server): run the real-ffmpeg join tests in their own file, inside the flake gate's limit
The flake gate runs each changed test file under full CPU load with 120 s per run. With this change's real-ffmpeg join tests added, proxyTranscoder.test.ts took about 108 s a run at a6d62ae2 and went over at 56cf7c74. Those tests move to proxyTranscoder.seams.test.ts; under 4-core load the two files take 15 s and 32 s.
* test(studio-server): keep the real-ffmpeg join tests inside the flake gate's limit
The seams file went over the gate's 120 s per run. Three tests whose checks the others already make are gone (plain copy with sound, the picture-and-sound-together clap case, the 5 s piece), each clip is measured in one ffmpeg pass, and the stopped-copy tests have their own file. On 4 busy cores the files take 15 s and 10 s. The cut piece keeps its header now, so the test reaches the retry after a refused join.
* fix(media-use): remove only the temp folders media-use made, and never fail on cleanup
discardPrivateOutput now removes a folder only if privateOutputPath made it in this
run, instead of matching names against the raw temp setting, and a removal error no
longer turns a finished or failed generation into a cleanup error. The hosted video
and favicon providers use the same helper, so resolve removes their folders too.
Provider tests remove the folders they create; the resolve test also redirects
TEMP and TMP, so it checks the cleanup on Windows as well.
* test(media-use): prove resolve can remove the hosted video and favicon folders
* test(media-use): name the folder this run did not make plainly
* test(core): a scope with thousands of excluded clips must check each element once
* test(core): a page of many svg clips and mounts must scope without a pairwise scan
* fix(core): check svg id scopes against excluded roots in one ancestor walk
* fix(share): ask before sharing from Studio, naming the review it changes
A composition's script runs on Studio's origin by default, and a received
folder's .hyperframes/review.json can point Studio at an existing review.
Every share action except sign-in now asks the person first, naming the
review (its link), who can open it, the workspace and whether project files
are uploaded. The request carries the manage link of the review that was
shown, and the server refuses it with share_target_changed when the
project's review no longer matches, so nothing is shared or changed.
* fix(share): bind each Studio share action to the review id the person confirmed
Studio now gets the id and title of the review an action reaches, including a folder
whose record names a review it never opened (a received folder can ship one). The
confirmation names that review, its workspace and who can open it, and says plainly
when a folder arrives already linked. Actions carry the confirmed id; a missing one is
refused as confirmation_required and a different one as share_target_changed, and
after that refusal Studio drops the earlier choice. The docs describe the
confirmation and that project files are included only when chosen.
* fix(share): show the review title on one quoted line in the confirmation
* fix(share): say a linked share also sets who can open it, and check the new state fields
* fix(share): separate the question from the details and say when a title is unknown
* docs(share): name the review record without a path the citation check reads as a file
* fix(studio): a video with no size of its own keeps its file's size while a lighter copy plays
The preview plays a smaller copy of a large video, and a video the film gives no
size took the copy's size: a 1920x1080 file in a 1080p film drew at 456x257 at
Quality 1/2 and 608x342 at Full, while a render draws it at 1920x1080. While a
copy plays, a rule keyed by the copy's address now gives the video its file's
shown size (its pixels' aspect and turn included), at zero specificity so any
size the film's own CSS sets still wins. Studio's media facts now carry the
pixel aspect and turn, read by the same code the engine uses.
* fix(studio): size only a video the film leaves unsized while its copy plays, as Chromium lays it out
A video whose box is its file's own size (300x150 before the file loads) gets a
plain width and height at that size while a smaller copy plays, through a
preview-only mark and a rule keyed by mark and copy address. A video the film
sizes in either direction is left to the film's CSS, so authored aspect
ratios, box sizing, containment and earlier rules lay out as before. The size
is the original's decoded size when the browser has it, else its facts with
narrow pixels stretching the height as Chromium does. ffprobe is asked for the
side data list, which 4.x also knows, in Studio and in the CLI. A video shown
with object-fit none or scale-down keeps its file.
* fix(studio): an unsized video keeps its size when its copy is made cold behind a still
* test(core): a held video gets its file back when waiting for its copy throws
* fix(core): a copy wait that throws counts as not served, so a held video gets its file back
* test(core): each proxy test resets its own runtime's copy reporting, so none reports into the next
* test(core): the stale-runtime test runs past the report throttle, as a finished test does
* test(core): a framed proxy test's runtime must not report its copies into the next test
* test(core): every proxy test runtime loaded fresh has its copy reporting reset after the test
* fix(studio): a sealed preview turns a rotated element live and saves the turn on its own route
* fix(studio): a sealed rotate regrabbed mid-save cancels to where it started on the frame too
* refactor(studio): keep the gesture handlers file under the size limit
* fix(studio): a sealed preview's timeline names each file by its project path
* fix(studio): keep a file on another site at its own address in a sealed preview's timeline
* test(studio): a sealed shadow's failed reload says only what it reported
* fix(studio): a sealed preview's failed reload no longer blames a page that never loaded
* fix(studio): a failed reload names the restore seek when the timeline already arrived
* test(studio): keep the restore seek test's comment under 120 characters
* fix(engine): bound the seek-index rebuild copy to a single mov/mp4 source
The seek-index rebuild now runs only for a source ffprobe reads as one
mov/mp4 file, and reads it with the mov demuxer, so a playlist or list
input is never copied. The copy is capped with -fs at twice the source's
size plus 1 MiB; a copy that reaches the cap is removed and extraction
continues as it does without a rebuild. The copy also waits for an
extraction slot like other ffmpeg work.
* fix(engine): remove the seek-index copy folder when the copy throws
The stream copy now runs in try/finally, so its temp folder is removed
whenever the copy is not kept, including when ffmpeg fails to start.
* fix(studio): a scene edit swaps in place and a far scene mounts for selection in a sealed preview
* test(studio): a sealed undo that reloads marks its scenes stale first
* test(core): a selector with many unclosed openers must scan in linear time
* fix(core): scan a selector's quoted, bracketed and comment parts in one linear pass
* refactor(core): split the guarded scan's bracket and escape steps into small helpers
* test(core): page goldens carry the linear selector scan the pages now inline
* test(catalog): mirror the font subset requests the pages' new inline scan text makes
* style(core): wrap the guarded scan's doc comment under 120 columns
* test(studio): a lane drag in a sealed preview restacks and saves its z-index
* fix(studio): a lane drag in a sealed preview saves the stacking change it implies
* test(studio): format the sealed restack test and skip a clip with no stored z-index
* fix(studio): dragging a layer in a sealed preview's layers panel restacks it
* fix(studio): a sealed layer drag restacks nothing from a malformed sibling reply
* chore(studio): drop a doc line the comment check counts against the stack base
* fix(core): a sealed preview's own videos load with CORS, so colour grading and audio effects work
* style(core): fit the sealed media note within the line limit
vertical.md put every word between 168 and 1330 px on 1080x1920, and
captions.md put portrait captions about 600-700 px from the bottom. The
safe areas `check` has warned about since #7680 (packages/core/src/
safeAreas.ts) are narrower: scaled to 1080x1920, TikTok is clear from
240 to 1260 px, Reels from about 269 to 1248 px and Shorts from 288 to
1248 px, and TikTok's right edge steps in to 780 px below 840 px. Text
placed by the references got outside_safe_zone warnings on all three.
Both references now give the band all three leave clear (288-1248 px
down, 120-888 px across, 780 px below 840 px) and say how to check a
single platform.
Fixes#8256
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The run summary now escapes the BGM provider and SFX count carried over
from audio_meta.json. A malformed audio_meta.json now stops the engine
through its usual error line, which escapes the file's bytes, instead of
an uncaught exception.
* test(studio): a lane drag in a sealed preview restacks and saves its z-index
* fix(studio): a lane drag in a sealed preview saves the stacking change it implies
* test(studio): format the sealed restack test and skip a clip with no stored z-index
* fix(studio): a sealed lane drag restacks from the z-index the preview paints
A sealed preview's lane drag read the clip's z-index from the store, which holds only inline styles and the value
from when the drag began. It now asks the frame for the computed z-index when the gesture runs, so a stylesheet's
value and an earlier queued gesture's save both count.
* chore: release v0.9.71
* chore: release notes for v0.9.71 link the commit after the first cut
* chore: release notes for v0.9.71 add the two commits merged after the review
* fix(engine): extract frames from MP4s whose seek index leaves out the first keyframe
Some MP4s (seen from VLC's muxer) carry a sync-sample table (`stss`) that omits the
IDR at the start of the file. Browsers ignore `stss` and play them normally, but every
ffmpeg input seek before the next listed keyframe fails ("Cannot find an index entry
before timestamp ... could not seek to position"), so frame extraction for that window
comes back empty. With JPEG frames the encoder then opens at EOF and ffmpeg exits
non-zero, surfacing as "Video source could not be decoded"; with PNG it exits 0 and
surfaces as zero_output. In distributed renders this fails every chunk that samples the
clip before its second keyframe, and the render fails after the retry pass.
When extraction's stderr shows that seek failure, stream-copy the source into a fresh
MOV (same packets, no re-encode; the muxer rebuilds the index from the packets' keyframe
flags), clear any partial frames, and extract once more from the copy. The copy lives in
its own temp dir and is removed afterwards; the result still reports the original srcPath.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(engine): keep the seek-index retry under the file's comment share
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(media-use): duck, cut, transcribe and dither lines show control characters as escapes
audio-duck, transcript-cut, transcribe and dither now print file paths, error
messages and text read from project files through terminalText, so control
characters show as visible escapes. Multi-line errors keep their line breaks.
--json output is unchanged.
* fix(media-use): audio engine, wait-bgm and heygen-tts lines show control characters as escapes
audio.mjs, wait-bgm.mjs and heygen-tts.mjs now print voice ids, line text, bgm paths, status
messages and voice names through terminalText. audio-duck also escapes the --target value it
prints. Files written to disk keep their values as they are.
* fix(media-use): audio engine error lines show control characters as escapes
die() in audio.mjs, wait-bgm.mjs and heygen-tts.mjs escapes each line of its message, so a
broken request or meta file and HeyGen's refusal text print control characters as escapes.
wait-bgm reports a broken audio_meta.json through die(). The bgm launch line, the
audio_meta.json path and the heygen-tts output paths are escaped as well.
* fix(core): selector alias values escape '<' so style text can't end early
Attribute values that the compiler copies into selector text, such as an
SVG reference alias's rewritten value or a composition or root id in a
scope selector, are written inside a <style> element. A '<' in one could
close that element early. These values now write '<' as the CSS escape
\3c , which reads back as the same character, so each selector still
matches the same elements.
* test(core): name the '<' escape tests for what the escapes guarantee
The selector escapes write '<' as \3c themselves, so selector text cannot
end its style element even when the CSS is serialized without postcss's
own </style escaping. The test names and comments now say that.
* fix(media-use): provider error lines print control characters as escapes
The local video, local image, Codex image, local voice and HeyGen providers
print a helper tool's output or an error message when a step fails. Those
lines now go through terminalText, as the sound effect provider already does,
so escape and bell bytes from a prompt or a helper's output show as visible
\xNN escapes instead of reaching the terminal. Printable text, return values
and thrown errors are unchanged.
* fix(media-use): keep line breaks in escaped provider error lines
A helper's multi-line error output printed as one long line, because every
line break showed as a visible escape. A new terminalLines helper keeps each
line break (a CRLF pair counts as one) and escapes every other control
character, a lone carriage return included. Provider lines that can carry
multi-line helper output now use it.
* test(core): pin that selector alias growth is charged while it is built
* fix(core): keep SVG selector alias growth within the compile budget
* fix(core): charge renamed-id selector growth too, and settle to the sheet's real growth
* chore(core): regenerate the selector alias installer and page goldens
* test(core): build the alias growth fixture from compiler-written aliases
* test(core): trip the alias budget only in the selector rewrite
* test(core): rewrite an escaped id with exactly its growth left
* fix(core): charge a renamed id against the token it replaces
* chore(core): regenerate the selector alias installer and page goldens
`catalog --type=` passed an empty string, which the truthiness check
read as no filter: it listed every item and exited 0. Any given value
other than block or component is now a usage error (exit 2), as #7669
made it for other bad values.
Follow-up to #7678 review.
Claude-Session: https://claude.ai/code/session_01M3Xbw44WYGyVqg4AjkzFxj
Co-authored-by: Claude <noreply@anthropic.com>
`mediaTimeWindow` parsed `data-start` with a raw `Number()`. A negative start,
which `readClipTiming` clamps to zero, produced a window entirely before zero,
so `mediaWindowsOverlap` reported no overlap and `video_audio_double_source`
missed a real duplicate-audio error.
Read the window through `readClipTiming`, the same contract parser the renderer
uses, and keep returning null when the start or duration is unknown.