Repository navigation
Description
Context
The server is gaining an "optimistic remux race" for H.264 copy-safety (silo-server branches feat/persist-pps-copy-safety + feat/optimistic-remux-copy-safety, PRs to follow). When a file's multi-PPS verdict is unknown at plan time, the server no longer blocks playback start on the 1–5 s bitstream scan: it issues the remux plan optimistically, scans in the background, and if the file turns out copy-unsafe it withdraws the plan mid-session.
Nothing breaks if you do nothing. A client that has not implemented this feature has its session stopped by the server; the app's existing recovery mints a fresh attempt, which is planned against the now-persisted verdict and lands on a transcode. Implementing the feature upgrades that stop into a smooth in-place switch (same UX as a quality change).
What to implement
Full contract: docs/architecture/playback-protocol-v3.md §6.1 ("plan_invalidated_v1 — the server withdraws a plan") on the server branch. Web reference implementation: web/src/player/realtime-protocol.ts, web/src/player/hooks/usePlaybackSession.ts (invalidatePlan), web/src/player/components/VideoPlayer.tsx.
- Advertise the feature. Add
"plan_invalidated_v1"toclient_featureson v3 start and replan requests — but only for video playback surfaces that can actually execute the command (the web client deliberately does not advertise it from the audiobook player). - Declare the command. Include
plan_invalidatedin the supported-commands set sent in the realtime hello on the session control socket (GET /playback/sessions/{session_id}/control/ws). - Handle the command. Envelope:
name: "plan_invalidated",deadline_ms: 8000,payload: {"reason": "video_copy_unsafe", "plan_id": "<withdrawn plan>"}.- Ack
acceptedimmediately. - If
payload.plan_idis not the plan currently on screen, complete as a no-op — you already moved past the withdrawn plan; do not evict a route the server never complained about. - Otherwise run your ordinary recovery replan:
operation: "failure_recovery"with the withdrawn plan'splan_attempt_keyinattempted_plan_keys. Rebuild the player from the new plan and restore position (the replacement plan's timeline carriessource_start_seconds). - Send
result: completedonce the replacement plan is adopted,rejectedif it cannot be.
- Ack
- Mind the deadline. The server stops the session unless a
completedresult arrives withindeadline_ms— an ack alone does not stop the clock. Arejectedresult also stops the session (deliberately: the route genuinely desyncs decoders).
Notes
- The command only ever fires for H.264 sources on a video stream-copy route whose verdict resolved unsafe after the plan was issued — first-ever play of a file, in practice. Inconclusive scans push nothing.
- This is the first server-initiated control push in protocol v3; everything else remains client-pulled.
Related server issue: Silo-Server/silo-server#135. Filed on Quick's behalf via Claude Code.
Activity
Quick104 commentedon Aug 23, 2026
Server implementation is now up: Silo-Server/silo-server#734 (stacked on Silo-Server/silo-server#733). The protocol contract lives in
docs/architecture/playback-protocol-v3.md§6.1 on that branch.