422 Commits
Author SHA1 Message Date
Vance IngallsandClaude Opus 5.5 4af0e9c09b fix(cli): media commands read only local, self-contained inputs (#8782)
* fix(cli): media commands read only local, self-contained inputs

The shared ffmpeg/ffprobe input guard kept the hls and concat demuxers on
the grounds that the playlist folder walk confines what a list names, but
only render and check/snapshot run that walk. Commands such as transcribe,
audio, media-use generate, remove-background, init, measure and
grade-compare handed the named file straight to ffmpeg, which then opened
whatever the list named, anywhere on disk.

- mediaInputFormatArgs leaves the playlist demuxers out unless the caller
  passes { playlists: true } after walking the file (render's urlInput,
  snapshot held videos, measure reads of a guarded file), and limits every
  input that is not an http(s) URL to the file protocol.
- init, media-use generate and remove-background run the existing walker
  on every named source before creating folders, copying, uploading or
  probing.
- The remaining bare -i reads go through the guard; the diff frame
  sequence, the local TTS probe and studio-server's media input args get
  explicit local-file limits.

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

* fix(cli): walk playlists before every CLI read that allows them

Render's urlInputArgs keeps reading playlists because preflight walks every
source first, but the CLI calls the same engine probes on files nobody
walked: timeline, check, info, audio --element and remove-background.

- runFfprobe walks a local input first and throws PlaylistLeavesFolderError
  for a list naming files outside its folder, so those probes fail as that
  file's error instead of opening what the list names.
- check decodes a clip for silence with playlists allowed: the engine probe
  before it already refused one that leaves its folder, so a contained HLS
  clip keeps its audio findings.
- transcribe (every engine) and audio --read walk the input before hashing,
  making cache folders or handing it on; media-use generate also walks
  --motion and --audio. remove-background relies on the engine probe.
- One table test proves each up-front refusal fires before anything is
  written, plus a listing-level check of the playlist opt-in.

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

* chore: trim comments the playlist changes added

Keeps each changed file at or under its comment share at the merge base:
the explanation moves into a name where it still matters.

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

* fix(cli): document the playlist refusal and walk file: URLs too

- docs: transcribe, audio, init --video/--audio and remove-background take a
  single self-contained media file; playlists and concat lists are refused.
- The engine probe converts a file: URL to a path before the folder walk,
  so a playlist named that way is refused like a plain path.
- init prints its refusal as literal CLI text, which keeps the printed-value
  baseline.
- The probe tests wait for each spawn before starting the next, since the
  walk now runs first and could reorder them.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 16:20:39 -08:00
James RussoandClaude Fable 5.2 305686b31e fix(studio): an element patch is declined when its target is a script, style or template (#8764)
* fix(studio): an element patch is declined when its target is a script, style or template

A patch edits a layer. patchElementInHtml wrote text, markup and
attributes into whatever element the target resolved to, including an
inline script, a stylesheet or a template, so a text edit whose target
named one replaced that element's source. It now answers matched:false
and leaves the file as it is when the target, or an operation's child
target, is one of the tags that never take a stable id (script, style,
template, meta, link, noscript, base). A text edit of a layer whose only
child is a script writes the text on the layer instead of into the
script.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* chore(studio): say the declined-target rule in the name, not in comments

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 20:53:43 +00:00
Michael Wang dd3f8440b1 fix(studio-server): judge file writes as files, and refuse names that shadow a module (#8711)
* fix(studio-server): judge file writes as files, and refuse names that shadow a module

A create or overwrite is now judged as writing a file whatever stands at the
path, and a create is checked again once its body has arrived, so swapping a
folder away while the body is pending no longer lets an extensionless name
through. Below a tooling package.json, a file whose name plus a module
extension names a file beside it (db.utils next to db.utils.js) is refused
too, since Node loads the exact name first.

* fix(core): refuse names that shadow a module in the shared Node-tooling rule

The sibling-module check now lives in core's nodeMayRun, where the rule moved,
so Studio saves and hyperframes add from another registry both refuse a file
Node would load before the module beside it.

* docs(core): describe the shadowing rule without a file-like example

The comments check reads the example name as a citation of a missing file.
2026-11-24 20:22:56 +00:00
James RussoandClaude Fable 5.2 ce3992edae fix(studio): a rename names the files it left pointing at the old path (#8747)
* fix(studio): a rename names the files it left pointing at the old path

Renaming or moving a file updates the references to it in the project's
files. A file Studio does not write was skipped without a word, so it kept
the old path. The rename response now lists those files in
unchangedReferences, and Studio shows one line naming them.

Signed: Rames Jusso

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* fix(studio): the rename message names at most five files

Signed: Rames Jusso

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 19:47:28 +00:00
Miguel Ángel 630409ca19 feat(studio): long audio keeps its fx and beats, read from the server, no page OOM (#8622)
* fix(core): decode whole audio files only up to ten minutes

* test: give the header stub only to tests with a DOM

* refactor(core): one header stub for both test setups, length check as its own step

* refactor(core): one decode gate for failed and too-long sources

* feat(studio): long audio keeps its fx and beats, read from the server as PCM

* fix(core): carve and levels read the same span of audio at any sample rate

* test(studio): beat analysis test waits for its read to start

* test(studio): beat analysis tests run on an idle timeline

* fix(studio): the clip menu's duck passes its carve rate too

* fix(core): publish the audio-decode subpath

* refactor(studio-server): the PCM route registers with the waveform routes

* fix(studio-server): the PCM route checks the file without blocking the server

* chore(skills): media-use's carve copy picks up the time-sized analysis window

* chore(skills): the skills manifest records media-use's new carve copy

* fix(studio): the PCM route refuses other sites, shares the decode slots and keeps stereo for beats

* fix(core): a short file whose length can't be read decodes again, judged by its size

* refactor(core): one window level and Hann helper, PCM route and decode split into steps

* chore(skills): the skills manifest records media-use with main's change and this branch's carve copy

* fix(studio-server): the PCM route answers not found for a request path it can't read

* chore(skills): the carve copy and skills manifest regenerate over main's carve change

* chore(skills): the skills manifest regenerates over main's media-use change
2026-11-24 19:30:50 +00:00
Miguel Ángel 96ec31243a fix(player): a sealed preview whose runtime fails shows the film's error at once (#8746) 2026-11-24 19:00:34 +00:00
Miguel Ángel ee4ecfd979 fix(studio-server): file edits refuse a target outside the project and change nothing (#8737) 2026-11-24 17:59:52 +00:00
James RussoandClaude Fable 5.2 07e03e8fed fix(studio-server): preview head scripts land in the head when an attribute holds <head> text (#8704)
* fix(studio-server): place the preview variables tag by reading the document

The tag that carries `?variables=` into a preview was placed after the
first "<head" text in the file. That text can also sit inside an attribute
value or a comment, and a tag placed there is not a script: the page got no
variables and the <html> element picked up extra attributes.

core gains headContentStart, built on the tokenizer helpers htmlDocument
already has. It reads the document prefix the way a browser does (comments,
doctype, quoted attribute values) and returns the position after the real
<head> start tag, else after <html>, else after the doctype, else 0.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* fix(studio-server): place the GSAP fallback script by reading the document

The preview route put this script after the first literal "<head>" in the
page, which can be text inside an attribute value or a comment. It now uses
headContentStart, the same as the preview variables tag. A page whose head
tag has attributes also gets the script inside the head now, where before it
went ahead of the doctype.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* fix(core): headContentStart keeps a leading byte-order mark first

With no doctype, html or head tag the position was 0, ahead of the mark.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* chore(core): trim comments added with head placement

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 13:51:54 +00:00
James RussoandClaude Fable 5.2 260a8d81cc fix(cli): add refuses block and component scripts the project's Node tooling may run (#8703)
* fix(cli): add refuses block and component scripts the project's Node tooling may run

A block or component never installs a TypeScript, JSX or CommonJS file. From a
registry other than the public one, a .js or .mjs file is also refused where a
package.json above the target brings Node tooling, the rule Studio saves follow.
The rule moves into core so the installer and Studio share one copy.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* test(cli): add refuses a page whose own file link leads to a Node-only script

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 12:21:24 +00:00
James RussoandClaude Fable 5.2 7ea6e42f07 fix(studio): a project page opened straight from a link runs apart from Studio (#8697)
* fix(studio): a project page opened straight from a link runs apart from Studio

A preview document or project file reached by direct navigation (address bar,
chat or mail link) is answered the way one framed by another site already is:
in a sandbox, marked, and with its type fixed. Studio's own frames and thumbnail
captures are answered as before. The CLI's Studio server and the Studio dev
server ask for this; a host that opens previews in its own windows does not
have to.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* docs(cli): say how a preview address opened outside Studio behaves

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* refactor(studio-server): split who asks for a preview from how it is answered

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 11:05:26 +00:00
Michael Wang 02fbd3979f fix(studio-server): refuse extensionless files where node tooling may run them (#8682)
Below a package.json that does more than run the hyperframes CLI, Studio now
refuses an extensionless file name everywhere it refuses .js and .mjs. Node
loads an exact extensionless name before its .js, .ts or .json sibling, and a
manifest can run one directly. Folders are judged as folders, so renaming,
moving and uploading into folders are unchanged.
2026-11-24 09:54:37 +00:00
Michael Wang b76bb07077 fix(studio-server): file routes and the received-files follower read one path (#8652)
requestSubPath now matches its route on decoded segments, as Hono does,
and returns null when the route is not in the URL. Every caller refuses
that request. The received-files follower refuses it too, so it and the
file route always act on the same path. The /api forwarder strips the
first segment however it is spelled.
2026-11-24 07:41:37 +00:00
Michael Wang 7b29b81011 fix(studio-server): studio no longer writes scripts node tooling may run (#8645)
Studio refuses TypeScript, JSX and CommonJS files everywhere. It writes .js
and .mjs files only when no package.json in their folder or above does more
than run the hyperframes CLI. This replaces the list of files read from
package.json script strings, which missed files reached through cd, default
entries, nested packages and imports.
2026-11-24 07:11:37 +00:00
Miguel Ángel c5e3ac89e4 fix(core): a one-shot Studio capture shows a 4K clip as the server's frame instead of decoding it (#8626)
* fix(core): a one-shot Studio capture shows a 4K clip as the server's frame instead of decoding it

* fix(core): a capture stand-in video is marked, so a frame capture knows it is drawn

* fix(studio-server): a preview still shows the colours the browser decodes its video with

* test(core): a capture stand-in follows each seek of a page seeked many times

* fix(core): a failed capture still leaves the clip to decode its file; stills stay in the clip

* fix(core): a capture keeps see-through clips decoding and takes only the latest still

* refactor(core): one check says whether a capture still may stand in for a file

* fix(core): a capture still's answer leaves alone a poster the page set meanwhile

* fix(core): a capture page never hands a clip its still stands in for its own file

* fix(studio-server): a capture still keeps a browser's colours on every FFmpeg CI and Studio run
2026-11-24 06:55:36 +00:00
Miguel Ángel bebfdd13e9 fix(studio): a ProRes clip's preview copy is no longer starved by thumbnail capture copies (#8597)
* fix(studio): a ProRes clip's preview copy is no longer starved by thumbnail capture copies

* fix(studio): thumbnail capture pages keep their copies but ask for them behind the preview's
2026-11-23 15:35:57 +00:00
Miguel Ángel 5409387218 fix(studio-server): a save asked to be recorded keeps its own undo step beside an import (#8585)
* fix(studio-server): a save asked to be recorded keeps its own undo step beside an import

* fix(studio-server): a waiting save keeps its step past a failed entry or an open agent window
2026-11-23 13:46:19 +00:00
Miguel Ángel 76a6bacdf7 fix(cli): a cloud upload leaves out a file it cannot read instead of failing (#8575)
* fix(cli): a cloud upload leaves out a file it cannot read instead of failing

* docs(cli): list the unreadable left-out reason and its cause
2026-11-23 10:50:16 +00:00
Miguel Ángel 773aedef46 fix(studio-server): a save made while an import is taken in keeps its own undo step (#8561) 2026-11-23 08:16:40 +00:00
Miguel Ángel cda1b00820 test(studio-server): a slow runner no longer leaves index.html's first copy owed in step-ahead tests (#8540) 2026-11-22 22:53:11 +00:00
Miguel Ángel 02450e3e2e fix(studio-server): a sandboxed history read no longer fails with EPERM while the app holds it (#8529)
A process that may only read the history folder now finds a live owner's lock busy at once instead of reporting the refused claim write, so readers show the history quietly.
2026-11-22 20:57:01 +00:00
Miguel Ángel 80f45de33d fix(core): the motion path plugin loads from beside the page's own GSAP, never a CDN it did not name (#8523)
* fix(core): the motion path plugin loads from beside the page's own GSAP, never a CDN it did not name

* test(core): local root, revalidation and path-free preload rows

* fix(core): the motion path plugin never falls back to jsDelivr, nor preloads for a page with none

* fix(core): the plugin path beside GSAP is cut in linear time

* test(core): the Desktop walk film's plugin request stays on its origin

* fix(core): preload the motion path plugin only from the page's origin or a configured mirror

* fix(core): the motion path preload compares with the preview document's own origin

* fix(core): one rule decides the motion path plugin URL, bound to the document's own origin

* fix(studio-server): the plugin tag sits beside the page's GSAP as the page wrote it

* test(studio): the plugin-load fixtures name a page GSAP or a configured mirror
2026-11-22 20:31:38 +00:00
Miguel Ángel 2425df5f4d fix(core): pasted or written markup never carries a composition source from elsewhere (#8520) 2026-11-22 17:16:16 +00:00
Miguel Ángel 0bc7963ffd fix(studio-server): a page with thousands of script tags no longer stalls the preview (#8518)
Deciding whether a preview needs the motion-path plugin read every
script file the page loads, once per script tag, all at once, and kept
reading after the check gave up. A page naming one file in thousands of
script tags started thousands of reads and froze the server.

The check now answers "preload the plugin" at once for a page with more
than 64 script tags, reads each script file once, keeps at most 8 reads
in flight, starts none after its time is up or once a script names a
path, and cancels the reads still running when it ends.
2026-11-22 16:14:58 +00:00
Miguel Ángel f03233ab4d fix(studio-server): previewing a page with thousands of media files no longer stalls the app (#8505)
* fix(studio-server): previewing a page with thousands of media files no longer stalls the app

Building a preview recorded each file the build read, and each file the
page names, by walking its path with blocking link reads, one file at a
time. A page naming 20,000 media files held the server's event loop for
over a second, and the app froze while the preview loaded.

The build now collects those paths and records them off the event loop
in one batch per step, reading each shared folder once per batch.

* fix(studio-server): a preview still loads when its project folder cannot be resolved

Recording a build's reads resolved the project folder with a reader that
fails on a folder it cannot resolve (a link loop, no permission), so a
finished bundle turned into a failed build and the sub-composition route
answered a server error. The folder now resolves the way the per-read
recorder resolves it, and recording never fails its caller.
2026-11-22 14:23:33 +00:00
Miguel Ángel fccd00e719 fix(studio-server): a cut names its new half from the file's own id (#8481) 2026-11-22 11:09:31 +00:00
Miguel Ángel 4157992664 fix(core): load the motion path plugin only for a page that tweens along a path (#8449)
* fix(core): load the motion path plugin only for a page that tweens along a path

* fix(core): a path tween an external script builds still gets the motion path plugin

* test(studio): a path tween from an external script gets the plugin when Studio connects

* fix(core): a page with a script the preview cannot read still gets the motion path plugin

* fix(studio-server): the preview builder, not a file name, decides a page needs no path plugin

* refactor(studio-server): split the preview builder's script check

* fix(studio-server): a script the preview builder cannot read leaves the page unmarked

* fix(studio-server): the preview builder reads scripts off the event loop, within a time budget

* fix(studio-server): the preview builder resolves script paths off the event loop too

* fix(studio-server): the preview builder's script scan stays inside the request's deadline

* fix(core): the async project path check answers null for a path it cannot resolve
2026-11-22 09:40:47 +00:00
Miguel Ángel 2d72e523ff fix(studio): an undo or redo that adds a sealed page's first edit stays in place (#8462)
A sealed preview only got its seek-reapply script when its file already held a Studio edit, and the script left
a page with none unarmed. The first restore that added one (a redo of a resize, say) was refused by the frame
and fell back to an unawaited reload. Every sealed page now carries the script, armed from the start.
2026-11-22 07:54:54 +00:00
Miguel Ángel 267ffc46c9 fix(studio-server): a file the drive never answers no longer holds a project's first history copy (#8187)
* fix(studio-server): a file the drive never answers no longer holds a project's first history copy

* fix(studio-server): keep history's comment share at or below its base

* fix(studio-server): a first copy that lands past its deadline is kept as the file's start

* fix(studio-server): a late first copy is adopted and kept while another file's read is stalled

* fix(studio-server): a waiting late first copy counts as baseline and rereads a few at a time

* fix(studio-server): every reread of an owed file takes a copy slot and is kept until adopted

* fix(studio-server): history pins a copy as it is filed and keeps a reference-only copy as such

* fix(studio-server): a history pin is taken and released by its owner, never across a delete

* fix(studio-server): an agent step waits at most a deadline for a file the drive never answers

* fix(studio-server): undo refuses a file whose first copy landed after an agent step rewrote it

* chore(studio-server): give the packed size budget its usual 5% headroom

Main packs to 190,094 bytes, already 0.65% over the 188,871 budget; this branch adds 1,264 bytes of its own code (no new import: dist/index.js is unchanged). The budget file's rule is 5% above measured: ceil(191,358 x 1.05) = 200,926.

* fix(studio-server): an agent step that goes ahead of a first copy owns that file's undo

* fix(studio-server): undo of a step that went ahead of a pending first copy is all or nothing

* fix(studio-server): an undo after a step that rewrote a pending file in place still refuses

A went-ahead file now clears from a step's list only when the first read after its copy lands finds the original
bytes, not when its size and times look unchanged. The list of went-ahead files is kept on disk, so a restart
before the step closes, or after it deleted the file, keeps the refusal. Parts a Studio claim cuts from a step
keep the list too.

* fix(studio-server): a step ahead of a pending file refuses undo after Cmd+Z, restarts, in older apps

Cmd+Z stops at an open step whose only write so far is a pending file. A step recovered after the process died
keeps its list of pending files. A later Studio save's receipt no longer sets the start of a file a step went ahead
of. Every earlier point names a pending file as not kept, so no restore deletes it in any app version.

* fix(studio-server): a step that went ahead of a pending file never undoes, whatever bytes land

Bytes cannot tell steps apart: a file written A, B, then A again by two steps looked untouched and cleared both. A
step's list of files it went ahead of is now never cleared, so its undo refuses after a stalled read.

* fix(studio-server): a recovered step keeps its guard through a second crash; saves keep the start

The closed window is recovered before the reopen rewrites went-ahead.json, so a crash during recovery no longer
erases its list of pending files. A copy read before a step went ahead is the file's start whatever a later save's
receipt says it replaced.

* fix(studio-server): a start keeps receipts heard before its read; reopen writes all pending files

A copy read before a step went ahead follows only the save receipts heard by the moment of its read, so an early
save's original stays the start and a later save naming the step's bytes cannot replace it. The reopen rebuilds
the list of pending files in memory and writes it once, so a crash midway keeps every file on it.

* fix(studio-server): a first copy's start follows only receipts heard by its read and keeps them

Every adopted copy follows the save receipts heard by the moment of its read, with or without a step, so a later
save writing the original back cannot move the start. A small file's read is reported before its close, which a slow
drive can hold. Bytes a save replaced in a file history has no copy of yet stay through pruning until it does.

* fix(studio-server): bytes kept for a pending first copy count as start, not undo history

The bytes a save replaced are kept only for a file still owed its first copy, and they count as start rather than
undo history, so they never fold an unrelated edit out of the budget or stay for a file that never needed them.
2026-11-21 23:28:17 +00:00
Miguel Ángel b008e37b46 test(studio-server): the Windows workflow fails when the link tests cannot run (#8395) 2026-11-21 23:00:08 +00:00
Miguel Ángel 71dc6f2fe1 fix(studio-server): a file the drive never answers no longer holds a project's first copy (#8403)
* fix(studio-server): a file the drive never answers no longer holds a project's first history copy

Each file the first copy reads gets a deadline from when its read starts. A file that misses it is left owed and
adopted once the drive answers, keeping the bytes it read as the file's start, so the open finishes.

* fix(studio-server): a late first copy starts from receipts heard by its read, kept through pruning

A late first copy follows only the save receipts heard by the moment of its read, so a later save writing the
original back cannot move the start. The bytes a save replaced in a file still owed its first copy stay through
pruning, counted as start rather than undo history, until that copy is recorded.

* chore(studio-server): give the packed size budget its usual 5% headroom
2026-11-21 22:25:38 +00:00
Miguel Ángel 22b394c663 fix(studio-server): a preview asset whose read cannot be recorded answers not found (#8385) 2026-11-21 19:59:08 +00:00
Miguel Ángel 63e700de1e fix(studio-server): history keeps undo steps in order when file times and its clock disagree (#8383)
* fix(studio-server): history keeps undo steps in order when file times and its clock disagree

* fix(studio-server): a removal made while a turn was closed can join that turn
2026-11-21 17:55:42 +00:00
Miguel Ángel 40cc86252d fix(studio-server): the preview file check resolves links on volumes that refuse native realpath (#8377) 2026-11-21 14:27:08 +00:00
Miguel Ángel fbbf5ee67e fix(studio-server): an agent step waits for history's first copies, so undo brings old files back (#8375) 2026-11-21 14:14:14 +00:00
Miguel Ángel d5881e8aa6 fix(studio-server): history refusals carry a closed reason, so callers tell them from failures (#8376) 2026-11-21 14:12:57 +00:00
Miguel Ángel 6b74cfa9f5 fix(studio-server): a timed-out history save says it may still land, so callers don't retry blindly (#8300) 2026-11-21 14:00:37 +00:00
Miguel Ángel 29a5003eeb test(studio-server): a held-file edit is checked for blocking waits, not wall-clock gaps (#8236)
* test(studio-server): a held-file edit is checked for blocking waits, not wall-clock gaps

* test(studio-server): the held-file wait counter says what it counts

* test(studio-server): a held-file edit fails the test if its retries block the process in any way
2026-11-21 09:54:09 +00:00
Miguel Ángel 7cb605c787 fix(studio-server): a preview file request no longer waits on a silent drive on the event loop (#8254)
* test(studio-server): a preview file request on a silent drive asks it nothing on the event loop

* fix(studio-server): a preview file request reads its project off the event loop

* ci(studio-server): refuse a new synchronous fs call in Studio's routes and history engine

* fix(studio-server): a preview file request and a miss stay off the event loop to the end

* test(studio-server): a shared still's remake no longer depends on busy requests' slot order

* fix(ci): the studio-server sync fs gate counts every sync call node:fs has, globSync included
2026-11-21 09:03:14 +00:00
Miguel Ángel ba81f67930 test(studio-server): a held save proves it never sleeps the thread, not a 100 ms stall bound (#8359) 2026-11-21 08:27:21 +00:00
Miguel Ángel d606c2a531 feat(studio-server): history names the bytes its next restore point would copy in (#8120)
* feat(studio-server): history names the bytes its next restore point would copy in

* fix(studio-server): count each unsaved blob once, and name the method for what it counts

* refactor(studio-server): a file the next restore point copies nothing of is its own check
2026-11-21 07:55:02 +00:00
Miguel Ángel 9bea44695b feat(studio-server): a host can name paths its project history never records (#8224)
* feat(studio-server): a host can name paths its project history never records

* test(studio-server): an ignored path loses its old targets, its pruned versions and every write

* fix(studio-server): an ignored path leaves old targets and the saved log, and is never written

* refactor(studio-server): opening a log that drops ignored paths is its own step

* perf(studio-server): a restore checks where each write lands without blocking the thread

* test(studio-server): an undo never writes an ignored file through a folder link

* test(studio-server): ignored kept files leave old undos, and no ignores keeps the link refusal

* fix(studio-server): ignored paths leave old kept files; only the host's rule skips a linked write

* test(studio-server): the link refusal is the thrown error, and no redo is offered
2026-11-21 06:43:23 +00:00
Miguel Ángel e1b951586f perf(studio-server): a root preview's parse passes run off the request thread (#7934)
* perf(studio-server): a root preview's parse passes run off the request thread

* test(studio-server): a root build's page passes counted off the request thread, not timed

* chore(studio-server): the root deadline's name says it; no comment over the ratchet
2026-11-21 05:56:44 +00:00
Miguel Ángel 7df3ae0a51 fix(studio-server): an undo never deletes a file a page it leaves still names (#8186)
* test(studio-server): an undo keeps a file a page it leaves still names

* fix(studio-server): an undo never deletes a file a page it leaves still names

* fix(studio-server): keep the undo's page check small and comment-free

* refactor(studio-server): the history reads file references without loading the file routes

* fix(studio-server): the history loads the file routes only when an undo would delete a file

* refactor(studio-server): history and renames share one core-free file reference matcher

* test(studio-server): undo steps past a kept upload and keeps a kept page's files

* fix(studio-server): undo steps past kept files and keeps what a kept page names

* refactor(studio-server): split the kept-empty undo check out of commit

* test(studio-server): a kept upload is redone, after reopening too, and a kept redo never traps undo

* fix(studio-server): an undo or redo records the files it kept, so redo and undo step past them

* test(studio-server): kept files go through redo's conflict check, newest redo and step paths

* fix(studio-server): a step over kept files checks later edits and names the files it writes

* test(studio-server): keep-later-edits over a kept upload leaves Cmd+Z on the earlier edit

* fix(studio-server): a redo that keeps every later edit records nothing, so Cmd+Z moves on
2026-11-21 04:47:30 +00:00
Miguel Ángel 63d1bb5596 fix(studio-server): history reads a project's folder off the thread when opening and pruning (#8340) 2026-11-21 03:22:10 +00:00
Michael Wang 12eab05b5a fix(studio-server): refuse a sub-composition preview past the render's limits (#8308)
* fix(core): give the preview bundler the render's expansion budget

The preview bundler inlined every sub-composition mount with only a depth
limit, so a few small files that mount each other many times assembled a
page without bound. The producer's expansion budget now lives in core, and
the bundler charges every mount and the scripts and styles generated for
it to that budget, and checks each file's size before reading it. Studio
preview shows the refusal instead of falling back to the raw page, whose
mounts the browser would expand the same way.

* refactor: drop comments the names already carry

* fix(studio-server): refuse a sub-composition preview past the render's limits

The single sub-composition page is served without bundling its mounts, and
the browser runtime then fetches one copy for every data-composition-src
host in it, with no count or byte limit. The page build now charges each
host the browser will fetch to the shared expansion budget, reading each
target's size once, and the route serves the preview's refusal page.

Also moves the preview route's size-limit check above the comment it had
displaced, and uses core's check through a light subpath.

* fix(core): give the preview bundler the render's element cap

#8295 added a 100,000-element cap to the render's expansion budget. The
preview bundler now passes chargeElements to the shared inliner too, so
preview refuses the same compositions.

* fix(studio-server): charge a percent-encoded composition src for the file it serves

The comp page build looked up each data-composition-src by its raw text, so
an encoded spelling such as b%69g.html counted as a mount but was charged
0 bytes, while the preview route decodes it and serves big.html. Resolve
the same decoded path the route serves.

* test(core): give the preview fan-out budget test a 30 s timeout

The flake gate saw it pass 9 of 10 runs under CPU contention, timing out
at the default 5 s. The neighbouring scoper bound tests use 30 s too.
2026-11-20 22:09:10 +00:00
Michael Wang 19253b3c86 fix(core): give the preview bundler the render's expansion budget (#8306)
* fix(core): give the preview bundler the render's expansion budget

The preview bundler inlined every sub-composition mount with only a depth
limit, so a few small files that mount each other many times assembled a
page without bound. The producer's expansion budget now lives in core, and
the bundler charges every mount and the scripts and styles generated for
it to that budget, and checks each file's size before reading it. Studio
preview shows the refusal instead of falling back to the raw page, whose
mounts the browser would expand the same way.

* refactor: drop comments the names already carry

* test(core): give the preview fan-out budget test a 30 s timeout

The flake gate saw it pass 9 of 10 runs under CPU contention, timing out
at the default 5 s. The neighbouring scoper bound tests use 30 s too.
2026-11-20 21:22:17 +00:00
Miguel Ángel 5f024e34e2 fix(studio): thumbnails of compositions with no code of their own load in under a second (#8316)
* fix(studio): thumbnails of compositions with no code of their own load in under a second

Both thumbnail paths (the CLI's preview server and Studio's dev server) waited up to 5 s for
a GSAP timeline before shooting a card. A composition with no script never registers one, so
each of its cards took the full 5 s, and the route shoots one card at a time, so the third
card came at about 16 s.

The wait cannot simply go: a composition may register its timeline late, in a timer or a
load handler, after the runtime is ready, and shooting it then shows the wrong moment.

So the preview route now marks the page a thumbnail loads when nothing on it can register a
timeline: no script but Studio's own (the runtime, GSAP core, an import map, the registry
line), no inline event handler, frame, template or child composition loaded at run time, and
no Studio motion. A marked page is shot once the runtime is ready. Every other page is held
for its timeline exactly as before.

The rule lives once, in studio-server, and both thumbnail paths wait on it.

fails without the fix: "is skipped for a composition with no code of its own" and "holds for
a composition whose script registers its timeline late"
(packages/studio-server/src/routes/preview.thumbnailMark.test.ts), "thumbnailSeekReadyInBrowser"
(packages/studio-server/src/helpers/screenshotClip.test.ts), "hasAuthoredCode"
(packages/studio-server/src/helpers/authoredCode.test.ts), and "holds a thumbnail's shot on
the thumbnail readiness rule" (packages/cli/src/server/studioServer.test.ts and
packages/studio/vite.browser.test.ts).

* test(studio-server): the thumbnail mark test builds its page from elements, not parsed text

The test read the served page back through DOMParser and innerHTML to hand its metas to the
readiness rule, which code scanning reports as DOM text reinterpreted as HTML. It now finds
the served page's meta tags with the compiler's own tag scanner and creates each one as an
element, so no text is parsed as markup.

Also adds a row to the code check's table: a script inside an inline SVG counts as code.

fails without the fix: "is skipped for a composition with no code of its own"
(packages/studio-server/src/routes/preview.thumbnailMark.test.ts) still fails when the route
writes no mark.
2026-11-20 21:19:26 +00:00
Miguel Ángel 88c22a77f4 fix(studio-server): saving history on a drive that stops answering no longer freezes the app (#8294)
* 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
2026-11-20 15:35:09 +00:00
Wenbo ZhuandClaude Opus 5.5 4e3c960457 fix(cli): preview answers unknown paths with an inert refusal, not the Studio shell (#8161)
* 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>
2026-11-20 14:31:56 +00:00
Miguel Ángel 95a8a91b5e fix(core): a redo in a sealed preview puts Studio's edit marks back in place (#8264)
* 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
2026-11-20 07:26:49 +00:00