Skip to content

fix(cli): play and present check the Host like preview; local render leaves out outside files for a received composition - #7792

Merged
michaelwang11394 merged 32 commits into
mainfrom
sec-hf6-1114
Nov 15, 2026
Merged

michaelwang11394 merged 32 commits into
mainfrom
sec-hf6-1114

Conversation

@michaelwang11394

@michaelwang11394 michaelwang11394 commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

What

Two local-server and local-render changes:

  • play and present keep listening on every interface, but answer only a Host that preview would accept: localhost, loopback IPs, this machine's own IP literals, its .local name, or a name listed in HYPERFRAMES_PREVIEW_ALLOWED_HOSTS. Any other Host gets a 403 that names the setting.
  • Local render of a project holding received code. A local render, from the CLI or Studio, changes nothing for a project with no received files. It reads nothing outside the project when the received-files record lists a file that can load others: HTML, HTM, CSS, JS, MJS, CJS or SVG by name, or content that reads as HTML, SVG or CSS. It does the same when the record can't be read. A project that received only images, video, audio or fonts keeps its outside files. One line says why, names the references left out, and names any outside sub-composition the render stops on. A static dependency list can't be used for this, because the browser loads a scene's stylesheets and scripts during capture, so this rule replaces the earlier scan.

Why

Related work

Stacked on #7771, which adds the received-files lookup this uses. Refs #7490, #7493.

How

  • studio-server/helpers/requestIdentity.ts: wildcardBindHostAllowed, shared with preview's check. cli/utils/compositionServer.ts: refuseUnknownHosts(app) for play and present.
  • cli/commands/render.ts and Studio's render route: allowOutsideProjectAssets is false when the entry is received.
  • cli/utils/receivedRender.ts names the skipped references. It uses a linear forward scan of the entry, its sub-compositions and its stylesheets, reads at most 2 MB per file, and skips files it can't read.
  • A received entry whose sub-composition sits outside the project stops the render with the existing "outside the project folder" error, the same as cloud. The printed line says so.
  • docs/packages/cli.mdx documents the setting for preview, play and present.
  • scripts/package-size-budgets.json: the producer's unpacked budget goes from 3,245,000 to 3,290,000 bytes. The new composition file checks in htmlCompiler.ts put the unpacked package about 270 bytes over the 1% margin. The packed size stays under its budget.

Test plan

  • Unit tests added/updated

  • Manual testing performed

  • Documentation updated (if applicable)

  • Comments follow CONTRIBUTING.md "Comments": they say why, not what, and a bug fix says what the code must do and how to reproduce the bug

  • CLI and studio-server vitest pass: compositionServer, play, createStudioApi.originGuard, receivedRender, render and the Studio render route. That's 148 in the last run. Each new test fails without its fix.

  • Host edge cases pass: LAN IP, <host>.local, [fe80::…], [::1], a host with a port, upper case, and a Tailscale IP. These get a 403 with the hint: a trailing-dot name, host.docker.internal and a MagicDNS name.

  • Two real local renders: the received copy printed the line and left out the outside files; the person's own copy rendered normally.

  • Not tried: a real phone, a Mac whose hostname differs from its Bonjour name (that .local name may need the setting), and range renders run for real.

michaelwang11394 and others added 15 commits November 14, 2026 14:33
… record

Publish, cloud render and feedback now read the received-files record at
the nearest folder at or above the one they stage, so staging a subfolder
of an imported project still leaves out the outside files its received
files reference.

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

The received-files lookup now also matches a project file that is the
same file on disk as a listed path, so a name respelled in letter case on
a case-insensitive disk keeps its received status.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The entry GIF prep before a cloud render upload now reads only the staged
copies it is handed. An image whose source staging left out keeps its
reference as written and is never read from disk.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A media file whose first bytes are an HLS playlist, an XML manifest or a
concat script now stays out of ffprobe and ffmpeg: cloud render leaves it
in the zip as authored, the media probe reports it as not media, and the
proxy copy refuses it. Real media never starts with these bytes, so it
probes and transcodes as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… from stills and audio probes

A text playlist or concat script is detected whatever bytes follow its
first line; only markup must be all text. A still frame and the audio
probe behind waveforms, peaks and loudness now refuse a file the probe
reads as not media, as the proxy copy already does.

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

The walk up for a received-files record now skips a parent whose record
cannot be reached. Only a record file that is there but cannot be read
or parsed counts every file as received.

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

Some network and virtual drives report a file id of 0 for every file, so
the same-file match now gives such a file no identity instead of
matching it to every listed file.

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

The playlist check reads the first 64 bytes through a bounded read
stream instead of a raw file descriptor, and the audio-track probe's doc
comment sits on its function again.

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

Main packs @hyperframes/studio-server close to the 1% tolerance on the
168500 budget, and the playlist check adds about 320 bytes, which put
the Build over. Set the budget to 172000.

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

Every ffprobe and ffmpeg input that cloud render offload, the publish
proxy bake and Studio's media helpers open now carries a demuxer
whitelist built from the supported media extensions: MP4/MOV/M4A/AVIF,
Matroska/WebM, MXF, AVI, MPEG-PS/TS, FLV, ASF, Ogg, WAV, MP3, AAC, FLAC,
AIFF and the still-image formats. Playlist, manifest and concat demuxers
can no longer open, whatever a file's bytes say. The proxy's own concat
step is left as it is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…muxer list in loudness args

Two probe argv literals built from nested spreads are flat again, so
"--" stays the visible second-to-last entry the argv contract checks.
The normalize-audio test expects the demuxer list before the input.

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

play and present listen on every interface. Each request now passes the
same Host check preview uses: localhost, loopback addresses and this
machine's own addresses and names are answered, and any other host name
gets a 403 naming HYPERFRAMES_PREVIEW_ALLOWED_HOSTS until it is listed
there. Phones and other machines on the network still open them by LAN
address or .local name.
…utside the project

When the composition a local render opens is listed in the project's
received-files record, hyperframes render (full and range) no longer
brings in files outside the project. It prints one line naming the
references it leaves out and why. An unreadable record counts as
received. A project whose entry is the person's own, or that has no
record, renders exactly as before.
…record as unknown

The scan behind the received-composition notice skips a file it cannot
read, finds url() references with a linear forward scan, and reads at
most 2 MB of each file. An unreadable received-files record no longer
counts as everything received for local render: the render keeps
outside files and names the record it could not read. Publish and cloud
upload still treat it as received. The notice now says the render stops
on a sub-composition outside the project rather than leaving it out.
…s outside the project

The Studio render route applies the same rule as hyperframes render:
when the composition it renders is listed in the received-files record,
the job does not bring in files outside the project, and the server log
names the references it refuses.
Base automatically changed from sec-received-1114 to main November 15, 2026 01:32
@mintlify

mintlify Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
hyperframes 🟢 Ready View Preview Nov 15, 2026, 8:59 AM

💡 Tip: Enable Automations to automatically generate PRs for you.

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 267 (base branch 267), smooth 109 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 (1)

  • seqrepeat-none-px-r0-root-z100: tracking 0.05, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true / tracking 0.05, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true / tracking 0.05, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed at 73cb36a

The Host middleware covers every play/present route, and the received-entry policy reaches ordinary, range and Studio renders through the existing producer option. The current head needs a restack before approval.

Important — resolve the base conflict: packages/cli/src/utils/privateProjectFile.ts conflicts with current main. GitHub reports CONFLICTING, and an actual three-way merge trial reproduces it. Rebase onto main after the merged parent, retaining the received-record lookup protections plus the new unreadable-record helper; rerun the focused tests on that resolved head. The retargeted diff currently also contains already-landed parent changes.

Nit: packages/cli/src/utils/receivedRender.ts:127–148 prints raw composition reference text in the new notice. Reuse the shared terminal-text escaping helper for the complete notice before both CLI and Studio sinks. An added local probe confirms that source control characters survive into the warning; add an escaping assertion.

Validation: frozen install/full build passed; focused CLI 149 passed, Studio origin guard 24 passed. Read the 14-path increment and its producer/server consumers; parent changes were covered in the earlier review. No fresh phone, DNS-rebinding browser session or full local render walkthrough performed. The unreadable-record local-render fallback is the explicitly documented policy; upload behavior is unchanged.

Commands: bun run --cwd packages/cli test src/utils/compositionServer.test.ts src/utils/receivedRender.test.ts src/commands/render.test.ts src/server/studioServer.renderBrowser.test.ts --maxWorkers=1 and bun run --cwd packages/studio-server test src/createStudioApi.originGuard.test.ts --maxWorkers=1 (through the shared test gate). Merge trial: git merge-tree --write-tree HEAD origin/main.

Need: yes · Size: ok, two bounded fixes plus inherited parent diff · Reuse: preview Host predicate, received lookup and producer outside-asset policy · Simpler: use those shared boundaries; escape the notice once · Structure: fine (checked preview versus composition server guards, render/range/Studio option paths and reference scanning; no split)
Risk: medium — changes local listener access and received-project render inputs.

Verdict: REQUEST CHANGES
Reasoning: The increment looks sound, but approval needs the actual conflict resolution at a fresh reviewed head.

— Rames

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed at d15a5b2

The earlier restack requirement is resolved. Main is now merged, the PR's own diff is the intended 14 files, and the privateProjectFile conflict retained the new unreadable-record helper alongside the existing received lookup. Comparing the production paths with the previous reviewed head shows only removal of that helper's comment; the Host and render-policy behavior is preserved.

The earlier Nit remains at packages/cli/src/utils/receivedRender.ts:122–149: escape untrusted reference text once before the CLI/Studio notice sinks, using the existing terminal-text helper when available. This does not hold the approval.

Validation: frozen install/full build passed; focused CLI 153 passed, Studio origin guard 24 passed at this head. Read the merge resolution and complete changed production files; a fresh independent adversarial pass found no regression. No new browser/phone or full local-render walkthrough performed.

Commands: bun run build; bun run --cwd packages/cli test src/utils/compositionServer.test.ts src/utils/receivedRender.test.ts src/utils/privateProjectFile.test.ts src/commands/render.test.ts src/server/studioServer.renderBrowser.test.ts --maxWorkers=1; bun run --cwd packages/studio-server test src/createStudioApi.originGuard.test.ts --maxWorkers=1 (tests through the shared gate).

Need: yes · Size: ok · Reuse: preview Host predicate, received lookup and producer outside-asset option · Simpler: existing shared policy boundaries · Structure: fine (checked Host middleware, normal/range/Studio render paths and resolved receipt helper; no split)
Risk: medium — local listener access and received-project render inputs change.

Verdict: APPROVE
Reasoning: The resolved head preserves the reviewed safeguards and removes the merge conflict; the remaining output-escaping nit is nonblocking.

— Rames

@miguel-heygen miguel-heygen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Two changes:

  1. packages/cli/src/utils/receivedRender.ts:139-151 outsideAssetsAllowed decides only on whether the entry file is received. A person's own index.html that plays a received sub-composition (what Desktop's project-as-scene drop makes) renders with outside assets allowed, so the received scene's ../ and absolute references are read. outsideReferences already walks every page and stylesheet the entry pulls in: return false when any visited file is received, name that file in the notice, and flip the assertion at receivedRender.test.ts:62-68.
  2. Product call (Miguel): an unreadable, truncated or empty received-files record must refuse outside assets in the local render too, with the same warning, matching publish, cloud upload and Desktop, which all treat a damaged record as "everything received". Please change :143-146 and the PR body accordingly.

…plays was received

The received-file rule for local render (CLI and Studio) now checks
every page and stylesheet the render pulls in, not only the entry, so
an own index.html that plays a received scene also reads nothing
outside the project, and the notice names the received file. An
unreadable, truncated or empty received-files record refuses outside
files too, as publish and cloud upload do, and the notice names the
record it could not read.
@michaelwang11394

Copy link
Copy Markdown
Contributor Author

Both points are fixed in f454138. Local render, in the CLI and in Studio, now refuses outside files when any page or stylesheet it opens is received, not only the entry. The notice names that file, and Studio's test covers an own index.html playing a received scene. An unreadable, truncated or empty record refuses outside files again: the render finishes without them, and one line says the record couldn't be read and lists what was left out. The description is updated to match.

@michaelwang11394

Copy link
Copy Markdown
Contributor Author

Merged main (b290d77), now that #7808 has landed. receivedRecordStatus combines every received-files record at or above the folder, as #7808's receivedFiles does. An unreadable record refuses outside files, and the NFC prefix fix is kept. In 7e8f156, a new test checks that an empty nested record can't hide an outer record's received index.html in the render decision. Touched tests pass (235).

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed at 7e8f156

The literal media-named subcomposition cases now refuse, and the new response headers preserve extension-based script/style types. The merge resolution also retains the ancestor-record union, conservative invalid-record behavior and Unicode comparison fix.

Important — the consumer boundary remains incomplete (packages/cli/src/utils/receivedRender.ts:260–276, packages/producer/src/services/htmlCompiler.ts:2247–2253). The extension check covers mounted subcompositions, but the direct-entry path still accepts a media-named file as HTML. A producer-backed probe first passes the real CLI entry parser, then confirms the compiled page contains the received content and collects its outside asset; outsideAssetsAllowed still returns true. Two more probes consume the received bytes through an in-project HTML hardlink or symlink and likewise return true. Checking only the receipt-listed filename does not establish the role of its aliases; a correctly typed alias also defeats the premise behind nosniff.

Fix: apply the boundary to direct entries and account for received file identities across usage names, rather than only their recorded spelling. Reuse the existing received identity handling where applicable, and keep outside access refused when an inert role cannot be established. Retain the direct-entry parser/compiler control and alias-consumption controls alongside the repaired literal-name cases. This is the remaining consumer-role issue from the previous review.

Important — reject a non-HTML composition without reading it before containment (packages/producer/src/services/htmlCompiler.ts:292–295). The new diagnostic branch calls readProjectFile(named) before the outside/private-path checks. That helper opens the target and reads the full regular-file contents just to choose error wording. With outside access disabled, an in-project non-HTML symlink to an outside file is now read before compilation refuses it; a probe wrapping the actual reader confirms the call. This also makes a large rejected input consume memory unnecessarily. Reject the extension without reading contents, or perform containment/private checks first and use metadata only for the diagnostic.

Validation: fresh frozen install/full bun run build passed after the main merge. 230 committed CLI tests, 251 producer tests and 77 runtime tests pass. Four temporary probes fail (expected true to be false / rejected target observed in the read list): three allow outside access after actual compiler controls succeed, and one observes the rejected outside-target read. Restoring the preceding classifier/compiler guards makes all four diagnostic probes pass. No full browser render, Windows run or dev walkthrough performed. Temporary changes restored before posting.

Commands (through the shared gate): bun run --cwd packages/cli test src/utils/receivedRender.test.ts src/utils/privateProjectFile.test.ts src/commands/render.test.ts src/server/studioServer.renderBrowser.test.ts src/utils/staticProjectServer.test.ts src/utils/reviewGuardOrder.test.ts --maxWorkers=1; bun test packages/producer/src/services/htmlCompiler.test.ts packages/producer/src/services/fileServer.test.ts; bun run --cwd packages/core test src/runtime/compositionLoader.test.ts --maxWorkers=1. reviewGuardOrder.test.ts is a temporary diagnostic, removed after verification.

Need: yes · Size: focused policy and consumer guards · Reuse: received file identities and existing producer containment checks · Simpler: conservative refusal when inert usage is unproven; no content read for an extension error · Structure: fine (checked CLI/Studio consumers, compiler entry/mount paths, response MIME handling and the ancestor-record merge; retain one policy boundary)
Risk: high — misclassified received content permits outside-project access, and a diagnostic now reads before confinement.

Verdict: REQUEST CHANGES
Reasoning: The previous literal-name examples are fixed, but direct entries and aliases still violate the intended media-only exception, and the new error path bypasses the read guard.

— Rames

…tside files

The received-render decision now compares file identities, not names.
It walks the project once, bounded by entry count and time, and refuses
outside files when a hardlink or a symlink with a name that is not
media reaches a received file, or when the walk cannot finish. A
received file with no identity matches nothing, as in the received
files check.
@michaelwang11394

Copy link
Copy Markdown
Contributor Author

All three points are fixed in 0638f94. The commit message covers only the alias fix, because the entry check had to join that commit.

  1. Entry: a render entry must be .html or .htm. The CLI's --composition check and the producer both refuse anything else with a clear message, and Studio's render goes through the producer.
  2. Aliases: identities replace names. One bounded walk of the project (20,000 entries at most) flags any hardlink or symlink alias of a received file. Outside files are refused if an alias has a non-media name, or if the walk can't finish. The walk only runs when the project has received files.
  3. Read order: a sub-composition's location is checked first, and a non-HTML one is refused without being read.

Your direct-entry, hardlink and symlink probes are tests, alongside the earlier cases. CLI tests pass 222 and producer tests pass 253.

🤖 Addressed by Claude Code

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed at 0638f94

The direct-entry check, direct HTML hardlink/symlink aliases and containment-before-read issue from the previous review are fixed. Both CLI and producer reject a media-named entry; the compiler no longer reads a rejected non-HTML target for its diagnostic.

Important — the existing alias-class finding remains open (packages/cli/src/utils/receivedRender.ts:277–279, 307–316, 343). Media validation follows a receipt-listed symlink, but the received identity set uses lstat on that link. Candidate aliases instead use their resolved target identity, so the same received bytes reached through an HTML name can miss the set. Separately, directory symlinks are treated as individual entries without checking the files reachable through them. Two real-compiler controls consume the received page and collect an outside asset, after which outsideAssetsAllowed still returns true in both cases.

Fix: canonicalize the received paths and candidate paths consistently before comparing identities. Treat an unavailable identity or an unexamined linked directory as incomplete evidence and refuse the media exemption, or traverse resolved directories with containment, cycle and budget checks. Keep both compiler-backed linked-path cases alongside the direct-alias tests. This is the remaining alias coverage from the previous review, not a new policy request.

Important — empty receipts now change owned-project behavior (receivedRender.ts:338–347). Even files: [] starts the new whole-project walk. An ordinary project with an empty receipt and more than 20,000 entries (for example dependencies) now loses outside assets when the walk reaches its budget. The preceding implementation returns true immediately for the same empty record. Return without a walk when the validated list is empty; do not infer “empty” merely from failed identity lookups. Retain a large-project empty-receipt control.

Validation: frozen install/full bun run build passed; 275 committed CLI tests and 253 producer tests passed. Eight temporary controls give five passes (direct aliases, direct-entry rejection, guard ordering and media-only behavior) and three failures: the two compiler-backed linked-path cases report expected true to be false, and the empty-receipt case reports expected false to be true. The empty-receipt case passes with the preceding classifier. A temporary conservative repair (consistent target identity, refusal for an unchecked linked directory, empty-list short circuit) makes all eight pass. Temporary changes restored before posting. No native browser, Windows, cloud-render or dev walkthrough performed.

Commands through the shared gate: CLI Vitest on receivedRender, privateProjectFile, renderArgs, render, Studio render adapter and staticProjectServer, plus temporary alias/guard controls, with --maxWorkers=1; producer bun test on htmlCompiler and fileServer.

Need: yes · Size: focused policy and consumer guards · Reuse: existing identity and producer containment helpers · Simpler: consistent identity plus conservative refusal when alias coverage is unknown · Structure: fine (checked receipt identity construction against alias readers and CLI/Studio compiler consumers; no separate policy framework)
Risk: high — incomplete alias classification still permits outside-project access, while an empty receipt can now remove legitimate assets.

Verdict: REQUEST CHANGES
Reasoning: The earlier entry and read-order fixes hold, but linked aliases remain outside the identity proof, and the new walk regresses empty-receipt projects.

— Rames

…s for an empty record

A received media file and every other project name are now compared by the
identity of the file they reach with links followed. A linked folder that
leads outside the project, or a file whose identity cannot be read, counts as
unchecked and refuses outside files. An empty received-files record keeps
outside files without walking the project.
@michaelwang11394

Copy link
Copy Markdown
Contributor Author

Both points are fixed in df19490.

  1. Aliases through links. Received files and every candidate path are now compared by the identity of the file they reach once links are followed, so a received symlink and an HTML symlink that reach the same bytes match. Missing evidence refuses the media exemption:

    • a received file whose identity can't be read;
    • a candidate whose identity can't be read (a dangling link with nothing behind it is skipped, because the render can't read it either);
    • a linked directory that leads outside the project.

    A linked directory inside the project is fine, because the walk already lists its files. fileIdentity is no longer exported.

  2. Empty receipt. A validated files: [] returns true before any walk.

Tests in receivedRender.test.ts. Each of these fails on 0638f94 and passes now:

  • a received symlink plus an HTML symlink to the same page, through the real compiler (before the fix: true);
  • a linked directory outside the project holding the received page, through the real compiler (before the fix: true);
  • an empty receipt in a project with 20,001 entries (before the fix: false).

I also added a control test: a linked directory inside the project keeps outside files. The direct-alias tests are unchanged.

Ran: CLI vitest with --maxWorkers=1 on receivedRender, privateProjectFile, renderArgs, render, studioServer.renderBrowser, staticProjectServer and compositionServer (284 passed). tsc --noEmit, the comment ratchet, oxlint and oxfmt also pass. The producer is unchanged. Not run on Windows, where the link tests are skipped.

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed at df1949028a6cc3e9bf923ca2246465d8f9a0f1c6, including 0638f94b..df1949028. The blockers in reviews 5909716379, 5909588088 and 5909405235 are resolved at this head.

Audited: full latest three-file delta; received-file policy/identity helpers; CLI/Studio policy call sites; producer entry/subcomposition checks, response types and runtime composition extension checks; shared Host middleware and both command registrations. Trusting: unrelated existing render orchestration/compiler internals outside those integration points; no native render acceptance run.

  • Receipt-listed files and candidate aliases now use the same followed-target identity. Unknown/missing listed identity is incomplete evidence, not an empty proof. Unchecked linked directories fail closed; a linked directory whose canonical target stays inside the project is covered by the normal walk. Entry/time budgets still refuse incomplete evidence.
  • A validated empty files: [] list (distinct from an unreadable/empty file) now returns before identity construction or the project walk, preserving owned-project behavior even beyond the walk budget.
  • Direct media-named entries remain refused by CLI and producer. The checked producer subcomposition path runs containment/private checks before its guarded content read, and the extension-based MIME/nosniff behavior remains. The prior guard-order control passes.
  • CLI and Studio use the same outside-asset decision, including range-render propagation. Play/present install the shared Host middleware before serving routes; the check uses Host rather than a forwarded-host claim and retains the existing explicit allowlist behavior.

Validation through the shared gate: frozen install/full workspace bun run build succeeds. CLI received/private-file/render/Host/static-server suites plus the prior eight controls give 271 passed (including 8/8 original controls). Producer htmlCompiler/fileServer: 253 passed; Studio origin guards: 24 passed; runtime compositionLoader: 77 passed. Restoring the two policy/helper files to 0638f94b reproduces 3 failed/5 passed in the original controls; restored head gives 8 passed. These are compiler/in-process controls, not browser or cloud renders. Temporary files and production source restored before posting. Fresh independent adversarial code review found no new blocking regression.

Scope/follow-up: this is outside-asset acquisition policy, not a general filesystem-read sandbox. The existing advisory/entry-reading paths merit separate containment/nonregular-file hardening; they are unchanged by the latest delta, and ordinary CLI entry planning already reads the entry. I found no newly observable regression there to block this repair. No Windows, native browser, cloud render or dev walkthrough was performed.

Sibling: #7818 at 3eabfac8 overlaps only docs/packages/cli.mdx; the trial merge is clean (tree e8f7a8215194fdfe1dd460403f891590388af58e). Its upload type rule and this local received-file policy are additive. Landing #7818 first is the recommended order; there is no source dependency on that order in the checked heads.

Need: yes · Size: focused latest repair · Reuse: existing receipt union, canonical file identity and producer containment/MIME consumers · Simpler: consistent target identity plus conservative incomplete-evidence refusal · Structure: fine (checked the existing lstat identity against followed consumers; one shared alias decision and one Host check, not a new policy framework)
Risk: high — received-content classification controls outside-project asset access.

Verdict: APPROVE
Reasoning: The linked-path evidence and empty-receipt regressions are repaired, while the earlier entry/type/read-order protections remain intact. The original failing controls discriminate this head from the preceding one.

— Rames / cutroom-review

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed at c5118694b4bbdf4e790c815a2aa5d91fee6da3f6, rechecking the delta from approved df1949028a6cc3e9bf923ca2246465d8f9a0f1c6.

The merge is reproducibly mechanical: git merge-tree --write-tree df1949028 ded5e3eec yields daf1dd13dbf3ddda93af9a43b400f764fe3c3027, exactly the tree of merge commit 70147ba8. The following commit changes only the producer unpacked budget. Comparing each revision against its own base gives the same 25 PR paths plus that budget file; 23 original path blobs are identical, and only htmlCompiler.ts and compositionLoader.ts receive main's CSS-scanner changes. There are no additional hand-resolved production edits.

The received-file/alias helpers, CLI Host middleware, producer file server and shared Host predicate are byte-identical to the approved head. Main's CSS scanners retain the compiler's containment/private-path checks and runtime composition-type restriction. The incoming public producer server policy is additive: public request confinement does not enable outside assets, while CLI/Studio embedded rendering retains its received-file decision. #7818 is still open, so it is not included here; the prior recommended ordering remains unchanged. The independent code pass found no new blocker in the compiler/runtime and public-versus-embedded server interactions.

Nit — budget headroom: scripts/package-size-budgets.json:40 raises 3,245,000 → 3,290,000 (+45,000, 1.39%). My fresh producer tarball measures 3,277,717 unpacked bytes, only 267 above the old 1% threshold (3,277,450). A budget of 3,245,265 would just pass this measurement; the chosen budget permits another 45,183 bytes at its tolerance. Consider a tighter rounded value. This is substantially more than the immediate excess, but a small bounded allowance, not a correctness blocker. Packed size is 902,834, within the unchanged 901,000 budget's 1% tolerance (910,010).

Validation: frozen install and full bun run build pass. Gated Vitest runs (--maxWorkers=2): CLI received-file/render/Host/server suites 280 passed; original alias/empty-receipt/guard-order controls 8 passed; producer compiler/file-server Bun suites 253 passed, CSS/public-server Vitest suites 16 passed. (The first combined Vitest invocation could not collect the two bun:test files; rerunning those with their prescribed Bun runner passed.) Runtime composition loader 77 passed. No native browser, Safari, Windows or cloud-render acceptance run; previous broader follow-up scope remains unchanged.

Need: yes · Size: focused merge plus one budget value · Reuse: existing CSS scanners and received-file/Host guards · Simpler: mechanical merge; tighter budget optional · Structure: fine (checked compiler/runtime and public versus embedded server boundaries; no split)
Risk: high — received-content policy controls outside-project asset access.

Verdict: APPROVE
Reasoning: The approved guards survive the automatic main merge, and the only change beyond the mechanical main merge is a bounded package-size allowance. Focused integration controls still pass.

— Rames / cutroom-review

This branch was successfully deployed

1 active deployment
staging - docs — c5118694 Deployed Nov 15, 2026 by mintlify[bot]
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.

3 participants