Repository navigation
fix(cli): batch renders accept PowerShell JSON files - #6605
Conversation
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
|
Independent GPT-6 Astra high review of exact head The reviewer independently passed 68 focused tests and 26 bounded base/head controls. Both BOM-marked batch formats fail on the base and succeed on this head, preserving Review validation reused the verified clean exact-head author checkout and its existing successful build. Native Windows, the broad suite and fresh video renders were not rerun by the reviewer. The author's matching render proof and baseline comparison remain in the PR description. All twelve required checks have passed at |
jrusso1020
left a comment
There was a problem hiding this comment.
Reviewed at 1145a3f7c641f3202d60c86bc3482f57cd742cb3.
I checked the batch-reader boundary and the full shared JSON decoder. Only default file reads decode BOMs; injected string readers and literal BOMs inside JSON values keep their behavior. No introduced blocker found.
I ran the exact-head batchRender suite: 13 tests passed with borrowed dependencies. Workspace imports used the donor build, so this does not assert a fresh workspace build or native PowerShell execution.
Need: yes · Size: ok · Reuse: existing implementation and tests · Simpler: already bounded · Structure: fine
Risk: low - bounded change; validation limits are stated above.
Verdict: APPROVE
Reasoning: I checked the batch-reader boundary and the full shared JSON decoder. Only default file reads decode BOMs; injected string readers and literal BOMs inside JSON values keep their behavior. No introduced blocker found.
… motion specs (heygen-com#6845) * fix(cli): read BOM-prefixed JSON files for timeline plans, grades and motion specs * fix(cli): read BOM-prefixed files for render --batch, lambda policy and transcripts * test(cli): drop the batch BOM test heygen-com#6605 already covers * fix(cli): decodeJsonText is only used inside jsonFlag.ts * fix(cli): drop a fallow suppression the export no longer needs
…com#6605 heygen-com#6611 heygen-com#6831 heygen-com#6800 Windows debug.log lock, PowerShell UTF-16 batch JSON, long backup names, --variables-file readFile override, Figma motion key collisions. Rest deferred with per-commit evidence; 72 PRs pinned in monitored. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: SanHsien <[email protected]>
What
Batch rendering rejects otherwise valid JSON saved with a UTF-8 BOM or as UTF-16LE with a BOM, including files written by Windows PowerShell. These files now render through the existing JSON decoder.
The complete input and setup are in #6604. On the same one-second composition, run:
node --import ../node_modules/tsx/dist/loader.mjs ../packages/cli/src/cli.ts render \ --batch rows-utf8.json --output 'renders/{index}.mp4' \ --fps 1 --workers 1 --json --quiet --strict-variablesRepeat with
rows-utf16le.json; only that filename changes between the two encoding cases. Within each case the input bytes, composition, arguments, environment and browser are identical before and after.7e92aec5Invalid JSON in --batchInvalid JSON in --batchBoth successful runs produce this projection of stdout (paths and timing fields omitted):
{"type":"batch-complete","total":1,"completed":1,"failed":0,"skipped":0,"variables":{"title":"Café"},"durationMs":1000}FFprobe reports H.264, 320×180, one frame and 1.000000 seconds for each output. I decoded and inspected both frames: they show
Café. An unmarked UTF-8 control also renders successfully.Why
The batch reader decoded every file as UTF-8 and sent a leading BOM directly to
JSON.parse. Other JSON flags already decode these PowerShell file formats.Related work
Fixes #6604.
#5725 handles project configuration; #6580 handles HTML files; #6591 handles undefined injected readers for
--variables-file. This change uses the existing decoder without changing that reader-selection logic.How
Share the existing byte decoder with the batch-file reader. Keep JSON parsing and row validation unchanged. The regression reads real UTF-8 and UTF-16LE files, checks non-ASCII text and the output path, and preserves a U+FEFF inside a value.
Test plan
mintis not installed locally.