Skip to content

fix(render): probe runtime media source mutations - #3729

Merged
miga-heygen merged 1 commit into
mainfrom
magi/fix-runtime-media-src-mutation
Sep 8, 2026
Merged

miga-heygen merged 1 commit into
mainfrom
magi/fix-runtime-media-src-mutation

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

Summary

Known-duration compositions now launch the browser reconciliation probe when inline JavaScript synchronously mutates the source of an existing video, audio, or nested <source>. Extraction, video-frame injection, and audio mixing therefore receive the browser-live source instead of silently retaining the static fallback.

An AST-backed media_runtime_src_mutation warning identifies literal .src = … and setAttribute("src", …) writes tied to statically resolvable managed media. It recommends a final static source or declared data-var-src; image and script source mutations are excluded. The warning remains useful for delayed or external mutations that a pre-extraction probe cannot guarantee.

Validation

  • Probe-stage suite: 39/39 tests passed.
  • Media lint suite: 67/67 tests passed.
  • Parser, lint, and producer package typechecks passed.
  • Changed-file formatting, lint, and diff checks passed.

The sanitized reconciliation fixture uses distinct SHA-256 identities:

  • Video A: 986b0b8e67d317608d3edba09b7cdc49afb8237df7e4c7624b766f5d6e0951ac
  • Video B: 4f250966375ee944833a5633af41005817fd3dffd8975bf16d13f7e3bc3feb09
  • Audio A: ec6b554699634f58f2783bfdf8345d3280c7217010b932564ea8c3c140f60935
  • Audio B: 28d1a173cb73315c777ac2970cb402267dae4661cb26863d02ad700bd3be469e

The test starts with A in compiled metadata, discovers B from the browser, and proves B reaches media preflight for both video and audio. Original-project preview/output hash verification remains unavailable because the private assets and output were not supplied.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Fallow audit report

Found 11 findings.

Duplication (10)
Severity Rule Location Description
minor fallow/code-duplication packages/producer/src/services/render/stages/probeStage.test.ts:552 Code clone group 1 (20 lines, 2 instances)
minor fallow/code-duplication packages/producer/src/services/render/stages/probeStage.test.ts:571 Code clone group 2 (18 lines, 2 instances)
minor fallow/code-duplication packages/producer/src/services/render/stages/probeStage.test.ts:663 Code clone group 3 (15 lines, 2 instances)
minor fallow/code-duplication packages/producer/src/services/render/stages/probeStage.test.ts:680 Code clone group 3 (15 lines, 2 instances)
minor fallow/code-duplication packages/producer/src/services/render/stages/probeStage.test.ts:682 Code clone group 4 (17 lines, 4 instances)
minor fallow/code-duplication packages/producer/src/services/render/stages/probeStage.test.ts:694 Code clone group 1 (20 lines, 2 instances)
minor fallow/code-duplication packages/producer/src/services/render/stages/probeStage.test.ts:694 Code clone group 2 (18 lines, 2 instances)
minor fallow/code-duplication packages/producer/src/services/render/stages/probeStage.test.ts:695 Code clone group 4 (17 lines, 4 instances)
minor fallow/code-duplication packages/producer/src/services/render/stages/probeStage.test.ts:710 Code clone group 4 (17 lines, 4 instances)
minor fallow/code-duplication packages/producer/src/services/render/stages/probeStage.test.ts:727 Code clone group 4 (17 lines, 4 instances)
Health (1)
Severity Rule Location Description
minor fallow/high-crap-score packages/parsers/src/mediaSrcMutation.ts:32 'lookupSelector' has CRAP score 43.1 (threshold: 30.0, cyclomatic 12)

Generated by fallow.

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

Reviewed: AST-based extractMediaSrcMutations correctly detects .src assignment and setAttribute on statically-resolvable DOM lookups, scoped to video/audio/source tags. Probe reconciliation and lint paths both wired. Tests thorough. — Miga

@miga-heygen
miga-heygen enabled auto-merge (squash) September 8, 2026 18:09
@miga-heygen
miga-heygen merged commit 5c44cd2 into main Sep 8, 2026
54 of 55 checks passed
@miga-heygen
miga-heygen deleted the magi/fix-runtime-media-src-mutation branch September 8, 2026 18:10
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.

2 participants