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
+10 -10
View File
@@ -73,7 +73,8 @@ func (f pairFixture) album(title, releaseGroup string) dbq.Album {
return a
}
// track adds a row; mbid "" leaves it without one, and missing marks it missing.
// track adds a row; mbid "" leaves it without one, and missing marks it
// missing.
func (f pairFixture) track(album dbq.Album, title, path, mbid string, missing bool) dbq.Track {
f.t.Helper()
tr, err := f.q.UpsertTrack(context.Background(), dbq.UpsertTrackParams{
@@ -110,7 +111,7 @@ func (f pairFixture) count(sql string, args ...any) int {
return n
}
// The M485 proof on rows: each rule folds the pair it should, history moves onto
// On rows: each rule folds the pair it should, history moves onto
// the replacement, and every shape the pass must leave alone is left alone.
func TestPairMissingTracks_Integration(t *testing.T) {
pool := newPool(t)
@@ -126,13 +127,13 @@ func TestPairMissingTracks_Integration(t *testing.T) {
edition := f.album("Pair Album (Deluxe)", "rg-pair") // same release group as albumA
other := f.album("Other Album", "rg-other")
// Rule title: the mp3 went, the flac came, no MBID on either, and the title's
// case differs as it does between old and new tags.
// Rule title: the mp3 went, the flac came, no MBID on either, and the
// title's case differs as it does between old and new tags.
oldMp3 := f.track(albumA, "Song One", "/m/a/01 - Song One.mp3", "", true)
newFlac := f.track(albumA, "song one", "/m/a/01 - song one.flac", "", false)
// Rule mbid: the same recording, retitled and filed under another edition of
// the same release group.
// Rule mbid: the same recording, retitled and filed under another edition
// of the same release group.
oldByMbid := f.track(albumA, "Old Name", "/m/a/02 - Old Name.mp3", "rec-2", true)
newByMbid := f.track(edition, "New Name", "/m/d/02 - New Name.flac", "rec-2", false)
@@ -231,10 +232,9 @@ func TestPairMissingTracks_Integration(t *testing.T) {
}
}
// The case that made M485: a quality upgrade. The mp3 is removed and a
// re-encode of it arrives at a new path with no recording MBID, so move adoption
// has nothing to match. The scan must still end with one row, carrying the old
// row's history.
// The common case: a quality upgrade. The mp3 is removed and a re-encode of it
// arrives at a new path with no recording MBID, so move adoption has nothing to
// match. The scan must still end with one row, carrying the old row's history.
func TestScanner_FoldsUpgradedFile_Integration(t *testing.T) {
pool := newPool(t)
ctx := context.Background()