Commit Graph
1193 Commits
Author SHA1 Message Date
Miguel Ángel a1ee40094d fix(studio): a value or keyframe edit shows in place in a sealed preview (#8151)
* fix(studio): a value or keyframe edit shows in place in a sealed preview

* fix(studio): a sealed group edit reloads once at its end, and a batch renders its last tween

* refactor(studio): the sealed tween patch path lives in its own module

Keeps useGsapScriptCommits under Studio's 600-line limit, and records the authoredOpacity helpers' move into core as an intended deletion.

* refactor(studio): the sealed tween patch code passes the quality audit without suppressions

Splits the frame-side change parser per kind, the tween lookup and keyframe rebuild into small checks, and the reachable-preview patch out of applyPreviewSync; drops an unused type re-export.
2026-11-18 15:33:50 +00:00
Miguel Ángel a82ee10c68 feat(producer): a failed render says which file was gone again, looking only in its own folders (#8168)
* feat(producer): a render that fails on a missing file says what was gone again

Restores the diagnostic the previous commit on main took out, as it was; the commits after it confine what it looks at.

* test(producer): render failure diagnostics never probe a path from error text or outside the render

* fix(producer): probe a missing path only from a real error, inside the render's folders

describeMissingPath now reads only the path Node set on an ENOENT error, never
one quoted in a message the page can write, and looks on disk only under the
render's temp root, extract cache or work folder. Any other path is named from
its text, so a network share is never contacted and the facts cannot tell an
existing path from a missing one.

* test(producer): a missing-path probe never passes an outside link or climbs above its folder

* fix(producer): walk down from the render's own folder and check each link before following it

* build(producer): give the packed size budget its 5% headroom with the missing-file diagnostic back
2026-11-18 13:41:39 +00:00
Miguel Ángel 67410727e6 perf(core): count an svg id scope's renames once, not on every stylesheet it rewrites (#8182)
* test(core): reading an svg id scope's size never walks its ids

* perf(core): count an svg id scope's renames once, not on every stylesheet it rewrites
2026-11-18 13:07:42 +00:00
Miguel Ángel 75992d82ad fix(studio): a 3D slider drag previews live in a sealed preview (#8148) 2026-11-18 12:12:09 +00:00
Miguel Ángel 94d06663b1 revert(producer): a render that fails on a missing file stops naming what was gone, for now (#8174)
* revert(producer): a render that fails on a missing file stops naming what was gone, for now

This reverts commit cfea8cfff5 (#7955). The detail comes back in a follow-up that only looks inside the folders the render owns.

* revert(producer): name the files the #7955 revert removes in the deletion guard
2026-11-18 11:34:57 +00:00
Miguel Ángel b525686e7e fix(studio): property panel style and attribute edits show in a sealed preview (#8149)
* test(studio): property panel edits in a sealed preview reach the frame's element

* fix(studio): property panel style and attribute edits show in a sealed preview

* fix(studio): keep live property saves synchronous and use the runtime's realm-safe element check

* fix(studio): a sealed edit's put-back never replaces a newer edit

* refactor(studio): keep the sealed save wait private

* fix(studio): check a sealed edit's put-back reply without the helper main removed
2026-11-18 10:11:16 +00:00
Miguel Ángel bb55c1ea7e fix(compiler): rebase composition asset paths from the file read and charge what they add (#8166)
* test(producer): a deep or query-stretched composition folder stays within the size limit

* fix(compiler): rebase composition asset paths from the file read and charge what they add

A mount's references now rebase from the project file the render read for
it, so a query or fragment in data-composition-src no longer lengthens every
rebased path. Every byte a rebased reference adds, including the entry file's
own rebase, is charged to the render's expansion budget as it is produced.

* test(producer): close the font embedding block after the rebase
2026-11-18 09:50:35 +00:00
Miguel Ángel e623031f3a fix(studio): a sealed preview's element reads are bounded, and a frame with no agent answers at once (#8055)
* fix(studio): a sealed preview's element reads are bounded, and a frame with no agent answers at once

* fix(studio): a sealed preview's sources and style names are bounded too, never cut
2026-11-18 08:36:06 +00:00
Miguel Ángel e95cdf7d76 fix(core): each editing client takes its own port, so a sealed preview answers Studio again (#8154)
* test(core): two editing clients of one preview frame each get their replies

* fix(core): each editing client takes its own port, so a sealed preview answers Studio again
2026-11-18 08:34:12 +00:00
Miguel Ángel 5bd3e3242c fix(core): keep SVG id renaming linear in the page size and within the render size limit (#8147)
* test(core): SVG id renaming shares its table, looks up only named ids, caps and charges what it adds

* fix(core): SVG id renaming shares one table, caps id prefixes and charges the bytes it adds

* test(core): a long namespace is hashed once per mount

* fix(core): sanitize and hash each mount's namespace once, before minting its ids

* test(core): page goldens carry the regenerated selector alias bundle
2026-11-18 08:31:56 +00:00
Miguel Ángel 12a2f83c49 fix(core): keep the styles of a composition whose id contains $ patterns (#8141)
* test(core): a composition id with $ patterns scopes as text, not as a replace pattern

* fix(core): scoping writes a composition id's $ as text, at compile time and in the runtime script
2026-11-18 06:53:30 +00:00
Vance IngallsandClaude Sonnet 5.5 c6e3f30bea fix(compiler): bound composition variable styles and variable media sources (#8144)
* fix(compiler): bound composition variable styles and variable media sources

Charge every compile-time composition-variable rule against a size budget
and stop emitting once it is exceeded. The render compiler shares one
CompositionExpansionBudget between mounts, variable styles and variable
media sources; other callers get a 32 MiB core default. Host
data-variable-values are now parsed once per host instead of once per
declarer. Bound media sources over 8 KiB or holding control characters are
refused, and every src written is charged.

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

* fix(producer): trim bound media sources and name the variable budgets in errors

Bind the trimmed value, as a browser does, so a trailing newline no longer
makes compile-time probing disagree with the runtime; refuse only interior
control characters or values over 8 KiB, and log the refusal as a warning.
The generated-bytes error now says which of variable styles or variable
media sources overran. Adds a with-mount test for the after-inline budget.

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

* fix(producer): trim comments added to htmlCompiler to keep its comment share down

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

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-17 23:11:40 -08:00
Miguel Ángel cfea8cfff5 fix(producer): a render that fails on a missing file says what was gone (#7955)
* fix(producer): a render that fails on a missing file says what was gone

* fix(producer): a failed look at what was missing never hides the render's own error

The missing-path probe now returns nothing when it throws, reads through at most four links and only
links that point into the temp root or the cache folder, names a removed folder by its own name, treats
a custom cache folder as the cache, and skips programs that could not start.

* refactor(producer): split the missing-path link walk into its own step
2026-11-18 06:36:23 +00:00
Miguel Ángel 01331014d8 fix(core): a clip that stops downloading no longer holds the preview in Buffering forever (#8138)
* fix(core): a clip that stops downloading no longer holds the preview in Buffering forever

* fix(core): the stuck-clip bound also holds in a hidden tab
2026-11-18 06:15:41 +00:00
andybpan ebddc42486 fix(media): keep each index.md row on one line and show control characters as escapes (#8127)
The .media/index.md generators (figma's mediaIndex.ts and media-use's
index-gen.mjs) turned only CR and LF in a record into a space. Vertical
tab, form feed, NEL, U+2028 and U+2029 still ended a row early for
readers that treat them as line breaks, and other control characters
(NUL, ESC, BEL, C1) reached the file as raw bytes.

- Every line-ending character now becomes a space.
- Other control characters are written as visible \xNN escapes through
  the existing terminalText helper; tabs stay as they are.
- Both generators and the skill copy change together, so their output
  stays byte-identical.
2026-11-18 03:05:02 +00:00
Miguel Ángel c569417bb5 fix(studio): crop and scale resize work in a sealed preview (#8005)
* test(studio): sealed preview crop and scale resize read the frame's values

* fix(studio): crop and scale resize work in a sealed preview

* test(studio): a sealed preview's crop lift and resize box survive lost or bad frame replies

* fix(studio): a sealed preview's crop lift and resize box survive lost or bad frame replies

* refactor(studio): the crop's stylesheet clip under a lift is read in its own step

* test(studio): the frame crop-lift helper answers the lift it just sent
2026-11-18 01:44:51 +00:00
andybpan 5f06e1b0a3 fix(core): treat files package managers run by default as tool-trusted (#8129)
npm, pnpm, yarn and bun run `node-gyp rebuild` on install when a binding.gyp
is present and package.json has no install script, and a .gyp file can include
any .gyp or .gypi. npm, pnpm and yarn run `node server.js` for start when
package.json has no start script. A project from `hyperframes init` has
neither script, so both defaults apply.

toolTrustedFileKind now classifies .gyp/.gypi files and server.js, in every
spelling projectPathSegments folds, so Studio's file routes and the registry
installer refuse to write them. Rename and duplicate refusals now report
why: protected_path when the destination is inside the project, as POST and
PUT already do.
2026-11-18 01:32:34 +00:00
Miguel Ángel 80bf6a9ddb fix(studio): slideshow scenes, block stacking, drill-down and shortcuts work in a sealed preview (#8118)
* fix(studio): slideshow scenes, block stacking, drill-down and shortcuts work in a sealed preview

* fix(studio): sealed preview keys act only with the preview focused; frame replies are validated
2026-11-17 23:36:08 +00:00
Michael Wang 3f3fa67f9c fix(producer): charge generated mount scripts and scoped styles to the budget (#8094)
* fix(producer): charge generated mount scripts and scoped styles to the expansion budget

The expansion budget charged only the source bytes of each mounted file.
The inliner wraps every inline script in kilobytes of scoping code and
prefixes every style rule with the host's scope, so tiny scripts or a long
composition id over many rules assembled a page hundreds of times larger
than its source.

The inliner now reports what it generates through a chargeEmitted option.
Each wrapped script is charged once built. Each style rule reserves an upper
bound before it is scoped and settles to its real size after, so no rule is
built past the limit. Generated output has its own 32 MB allowance.

* fix(core): reserve the separator postcss re-joins scoped selectors with

The per-rule reservation summed a bound per selector but left out the
separator. postcss's selectors setter re-joins the list with the first
separator in the authored selector, so a wide first separator over many
selectors grew the rule past its reservation before it was charged.

* test(core): give the scoper bound test the same time limit as its neighbour
2026-11-17 22:53:11 +00:00
Miguel Ángel 373d987e32 fix(studio): the motion path draws and can be created in a sealed preview (#8108)
* test(studio): a sealed preview's motion path finds its layer's home

* fix(studio): the motion path draws and creates in a sealed preview

* test(core): a motion path's home counts a wrapper's 2D and 3D translate

* test(studio): a sealed click places a new motion path from the layer's home at the click

* test(studio): a sealed motion path refuses a bad frame reply and reads the blur root via the port

* fix(studio): a sealed click places a new motion path from the layer's home at the click

* refactor(core): a motion path home reads a matrix's translate in one small helper
2026-11-17 21:58:01 +00:00
andybpan a765c93791 fix(figma): write .media and component outputs without following links (#8111)
* fix(figma): write .media and component outputs without following links

The figma importer's writers (index.md, manifest.jsonl, figma-bindings.jsonl,
figma-tokens.json and component files) used writeFileSync, appendFileSync and
recursive mkdirSync, which follow a link at the target or in its folders.

- Folders under the project (.media, .media/images,
  compositions/components/<name>) are created one level at a time and refused
  when one is a link or resolves outside the project.
- Whole-file rewrites go through replaceFileAtomically (temp file + rename),
  so a link at the target is replaced rather than written through.
- Appends open with O_NOFOLLOW and refuse a link at the target.
- index.md cells collapse line breaks, matching media-use's index-gen.mjs
  byte for byte, so each record stays on one line.

* chore(figma): trim added comments; check the component folder right before writing

* fix(figma): open appends first, then check the path holds that same file

appendWithoutFollowing checked the path with lstat and then opened it, leaving
a gap between check and use. It now opens with O_NOFOLLOW first and writes
through the descriptor only when lstat finds the same single-link plain file at
the path, the pattern projectRecords' appendRecord already uses.
2026-11-17 21:36:57 +00:00
Miguel Ángel 133965e4f5 fix(studio): GSAP keyframe and value reads work in a sealed preview (#8003)
* test(studio): adding a keyframe at the playhead reads a sealed preview's GSAP values

* fix(studio): GSAP keyframe and value reads work in a sealed preview

* test(studio): run the sealed keyframe test's agent on a marked Studio preview page

* test(studio): a sealed preview's GSAP reply is checked before Studio holds it

* fix(studio): hold a sealed preview's GSAP reply only when it is in shape and within bounds

* style(core): keep the snapshot limits module within the comment share

* refactor(studio): check a GSAP reply's tween in small parts

* build: raise the core packed-size budget for the sealed preview's GSAP reader

* test(core): a sealed preview's GSAP read takes a real keyframes tween

* fix(core): a sealed preview's GSAP read leaves GSAP's live objects out of a tween's vars
2026-11-17 19:11:15 +00:00
Miguel Ángel f1f8ca31c3 fix(core): hover and thumbnail captures never wait for a 4K clip's preview copy (#8079)
* test(core): a hover capture page keeps a 4K clip's file instead of waiting for its copy

* fix(core): hover and thumbnail captures never wait for a 4K clip's preview copy

* fix(core): keep mediaProxy's comment share flat

* test(core): keep the capture-page test comment within 120 characters
2026-11-17 17:26:46 +00:00
Michael Wang f5ccfcc960 fix: narrow the private-file rule for hidden files, build output and lint (#7990)
* fix: refuse framework build output and service-account files; lint skips private compositions

Review follow-ups:
- Hidden framework build-output folders (.next, .nuxt, .output, .svelte-kit,
  .vercel, .netlify, .wrangler, .astro, .turbo) are private whatever the file
  type, since their scripts can carry inlined server environment values.
- credentials.json and common service-account key names are private.
- Lint's compositions/ walk skips private files and folders, and an explicit
  lint entry that is a private file is refused.
- New lint tests link .git/m.json, .mcp.json and a .hyperframes record as an
  import map; they fail when lint's private-file check is removed.

* fix: a hidden file is private whatever its type; files in hidden folders keep the asset rule
2026-11-17 17:08:14 +00:00
Miguel Ángel a56fa2caf3 fix(studio): scrubbing the playhead plays the music track in a sealed preview (#8082)
* test(studio): scrubbing a sealed preview plays the music track

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

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

Fixes #7986
2026-11-17 16:13:03 +00:00
Miguel Ángel 72925380cc fix: render, capture and inspector servers never serve a service worker's script (#8073)
* fix(engine): the render file server never serves a project file as a service worker's script

* fix(producer): render, capture and inspector servers never serve a service worker's script
2026-11-17 14:15:52 +00:00
Miguel Ángel 93a4d29c03 fix(studio): audio meters and audio groups work in a sealed preview (#8011)
* test(studio): audio meters and group volume in a sealed preview

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

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

* test(studio): the sealed audio test serves a Studio-marked preview, as the editing port now requires
2026-11-17 13:26:15 +00:00
Miguel Ángel f9c5ed07bf feat(core): the preview can stream an element's geometry to the editor every frame (#8052)
* feat(core): the preview can stream an element's geometry to the editor every frame

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

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

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

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

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

* test(core): keep the fake resize observer's note within the line limit
2026-11-17 12:35:23 +00:00
Miguel Ángel 43e5b7cecd fix(core): a held video picture is drawn through a VideoFrame closed after the draw (#7971)
* test(core): a held picture is drawn through a closed VideoFrame

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

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

* test(core): keep the playhead fixture note inside the comment line limit
2026-11-17 11:53:32 +00:00
Miguel Ángel 7a0bec6828 fix(studio): a service worker a project left behind is gone before a preview frame loads (#8067)
* fix(studio): a service worker a project left behind is gone before a preview frame loads

* fix(cli): the player page's inlined script list is escaped for a script tag
2026-11-17 11:05:40 +00:00
Miguel Ángel 55291c00c2 fix(core): only Studio's own preview pages get the editing port, and undo sets only safe attributes (#8057)
* fix(core): only Studio's own preview pages get the editing port, and undo sets only safe attributes

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

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

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

* style(core): keep the restore plan's doc comment within the line limit
2026-11-17 08:46:24 +00:00
Miguel Ángel f91bbf0dac fix(inspector): the inspector's Chrome starts as root or in a container (#8050)
* test(inspector): the inspector's Chrome follows the host sandbox rule, and probes retry without it

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

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

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

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

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

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

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

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

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

* test(parsers): a harmless name shaped like a pattern is refused too
2026-11-17 07:28:09 +00:00
Miguel Ángel d7d416124f fix(studio): colour grading works in a sealed preview (#7999)
* test(studio): colour grading previews and status on a sealed preview

* fix(studio): colour grading reads a sealed preview through the editing port
2026-11-17 07:00:14 +00:00
Miguel Ángel 915021265f fix(studio): caption editing works in a sealed preview (#8002)
* test(studio): caption overlay shows and edits words in a sealed preview

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

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

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

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

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

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

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

* refactor(studio): keep the sealed caption nudge request inside its helper file
2026-11-17 06:02:22 +00:00
Andy CheighandClaude Opus 5.5 19743ea094 fix(studio): the copied render command carries no composition text a shell can run (#8012)
* fix(studio): the copied render command carries no composition text a shell can run

The Variables panel's "Copy render command" put every variable value inline,
quoted for POSIX shells only. A shared project's author chooses those values,
so in PowerShell, cmd.exe (including npx.cmd's re-parse) or fish a default
such as `x'; calc.exe; '` ran as commands when the command was pasted.

The command is now fixed text: `npx hyperframes render -c <composition>
--variables-file .hyperframes/render-variables.json`. Copying it saves the
previewed values to that file through a new PUT /projects/:id/render-variables
route, which refuses a link standing in for .hyperframes and replaces, rather
than writes through, a link at the file itself. A composition path that is not
one plain word in every shell (letters, digits, `_ . / -`) gets no command.

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

* fix(scripts): the comment checker skips a template nested in a substitution

stripLiterals ended a template literal at the first backtick, including one
that opens a nested template inside `${...}`. On a line such as
`'${value.replace(/'/g, `'\\''`)}'` that left a backtick unmatched, so
scanCLike read the rest of the file as one template and counted none of its
comments. The ratchet then measured VariablesPanel.tsx on main at 1 comment
line instead of 31 and failed any change that removed that line.

A `${...}` is now scanned as code: strings, regexes and templates inside it
are skipped, and its closing brace returns to the outer template.

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

* test(studio-server): read the replaced render-variables record through one no-follow descriptor

The link test checked the record with lstat and then read it by path, two
lookups CodeQL reports as a file-system race. Opening it once with O_NOFOLLOW
fails if a link is still there and reads the file that open checked.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 05:05:28 +00:00
Miguel Ángel fee03bfbe1 fix(studio): an undo on a sealed preview shows in place, not after a reload (#8009)
* fix(studio): an undo on a sealed preview shows in place, not after a reload

* fix(studio): split the sealed restore checks, and the inspector budget takes the new kind
2026-11-17 03:55:09 +00:00
Michael Wang 32fe10a8b3 fix(studio-server): history writes and claims follow Studio's write rule (#7988)
History undo, restore and Cmd+Z now leave alone every file that Studio's
file routes refuse to write. This covers tool-trusted, private, hidden and
node_modules paths, and scripts the project's package.json runs. Cmd+Z
passes over an edit that only changed such files. A claim no longer takes
such a file's pending change.

A claim's `overwrote` version now counts only when the server itself saw
that version at that path. A version stored for another file can no longer
become a file's earlier state.

The write rule also refuses more files that tools and agents load on
their own: opencode and crush settings, compose override files,
Dockerfile.* and Containerfile, every lefthook spelling, mise, nodemon,
devbox, wrangler, vercel and netlify settings, *.config.jsonc,
tsconfig.*.json, Taskfile.dist, simple-git-hooks, Ruby build files, and
.nix and .fish scripts.
2026-11-17 00:48:03 +00:00
Xuanru Li ca25558083 fix(cli): enforce private cache install paths (#7981)
* fix(cli): cache installs only use folders the current user owns

Code the CLI downloads or builds into its cache (Chrome, the TTS script,
audio helpers, whisper.cpp, OpenCV, the Lambda handler, optional packages)
now goes into folders created by the current user with owner-only write,
and each installed file is checked again before it is returned.

- A cache root that other accounts can add entries to, sticky or not, is
  no longer used for code; the per-user cache is used instead.
- The ownership check reads links rather than following them, and a link
  that leads out of the cache root is not trusted.

* fix(cli): validate cache ancestry before filesystem side effects

* fix(core): check links before parent path segments

* fix(cli): validate cached libraries and clarify private parent requirements

* fix(cli): use the shared staging directory helper for Apple builds
2026-11-16 23:28:26 +00:00
Michael Wang c68c78445d fix: hidden and credential files stay out of Studio, history and lint (#7979)
* fix: hidden and credential files stay out of Studio, history and lint

- The private-file rule now refuses every hidden file or folder in a project,
  except Studio's own files, the root .media folder, and pictures, video,
  sound, fonts, stylesheets and scripts a page can load. It also refuses
  Terraform state and variable files and more key-store types.
- Project history never tracks, lists or serves a private file, and the blob
  route serves only bytes a listed file had, so copies kept by an older
  version are no longer readable.
- Lint reads a linked stylesheet, script, import map or sub-composition only
  when the private-file rule allows it and the file is the kind its link
  names, so no finding quotes a private file.
- The rule moves to @hyperframes/parsers/private-path so lint can use it;
  @hyperframes/core/safe-path re-exports it unchanged.

* fix(studio-server): a refused history blob reads as not a history blob

* fix(core): keep realpath in core, so its file-system callers and tests see one module
2026-11-16 23:15:31 +00:00
Michael Wang 6f88be3941 fix(cli): escape control characters in project, page and registry text (#7913)
* fix(cli): text from projects, pages and registries prints control characters as visible escapes

catch-up, capture, figma component, timeline, keyframes, layout/inspect,
catalog and add printed strings that come from a project folder, a captured
web page or a registry manifest straight to the terminal. A crafted value
could move the cursor, rewrite earlier lines, set the window title or write
the clipboard. Those values now go through terminalText(), the same helper
lint, check and snapshot already use. The CLI's own colours stay, and --json
output is unchanged.

layout/inspect also keeps only well-formed issues with a known code from the
page, the way check already does, by reusing check's parseLayoutIssue. The
browser-script loader moves to its own module so layout and check can share
the parser without importing each other.

* test(cli): catch-up test names files with control characters only where the OS allows it

* fix(cli): import terminalText from core after main moved it

* fix(cli): escape layout banner and failure, top-level errors and installed paths; keep line breaks
2026-11-16 23:11:33 +00:00
Michael Wang c4d607c7f8 fix(core): a page marked for another site gives that site only playback (#7980)
* fix(core): a page marked for another site gives that site only playback

The runtime control bridge trusted window.parent alone. In a document the
preview server marked as framed by another site, that parent is the other
site, so it could turn on pick mode, flash elements, set runtime data and
colour grading, and it received the timeline, diagnostics and picked
elements, which describe the composition.

In a marked page the bridge now takes only playback controls (play, pause,
seek, volume, mute, rate) and posts only the ready, state and stage-size
messages. Pages served to their own site are unchanged.

* fix(core): keep the bridge's handler lookup in the shape code scanning accepts
2026-11-16 22:53:30 +00:00
Miguel Ángel 33e1a36a39 revert(player): an app embedding the preview re-reads it after a script edit again (#7795) (#7978)
This reverts commit 42508c1ef1.
2026-11-16 21:54:40 +00:00
Michael Wang 2a28e43685 fix(studio-server): no write route touches files other tools run or trust (#7964)
* fix(studio-server): no write route touches files other tools run or trust

A composition previewed in Studio runs same-origin with the API, and the write rule
refused only private paths, node_modules and hidden names. Its script could create,
overwrite, rename or delete package.json, lock files, agent instruction files and
scripts, which a package manager, build tool or coding agent then runs with the
developer's rights.

Core now names these files in one predicate, toolTrustedFileKind, read in every
spelling a case-insensitive file system or Windows opens. Studio's write rule and the
registry installer's target rule both use it, so every write route (PUT, POST, PATCH,
DELETE, upload, duplicate-file, file-mutations and gsap-mutations) refuses such a
target. Deleting or moving a folder that holds one is refused too. Ordinary
composition, stylesheet, script-asset and media writes still succeed.

* fix(core): fold look-alike letters before matching files other tools trust

A case-insensitive macOS volume opens "AGENTſ.md" (long s) as AGENTS.md
and "Makefile" (fi ligature) as Makefile, but lower-casing alone does not
map either letter. Project path segments now fold names the way such a
volume does: NFKC, upper-then-lower case, and invisible characters
dropped. Every rule built on the segments gets the fold.

Also:
- name JSON, YAML and TOML tool config, compose files, turbo.json,
  nx.json, pyproject.toml and gulp or grunt files
- treat a ~N name as a short name only when it has the 8.3 shape and an
  extension a trusted file's could shorten to, so take~2.mp4 stays
  writable
- refuse to delete or move a folder holding node_modules or .git, walking
  it without the listing's ignore rules
- report an upload refused by the write rule in `skipped`
2026-11-16 21:30:32 +00:00
Ice colaandClaude Fable 5.1 95e4e7f880 fix(producer): probe sub-composition media defaults (#7550)
* fix(producer): probe sub-composition media defaults

Sub-composition defaults declared on <html> disappear from the DOM
during inlining. The browser-probe gate then misses data-var-src
bindings, causing renders to use the authored placeholder source.

Pass the inliner's variablesByComp table through CompiledComposition
and consult the nearest composition scope when checking media bindings.

Give anonymous mounts distinct runtime scopes and reserve IDs as
nested mounts are processed, preserving each instance's variable values.

Add regression coverage for declared defaults, repeated mounts,
nested scopes, and named/anonymous mount collisions.

Fixes #7505

* fix(core): keep anonymous hosts unnamed, key their variables by the authored id

The previous commit made an anonymous mount claim its sub-composition's id on
the host element, which changed the DOM contract the runtime mount path and
the `missing-host-comp-id` regression golden pin: the compile paths put the
host's start/duration on the composition while the mount path kept them on an
unnamed timed element, so the producer parity test and the regression shard
failed on the first CI run.

Restore the contract: an anonymous host carries no composition id and its
flattened wrapper keeps the authored one. For #7505 that wrapper is already
the scope the probe gate (and `variableScope.ts`) resolves through, so the
inliner now keys an anonymous mount's merged defaults by the authored id
instead of skipping them. A named mount of the same file shares that scope;
its explicit instance values win regardless of inlining order, which the
replacement unit test pins in both orders. The id-reservation machinery for
claimed ids goes with the claim.

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

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-16 18:58:41 +00:00
Miguel Ángel ce8d55d302 fix(cli): validate and keyframes print project text with control characters as visible escapes (#7958)
* fix(cli): validate and keyframes print project text with control characters as visible escapes

* test(cli): the CSS case prints a payload the declaration split keeps whole

* fix(cli): escape project-supplied object keys too, so keyframes prints tween property names safely
2026-11-16 18:37:36 +00:00
Robin Ebers 42508c1ef1 fix(player): stop the preview freezing when many clips share one long recording (#7795)
* fix(core): a clip the preview lets go of stays unloaded in Firefox

Releasing a clip dropped its src, called load() and set the src again.
Firefox treats preload="none" as "metadata" while an explicit load() is
pending, so every release fetched the clip's metadata and first frame. The
runtime then saw a far clip loading and released it again, in a loop: about
20,700 media requests over one 2:16 film, with 2-4 s stalls at cuts.

Setting src already runs the media load algorithm, which ends the fetch, so
the release now sets it again without load(). Chrome and Safari behave as
before: Blink clears its ignore-preload-none flag when src is set, and
WebKit's src set cancels the prepareToPlay that load() queued.

To reproduce: in Firefox, give a <video> with a src preload="none", then call
removeAttribute("src"), load() and setAttribute("src", src) in one task. It
loads to readyState 4; with the src set in a later task it stays at 0.

* fix(player): a film cut from one long recording plays through in Chrome and Firefox

A film whose clips are cut from one or two long recordings froze a few
seconds in, in Chrome and Firefox. Both keep a paused clip's request open
with its unread bytes, and every request to one host shares one HTTP/2 or
HTTP/3 connection window. With every clip of the file loading at parse, those
idle streams fill the window, and the request for the clip coming up is never
answered.

The player's frame now holds clips back on every engine, as it already did on
WebKit: each file keeps the clip on screen and the next one loading, and
frees the rest. The player also names its frame, because a composition in an
opaque sandbox cannot read frameElement to find the player's mark.

To reproduce: play a film of 37 clips cut from a 363 MB and a 180 MB .mov
served over HTTP/3 in <hyperframes-player>. On main it stops at 0:17 in
Chrome and at 0:09 in Firefox and never recovers.

* chore(player): raise the packed size budget for the frame name

Naming the player's frame adds 44 bytes to the packed player (158,706 to
158,750 bytes with pnpm 10.17.1). main was already 10 bytes under the 1%
tolerance of its 157,145-byte budget, so any growth fails the check. The
budget moves to 5% above the new measured size, as the check suggests.

* fix(core): seeking in the player stays as it was in Chrome and Firefox

Holding clips back in every player frame also moved Chrome and Firefox
player frames onto Studio's paused-seek path, which keeps the old picture
until every clip on screen has its new frame. In the player's scrub
benchmark the inline p95 rose from about 1.0 s on main to 1.9 s in CI,
and a seek could miss the benchmark's 1 s limit. In Firefox a paused seek
to a clip the player had let go showed no frame for about 5 s, because the
clip was released again each time it loaded.

Chrome and Firefox player frames now hold clips back and seek as they did
on main. Studio and Safari player frames keep the path they already had.
2026-11-16 18:15:46 +00:00
Miguel Ángel 9e50487720 fix(core): a capture page loads a clip with no set length only when it is due (#7938)
* fix(core): a capture page loads a clip with no set length only when it is due

* fix(core): keep the capture-page comment within the comment share
2026-11-16 16:10:40 +00:00