Repository navigation
refactor(media): remove playback policy test seam - #132465
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 29, 2026, 8:36 PM ET / August 30, 2026, 00:36 UTC. ClawSweeper reviewWhat this changesThe PR removes test-only exports of the private playback policy and replaces direct policy assertions with public resolver and FFmpeg conversion-boundary tests. Merge readiness✅ Ready for maintainer review Keep open. The latest revision addresses the prior P2 finding by exercising every supported MIME-to-demuxer mapping through the public conversion boundary, while removing only test-only access to private policy internals; this MEMBER-authored, maintainer-labeled PR requires normal maintainer handling rather than automated closure. Priority: P3 Review scores
Verification
How this fits togetherPlayback handling classifies audio and video attachments, probes their codecs, and either serves compatible media unchanged or converts it to a portable format. Gateway media endpoints use this result to return original, pending, or transcoded attachment content. flowchart LR
A[Media attachment] --> B[Gateway media endpoint]
B --> C[Playback resolver]
C --> D[Codec and container inspection]
D --> E{Compatible format?}
E -->|Yes| F[Serve original]
E -->|No| G[FFmpeg conversion job]
G --> H[Serve portable media]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -26, Tests -18. Total -44 across 5 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the private policy unexported and retain the table-driven public classification and conversion tests as the canonical coverage for supported and unsupported playback media. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR is a behavior-neutral test refactor, and its relevant verification is the public resolver and conversion-boundary test coverage. Is this the best way to solve the issue? Yes. Exercising classification and FFmpeg demuxer selection through public APIs preserves the meaningful contract without retaining a test-only production policy export. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 80e4dd3d3ae4. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles) |
38c146b to
8744d25
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
* test(media): remove playback policy inventory seam * test(media): cover playback policy through public resolver * test(media): cover playback demuxer mappings
Additional instructions
MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.
What Problem This Solves
Removes a playback-policy unit test that duplicated the private production policy table and required a test-only production API. The snapshot had to change for behavior-preserving policy edits while stronger codec, file, and transcoding tests already cover the operator-visible behavior.
Why This Change Was Made
The private policy inventory and direct resolver assertions are deleted together with their production/test-support exposure. Gateway tests now use a narrow local playback-mode fixture, while the real playback suite continues to exercise codec probing, classification, fallback, cache, and ffmpeg behavior.
User Impact
No user-visible behavior changes. Maintainers have less duplicated policy data and a smaller test-only production surface.
Evidence
node scripts/run-vitest.mjs src/media/playback-transcode.test.ts— 31 passed.node scripts/run-vitest.mjs src/gateway/control-ui.http.test.ts src/gateway/managed-image-attachments.test.ts— 268 passed.node scripts/run-vitest.mjs src/tts/tts-audio-store.test.ts src/tts/tts-runtime-routing.test.ts— 21 passed.git diff --check— passed.node scripts/check-changed.mjs --dry-run -- ...— core/coreTests plan confirmed.node scripts/check-changed.mjs -- ...— all checks through core typecheck passed; core-test typecheck was blocked by the existing shared-install errorui/vite.config.ts:9:22 TS7016 Could not find a declaration file for module 'pako'.LOC: production +0/-2; tests and test support +16/-116; net -102.