Skip to content

fix(playback): lock Android direct-play contract - #876

Merged
Quick104 merged 2 commits into
Silo-Server:mainfrom
blurbery:test/android-direct-play-contract-upstream
Sep 2, 2026
Merged

Quick104 merged 2 commits into
Silo-Server:mainfrom
blurbery:test/android-direct-play-contract-upstream

Conversation

@blurbery

@blurbery blurbery commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Important

Coupled upstream change: this server PR must be merged together with Silo-Server/silo-android #268. Do not merge either PR independently; they form one coordinated Android playback contract change.

Problem

Related issue: N/A — narrow fix

The Android client now advertises a delivery-scoped source-audio selection claim and runtime-probed Media3/FFmpeg decoders. The existing server planner already supports this contract, but it lacked a client-shaped regression suite proving that Android receives original MKV delivery when eligible and a safe packaged fallback when execution fails or output constraints apply.

Dependency and direction

This is the user-directed upstream server companion to Silo-Server/silo-android #268. Both upstream PRs are ready for review and cross-linked. This branch is based on Silo-Server/silo-server:main at 604bafe1 and contains only the portable playback-contract tests; nothing here has been deployed or merged into either server main branch.

Approach

Add planner contract tests using the Android phone/TV protocol-v3 payload shape:

  • progressive delivery disabled and native HLS available;
  • hardware H.264 video decode;
  • runtime-probed AC-3, E-AC-3, TrueHD, DTS/DTS-HD, and ALAC audio decode;
  • client_selected_audio_track_v1 scoped to original HTTP;
  • non-default audio selection retained across original and fallback plans;
  • rejected original plan keys skipped on typed recovery;
  • missing decoders and channel ceilings converted to HLS/AAC without video transcoding.

This PR changes tests only. It does not change planner behavior, deployment configuration, containers, or data.

Validation

Passed locally:

git diff --check upstream/main...HEAD
(no output; passed)

GOCACHE=<temporary task cache> go test ./internal/playback -run 'TestPlanPlaybackV3AndroidMedia3' -count=1
ok github.com/Silo-Server/silo-server/internal/playback

GOCACHE=<temporary task cache> go test ./internal/playback -run 'TestPlanPlaybackV3(NonDefaultAudioSelectionRequiresScopedOriginalClaim|HLSAudioConversionHonorsChannelCeiling|AppliesDeliverySpecificCodecAndChannelLimits|AndroidMedia3)' -count=1
ok github.com/Silo-Server/silo-server/internal/playback

Upstream GitHub Actions run 33518486226 passed Docs hygiene, Web, and Go on the published head.

Risks

None identified. Test-only change; runtime behavior is unchanged.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.

AI Disclosure

  • Harness: OpenAI Codex desktop
  • Tool(s): Codex local command execution and GitHub CLI
  • Model(s): gpt-5.6-sol (reasoning effort: ultra)
  • Involvement: AI-assisted
  • Direction: User-directed. The repository owner explicitly requested the scope, upstream target, cross-PR linkage, sequencing, and publication.
  • Adversarial review: Cross-checked the Android wire builder against original, attempted-route, HLS, codec, and channel eligibility; negative cases were added and all focused tests passed.

@coderabbitai

coderabbitai Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: a0509193-6571-4c84-912d-4907cbc26830

📥 Commits

Reviewing files that changed from the base of the PR and between 604bafe and 73bbf93.

📒 Files selected for processing (1)
  • internal/playback/protocol_v3_test.go

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

Adds Android Media3/FFmpeg playback planning tests and helpers. The tests cover direct MKV playback, selected audio tracks, failed original-route fallback, channel limits, and missing source decoders.

Changes

Android Media3 playback planning

Layer / File(s) Summary
Android Media3/FFmpeg fixture setup
internal/playback/protocol_v3_test.go
Adds helpers that build h264 MKV fixtures, configure Android Media3/FFmpeg requests, and select audio tracks.
Playback plan assertions
internal/playback/protocol_v3_test.go
Tests direct-play original MKV for supported codecs, preserve non-default audio selections during HLS fallback, and use AAC remuxing when audio constraints require it.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 73bbf

This PR adds localized Android playback contract coverage without changing production behavior, so no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: quick104, neurekadev, rhainland

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding playback tests that lock the Android direct-play contract.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@blurbery
blurbery marked this pull request as ready for review September 1, 2026 14:19
@blurbery blurbery changed the title test(playback): lock Android direct-play contract fix(playback): lock Android direct-play contract Sep 1, 2026
@Quick104
Quick104 merged commit 90b5c0f into Silo-Server:main Sep 2, 2026
4 checks passed
@blurbery
blurbery deleted the test/android-direct-play-contract-upstream branch November 6, 2026 00:01
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