Repository navigation
fix(media-use): never replace a voice, music or sound file the person put in the project - #4665
Conversation
…he project's media manifest
… locally made music generated
… manifest library
…the project sfx source
… put in the project
…kip the replaced one
…o fix/media-use-keep-person-files # Conflicts: # skills-manifest.json # skills/media-use/audio/scripts/lib/media-record.test.mjs
…o fix/media-use-keep-person-files # Conflicts: # skills/media-use/audio/scripts/lib/media-record.test.mjs
|
Verdict: COMMENT (holding, not approving) — see gate note at the bottom. Reviewed at What I did
FindingsNone blocking on this PR's own diff. The design (manifest-recorded ownership, Gate — why I'm not approving right nowThis PR's base is Once #4648 clears Rames's finding 1, I'll re-review at whatever new head results (should be fast — my findings here don't change) and can approve then. |
somanshreddy
left a comment
There was a problem hiding this comment.
Upgrading my earlier comment to a formal REQUEST_CHANGES — not because the diff has a defect (it doesn't; see my full review above), but because on a "one approval clears the gate, the loop presses merge" lane, a plain comment doesn't hold the gate against a different reviewer approving without seeing this thread. That's exactly the failure mode from hyperframes#4054: a comment classified "hold, don't merge" still lets a stray approval clear an auto-merge gate.
The hold, restated: #4665's base branch is #4648, which carries an open, unresolved CHANGES_REQUESTED (Rames, bf463a0c). Merging #4665 now would move #4648's head mid-review. Once #4648 clears, I'll switch this to APPROVE immediately — my technical review above already stands and won't need to be redone.
…o fix/media-use-keep-person-files # Conflicts: # skills-manifest.json
…o fix/media-use-keep-person-files
somanshreddy
left a comment
There was a problem hiding this comment.
Verdict: APPROVE — hold cleared.
My hold on this PR was never about its own content (see my earlier full review, thoroughly verified and mutation-tested) — it was that its base, #4648, carried an open CHANGES_REQUESTED, and merging this PR would have moved #4648's head mid-review. Rames has since cleared that CR at #4648's dd78781e (reviewDecision: APPROVED).
Re-verified at this exact head (ac0edee9) rather than just trusting the dispatch label:
- #4665's own production source is byte-identical to the
de003bcchead I already fully reviewed and mutation-tested (git diff de003bcc...ac0edee9on every file in this PR's own scope, excluding one test file, is empty). - The only change within #4665's own scope is a small, positive test strengthening in
media-record.test.mjs: a new assertion that a re-recorded take with a new duration is a new record, and a new assertion that.media/index.mdreflects the current take's text, not a stale one. This directly exercises the integration with #4648's now-fixedcurrentRecords/index-gen behavior — a genuine strengthening, not a regression. - Everything else in the raw head-to-head diff (
candidates.mjs, bothindex-gen.mjscopies,mediaIndex.ts) is inherited from the rebased base, not authored by this PR — confirmed againstgh pr view --json files's base-relative scope before attributing anything to this PR.
CI green on all 15 checks. Approving.
The base branch was changed.
…rson-files # Conflicts: # packages/cli/src/media-use/lib/manifest.mjs # packages/cli/src/media-use/resolve.mjs # skills-manifest.json # skills/media-use/audio/scripts/audio.mjs # skills/media-use/audio/scripts/audio.test.mjs # skills/media-use/audio/scripts/gemini-pipeline.test.mjs # skills/media-use/audio/scripts/lib/media-record.mjs # skills/media-use/audio/scripts/lib/media-record.test.mjs # skills/media-use/audio/scripts/lib/sfx.mjs # skills/media-use/scripts/lib/manifest.mjs
somanshreddy
left a comment
There was a problem hiding this comment.
Verdict: APPROVE — re-verified at the rebased head, not just re-stamped.
At c512878e (rebased onto main after #4648 merged, resolving the conflict I flagged earlier). Diffed every file in this PR's own scope (gh pr view --json files) between my last-approved head (ac0edee9) and this one: the only difference is skills-manifest.json's auto-generated hashes for hyperframes, hyperframes-cli, hyperframes-creative and hyperframes-studio — all unrelated skills whose content shifted from picking up other main-merged PRs during the rebase. media-use's own hash (the actual subject of this PR) is byte-identical: 0744050e3114e60a on both heads. No production or test code changed.
CI green on 57 of 60 checks, 3 still in progress (Windows engine-cli/studio-2, CodeQL), none failed.
Stacked on #4648 (its base branch); review that first.
What
media-use's audio engine wrote to fixed names in the project and replaced whatever was there: a voice line to
assets/voice/<line id>.wav, retrieved music toassets/bgm/track.mp3, locally made music toassets/bgm/track.wav, and a HeyGen sound effect toassets/sfx/<name>.mp3. A person's ownassets/sfx/whoosh.mp3orassets/voice/intro.wavwas silently overwritten.Now the engine never replaces a file the person put there:
generated,searchorbundled), the engine writes there as before, so a rerun still replaces its own takes.whoosh-2.mp3,whoosh-3.mp3, and so on, records that file, and reports the switch as an anomaly:assets/sfx/whoosh.mp3: kept, because the file there is yours ...; writing assets/sfx/whoosh-2.mp3 instead (audio_meta.json has the path used). A second run reuses the same-2file, because it is now recorded as the agent's.hookandhook-2with a person'shook.wavgethook-2.wavandhook-2-2.wav).-2(glitchandglitch 2beside a person'sglitch.mp3getglitch-2.mp3andglitch-2-2.mp3).The rule that decides what counts as agent-made (
AGENT_SOURCES) now lives in the manifest library next to the records, andresolve --sourceuses the same list. The tts, bgm and sfx references say where a file lands when the fixed name is taken.Also fixed: generating music again over the engine's own
track.wavleft the old file in place until the new one was written, andwait-bgmtreats any file there as finished, so it reported the old track as ready at once. The old track is now removed right before the generator starts.Upgrade note
Files written by an engine older than #4648 carry no manifest record, so they count as the person's own: the first run after upgrading writes
-2names beside them, leaves the old files in place and says so in the anomalies. The run'saudio_meta.jsonnames the files it used.Known limits
bundled.Tests
assets/sfx/whoosh.mp3survives unchanged, the cue lands onassets/sfx/whoosh-2.mp3with the library's bytes, and a second run reuses that file. Fails on the base.assets/voice/intro.wavpresent, the voice line is written toassets/voice/intro-2.wav, recorded asgenerated, and the person's file survives. Fails on the base.agentWritePath: a free name is used; a person's file, and a file recorded asexisting, move the write to-2with one anomaly each; a recorded agent file and a reusable file are replaced silently; a person's-2moves it to-3; an agent-made-2is reused.voicePaths: two lines never share a file when one's name is taken by the person.-2is already recorded as the engine's; a repeated effect reuses its file. The bundled branch uses the same rule without a test of its own (it needs a library file literally named<other>-2).-2.track.wavbefore the generator runs (a fakepython3stands in for the model; skipped on Windows).Each rule's test fails with that rule removed (8 mutations, all caught).