You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(playback): carry a marker's provenance in the realtime marker update - #5611
Reopens the work of #4135, which the Evidence deadline closed before its evidence was on the check's head.
Rebased onto main on 2026-11-29: the six commits are replayed on the current base so the pull request is mergeable. #4465 pruned web/src/player/utils/watchPageMarkers.test.ts and web/src/player/hooks/useMarkerEditor.test.tsx in favour of PR verification, so this change's new cases now live in focused files at those paths rather than restoring the pruned suites. The realtime event's ranges are selected with models.SingularMarkerSegment, the same selector the watch and markers reads use, so the end credits stay the end credits.
Closes#4134
Related issue: N/A
Validation tasks: none
Other clients: Apple N/A (the app shows no marker source line); Android N/A (the app shows no marker source line); Roku N/A (no marker source setting)
Problem
With Show marker source (or Show marker confidence) on, the skip prompt draws nothing above "Skip Intro" for a range the player learns about over its realtime markers_updated event, and a range whose range that event changes loses the line the watch payload had already supplied.
Two markers are affected, and both are the ones a household cannot otherwise place:
an on-demand provider's answer, which is never saved, so the event is its only announcement; and
a marker local detection writes while the episode plays, which lands after the client has read the watch payload.
#3084 added the provenance to the watch payload and the two settings, and left the event out on purpose — its own review recorded the consequence (Kody: "Badges can be missing after a realtime marker update") and its Risks section said so.
Approach
Server. The event's ranges carry the provenance. playback.TimeRangePayload gains source, provider, confidence and algorithm with omitempty, mirroring the watch payload's marker; confidence stays a pointer because an unrated range is stored as 0, and sending that as a number would render a measurement nobody made. markerUpdateNotifier builds each kind's range once, from the same effective segment list the event already carries, reading the row's per-kind columns (markerUpdateRanges, markerProvenanceOf). The four ranges ride the cross-replica snapshot too, so a replica that republishes an update sends what the originating node sent instead of re-deriving a bare range.
Web.PlaybackTimeRangePayload extends the existing PlayerMarkerProvenance, and the parser accepts the fields (a mistyped one rejects the event, as the rest of that parser does). patchVersionMarkers merges per kind: an update that names a provenance is the whole answer for that range — a confidence it leaves out means unrated, not "keep the old rating" — while an update that names none keeps what the version already holds for a range it restates, and lends nothing to a range that moved, since a moved range was produced by someone the update does not name. The "nothing changed" check now compares provenance as well, or a provenance-only update would be dropped as a no-op. Finally, a save from the player's Edit markers panel reports the response's provenance rather than the draft's silence, so an edited range reads "Edited" instead of losing its line until the next watch read.
Validation
Go: go build ./..., gofmt -l . (nothing), go test ./internal/playback/ all pass. New TestMarkerUpdateNotifierCarriesMarkerProvenance drives the notifier and reads the event payload for a rated provider range, an unrated scanner one and a rated zero; TestMarkerUpdateNotifierDerivesRangesFromAnOlderReplicaSnapshot publishes the payload an older replica would and asserts the delivered ranges still come through; TestMarkerUpdateNotifierDeliversAcrossReplicasOnce now asserts the two replicas receive the range's provenance and that the bus snapshot carries the four ranges.
Web: tsc -p tsconfig.app.json, eslint and prettier are clean, and vitest passes for the touched test files. New cases: a restated range keeps its source while another kind in the same update moves; an update that names a provenance replaces the one it replaces; a moved range borrows nothing from its predecessor; a range only an update has ever named reports its source; the parser accepts the fields and rejects a mistyped confidence; a save reports the row's provenance; a save does not lend the stored range's provenance to a range the player shows instead.
Ratchet: go run ./scripts/ci/sizeratchet passes; realtime-protocol.ts goes 776 → 796 lines against the 800 limit.
Maintainer review (on the branch after merging main): a save could pair an untouched kind's on-screen range, such as an on-demand provider's credits, with the stored row's provenance for a different range. markerDraftFromV2 now takes a kind's provenance only when the response reports the draft's own bounds. Its new useMarkerEditor test fails on e2baaf04 and passes after the fix. docs/realtime-api.md gains a markers_updated section.
Tests that fail on main: four of the new web cases (the parser, a restated range keeping its source, an update replacing a source, a save reporting its source). The Go tests read the new fields and don't compile on main.
CI on 7fdef4cfe (the rebased head): every job passes — Go test, Go lint, Go vet and contracts, Go integration, Go DB pins, Go DB external auth, Web, Web test (1/2 and 2/2), and the repository checks, plus the Evidence check. No live session was driven against a server.
Before/after captures, paired on the evidence page.
Both captures render the real IntroSkipButton from the real marker helpers on a synthetic episode whose intro is 12–75 s from TheIntroDB, with both settings on, after the same marker update (the update restates the intro and moves the credits). The "before" panel drives the copy of watchPageMarkers.ts that main ships, the "after" panel this branch's. A third panel in the same harness — not shown here — covers a range the update introduces, which draws the line too. The page is a throwaway harness and is not in the diff.
No user-visible text is added, so there is no catalog change to show.
Risks
Additive and optional. The realtime event is not part of the published v2 OpenAPI artifact, so no contract approval moves; an older client ignores the extra fields.
The event grows by four ranges' worth of provenance (a few hundred bytes), including on the replica bus.
A server that still cannot name a range's provenance sends none, and the client then keeps only what it already held for an unchanged range rather than inventing an attribution.
A provenance field whose type the client cannot use rejects that whole marker update rather than just the field, as every other guard in that parser does to the payload it does not match. A normalizing parse would keep the update and drop the field; if that is wanted, it belongs in the same change as the other guards, not here.
Markers whose source changed without their range moving now show the update's newer answer instead of the older one, which is the point but is a visible difference on the first update after upgrading.
Checklist
I read and can explain the complete diff.
This pull request addresses one concern.
Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
The Evidence section shows every change a user can see, or says there is none.
AI Disclosure
Harness: Hermes Agent
Tool(s): Hermes Agent
Model(s): deepseek/deepseek-v4.1-flash (served by Nous Research)
Involvement: Fully AI-generated, human verified
Adversarial review: the whole diff was read end to end by a separate agent with no hand in writing it (fresh context, no access to this thread), which re-ran the package's Go tests and go vet, the web typecheck, eslint and prettier, and the touched web test files, and checked the tests against CONTRIBUTING's "Decide what to test".
Response to review
Findings from that review, and where they stand:
The throwaway evidence harness was left untracked in the working tree (blocker). Real, and removed before the branch was pushed: git status carries only tracked changes, and lint, prettier and tsc see nothing of it.
A snapshot from an older replica during a rolling deploy (medium). Real: the receiver no longer derives the ranges, so a payload with segments alone would announce four nulls — clearing the client's singular marker and its source line while the occurrences stayed. Fixed in dispatch, which derives the ranges from the snapshot's segments when all four are absent, with TestMarkerUpdateNotifierDerivesRangesFromAnOlderReplicaSnapshot publishing exactly what the older build publishes. Without the fix that test reports payload.Credits = nil.
A mistyped provenance field rejects the whole update (medium). Kept, deliberately. Every guard in that parser rejects the message its payload does not match — isMarkerSegment rejects the event for one bad segment the same way — so a field-level concession would be a different parse rather than a different line, and it is now called out in Risks instead of implied away by a comment.
Nothing pinned the rated-zero confidence (low). Added as a third row: a 0 rating reaches the client as 0, not as an absent field.
The bus snapshot's field count is incidental (low). Kept: it is the assertion main already made (len != 3), and this change only had to move the number.
The save path pairs the draft's ranges with the response's provenance (low). The pair agrees — a write validates rather than normalizes a range — and the callback now reports only the kinds the save wrote, so an untouched kind's stale draft cannot clear a range a marker update supplied while the panel was open. See the CodeRabbit round below.
The test's stubbed response did not match the wire (low). Fixed: an unset kind is {} and an absent provider is omitted, as the Go structs send them.
Nothing under docs/architecture describes the event (low). Added: intro-detection.md now says what a marker update carries, why its ranges carry provenance, and that the bus snapshot is the authority for them.
CodeRabbit review
The credits range was selected by first occurrence (major, marker_update_notifier.go). Right, and fixed on the rebased head: markerUpdateRanges now selects each kind's range with models.SingularMarkerSegment, the selector the watch and markers reads already use, so credits name the end credits rather than the first ones. TestMarkerUpdateNotifierDeliversAcrossReplicasOnce pins [150,180].
An unrated marker's confidence could be emitted as 0 (minor). Not reproducible. media_files.<kind>_markers_confidence is a nullable double precision with no default; the write path carries a *float64 and SummaryConfidence leaves it nil when no segment is rated; the catalog (internal/catalog/detail.go) and the v2 response set the field only when the pointer is non-nil. So unrated is absent, not 0, and a stored 0 is a genuine rating the client should keep. The "rated zero" case asserts exactly that.
A stored zero confidence could reach the skip prompt (minor). Same premise, same verdict: an unrated range comes back absent, so provenanceOf's != null guard is correct and a real 0 survives. Dropping the 0 would hide a measured rating at 0%. (The helper's own comment claiming "an unrated marker's confidence is 0 in the row" predates this change and reads against the schema; left alone as out of scope.)
The save reported kinds it did not write (minor). Right, and fixed: onSaved now carries only the kinds in the request body, so the host's patch leaves an untouched kind alone instead of clearing it. useMarkerEditor.test.tsx pins the omission, and a direct markerDraftFromV2 case keeps the mismatched-bounds guard covered.
Note
Carry marker provenance in realtime markers_updated events
Marker updates now include each kind's first effective occurrence with its recorded source, provider, algorithm, and confidence. Built in markerUpdateRanges/markerProvenanceOf in marker_update_notifier.go and serialized through markerUpdateSnapshot and the extended TimeRangePayload.
Client handling is provenance-aware: parsing in realtime-protocol.ts validates the new optional fields, and watchPageMarkers.ts preserves provenance only for unchanged ranges or updates that supply it. The marker editor's save callback also attaches server-reported provenance to matching ranges via markerDraftFromV2.
Snapshots from older replicas with segments but no ranges derive ranges at dispatch; fallback ranges carry no provenance.
Behavioral Change: markersEqual now treats differing provenance alone as a marker change, and patchVersionMarkers drops provenance when bounds move without new provenance; confidence 0 stays distinct from absent via nullable pointer.
No actionable comments were generated in the recent review.
Walkthrough
Realtime marker-update ranges now carry provenance from the file record. The web player validates and applies that provenance. Marker editor saves use response provenance when its bounds match the draft. Documentation and tests cover delivery, replica compatibility, and client updates.
Changes: Marker provenance
Layer / File(s)
Summary
Realtime marker payload and delivery internal/playback/realtime.go, internal/playback/marker_update_notifier.go, internal/playback/marker_update_notifier_test.go, docs/architecture/intro-detection.md, docs/realtime-api.md
Realtime marker ranges include source, provider, confidence, and algorithm. The notifier includes ranges in snapshots and derives ranges without provenance when older snapshots omit them. Tests and documentation cover payload content and replica delivery.
The client validates optional provenance fields and uses provenance-bearing marker ranges. Updates preserve existing provenance when bounds are unchanged, replace it when an update supplies provenance, and omit it when bounds change without provenance. Version comparisons include provenance.
Marker editor save response web/src/player/player-v2.ts, web/src/player/marker-wire.ts, web/src/player/hooks/useMarkerEditor.ts, web/src/player/hooks/useMarkerEditor.test.tsx
The editor captures the typed save response and adds provenance to a draft range only when the saved range has matching bounds. Tests cover returned provenance and a response range that does not match the displayed range.
sequenceDiagram
participant MarkerUpdateNotifier
participant ReplicaBus
participant RealtimeSession
participant Player
MarkerUpdateNotifier->>ReplicaBus: publish snapshot with marker ranges and provenance
ReplicaBus->>RealtimeSession: forward snapshot
RealtimeSession->>Player: deliver markers_updated payload
Player->>Player: validate and apply marker provenance
Loading
Possibly related PRs
Silo-Server/silo-server#3084: Adds the provenance fields and display behavior that this change carries through realtime marker updates.
Suggested reviewers:quick104, rhainland
Merge Risk: Minimal · up to 7fdef
Realtime marker updates now carry source and confidence into the skip prompt. Unrated markers stay without a confidence value, and editor saves report only the marker kinds they wrote. No actionable merge-blocking risk remains.
Security architecture risk: Minimal · up to 7fdef
Marker updates now carry attribution to the same playback sessions. Saving a marker still writes only the edited ranges. Older versions can omit attribution without losing the marker ranges.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
observed — The newly transmitted data is marker attribution metadata, including metadata for on-demand ranges that are not persisted. The notifier still sends to connected sessions selected by the affected file ID, and the web consumer rejects updates for a different file.
Trust Boundaries and Controls
observed — The server retains the marker-edit permission gate and catalog access filter. The editor sends bounds and clears, not provenance; the returned provenance is used in the local player callback, not in another write.
Hardening Proposals
proposed — Make provider-name lookup use a Map or an own-property check, so unknown identifiers reliably fall back to text without resolving inherited properties. The realtime path now reaches this existing display helper; whether admitted provider identifiers can trigger the edge case was not established.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: marker provenance is carried in the realtime marker update event for the playback feature. It is a conventional fix() commit that matches the server and client changes…
Description check
The description is detailed and directly related to the changeset. It covers the server-side TimeRangePayload provenance fields, the notifier and replica snapshot changes, the web parser and merge log…
Linked Issues check
Directly linked issue #4134 has one active coding objective. With Show marker source or Show marker confidence on, the Web skip prompt must show the source line for a marker that arrives over `markers…
Out of Scope Changes check
Each changed area connects to the #4134 objective of carrying marker provenance through markers_updated: - Server: realtime.go (range provenance fields), marker_update_notifier.go (range and pro…
Full details: Title check
Explanation
The title names the main change: marker provenance is carried in the realtime marker update event for the playback feature. It is a conventional fix() commit that matches the server and client changes in the changeset.
Full details: Description check
Explanation
The description is detailed and directly related to the changeset. It covers the server-side TimeRangePayload provenance fields, the notifier and replica snapshot changes, the web parser and merge logic, the save-path provenance, and the docs update. It also explains the validation and risks.
Full details: Linked Issues check
Explanation
Directly linked issue #4134 has one active coding objective. With Show marker source or Show marker confidence on, the Web skip prompt must show the source line for a marker that arrives over markers_updated, or whose range that event changes, when the file row records provenance. Unchanged markers already in the watch payload must keep their line.
Server side (whole-PR summary, merge base 5d0006f to head 7fdef4c):
internal/playback/realtime.go: TimeRangePayload gains optional source, provider, confidence (pointer, so an unrated range is absent and a rated zero is 0) and algorithm.
internal/playback/marker_update_notifier.go: markerUpdateRanges builds each kind's range with provenance from the per-kind row columns (markerProvenanceOf), using models.SingularMarkerSegment. The four ranges ride the bus snapshot. dispatch derives ranges from segments only when all four snapshot ranges are nil, covering older replicas.
Go tests cover a rated provider range, an unrated range, a rated zero, the older-replica fallback and cross-replica delivery.
Client side (whole-PR summary):
realtime-protocol.ts: PlaybackTimeRangePayload extends PlayerMarkerProvenance; the parser accepts the fields and rejects mistyped ones.
watchPageMarkers.ts: rangeAfterUpdate applies supplied provenance, keeps provenance for a restated range that names none, and carries nothing for a moved range. markersEqual compares provenance, so a provenance-only update is not dropped.
marker-wire.ts / useMarkerEditor.ts: a save reports response provenance only when the response bounds match the draft bounds, and only for kinds the save wrote.
Both cases in the issue (a marker absent from the watch payload, and a changed range) now carry provenance in the event.
Limits: I used the whole-PR summaries and the previous assessment. I did not re-read the incremental diff from the previous reviewed head, and I did not run the tests. The PR reports passing Go, web and CI checks on 7fdef4c.
Full details: Out of Scope Changes check
Explanation
Each changed area connects to the #4134 objective of carrying marker provenance through markers_updated:
Server: realtime.go (range provenance fields), marker_update_notifier.go (range and provenance construction, snapshot, older-replica fallback) and its tests.
Web: realtime-protocol.ts and its tests, watchPageMarkers.ts and its tests, types.ts (MarkerDraft ranges typed with provenance), player-v2.ts (PlayerV2Response type), and useMarkerEditor.ts, its test and marker-wire.ts. These carry provenance on the client and on the save path that the issue's scope covers.
Documentation: docs/realtime-api.md and docs/architecture/intro-detection.md describe the new event fields and fallback. These document the same change.
The PR description states that the throwaway evidence harness is not in the diff. The summaries show no unrelated feature or refactor.
Limits: as above, this rests on the whole-PR summaries, not a line-by-line read of the rebased head.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 2766538b-c5ac-491c-ac0d-cfe27f3ee30b
Commits
Reviewing files that changed from the base of the PR and between 35ade8f and 7fdef4c.
Files selected for processing: 2
web/src/player/hooks/useMarkerEditor.test.tsx
web/src/player/hooks/useMarkerEditor.ts
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Matching bounds can misattribute an untouched on-demand marker
Saving another marker kind can overwrite an untouched on-demand marker's provenance when its bounds match the stored marker but its provider differs. Apply provenanceOf(segment) only to kinds included in the save, and preserve existing provenance for untouched kinds.
Prompt for LLM
File web/src/player/marker-wire.ts, lines 55-58:
Matching bounds can misattribute an untouched on-demand marker
An untouched on-demand marker can have the same bounds as the stored marker but a different provider, so saving another kind replaces its actual provenance with the stored marker's source and confidence. Apply response provenance only to kinds included in the save, and preserve the player's existing provenance for untouched kinds.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 7cabe2ee-2464-4e4b-af2f-c4b54748d040
Commits
Reviewing files that changed from the base of the PR and between 5d0006f and f22c14d.
Files selected for processing: 14
docs/architecture/intro-detection.md
docs/realtime-api.md
internal/playback/marker_update_notifier.go
internal/playback/marker_update_notifier_test.go
internal/playback/realtime.go
web/src/player/hooks/useMarkerEditor.test.tsx
web/src/player/hooks/useMarkerEditor.ts
web/src/player/marker-wire.ts
web/src/player/player-v2.ts
web/src/player/realtime-protocol.test.ts
web/src/player/realtime-protocol.ts
web/src/player/types.ts
web/src/player/utils/watchPageMarkers.test.ts
web/src/player/utils/watchPageMarkers.ts
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Realtime updates select the wrong credits occurrence
For files with multiple credits occurrences, the skip prompt can target mid-credits after an update instead of the final credits. Use models.SingularMarkerSegment to select each kind's range before attaching provenance, consistent with watch reads.
Prompt for LLM
File internal/playback/marker_update_notifier.go, lines 132-135:
Realtime updates select the wrong credits occurrence
For files with multiple credits occurrences, realtime updates now select the earliest credits range, while watch reads select the last occurrence as the end credits. This changes the skip prompt after an update and can make it target mid-credits instead of the final credits; use `models.SingularMarkerSegment` to select each kind's range before attaching provenance.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 4c93b72f-7e38-4793-b995-715a17c878fa
Commits
Reviewing files that changed from the base of the PR and between f22c14d and eea4dcf.
Files selected for processing: 9
docs/architecture/intro-detection.md
docs/realtime-api.md
internal/playback/marker_update_notifier.go
internal/playback/marker_update_notifier_test.go
internal/playback/realtime.go
web/src/player/hooks/useMarkerEditor.test.tsx
web/src/player/hooks/useMarkerEditor.ts
web/src/player/types.ts
web/src/player/utils/watchPageMarkers.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
The skip prompt's source line reads the provenance recorded beside a range,
and the watch payload supplies it. The realtime marker update did not: its
four ranges were a start and an end, so a range the player learnt about over
the event — an on-demand provider's answer, which is never saved, or a marker
local analysis wrote mid-playback — drew no line, and a range the event moved
lost the one the watch payload had given.
The event's ranges now carry the source, provider, confidence and algorithm,
built once from the same segments the event already sends, and the cross-replica
snapshot carries them too so a replica republishes what the originating node
sent. Confidence stays a pointer: an unrated range is stored as 0, and sending
that as a number would render a measurement nobody made.
The web client accepts the fields, and merges per kind: an update that names a
provenance is the whole answer for its range, while one that names none keeps
what the version already holds for a range it restates and lends nothing to a
range that moved. The unchanged-version check compares provenance too, or a
provenance-only update would be dropped. A save from the player's marker editor
reports the response's provenance rather than the draft's silence, so an
edited range reads "Edited" instead of losing its line.
The snapshot a replica publishes on the bus now carries the four ranges, so a
receiver no longer derives them. During a rolling deploy an older replica still
publishes the segments alone, and a receiver on this build would read that as a
file with no ranges and announce four nulls for a file that has markers: the
client would clear the singular marker while its occurrences stayed, blanking
the skip prompt's source line for a viewer who asked for it and emptying the
marker editor's fields.
A snapshot whose ranges are all absent is one of those, so the ranges are
derived from its segments before delivery. A file with no markers derives
nothing, which is the same answer the older build gave.
The realtime event is not part of the v2 OpenAPI artifact, so the only
description of its shape was the Go structs. Say what it carries, why the four
ranges carry provenance, and that the bus snapshot rather than the receiving
replica is the authority for them.
A marker save's response reports the stored row. For a kind the viewer
did not touch, the player can be showing a different range: an on-demand
provider's marker, which is never saved, or one a marker update moved
while the editor was open. markerDraftFromV2 paired that range with the
stored range's provenance, so the skip prompt could label a provider's
range "Detected". It now takes a kind's provenance only when the response
reports the draft's own bounds, and otherwise returns the range bare so
the player keeps the attribution it already holds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The save callback handed the host every kind's draft range paired with the
response's provenance. The host's patch reads an absent kind as unchanged
and an explicit null as a clearance, so a kind this save never touched could
hand it the draft's stale null — for a range, such as an on-demand provider's
credits, that a marker update supplied while the panel was open — and clear it
until the next watch read. Report only the kinds the save wrote; a kind the
viewer cleared is still written and still reported as null.
Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.
Reviewing changes in Silo
Include the related issue, expected behavior, and validation steps in the PR description.
For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
Follow this repository's AGENTS.md and CONTRIBUTING.md.
Request another review with @kody start-review in a PR comment.
React with 👍 or 👎 to give feedback on individual suggestions.
Review settingsReview Options
The following review options are enabled or disabled:
Options
Enabled
Bug
✅
Performance
✅
Security
✅
Business Logic
❌
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
bugSomething isn't workinggoPull requests that update go codeimpact: polishAnnoyance, cosmetic, or nice-to-havejavascriptPull requests that update javascript codepriority: P2Limited scope, workaround exists, or polishsize/XL500–999 added + deleted lines (all files); change volume, not priority.
2 participants
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.
Reopens the work of #4135, which the Evidence deadline closed before its evidence was on the check's head.
Rebased onto
mainon 2026-11-29: the six commits are replayed on the current base so the pull request is mergeable.#4465prunedweb/src/player/utils/watchPageMarkers.test.tsandweb/src/player/hooks/useMarkerEditor.test.tsxin favour of PR verification, so this change's new cases now live in focused files at those paths rather than restoring the pruned suites. The realtime event's ranges are selected withmodels.SingularMarkerSegment, the same selector the watch and markers reads use, so the end credits stay the end credits.Closes #4134
Related issue: N/A
Validation tasks: none
Other clients: Apple N/A (the app shows no marker source line); Android N/A (the app shows no marker source line); Roku N/A (no marker source setting)
Problem
With Show marker source (or Show marker confidence) on, the skip prompt draws nothing above "Skip Intro" for a range the player learns about over its realtime
markers_updatedevent, and a range whose range that event changes loses the line the watch payload had already supplied.Two markers are affected, and both are the ones a household cannot otherwise place:
#3084 added the provenance to the watch payload and the two settings, and left the event out on purpose — its own review recorded the consequence (Kody: "Badges can be missing after a realtime marker update") and its Risks section said so.
Approach
Server. The event's ranges carry the provenance.
playback.TimeRangePayloadgainssource,provider,confidenceandalgorithmwithomitempty, mirroring the watch payload's marker;confidencestays a pointer because an unrated range is stored as0, and sending that as a number would render a measurement nobody made.markerUpdateNotifierbuilds each kind's range once, from the same effective segment list the event already carries, reading the row's per-kind columns (markerUpdateRanges,markerProvenanceOf). The four ranges ride the cross-replica snapshot too, so a replica that republishes an update sends what the originating node sent instead of re-deriving a bare range.Web.
PlaybackTimeRangePayloadextends the existingPlayerMarkerProvenance, and the parser accepts the fields (a mistyped one rejects the event, as the rest of that parser does).patchVersionMarkersmerges per kind: an update that names a provenance is the whole answer for that range — a confidence it leaves out means unrated, not "keep the old rating" — while an update that names none keeps what the version already holds for a range it restates, and lends nothing to a range that moved, since a moved range was produced by someone the update does not name. The "nothing changed" check now compares provenance as well, or a provenance-only update would be dropped as a no-op. Finally, a save from the player's Edit markers panel reports the response's provenance rather than the draft's silence, so an edited range reads "Edited" instead of losing its line until the next watch read.Validation
go build ./...,gofmt -l .(nothing),go test ./internal/playback/all pass. NewTestMarkerUpdateNotifierCarriesMarkerProvenancedrives the notifier and reads the event payload for a rated provider range, an unrated scanner one and a rated zero;TestMarkerUpdateNotifierDerivesRangesFromAnOlderReplicaSnapshotpublishes the payload an older replica would and asserts the delivered ranges still come through;TestMarkerUpdateNotifierDeliversAcrossReplicasOncenow asserts the two replicas receive the range's provenance and that the bus snapshot carries the four ranges.tsc -p tsconfig.app.json, eslint and prettier are clean, and vitest passes for the touched test files. New cases: a restated range keeps its source while another kind in the same update moves; an update that names a provenance replaces the one it replaces; a moved range borrows nothing from its predecessor; a range only an update has ever named reports its source; the parser accepts the fields and rejects a mistyped confidence; a save reports the row's provenance; a save does not lend the stored range's provenance to a range the player shows instead.go run ./scripts/ci/sizeratchetpasses;realtime-protocol.tsgoes 776 → 796 lines against the 800 limit.main): a save could pair an untouched kind's on-screen range, such as an on-demand provider's credits, with the stored row's provenance for a different range.markerDraftFromV2now takes a kind's provenance only when the response reports the draft's own bounds. Its newuseMarkerEditortest fails one2baaf04and passes after the fix.docs/realtime-api.mdgains amarkers_updatedsection.main: four of the new web cases (the parser, a restated range keeping its source, an update replacing a source, a save reporting its source). The Go tests read the new fields and don't compile onmain.7fdef4cfe(the rebased head): every job passes — Go test, Go lint, Go vet and contracts, Go integration, Go DB pins, Go DB external auth, Web, Web test (1/2 and 2/2), and the repository checks, plus the Evidence check. No live session was driven against a server.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-5611/
Before/after captures, paired on the evidence page.
Both captures render the real
IntroSkipButtonfrom the real marker helpers on a synthetic episode whose intro is 12–75 s from TheIntroDB, with both settings on, after the same marker update (the update restates the intro and moves the credits). The "before" panel drives the copy ofwatchPageMarkers.tsthatmainships, the "after" panel this branch's. A third panel in the same harness — not shown here — covers a range the update introduces, which draws the line too. The page is a throwaway harness and is not in the diff.No user-visible text is added, so there is no catalog change to show.
Risks
Checklist
AI Disclosure
go vet, the web typecheck, eslint and prettier, and the touched web test files, and checked the tests against CONTRIBUTING's "Decide what to test".Response to review
Findings from that review, and where they stand:
git statuscarries only tracked changes, and lint, prettier and tsc see nothing of it.dispatch, which derives the ranges from the snapshot's segments when all four are absent, withTestMarkerUpdateNotifierDerivesRangesFromAnOlderReplicaSnapshotpublishing exactly what the older build publishes. Without the fix that test reportspayload.Credits = nil.isMarkerSegmentrejects the event for one bad segment the same way — so a field-level concession would be a different parse rather than a different line, and it is now called out in Risks instead of implied away by a comment.0rating reaches the client as0, not as an absent field.mainalready made (len != 3), and this change only had to move the number.{}and an absent provider is omitted, as the Go structs send them.docs/architecturedescribes the event (low). Added:intro-detection.mdnow says what a marker update carries, why its ranges carry provenance, and that the bus snapshot is the authority for them.CodeRabbit review
marker_update_notifier.go). Right, and fixed on the rebased head:markerUpdateRangesnow selects each kind's range withmodels.SingularMarkerSegment, the selector the watch and markers reads already use, so credits name the end credits rather than the first ones.TestMarkerUpdateNotifierDeliversAcrossReplicasOncepins[150,180].confidencecould be emitted as0(minor). Not reproducible.media_files.<kind>_markers_confidenceis a nullabledouble precisionwith no default; the write path carries a*float64andSummaryConfidenceleaves it nil when no segment is rated; the catalog (internal/catalog/detail.go) and the v2 response set the field only when the pointer is non-nil. So unrated is absent, not0, and a stored0is a genuine rating the client should keep. The "rated zero" case asserts exactly that.provenanceOf's!= nullguard is correct and a real0survives. Dropping the0would hide a measured rating at 0%. (The helper's own comment claiming "an unrated marker's confidence is 0 in the row" predates this change and reads against the schema; left alone as out of scope.)onSavednow carries only the kinds in the request body, so the host's patch leaves an untouched kind alone instead of clearing it.useMarkerEditor.test.tsxpins the omission, and a directmarkerDraftFromV2case keeps the mismatched-bounds guard covered.Note
Carry marker provenance in realtime
markers_updatedeventsmarkerUpdateRanges/markerProvenanceOfin marker_update_notifier.go and serialized throughmarkerUpdateSnapshotand the extendedTimeRangePayload.markerDraftFromV2.markersEqualnow treats differing provenance alone as a marker change, andpatchVersionMarkersdrops provenance when bounds move without new provenance; confidence 0 stays distinct from absent via nullable pointer.Macroscope summarized f22c14d.