Repository navigation
fix(parsers,lint,producer,cli): confine composition path lookups to the project - #7534
Merged
Merged
Conversation
…he project - The local asset resolver offers only files inside the project: a path that is still absolute after its leading `../` is clamped (an encoded `//`, a drive letter, a leading backslash) yields no candidate. - Lint, the catalog-usage walk and `keyframes` read a data-composition-src only inside the project. Lint and the catalog walk resolve it with the render's own resolver, now shared from `@hyperframes/parsers/asset-resolution`, and lint reports one outside the project as the render pre-flight does. - The render compile step does not look at a media, gsap script or image path on another UNC or device root, and the GIF and HEIC preparation treats a `//host/...` image src as a URL rather than a share. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Edit accuracy: accurate 267 (base branch 267), smooth 108 of thoseThe gate passes. Quarantined, measured but not gated (8)
Unstable (1)
|
…es in The shared asset resolver now offers only files inside the project. On Windows a drive-letter src such as C:\media\clip.mp4 used to reach the real file through the old fallback, and render still copies that file in. Lint now accepts such a file for media and for CSS written in the page, so it raises no new missing_local_asset or texture_mask_asset_not_found error. The media-treatment and normalize-audio commands find it again. The check never looks at another computer's share, and on macOS and Linux a src that starts with / is still a project URL, so nothing changes there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d on Windows On Windows an absolute src outside the project is a drive-letter path, which resolveCompositionSrc refuses, as the render pre-flight already does. On POSIX the same src is a project URL and resolves inside the project. The test now expects each platform's result. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the project may hold Lint no longer reads a script outside the project. When a root composition loads such a script, lint cannot know whether the script registers the timeline, so it no longer reports missing_timeline_registry for that composition. Render still loads the script. A composition whose scripts are all in the project is checked as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Verdict: APPROVE · 0 blocker · 0 important · 0 nits · head 6e0d58f
What I checked:
- The
resolveCompositionSrcmove changes nothing.staysInsideProjectmatches the old producerisPathInside: a path equal to the project counts as inside, and a leading..segment or a path absolute afterrelative()counts as outside. localAbsoluteAssetFilestays a no-op on POSIX.isNonRelativeUrlrejects every leading/, soresolveAuthoredAssetFilecan't hand a host file like/etc/...tomedia-treatmentornormalize-audio. On Windows it reaches only local drive files, which matches what render copies in.namesAnotherNetworkRootkeeps UNC and device paths on other roots out of every new stat.- The resolver clamp is fixed. A re-anchored candidate that is still absolute (for example
C:/…after the leading../are stripped) used to escape throughresolve(). It is now dropped.
— Genesis V2
Merged
3 of 4 tasks
3 of 4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Composition path lookups outside the render now stay inside the project folder, the same way the render already does.
packages/parsers/src/assetResolution.ts): offers only files inside the project. A path that is still absolute after its leading../is clamped (an encoded//, a drive letter, a leading backslash) yields no candidate. This covers the lint stylesheet and script collectors, the Studio media scan, publish proxy baking and cloud offload, which read or upload what the resolver returns.localAbsoluteAssetFilefinds the local file a drive-letter src (C:\media\clip.mp4) names, as render does. It never looks at another computer's share, and it does nothing on macOS or Linux, where a src that starts with/is a project URL. Lint uses it, so a drive-letter src raises no newmissing_local_asseterror, and neither does amask-imagein the page's own CSS.resolveAuthoredAssetFileuses it too, somedia-treatmentandnormalize-audiostill find such a file. It only checks that the file exists; nothing is read into lint output.resolveCompositionSrcmoves unchanged into@hyperframes/parsers/asset-resolution. Lint and the catalog-usage walk now use it, andkeyframesgains a containment check. Lint reports adata-composition-srcoutside the project as "outside the project folder", as the render pre-flight already does.htmlCompiler.ts): the media-duration probe, the gsap existence check and the keyframe/VFR advisory skip a path on another UNC or device root. A project stored on a share still reads its own share, so a gsap script there is still used.//hostor/\hostimage src is treated as a URL, not a share. Backslash UNC sources are still copied, as render supports them.Valid in-project references resolve exactly as before. A side-by-side run of the old and new resolver gives the same candidates for in-project relative paths, leading
/,../that stays inside, encoded names and absolute paths inside the project, under both POSIX and Windows rules, including for a project on a UNC share. Lint now also stops reporting a false "file does not exist" for a leading-slash or percent-encodeddata-composition-src.Not changed on purpose
C:as a URL scheme). The published output does not change: publish copies such a file into_ext/with its own resolver, which this PR does not touch, and proxy baking then scans the rewritten_ext/path, so it never baked these files before or after.missing_timeline_registryfor that composition. Render still loads the script.Testing
assetResolution.test.ts,assetResolution.win32.test.ts,lint/src/project.test.ts(including the unread-script case),lint/src/project.windowsAbsolute.test.ts,htmlCompiler.networkRoot.test.ts,keyframes.test.tsandcatalogUsage.test.ts; each fails without its fix.htmlCompiler.test.ts177, CLI resolver callers 200, studio-servermediaCodecMap50.path.win32.🤖 Generated with Claude Code