docs: library comments say what the scanner and resolver do, not how they came to be (#6277)
release / govulncheck (push) Successful in 20s
release / web (push) Successful in 1m20s
release / go (push) Successful in 1m37s
release / integration (push) Successful in 5m15s
release / android (push) Successful in 5m26s
release / Build signed APK (releases and dev) (push) Successful in 5m45s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 16s
release / Verify release artifacts (tag releases only) (push) Skipped

Rewrites the internal/library comment blocks to rule 32. Task, milestone,
decision and rule ids are gone; the incidents behind them are restated as
the constraint they left (why a file is deleted before its row, why the
missing mark is a mark, why duplicates block on duration). Counts and
album names from one library are dropped from production comments; test
comments keep the names their fixtures use. The tagReadVersion log keeps
each version's before and after, without the measurements.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-23 12:27:34 -04:00
co-authored by Claude Opus 5.5
parent 08a2c06b85
commit 7e6228c13f
66 changed files with 578 additions and 564 deletions
+7 -8
View File
@@ -18,15 +18,15 @@ type SurvivorCandidate struct {
TagFit int
}
// TagFitScore counts the signs that a copy belongs where it is filed (M498
// #5436), one point each:
// TagFitScore counts the signs that a copy belongs where it is filed, one
// point each:
// - it has a track number that no other track on its album also claims
// - its file name carries no video-rip marker (SourceMarkersFor)
// - it has a MusicBrainz recording id
//
// Two copies of one song differ in these far more often than in anything a
// listener hears: the Humanz rips differ by a few bytes, and file size picked
// the wrong one in 6 of 21 groups.
// listener hears: rips of one song can differ by a few bytes, which makes file
// size a poor guide.
func TagFitScore(hasTrackNumber, positionClash bool, filePath string, hasMBID bool) int {
score := 0
if hasTrackNumber && !positionClash {
@@ -48,13 +48,12 @@ func TagFitScore(hasTrackNumber, positionClash bool, filePath string, hasMBID bo
var losslessFormats = map[string]bool{"flac": true, "wav": true}
// ProposeSurvivor picks which copy of a duplicate group to keep, and gives the
// reason in words the operator reads beside it. It is a default, not a verdict:
// the report shows it and the merge (#3911) lets the operator choose another.
// reason in words an admin reads beside it. It is a default, not a verdict:
// the report shows it and the merge lets an admin choose another.
//
// In order:
// 1. lossless over lossy — the one difference no later step can recover. It
// comes before tag fit: tags can be fixed, a deleted FLAC cannot, and on
// 2026-10-20 five FLACs went for mp3s that only carried a recording MBID
// comes before tag fit: tags can be fixed, a deleted FLAC cannot
// 2. the copy whose tags fit the album best (TagFitScore). It is zero for
// every copy when the caller does not know it, and the order falls through
// to the rules below