Repository navigation
Conversation
randrini
force-pushed
the
fix/rotation-respects-selection
branch
2 times, most recently
from
November 14, 2026 15:54
db2a2e2 to
9087333
Compare
randrini
force-pushed
the
fix/rotation-respects-selection
branch
from
November 14, 2026 16:18
9087333 to
2dfa271
Compare
This was referenced Nov 14, 2026
Collaborator
Author
|
Superseded by #459, which contains this change plus the rest of the playback reliability bundle. Closing to keep the review surface to one PR. |
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.
Problem
A deployed build played a different file from the one requested in 8 of 12 measured starts. The same request flipped between versions minutes apart: one pair resolved to the requested row at 14:02 and to a different row at 14:07 and 14:08, and another resolved to a different row twice at 14:12. Each session reported one start, so this is not a client retry loop.
The worst case requested a row with two audio tracks and four PGS tracks and played a row with one E-AC3 track and one SRT track. The action bar had advertised the selected row's tracks.
The acceptance change in #447 (
Usable()ininternal/scanner/virtual_probe_guard.go:117) lets a candidate whose served size contradicts its declaration reach the plan. The start path then rebinds to the catalog row that owns the concrete candidate URI (resolveVirtualPlaybackSource,playback_virtual.go:3413), so the plan's effective file becomes that row. Probe evidence takes the same path throughvirtualProbeEvidenceRotateTarget(playback_virtual.go:6106) and logsreason=sibling_owner_rotation(playback_virtual.go:6157).rotateVirtualSourceToOwnerRow(playback_virtual.go:7185) keeps the probed tracks, so a foreign release with fewer tracks replaces the selected row's inventory.Approach
A rotation may adopt the identity of the row that owns the bytes. It may not change which version the viewer selected, and it may not drop an audio or subtitle track.
virtualSiblingOwnerSharesRelease), the plan keeps the requested row and its inventory instead of rebinding to the duplicate.SubstitutedFromFileIDplusversion_not_playable) instead of silently naming a different file.Usable()is unchanged: a size-gapped probe still inventories and plays its own row. Only the row-switching decision is constrained.Validation
go build ./...passes aftermake embed-stub.go vet ./internal/api/handlers ./internal/scanner ./internal/playbackpasses.go test -count=1 ./internal/api/handlers ./internal/scannerpasses../internal/playbackhas two failures on this base (TestOnDemandSubtitleSegmentsDoNotWaitForTheStream,TestServeExtractDiscardsACappedDemuxCopy); both reproduce at303f3ecccwithout this change.go test -race -count=1on the three new tests passes.make verify-playback-fixturesreports the fixtures are current.make lint-changed BASE_REF=kipsilabs/mainreports 0 issues.Fail-before at
303f3eccc: the selected row played as the foreign owner row, the substitution reportedsubstituted_from_file_id=0, and the evidence write landed on the poorer owner row. Pass-after: the effective row is the selected row, a genuine substitute reports the requested row as its source, and the poorer owner receives no write.Base note:
kipsilabs/mainis303f3eccc, and #447 is still an open draft (head59da4565e). The branch is based onmainas requested. The same commit was applied to a throwaway merge with #447 and the new tests pass there. The start-loop conflict is #447's duration exemption, and the rotation guard rejects a contradictory runtime independently of it.Related issue: N/A
Validation tasks: none
Risks
None identified. The change only refuses a rotation the selected row did not ask for. Ordinary auto selection on a provider-neutral placeholder has no tracks to lose and keeps its existing behavior.
AI Disclosure
deepseek-v4.1-flash:1017, ollama-cloud)Posted by an AI agent (Muse Spark, OpenCode harness).