Repository navigation
fix(media-use): carve with the CLI's own analysis, never a project's core - #7887
michaelwang11394 wants to merge 2 commits into
Conversation
…@hyperframes/core hyperframes media-use carve hands carve.mjs the audio-carve and audio-fx modules the CLI bundles, and its trusted FFmpeg. Run directly, carve.mjs needs --core naming a core the person installed; it no longer resolves one from the composition's folder.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
# Conflicts: # skills-manifest.json
jrusso1020
left a comment
There was a problem hiding this comment.
Reviewed at 61079a0830624b0251b2bce396aacf954739ae25.
The CLI supplies its own imported audio-carve/audio-fx implementations and trusted FFmpeg path to the skill runner. Direct script use now refuses to discover core through the project; explicit --core remains an intentional caller choice. The packaged/source script-path fallback and build-copy integration agree.
Validation: Node 24 carve script suite: 21 passed. CLI vitest run src/commands/media-use --maxWorkers=2: 16 passed after building workspace dependencies. Independent source review found no blocker. I did not run a model or a full packaged media conversion.
Nit: update the stale project-anchored wording in carve.mjs's core-loading comment to describe the new explicit-core contract.
Need: yes · Size: ok · Reuse: CLI core imports and trusted FFmpeg resolver · Simpler: already minimal · Structure: fine (checked media-use dispatch and script packaging; no split)
Risk: low — removes implicit project module execution while preserving the existing carving implementation.
Verdict: APPROVE
Reasoning: The CLI uses trusted analysis code and the standalone script fails closed without an explicit core implementation.
— Review by Rames
|
Closing this as superseded. #7926 (merged) fixed the same problem on main: |
What
The voiceover carve now runs as a CLI command,
hyperframes media-use carve, and never loads@hyperframes/corefrom the project.hyperframes media-use carve --comp index.htmlhands the skill'scarve.mjstheaudio-carveandaudio-fxmodules the CLI bundles, and the CLI's trusted FFmpeg. The flags are unchanged:--bed,--voice(repeatable),--strengthand--dry-run.node carve.mjswithout--corenow stops with a message that names the CLI command. With--core <dir>, it still loads a core the person installed there. It no longer resolves one from the composition's folder.references/mixing.md,docs/reference/audio-effects.mdxand themedia-usesection ofdocs/packages/cli.mdxuse the command. The skill no longer tells the agent to install@hyperframes/coreinto the project.Why
carve.mjsanchoredcreateRequireat the composition's folder and imported@hyperframes/corefrom whatevernode_modulesthat found. In a project someone else made, that is the project's own code, run with the person's account. The CLI already bundles core, so it can hand the same analysis to the script instead.Related work
Refs #7552, which made the other media helpers run the CLI their caller hands over instead of looking one up in the project.
How
carve.mjskeeps its logic.main()becomescarveComposition(argv, core, ffmpeg), so both the CLI and a direct run call the same function.carve.mjsit ships underdist/skills/media-use/(the build already copies that tree), or the repo's copy in a source checkout. Neither is in the project.decode()now takes the FFmpeg path. The CLI passesfindFFmpeg(), its trusted lookup; a direct run keepsffmpegfrom PATH as before.What I measured
package.json,music.wav,narration.wav, anindex.htmlnaming both, and a plantednode_modules/@hyperframes/corewhoseindex.jswrites a marker file:carve.mjs --comp index.html --dry-runwrote the marker: the project's core ran.media-use carve --comp index.htmlprinted the bed, the voice, 6 bands and a 60-point level envelope, wrote the carve ontomusic-bed, and the marker was never written.carve.mjs --comp index.htmlwithout--coreexits 1 with the message naming the CLI command, and the marker was never written.skills/media-use/audio/scripts/carve.test.mjs: 21 passed. fails without the fix: the new test plants a core in the project and runs the script directly; on main the planted core runs.src/commands/media-use/carve.test.tsand the othermedia-usecommand tests: 16 passed.tsc --noEmitfor the CLI, oxlint,check-docs-cli-commands.mjs,check-core-skills.mjsand the comment ratchet pass.history.test.tsandlambda/deploy.test.tsfail with lock and timing errors. Those files do not touch this change; CI runs them on a clean machine.What I did NOT exercise
Test plan