Skip to content

fix(cli): cloud render zip carries files the composition references under dot-folders - #7353

Merged
miguel-heygen merged 5 commits into
mainfrom
fix/cloud-zip-referenced-files
Nov 7, 2026
Merged

miguel-heygen merged 5 commits into
mainfrom
fix/cloud-zip-referenced-files

Conversation

@miguel-heygen

@miguel-heygen miguel-heygen commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

What

hyperframes cloud render (and publish) left out any file under a dot-folder, even when the composition plays it, so the cloud render failed with "A video in the composition could not be loaded". The zip now carries every in-project file the composition references, dot-paths included.

How

tryResolveExternal already walks src, href, poster, srcset and CSS url() to find files outside the project. Its in-project branch now adds a referenced file the ignore rules skipped, resolved from the referring file's folder or the project root. .git and node_modules stay out, and unreferenced dotfiles such as .env are still left out. A referenced file wins over a .hyperframesignore rule, since the composition cannot render without it.

Upload stops, naming the file, only when a reference with no fallback is missing: <video src>, <audio src>, <img src> or <video poster>. A missing href, <source> fallback, srcset candidate or CSS url() ships if present and never blocks, as before.

Tests

  • carries a referenced file under a dot-folder
  • fails before upload when a referenced file is missing
  • does not fail on a missing href, source fallback, srcset candidate, inline or stylesheet CSS url
  • fails on a missing video, audio, img src or poster, naming the file
  • leaves out an unreferenced .env (guard, passes either way)

fails without the fix: createPublishArchive referenced dot-paths > carries a referenced file under a dot-folder; createPublishArchive referenced dot-paths > fails before upload when a referenced file is missing; createPublishArchive referenced dot-paths > fails on a missing video, audio, img src or poster, naming the file

Publish and cloud suites pass (23 files, 321 tests). Staging every registry, example and package project (129): 7 throw, all unfilled __VIDEO_SRC__ templates or a studio fixture with a missing asset.

Size

A lone root fix in one function that nothing else can carry; about 70 changed lines, half of them tests.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 267 (base branch 267), smooth 102 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (8)

Unstable (2)

  • seqrepeat-none-pct-r0-root-z100: tracking 0.06, pressJump 0, drop 0, reload 0, render 0.04, renderKey -, undo false, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.04, renderKey -, undo true, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.04, renderKey -, undo true, teleport true
  • seqplainkeys-none-px-r0-root-z100: tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo false, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes at 57b06fec. There are two blockers.

1. The PR body has no fails without the fix: line

The lane's gate needs a line starting fails without the fix: that names the failing test. The Tests section only marks two bullets with "(fails without the fix)", and those bullets don't use the test names. Please add a line such as:

fails without the fix: createPublishArchive referenced dot-paths > carries a referenced file under a dot-folder (and > fails before upload when a referenced file is missing)

The claim itself holds. With main's publishProject.ts swapped in, 4 of the 5 new tests fail: the dot-folder, missing-file, href and poster/CSS tests. The unreferenced .env guard passes either way. The body lists 3 tests but the diff adds 5, so please update that list too.

2. The missing-file stop rejects compositions that do render

tryResolveExternal now throws for every unresolved src, poster, srcset candidate and CSS url(). Some of those references are optional, and the browser handles them being absent. At this head, I checked with createPublishArchive:

  • <video><source src="a.webm" type="video/webm"><source src="a.mp4" type="video/mp4"></video> with only a.mp4 on disk throws The composition references "a.webm", which is not in the project folder. Chrome plays a.mp4, and main uploads this composition without complaint.
  • <img src="a.png" srcset="a.png 1x, a@2x.png 2x"> with only a.png on disk throws for a@2x.png. The browser falls back to the candidates that exist.

Both run on main and stop on this branch. Suggested fix: pass requireOnDisk = false for srcset candidates, and for a <source> element when another <source> in the same media element resolves. Alternatively, limit the hard stop to references with no fallback (<video src>, <audio src>, <img src>, poster), and add tests for both cases.

Non-blocking

  • ships nothing and does not fail for a missing href passes only implicitly, because names() would throw. An explicit expect(() => createPublishArchive(dir)).not.toThrow() plus a check that notes.html is absent would match the test name.
  • The rest looks right. .git and node_modules stay excluded through shouldIgnoreSegment. ? and # suffixes are stripped. The root-relative fallback matches how sub-compositions resolve. The existing publishProject.test.ts cases pass.

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes at 87f2a483. One blocker is left.

Resolved since 57b06fec:

  • The body now has the fails without the fix: line, naming the tests and listing all 5.
  • The <source> fallback and srcset cases no longer stop the upload. I re-ran my a.webm/a.mp4 repro at this head and it uploads.
  • The HARD_REFERENCES gate on video[src], audio[src], img[src] and video[poster] is the right shape. The existing publishProject.test.ts cases pass.

Blocker: a url() in a stylesheet file still stops the upload

The body says a missing CSS url() "ships if present and never blocks". That holds only for inline <style>, which goes through resolveTarget with no ref, so requireOnDisk is false. localizeCssEntry still calls tryResolveExternal(ctx, val, dir) and gets the default requireOnDisk = true. Repro at this head: index.html has <link rel="stylesheet" href="s.css">, and s.css contains .a{background:url(gone.jpg)}. createPublishArchive throws The composition references "gone.jpg", which is not in the project folder. Main uploads this project.

Fix: pass false from localizeCssEntry. Better, make requireOnDisk default to false, so only the HARD_REFERENCES path can stop an upload. Please also add a .css file case to does not fail on a missing href, source fallback, srcset candidate or CSS url.

Non-blocking

<VIDEO SRC="gone.mp4"> written in uppercase doesn't stop the upload. Main doesn't stop it either, so this is only a gap in the new check, not a regression. If el.localName or the attribute name can come back uppercase from linkedom, lowercasing the key before the HARD_REFERENCES.has check would close it.

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving at 5766ce61. No blockers.

Since 87f2a483, tryResolveExternal defaults to requireOnDisk = false. Only the HARD_REFERENCES path (video[src], audio[src], img[src], video[poster]) can stop an upload now, so a url() in a linked .css file ships if present and never blocks.

Verified locally:

  • publishProject.test.ts passes at this head: 71 tests.
  • With the default flipped back to true, does not fail on a missing href, source fallback, srcset candidate or CSS url fails on the s.css / gone.jpg case, so the new test guards the fix.
  • The body's fails without the fix: line still names the three tests I confirmed earlier fail on main.

The uppercase-tag gap from my last review is still non-blocking.

@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 7, 2026
Merged via the queue into main with commit 6161ae7 Nov 7, 2026
125 of 126 checks passed
@miguel-heygen
miguel-heygen deleted the fix/cloud-zip-referenced-files branch November 7, 2026 07:57
@miguel-heygen miguel-heygen mentioned this pull request Nov 7, 2026
2 of 4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant