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 - #4135
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 five touched files (63 tests). 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; the parser accepts the fields and rejects a mistyped confidence; a save reports the row's provenance.
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 da74ae80: 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. Locally this sandbox could not run go vet ./... or the whole vitest run in one process (memory), and no live session was driven against a server.
Evidence
Before (main)
After (this branch)
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). It does, and with today's server the pair agrees, because a write validates rather than normalizes a range; when the body is empty nothing new is known, so the draft is reported as it was, which is what the path did before.
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.
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.
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.
No actionable comments were generated in the recent review.
Walkthrough
Realtime marker ranges now carry source, provider, confidence, and algorithm through server snapshots and client marker state. Client validation checks provenance types, version updates preserve or replace provenance according to range changes, and marker editor saves use returned provenance.
Changes: Marker Provenance
Layer / File(s)
Summary
Server realtime marker payload 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 range payloads and notifier snapshots include marker source, provider, algorithm, and nullable confidence. Older snapshots derive ranges from marker segments. Tests cover provenance and replica delivery. The documentation describes the payload and fallback behavior.
Client payload types include provenance, and validation rejects mistyped provenance fields. Version updates preserve provenance for unchanged ranges, use supplied provenance, and do not carry provenance to moved ranges.
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 uses the PUT response to build the saved draft with provenance when the saved endpoints match. Tests check provenance in the saved callback and ensure mismatched ranges do not receive it.
Marker source and confidence labels are now carried through realtime updates and editor saves. The concerns raised earlier about legacy sources and unchanged markers after an edit do not apply to the current code. No open merge risk remains.
Security architecture risk: Minimal · up to f22c1
The change carries marker attribution through existing update and save paths. The inspected changes preserve file targeting and write permissions, and compatibility handling retains marker ranges when attribution is unavailable. No introduced security or material failure-containment risk was established.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
inferred — The added metadata follows the existing per-file playback audience and client state selection. The inspected change does not add recipients, a new network destination, or a provenance-based privilege decision; exposure is marker attribution for sessions already receiving that file's updates.
Trust Boundaries and Controls
observed — The client edit-permission guard and bounds-only PUT body remain unchanged. Response provenance is consumed after the write succeeds and cannot alter that request. The converter preserves draft endpoints and attaches response attribution only when both endpoints match.
Resilience and Maintainability Implications
observed — PUT failure returns before committing the local draft or invoking the host callback. Success commits the submitted draft before notification, as at the base. Each invocation merges its own response with its captured draft; response-ordering and in-flight-edit overwrite behavior already existed. Repeated identical marker updates return existing state, and explicit null updates clear the range.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: the realtime marker update event now carries a marker's provenance (source, provider, confidence, algorithm). The raw summary confirms the Go notifier, realtime payloa…
Linked Issues check
Directly linked issue #4134 requires the skip prompt to show marker source and confidence when a markers_updated event carries them. This applies to two cases: a marker first received through the even…
Out of Scope Changes check
Every changed area in the whole-PR summary serves the marker provenance objective of #4134. Server: realtime.go (TimeRangePayload fields), marker_update_notifier.go and its test (range construction, s…
Description check
The description is specific and on-topic. It names the issue (#4134), the affected realtime markers_updated event, the server and web changes (TimeRangePayload provenance fields, markerUpdateNotifier,…
Full details: Title check
Explanation
The title names the main change: the realtime marker update event now carries a marker's provenance (source, provider, confidence, algorithm). The raw summary confirms the Go notifier, realtime payload, and web merge logic all carry provenance through the marker update, so the title matches the changeset. It is a single sentence, concise, and follows the conventional-commit style.
Full details: Linked Issues check
Explanation
Directly linked issue #4134 requires the skip prompt to show marker source and confidence when a markers_updated event carries them. This applies to two cases: a marker first received through the event, and a previously known marker whose range the update changes. The reviewed head implements both. Server: internal/playback/realtime.go adds optional Source, Provider, Confidence (*float64, so zero stays distinct from absent) and Algorithm to TimeRangePayload. internal/playback/marker_update_notifier.go builds the intro, credits, recap and preview ranges from the media-file row's per-kind columns (markerUpdateRanges, markerProvenanceOf). The ranges travel in markerUpdateSnapshot, so replicas that republish keep the originating provenance. For an older replica snapshot without range fields, dispatch derives ranges from segments without provenance, which is the documented fallback. Web: PlaybackTimeRangePayload extends PlayerMarkerProvenance, and the parser in realtime-protocol.ts validates the new fields. patchVersionMarkers in watchPageMarkers.ts merges per kind. A restated range keeps its prior provenance when the update names none. A moved range takes none. A provenance-only change is no longer treated as unchanged. useMarkerEditor reports response provenance on save, so an edited range reads 'Edited'. Tests named in the PR cover the rated provider range, the unrated scanner range, the rated zero, replica delivery, the restated and moved cases, the parser and the save path. Limits: this assessment relies on the whole-PR summary and the PR's test descriptions. I did not read the source or test blobs directly in this pass, so the verdict rests on the summary's account of the code.
Full details: Out of Scope Changes check
Explanation
Every changed area in the whole-PR summary serves the marker provenance objective of #4134. Server: realtime.go (TimeRangePayload fields), marker_update_notifier.go and its test (range construction, snapshot, replica fallback and delivery). Web: realtime-protocol.ts and its test (parser for the new fields), watchPageMarkers.ts and its test (per-kind merge and equality), types.ts (MarkerDraft holds PlayerMarkerRange), marker-wire.ts (markerDraftFromV2), player-v2.ts (PlayerV2Response type), and useMarkerEditor.ts and its test (save reports response provenance). Documentation in docs/architecture/intro-detection.md and docs/realtime-api.md describes the marker_update payload and its provenance fields, which supports the change. The sizeratchet note for realtime-protocol.ts is a line-limit check and adds no behavior. The summary shows no unrelated feature or refactor. Limit: this check uses the whole-PR summary, not a direct read of the diff hunks.
Full details: Description check
Explanation
The description is specific and on-topic. It names the issue (#4134), the affected realtime markers_updated event, the server and web changes (TimeRangePayload provenance fields, markerUpdateNotifier, patchVersionMarkers, markerDraftFromV2), the validation performed, and the risks. It clearly relates to the changeset, so the lenient check passes.
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: a86c3cbd-b6a9-4442-8012-5d06240f78ef
Commits
Reviewing files that changed from the base of the PR and between e2baaf0 and f22c14d.
Files selected for processing: 4
docs/realtime-api.md
web/src/player/hooks/useMarkerEditor.test.tsx
web/src/player/marker-wire.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.
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: 690caa31-9a97-429f-96fc-b9825b12fa40
Commits
Reviewing files that changed from the base of the PR and between 4448e40 and da74ae8.
Files selected for processing: 12
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 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.
The reason will be displayed to describe this comment to others. Learn more.
🤖 Claude Code (claude-opus-5-5)
Two findings on e2baaf04. I merged main into the branch first, because #4124 changed the WatchPage.tsx code that calls patchVersionMarkers. I'm fixing both in a commit on this branch, so there's no need to change anything yourself.
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>
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
❌
⚠️ 4 Kody Rule(s) were not evaluated
These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:
Preserve optional store capabilities through production wrappers
Detach mandatory cleanup from request cancellation and bound its lifetime
Preserve durable media identity and share identity-evidence precedence
Bound decoder throughput trades and share direct-play eligibility
Reviewed head: f22c14d388. That's the branch after merging main (e2baaf04) plus two review fixes.
The approach holds up. The event already carries the ranges, so sending their provenance with them is the smallest fix, and it is the only fix that reaches an on-demand provider's marker, which is never saved and can't be re-read. The server builds the ranges once and sends them across the replica bus, and dispatch falls back for a snapshot from an older replica. On the client, rangeAfterUpdate merges per kind and keeps the held provenance for a bare range that didn't move. The review found no defect in either half.
078d6cf: a save no longer gives an untouched kind the stored row's provenance when the player is showing a different range, for example an on-demand provider's credits. The new test failed on e2baaf04.
f22c14d: docs/realtime-api.md now describes markers_updated and its provenance fields.
Bot threads: the older-replica snapshot (Kody) was already fixed by c83bb49. The legacy-source fallback (CodeRabbit) doesn't apply, because the watch payload has no such fallback either. The editor-response concern (CodeRabbit) is handled by rangeAfterUpdate, and the real case next to it is the 078d6cf fix above.
Tests that fail on main: four of the new web cases (parser, restated range keeps its source, update replaces a source, save reports its source). The Go tests read the new struct fields and don't compile on main, so they show the payload shape rather than prove the fix. Nothing was run against a live server.
Left as is
A mistyped provenance field rejects the whole event. The PR's Risks section explains this choice. Today's server sends the fields only as typed values and never as null.
The switch from marker kind to provenance columns now exists in four places (catalog.markerFromFile, markers.fileSegmentFields, handlers.fileMarkers, and the new markerProvenanceOf). Sharing it is a separate cleanup.
Validated features: no passed case on the v1.0 board covers the skip prompt's source line, marker editing, or realtime marker updates. Marker and chapter thumbnail cases (#1156 C1/C2, #1155 C1) use separate events, and their behavior doesn't change. Validation tasks: none.
User manual: unaffected. The manual doesn't describe the player's "Show marker source" setting.
Other clients: Apple, Android, and Roku don't show a marker source line, and the new fields are optional, so older parsers ignore them. No parity issue is needed.
Cross-provider review: one Codex round on e2baaf04. It raised one finding, the save pairing, which is fixed in 078d6cf.
Fit: it completes the "Show marker source" and "Show marker confidence" settings for markers that arrive after the watch read, without adding a setting. It does add optional fields to a client-visible event, which keeps it below 9 in the current polish phase.
Readiness: no substantive concern remains after the fixes. The web tests that prove the fix fail on main.
Thanks for the pull request. Every Silo pull request needs evidence that shows the change working, and this one still has none 24 hours after it opened, so it is closed without review. That isn't a judgment of the work.
The Evidence check's Details link explains how to publish screenshots, a recording, or test results. Publish them, then open a new pull request or ask a maintainer to reopen this one. The contributing guide has the details.
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.
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 five touched files (63 tests). 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; the parser accepts the fields and rejects a mistyped confidence; a save reports the row's provenance.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.da74ae80: 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. Locally this sandbox could not rungo vet ./...or the wholevitest runin one process (memory), and no live session was driven against a server.Evidence
main)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.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.