Skip to content

fix(cli): media-treatment reads a relative --grading file from the project folder - #6964

Merged
miguel-heygen merged 1 commit into
mainfrom
fix/media-treatment-grading-path
Nov 2, 2026
Merged

miguel-heygen merged 1 commit into
mainfrom
fix/media-treatment-grading-path

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

hyperframes media-treatment --file compositions/<scene>.html --grading assets/<grade>.json --apply failed with ENOENT on a path under the folder the command runs in. --file is read from the project folder, but a relative --grading file was read from the current directory, so a command launched from anywhere but the project (an app's install folder) never found it.

A relative --grading path is now read from the project folder, the same as --file. Absolute paths, inline JSON and - for stdin are unchanged. Run inside the project (the usual case), nothing changes.

Why

Reported against 0.8.228 on Windows; reproduced on 0.8.230 with --project <dir> run from another folder: ENOENT ... open '<cwd>/assets/g.json'.

Test

New test: a relative --grading file is read from the --project folder. The existing grading-file tests still pass; 50 tests, 3 runs in a row.

fails without the fix: packages/cli/src/commands/media-treatment.test.ts › applyMediaTreatmentToHtml › reads a relative --grading file from the project, not from where the command runs

Size

Under 100 changed lines.

@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.

Verdict: APPROVE · 0 blocker · 0 important · 0 nits · head 6c503203

Scope
  • Read the full diff and utils/jsonFlag.ts. Inline JSON and - (stdin) return before readFile is called. resolve(projectDir, path) leaves absolute paths, including Windows drive paths, unchanged.
  • --file already resolves against project.dir (media-treatment.ts:678). --grading is the only JSON-file flag in media-treatment, so there are no other call sites to fix.
  • The test named on the fails without the fix: line runs with --project <tmp> while the working directory is somewhere else, so assets/g.json fails with ENOENT without the fix.
  • CI on this head was still running (CI, CodeQL, Windows, preview-regression); the required checks still gate the merge.

@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit f8309b3 Nov 2, 2026
77 of 79 checks passed
@miguel-heygen
miguel-heygen deleted the fix/media-treatment-grading-path branch November 2, 2026 02:02
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