test(engine): cover held tails in HDR preflight - #3963
Open
heygengenesis[bot] wants to merge 1 commit into
Open
heygengenesis[bot] wants to merge 1 commit into
heygengenesis[bot] wants to merge 1 commit into
Conversation
Add regression coverage for finite SDR video slots that start past EOF in mixed HDR timelines, and verify lint exclusions with successful local duration probes. Co-authored-by: miguel.sierra <229591595+miguel-heygen@users.noreply.github.com>
miga-heygen
approved these changes
Sep 15, 2026
miga-heygen
left a comment
Contributor
There was a problem hiding this comment.
Reviewed head 7aadf147 in an isolated worktree. Test-only follow-up to #3962; the diff is exactly two test files and touches no production code.
Strengths
packages/engine/src/services/videoFrameExtractor.test.ts:2241-2263— the mixed SDR-in-HDR fixture is the missing pin for thecanHoldFinalFramePastEofhalf of the preflight guard (videoFrameExtractor.ts:1755). Reverting the guard tomediaStart >= playableDurationlocally makes it fail withmedia_start_out_of_rangeforsdr-past-eof, exactly as the PR body states.packages/lint/src/project.test.ts:657-659— switching the exclusion case tomockDurationProbe(2)turns a vacuous test into a real one. Locally, deleting each of theloop,data-var-src, anddata-durationexclusions inreadFiniteVideoSlot(hevcPreviewLint.ts:176-179) now makes this test emitvideo_media_start_at_or_past_eof; on the previous head all three survived.
Verified
- Both tests pass on this head (engine fixture 1/1 with ffmpeg present;
project.test.ts37/37). - Four mutants killed: guard revert, drop
loopexclusion, dropdata-var-srcexclusion, drop open-slot (data-duration) exclusion. - Fixture files land under the per-suite
FIXTURE_DIRtemp dir thatafterAllremoves; no new cleanup surface. - All nine required checks green on
7aadf147.
Nit
packages/lint/src/project.test.ts:649— the title still says "unprobeable", but with a succeeding probe mock no row in this fixture exercises that path any more (probe failure is covered separately by "silently skips the finding when ffprobe errors or times out"). Either drop the word or add a row whose probe fails, so the name matches what the assertion proves.
Verdict: APPROVE
Reasoning: Test-only change with no production diff; both new assertions are mutation-verified locally to fail when the guard or any of the three lint exclusions is removed, closing the coverage gaps noted on #3962.
— Miga
miguel-heygen
approved these changes
Sep 15, 2026
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.
Follow-up to #3958.
Summary
ffprobemock, so the exclusions—not probe failure—produce no finding.Behaviour is unchanged: this PR changes tests only.
Validation
bunx vitest run src/services/videoFrameExtractor.test.ts -t 'keeps a finite SDR past-EOF slot in a mixed HDR timeline'bunx vitest run src/project.test.ts -t 'silently skips open, looping, remote, variable, missing, and unprobeable slots'bunx vitest run src/project.test.ts— 37 passedbun run --cwd packages/engine typecheckbun run --cwd packages/lint typecheckbunx oxlintandbunx oxfmt --checkon the changed testsbunx fallow audit --base origin/main --fail-on-issues— no new issues in changed filesMutation verification:
mediaStart >= playableDurationmakes the new fixture fail withmedia_start_out_of_rangeforsdr-past-eof.loopexclusion makes the successful-probe lint fixture emitvideo_media_start_at_or_past_eof.Simplify: built-in
/simplifywas attempted after CI; sandbox error:Not logged in · Please run /login. No reductions were applied.Commit-pinned references
The guarded mixed-HDR preflight path on main is videoFrameExtractor.ts:1752-1764. The test changes at this head are the mixed HDR fixture and the successful-probe exclusion fixture.