Repository navigation
fix(markers): stop weak online markers replacing chapter markers - #2974
Conversation
An online marker replaced a file's own chapter marker however low the provider rated it, so a TheIntroDB intro at 0.10 from one submission replaced an authored Opening chapter at 0.95. CanWriteMarkerUpdate now weighs a marker placed from the file's own chapters against an online or plugin marker by confidence, with ties going to the online marker. Local detection offers the chapter over a stored online marker the writer would replace. Chromaprint, audio and video credits, and version copies keep source priority. Each marker provider gains fetch_min_confidence (default 0, today's behavior). Markers below it take no part in provider selection, and the provider's stored marker of that kind is withdrawn even when its answer came from the cache. The field is exposed on the v2 admin provider API and the web provider tile; the frozen v1 routes neither return nor accept it. Also prunes the merged #2903 entries from breaking-approvals.json, which the contract gate requires of the next PR that changes the OpenAPI. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Problem
Related issue: N/A
Validation tasks: changes #1148 C1 and C2, and the marker times played in #1149 C1, Silo-Server/silo-apple#311 C1, Silo-Server/silo-apple#312 C1, Silo-Server/silo-android#321 C1 and Silo-Server/silo-android#322 C1 (all open, not run yet)
An online marker replaces a file's own chapter marker however unsure the provider is. Online and plugin markers outrank every local marker, so a TheIntroDB intro rated 0.10 from a single submission replaces the file's authored
Openingchapter, which Silo rates 0.95. This hits every server in the default marker mode, online with local fallback, on each file that has both. Admins also have no way to tell Silo to ignore a provider's low-confidence markers.This change keeps chapter markers over less confident online markers and adds a per-provider minimum confidence for lookups, which defaults to 0 (today's behavior).
Approach
CanWriteMarkerUpdatecompares a marker placed from the file's own chapters (chapter:v1,chapter:silence:v1,chapter:silence:v2,credits-chapter:v1) with an online or plugin marker by confidence. The higher one wins, and a tie goes to the online marker. A manual marker still wins over everything. Episode-version copies, Chromaprint, and audio or video credits keep plain source priority: their scales are not comparable with a provider's, and extending the rule to them would undo "online with local fallback".marker_provider_config.fetch_min_confidence(new column, default 0) applies when provider results are merged. A marker below it takes no part, so the next provider or local detection fills that kind. A provider with a marker dropped this way counts as refreshed even when its answer came from the cache, so its stored marker of that kind is withdrawn. Local markers carry no provider and stay. Because the minimum is applied at selection time, a changed value reaches cached answers on the file's next lookup or refresh without fetching again. The nightly sync looks up only files whose cached answer is due, so with lazy playback off a raised minimum can take up to 30 days to reach a file, or one admin refresh./api/v2/admin/markers/providersonly. The shared handler view hides it from the frozen v1 routes (json:"-"), and a v1 PUT cannot set it. The web provider tile shows it under Advanced as Minimum confidence to use markers.make apiv2-fixtures-sync.Each path settles a file once and then leaves it:
on_demandoverlayApplyResultandOverlayOnlineuse the same rule, so the overlay keeps the stored chapter.Default for the minimum. Shared dev holds only 22 TheIntroDB markers with a real confidence. They were fetched after the plugin began requesting
details=true, and all are rated 0.10 to 0.30 from one or two submissions. Earlier markers all carry the plugin's 0.9 fallback. Against the files' own chapters, 4% of those intros and 6% of those credits cover less than 80% of the chapter, and the three low-confidence intros that have a chapter cover all of it. Any minimum above 0.30 would drop every recent TheIntroDB marker. The data does not support a nonzero default, so it stays 0, and the chapter rule handles the low-confidence answers.Shared-dev measurements (read-only, 23 October 2026)
details=true(intro / credits / recap cached)details=true(intro / credits / recap / preview)Overlap with #2971. Both PRs change
internal/markers/write.go,write_test.go, andtypes_test.go, in different places: #2971 editsApplyResultand adds tests near the top ofwrite_test.goand a row to the provider priority table; this PR editsCanWriteMarkerUpdate, adds rows to the scanner-algorithm table, and adds a test after the priority table. This PR does not touchpopulation.go,population_test.go, orinternal/scanner/file_repo.go. Expect a small textual merge and no semantic conflict: #2971 drops misplaced credits inselectResults, just before the merge where this PR applies the minimum.Maintainer decisions
chapter:silence:v1counts as chapter-derived. It is the legacy silence extension that ran too long; the backfill already rewrites it.Validation
make lint-changed(0 issues),make lint-router-recovery(0 issues),make migrate-validatepassed.make test-goagainst a fresh migrated database: 185 packages passed, andTestV1AdminUserChangesKeepBreakGlassDBfailed under full-suite load. It passes on its own on this branch and onmain, and it does not touch markers.pnpm run lint(0 errors),format:check,build,budget:checkpassed.make test-web: 6440 of 6441 passed;pgs.test.ts"drops objects past 16 MiB" timed out under full-suite load and passes on its own. It does not touch this change.TestCommittedArtifactMatchesRouter, local paths, case collisions, and actionlint passed. The contract diff first failed on the 78 merged [bug] v2 schema declares no format for dates, URLs, or language and country codes #2903 approvals inbreaking-approvals.json; this PR removes them, as the contract doc asks of the next PR that changes the OpenAPI.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/markers-online-confidence/
Surface and build: web admin, desktop (1440 px) and mobile web (390 px),
main31fabc7 against this branch, on the same sandbox data.Risks
Checklist
AI Disclosure
on_demandoverlay, theprocessChapterCandidatesrestructure, v1 leakage, the SQL and migration, and the web tile. It found no correctness bugs. It found two doc inaccuracies: playback and admin refresh do run the chapter step when local analysis starts, and the nightly sync does not reach files whose cached answer is fresh. Both are fixed in the docs and in this description.🤖 Generated with Claude Code
Note
Let file-owned chapter markers replace weaker online markers and add provider
fetch_min_confidencesettingmarkers.CanWriteMarkerUpdatevia the newintromarkers.Candidate.yieldsToChapterhelper in kind.go, with rules in write.go.fetch_min_confidencesetting (0–1 range, default 0). Provider lookups now drop markers below the threshold inmarkers.mergeProviderResults(types.go), and the filtered provider is marked refreshed so its cached marker is withdrawn.markers.CanWriteMarkerUpdatenow gives providers tie wins and lets higher-confidence chapters beat providers; registries without a config store keep the zero threshold, so filtering only applies to configured providers.Macroscope summarized 4f99817.