Skip to content

test: remove low-value and never-run tests - #2817

Merged
Quick104 merged 1 commit into
mainfrom
test/prune-low-value-tests
Oct 21, 2026
Merged

Quick104 merged 1 commit into
mainfrom
test/prune-low-value-tests

Conversation

@Quick104

@Quick104 Quick104 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: N/A
Validation tasks: none (test-only change; no product behavior changes)

Silo's Go and web test code reached about 886,000 lines, more than the production Go code. Most of it was written by coding agents one change at a time, and a large part of it cannot catch a regression: it restates constants, checks that a fake received the test's own inputs, re-tests the same behavior at several layers or on both /api/v1 and /api/v2, pins SQL statements or copy, or needs a Postgres or Redis that no CI job provides, so it never runs. Every extra test adds CI time and has to be kept passing by every later change. This PR removes about a quarter of that code while keeping the tests that guard security, data integrity, public contracts, failure handling, and logic with real edge cases.

Before After
Test code, Go and web, including helpers and fixtures 886,416 lines 667,962 lines (−24.6%)
Top-level Go tests 15,074 10,637 (−29.4%)
Web test cases (vitest) 8,415 6,384 (−24.1%)
go test ./..., local wall time 4m23s 1m40s
Go package test time, summed 875s 486s
Web test file time, summed 700s 454s

Timings are from one local run each on the same machine, without a database; the second run shared the machine with another build.

Approach

The suite was split into 19 shards. For each shard, one agent removed tests against a shared rubric, and a second agent reviewed every removal: it read each high-risk deletion at the base revision, checked that the test named as covering the same behavior exists and takes the same branch, and restored what did not hold up (more than 750 tests came back this way). A second pass then took only changes that cannot lose CI coverage: deleting tests that never run in CI, deleting /api/v1 duplicates other than v1's own authorization checks, and folding near-identical tests into table tests with every case kept as a row.

Removed Go tests by reason: never run in CI 1,232; duplicate of another test 1,104; no logic under test 523; folded into a table 520 (cases kept); pins implementation detail 447; only checks a fake 334; /api/v1 duplicate 179; other 151; scans source text 28; tests a library 26; slow for no gain 11. Web removals are mostly render-only checks, duplicates of hook and helper tests, and copy and class pins.

What stays:

  • Every test that CI, the Makefile, scripts, or docs name: scripts/ci/db-pins.txt, scripts/ci/db-contracts.txt, the Go integration and external-auth jobs' -test.run patterns, the scenario acceptance targets, and the contract, fixture, route-inventory, and settings-binding gates.
  • The whole internal/watchtogether package, which CI runs against Postgres.
  • In /api/v2, a denial assertion for every operation and one assertion for every operation and problem code pair, matched by a static scan of the remaining tests and fixtures.

Only test files, test helpers, and test fixtures change. Production code, CI lists, the Makefile, and workflows do not. The companion PR #2816 adds rules to CONTRIBUTING.md and AGENTS.md so the suite does not grow back the same way.

Validation

  • go build ./..., go vet ./..., gofmt: clean.
  • go test ./... on macOS without a database: passes apart from the six tests that already fail on macOS at the base revision (case-insensitive filesystem, permissions, platform capability), and eight timing tests that hit their deadlines while another build loaded the machine. Those eight pass when rerun alone and as whole packages.
  • make lint-changed: the first run found 30 findings in new table tests and helpers, mostly funlen. Case tables moved to package-level variables, with no case, input, or assertion changed. golangci-lint run --new-from-rev over every affected package now reports no issues.
  • Web: pnpm run lint, pnpm run format:check, pnpm run build, and the full vitest suite (6,384 of 6,384 pass).
  • make verify-size-ratchet, make verify-local-paths, make verify-case-collisions: pass.
  • No test named by CI, the Makefile, scripts, or docs was removed.
  • The DB-backed CI tests in the scanner, identity, and contracts areas were run against a disposable Postgres after their setup helpers changed, and passed. The Go DB pins and integration jobs cover the rest in CI.

Evidence

Evidence: https://evidence.siloserver.org/r/silo-server/pr-2817/

Risks

  • Behaviors whose only test needed a database or Redis now have no test. Those tests never ran in CI, so CI coverage is unchanged. Examples: the transcode-node check that refuses paths outside the catalog, the scanner's file-removal protection, machine-ID lease renewal, the Redis rate limiter, and many profile-isolation queries. The evidence page lists each one. Any of them can come back from git history together with an entry in scripts/ci/db-contracts.txt.
  • The second-pass review finished for 4 shards, stopped partway for 8, and did not run for 6. In those shards a table fold or a new shared setup helper could have dropped or weakened an assertion. Their tests pass and the case counts match, but nobody has compared every row by hand. The evidence page lists the shards and what was not compared.
  • internal/noderecipe TestDeleteUnlessMovedKeepsAnotherNodesCard, added on main today, needs Redis and so never runs in CI. This PR keeps it; its author can decide whether it belongs in CI.
  • Some production code is now reached by no test, or has no caller at all (for example (*Titles).waitChecks and several unmounted Handle* methods). It is unchanged here.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • The Evidence section shows every change a user can see, or says there is none.

AI Disclosure

  • Harness: Claude Code, run inside T3 Code with T3 delegated subagents
  • Tool(s): Claude Code
  • Model(s): claude-opus-5-5 (coordinator at xhigh effort; shard auditors at high; reviewers at xhigh)
  • Involvement: Fully AI-generated; the maintainer reviews before merge
  • Adversarial review: every shard's deletions were reviewed by a separate agent that read high-risk deletions at the base revision, checked named survivors, sampled the rest, and checked regression tests from fix commits in later rounds; more than 750 tests were restored. Second-pass folds were reviewed fully in 4 shards and partly in 8.

🤖 Generated with Claude Code

Note

Remove low-value and never-run tests across backend and web suites

  • Deletes a large number of test cases judged low-value, duplicated, or never executed, across Go packages (internal/playback, internal/apiv2, internal/recommendations, and many others) and web suites (web/src/hooks, web/src/lib, settings and player pages)
  • Consolidates similar tests into shared table-driven cases and adds shared test support helpers, such as fakeSettingsServer in settingsServer.test-support.ts, makeItemDetail in itemDetail.test-support.ts, stubRadixDom in adminPage.test-support.ts, and applyMigrationForTest in migrate_progress_test.go
  • Trims parameterized tables (naming cases, capability matrices, codec inputs) instead of removing whole suites, and reduces integration-test fixture sizes (smaller synthetic video, shorter ffmpeg delays, fewer writes) to speed up runs
  • Behavioral Change: coverage is removed, not replaced — e.g. TestRedisAttemptLimiterSharesStateAcrossNodes in attempts_test.go, capability-refusal cases in reprobe_test.go, and series play-target scenarios in SeriesContent.requests.test.tsx no longer run

Macroscope summarized f35bd02.

@silo-triage silo-triage Bot added the size/XXXL 3000+ added + deleted lines (all files); change volume, not priority. label Oct 21, 2026
@coderabbitai

coderabbitai Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

Warning

Review details and warnings were omitted to fit the comment limit.

@Quick104 Quick104 mentioned this pull request Oct 21, 2026
3 tasks done
@silo-triage silo-triage Bot added go Pull requests that update go code javascript Pull requests that update javascript code needs-review Needs maintainer review to resolve uncertain classification, scope, or changed evidence. priority: P2 Limited scope, workaround exists, or polish labels Oct 21, 2026
@silo-kody

silo-kody Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

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 settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@Quick104
Quick104 merged commit 174fb9a into main Oct 21, 2026
20 checks passed
@Quick104
Quick104 deleted the test/prune-low-value-tests branch October 21, 2026 04:15
rangoDJ added a commit to rangoDJ/silo-server that referenced this pull request Oct 21, 2026
Main's Silo-Server#2817 removed TestSetTranscodeStreamDetails and
TestRecipeCardLegacyDecodeHasEmptyPlayMethod as low-value. This branch had
extended the first for the target resolution and bitrate; take main's
removal. The jellycompat tests here still check that sessions report both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
rangoDJ added a commit to rangoDJ/silo-server that referenced this pull request Oct 21, 2026
Main's Silo-Server#2817 removed tests from AdminAccessGroups.test.tsx, including the
one that listed a group's members, and with it the adminUsers data its
useAdminUsers mock returned. This branch's tests for moving and adding
members need that data, so keep the adminUsers mock and have
useAdminUsers return it. Take main's removal of the member-list test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
rangoDJ added a commit to rangoDJ/silo-server that referenced this pull request Oct 21, 2026
Main's Silo-Server#2817 removed four contribute-markers tests (invalid and conflict
counts, and the two retry-counting cases). Take that removal, and keep
this branch's three tests: the all-failed run, failures mixed with skips,
and the resolver error text, with the imports they use.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
rangoDJ added a commit to rangoDJ/silo-server that referenced this pull request Oct 21, 2026
Main's Silo-Server#2817 removed TestLoadCachesMalformedFiles as low-value and kept
TestLoadVerifiedStopsWhenCanceled. Take the first removal. The second
tests LoadVerified, which this branch removes, so it goes too, with the
bytes and context imports only they used.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
zenjabba added a commit to zenjabba/silo-server that referenced this pull request Oct 21, 2026
…hem in CI

Main removed internal/nodepool/repository_last_stats_test.go in Silo-Server#2817, which
defined the helpers TestRepositoryEncodingCeilingPreservesDrainState and
TestRepositoryHealthReconcilesWorkerCeilingAndRevision used, so the package no
longer built once merged with main. The two tests now open the test database
through a helper in their own file, and scripts/ci/db-contracts.txt lists them
so the DB contracts job runs them instead of skipping them.
Tobechukwu-Njoku added a commit to Tobechukwu-Njoku/silo-server that referenced this pull request Oct 21, 2026
Collections created from a built-in template can keep the bundled poster
path "/images/collection-templates/<id>.jpg". The reconcile sweep treated
it as a storage key, blobstore.ValidateKey rejected it as invalid, and
every such row counted as a sweep error. The task then failed on every run
and never certified the storage identity.

cachedPredicate now excludes paths starting with "/", as it already
excludes provider URLs. The predicate is shared by the count, probe, bulk
reset and per-row sweep, so all of them skip these rows.

TestArtworkReconcileSkipsBundledPostersDB seeds a template collection
with a bundled poster and runs the reconciler: the path is never checked,
the sweep reports no errors and the row is unchanged. It is listed in
scripts/ci/db-contracts.txt so CI runs it (the earlier sweep test it
extended was removed in Silo-Server#2817 because no CI job ran it).

Fixes Silo-Server#1131

Co-Authored-By: Claude Opus 5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Tobechukwu-Njoku added a commit to Tobechukwu-Njoku/silo-server that referenced this pull request Oct 22, 2026
Collections created from a built-in template can keep the bundled poster
path "/images/collection-templates/<id>.jpg". The reconcile sweep treated
it as a storage key, blobstore.ValidateKey rejected it as invalid, and
every such row counted as a sweep error. The task then failed on every run
and never certified the storage identity.

cachedPredicate now excludes paths starting with "/", as it already
excludes provider URLs. The predicate is shared by the count, probe, bulk
reset and per-row sweep, so all of them skip these rows.

TestArtworkReconcileSkipsBundledPostersDB seeds a template collection
with a bundled poster and runs the reconciler: the path is never checked,
the sweep reports no errors and the row is unchanged. It is listed in
scripts/ci/db-contracts.txt so CI runs it (the earlier sweep test it
extended was removed in Silo-Server#2817 because no CI job ran it).

Fixes Silo-Server#1131

Co-Authored-By: Claude Opus 5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Tobechukwu-Njoku added a commit to Tobechukwu-Njoku/silo-server that referenced this pull request Oct 22, 2026
The Postgres tests for the list of skipped files never ran in CI. The six
that each cover a separate behavior of the repository or the scan are
now named in scripts/ci/db-contracts.txt: replacing rows and keeping
those under paths a scan could not read or verify, an older scan never
overwriting a newer count, add-only guarded scans across bounded
batches, list paging and search, a suspect empty root, and the row of a
folder holding an unreadable file. The add-only case joins the batching
test.

Dropped: the scan-result test that repeated the walk and protected-path
tests, the scanner test for an unreadable folder (its walk behavior is
now asserted in the existing walk test, and the repository test covers
the rows), and the scan-queue count copy. The name-cap and label checks
fold into their neighbours. The regression for a subtree scan under a
skipped library root, whose test Silo-Server#2817 removed, is a test that needs no
database. The component test keeps the cases where the section decides
something: folder labels and details, labels against the folder's own
library, and both failure states.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Tobechukwu-Njoku added a commit to Tobechukwu-Njoku/silo-server that referenced this pull request Oct 28, 2026
Collections created from a built-in template can keep the bundled poster
path "/images/collection-templates/<id>.jpg". The reconcile sweep treated
it as a storage key, blobstore.ValidateKey rejected it as invalid, and
every such row counted as a sweep error. The task then failed on every run
and never certified the storage identity.

cachedPredicate now excludes paths starting with "/", as it already
excludes provider URLs. The predicate is shared by the count, probe, bulk
reset and per-row sweep, so all of them skip these rows.

TestArtworkReconcileSkipsBundledPostersDB seeds a template collection
with a bundled poster next to one with an ordinary cached poster, so the
run reaches the verify sweep, and runs the reconciler: the cached key is
checked, the bundled path never is, the sweep reports no errors and the
template row is unchanged. It is listed in
scripts/ci/db-contracts.txt so CI runs it (the earlier sweep test it
extended was removed in Silo-Server#2817 because no CI job ran it).

Fixes Silo-Server#1131

Co-Authored-By: Claude Opus 5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Tobechukwu-Njoku added a commit to Tobechukwu-Njoku/silo-server that referenced this pull request Oct 28, 2026
Collections created from a built-in template can keep the bundled poster
path "/images/collection-templates/<id>.jpg". The reconcile sweep treated
it as a storage key, blobstore.ValidateKey rejected it as invalid, and
every such row counted as a sweep error. The task then failed on every run
and never certified the storage identity.

cachedPredicate now excludes paths starting with "/", as it already
excludes provider URLs. The predicate is shared by the count, probe, bulk
reset and per-row sweep, so all of them skip these rows.

TestArtworkReconcileSkipsBundledPostersDB seeds a template collection
with a bundled poster next to one with an ordinary cached poster, so the
run reaches the verify sweep, and runs the reconciler: the cached key is
checked, the bundled path never is, the sweep reports no errors and the
template row is unchanged. It is listed in
scripts/ci/db-contracts.txt so CI runs it (the earlier sweep test it
extended was removed in Silo-Server#2817 because no CI job ran it).

Fixes Silo-Server#1131

Co-Authored-By: Claude Opus 5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Tobechukwu-Njoku added a commit to Tobechukwu-Njoku/silo-server that referenced this pull request Oct 28, 2026
Collections created from a built-in template can keep the bundled poster
path "/images/collection-templates/<id>.jpg". The reconcile sweep treated
it as a storage key, blobstore.ValidateKey rejected it as invalid, and
every such row counted as a sweep error. The task then failed on every run
and never certified the storage identity.

cachedPredicate now excludes paths starting with "/", as it already
excludes provider URLs. The predicate is shared by the count, probe, bulk
reset and per-row sweep, so all of them skip these rows.

TestArtworkReconcileSkipsBundledPostersDB seeds a template collection
with a bundled poster next to one with an ordinary cached poster, so the
run reaches the verify sweep, and runs the reconciler: the cached key is
checked, the bundled path never is, the sweep reports no errors and the
template row is unchanged. It is listed in
scripts/ci/db-contracts.txt so CI runs it (the earlier sweep test it
extended was removed in Silo-Server#2817 because no CI job ran it).

Fixes Silo-Server#1131

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Tobechukwu-Njoku added a commit to Tobechukwu-Njoku/silo-server that referenced this pull request Oct 28, 2026
Collections created from a built-in template can keep the bundled poster
path "/images/collection-templates/<id>.jpg". The reconcile sweep treated
it as a storage key, blobstore.ValidateKey rejected it as invalid, and
every such row counted as a sweep error. The task then failed on every run
and never certified the storage identity.

cachedPredicate now excludes paths starting with "/", as it already
excludes provider URLs. The predicate is shared by the count, probe, bulk
reset and per-row sweep, so all of them skip these rows.

TestArtworkReconcileSkipsBundledPostersDB seeds a template collection
with a bundled poster next to one with an ordinary cached poster, so the
run reaches the verify sweep, and runs the reconciler: the cached key is
checked, the bundled path never is, the sweep reports no errors and the
template row is unchanged. It is listed in
scripts/ci/db-contracts.txt so CI runs it (the earlier sweep test it
extended was removed in Silo-Server#2817 because no CI job ran it).

Fixes Silo-Server#1131

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Tobechukwu-Njoku added a commit to Tobechukwu-Njoku/silo-server that referenced this pull request Oct 28, 2026
Collections created from a built-in template can keep the bundled poster
path "/images/collection-templates/<id>.jpg". The reconcile sweep treated
it as a storage key, blobstore.ValidateKey rejected it as invalid, and
every such row counted as a sweep error. The task then failed on every run
and never certified the storage identity.

cachedPredicate now excludes paths starting with "/", as it already
excludes provider URLs. The predicate is shared by the count, probe, bulk
reset and per-row sweep, so all of them skip these rows.

TestArtworkReconcileSkipsBundledPostersDB seeds a template collection
with a bundled poster next to one with an ordinary cached poster, so the
run reaches the verify sweep, and runs the reconciler: the cached key is
checked, the bundled path never is, the sweep reports no errors and the
template row is unchanged. It is listed in
scripts/ci/db-contracts.txt so CI runs it (the earlier sweep test it
extended was removed in Silo-Server#2817 because no CI job ran it).

Fixes Silo-Server#1131

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Quick104 added a commit that referenced this pull request Oct 31, 2026
#2817 deleted local_signup_policy_db_test.go because no CI job ran it. This
branch now runs TestSignupRechecksLocalPolicyBeforeSpendingInviteDB in the
serial auth DB job, and signup_policy_db_test.go uses its paused repository
helper, so restore the file unchanged.

#2817 also deleted TestInvitedAccountAtomicDB and
TestInvitedAccountWrappedPostgresDB; drop them from the DB contract list,
which fails on listed tests that do not exist.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Quick104 added a commit to Rhainland/silo-server that referenced this pull request Oct 31, 2026
Callers read at most 32 KiB at a time, so every read cost one Redis round
trip and a fast cap was bounded by Redis latency. The reader now pays for a
whole chunk ahead and serves later reads from that credit.

The shared buckets now reserve every charge, letting the balance go
negative, so contending transfers are served in order instead of polling.
A replica that still sees a limit as off leaves that bucket alone rather
than deleting a balance other replicas are charging. The settings read has
its own deadline on every path, and a transfer that ends mid-read is no
longer logged as a settings outage.

Drop the Redis-only script test: CI has no Redis. Restore the imports the
proxy reload test needs after Silo-Server#2817 trimmed that file on main.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Quick104 added a commit that referenced this pull request Oct 31, 2026
Callers read at most 32 KiB at a time, so every read cost one Redis round
trip and a fast cap was bounded by Redis latency. The reader now pays for a
whole chunk ahead and serves later reads from that credit.

The shared buckets now reserve every charge, letting the balance go
negative, so contending transfers are served in order instead of polling.
A replica that still sees a limit as off leaves that bucket alone rather
than deleting a balance other replicas are charging. The settings read has
its own deadline on every path, and a transfer that ends mid-read is no
longer logged as a settings outage.

Drop the Redis-only script test: CI has no Redis. Restore the imports the
proxy reload test needs after #2817 trimmed that file on main.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Quick104 pushed a commit to Tobechukwu-Njoku/silo-server that referenced this pull request Nov 1, 2026
Collections created from a built-in template can keep the bundled poster
path "/images/collection-templates/<id>.jpg". The reconcile sweep treated
it as a storage key, blobstore.ValidateKey rejected it as invalid, and
every such row counted as a sweep error. The task then failed on every run
and never certified the storage identity.

cachedPredicate now excludes paths starting with "/", as it already
excludes provider URLs. The predicate is shared by the count, probe, bulk
reset and per-row sweep, so all of them skip these rows.

TestArtworkReconcileSkipsBundledPostersDB seeds a template collection
with a bundled poster next to one with an ordinary cached poster, so the
run reaches the verify sweep, and runs the reconciler: the cached key is
checked, the bundled path never is, the sweep reports no errors and the
template row is unchanged. It is listed in
scripts/ci/db-contracts.txt so CI runs it (the earlier sweep test it
extended was removed in Silo-Server#2817 because no CI job ran it).

Fixes Silo-Server#1131

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Quick104 added a commit that referenced this pull request Nov 1, 2026
…#1132)

* fix(metadata): skip app-relative paths in the artwork reconcile sweep

Collections created from a built-in template can keep the bundled poster
path "/images/collection-templates/<id>.jpg". The reconcile sweep treated
it as a storage key, blobstore.ValidateKey rejected it as invalid, and
every such row counted as a sweep error. The task then failed on every run
and never certified the storage identity.

cachedPredicate now excludes paths starting with "/", as it already
excludes provider URLs. The predicate is shared by the count, probe, bulk
reset and per-row sweep, so all of them skip these rows.

TestArtworkReconcileSkipsBundledPostersDB seeds a template collection
with a bundled poster next to one with an ordinary cached poster, so the
run reaches the verify sweep, and runs the reconciler: the cached key is
checked, the bundled path never is, the sweep reports no errors and the
template row is unchanged. It is listed in
scripts/ci/db-contracts.txt so CI runs it (the earlier sweep test it
extended was removed in #2817 because no CI job ran it).

Fixes #1131

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(metadata): isolate the bundled poster reconcile test and cover bulk reset

Run the regression test against the collection posters surface in its own
schema, through the verify sweep and the bulk reset, instead of a full
reconcile over the shared test database. Reuse presentObjects and drop the
one-off checker whose missing and erroring branches nothing set.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Quick <[email protected]>
Quick104 added a commit to Rhainland/silo-server that referenced this pull request Nov 2, 2026
Resolve conflicts with current main:

- internal/auth/permissions_test.go: Silo-Server#2817 kept tests for
  HasEffectivePermission, which this branch removes; keep the branch's
  PolicyPermissions table and drop the default-permissions test as Silo-Server#2817 did.
- internal/api/handlers/items.go: Silo-Server#2370 added a secondary-admin file-path
  check through HasAssignedPermission. A secondary admin now falls through
  to the shared masked check; groups never mask an admin, so it still needs
  metadata_curation assigned to the account.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Quick104 added a commit that referenced this pull request Nov 2, 2026
)

* fix(scanner): scan a podcast show folder with the podcast scanner

ScanSubtree had no podcast branch, so a subtree scan of a podcast library
went through the movie/TV file pipeline. New episodes and new shows became
unmatched movie items, and the existing episodes had their podcast
base_type and canonical_root_path overwritten, so the next full scan
rebuilt the show under a new content ID.

A podcast subtree now maps to the show folder that holds it, indexes that
show the way a full scan does, and limits missing-file reconciliation to
the show folder. The subtree reconciliation never consumes the folder's
empty-cleanup confirmation, and a show folder that is gone or unreadable is
left to the next full scan. A library root path scans the whole library.

Closes #2222

* test(scanner): run the podcast subtree scan tests in the DB contracts job

make test-go has no database, so the two DB tests skip there. Listing them
in scripts/ci/db-contracts.txt makes the Go DB pins job run them against a
migrated database and fail if either is skipped.

* fix(scanner): commit a podcast show's files and membership together

The ingest executor runs subtree scans of different shows side by side, and
next to a full scan. Each podcast scan ends with a folder-wide membership
sweep that deletes any item whose files have no membership. Written file by
file, a show another scan was still indexing could be deleted between its
files and its membership, and that scan then failed on the membership's
foreign key.

Write the episode files and the show's membership in one transaction, as
the audiobook scanner does. The new DB test runs another scan's sweep right
before the membership insert and fails without the transaction.

The subtree reconciliation test now also checks that other shows stay in
the library, and grants the empty-cleanup confirmation before the emptied
show folder scan so it proves the subtree scan leaves it unused.

* style(scanner): group Silo imports apart in the podcast subtree test

* fix(libraryingest): run podcast scans of one library one at a time

The podcast scanner finds a show by its folder and creates the show when
none is found. Two scans indexing the same new show at once, such as scans
of two folders inside it or a show folder scan next to a library scan, could
each create the show and leave its episodes split between two items until
a later scan cleaned up. A claim in a podcast library now conflicts with
every other claim on that library, so those scans wait for each other.

* fix(scanner): report podcast show scan changes and keep probed file data

A show folder scan returned an empty result, so the ingest never published
its scan event after adding episodes or marking them missing. It now
counts new, restored and newly missing episode files and the cleanup that
followed.

The podcast scanner probed every episode but wrote zero duration, codecs,
tracks, size and modification time, and the file upsert replaces those
columns. Episode rows now record the probe and the file stat, for full
scans as well as show folder scans.

* fix(scanner): lock a podcast show while finding and writing it

The scan queue is shared by every node and only caps running scans
cluster-wide, so two scans of one podcast library can run at once on
different nodes. The executor rule from e8a2136 only kept them apart
within one process. Two scans indexing the same new show could still each
create it, and the files ended up on whichever committed last.

A scan now takes a transaction-scoped advisory lock on the show folder
before it looks the show up, and holds it until the show's files and
membership commit. A second scan of the show waits, then finds the show
the first one wrote. This covers one node and many, so the executor rule
is reverted rather than kept as a second mechanism.

The new DB test starts a second scan of the same new show while the first
is inside its write. It fails without the lock: the second scan creates
its own show and takes the files over.

* fix(scanner): skip the folder-wide sync when a podcast scan indexes nothing

ScanSubtree ran the folder-wide membership sync after every podcast
subtree scan, including one that left an unavailable show folder alone.
The sync now runs inside scanPodcastSubtree, after a library scan or a show
that was indexed, so a scan of a vanished or unreadable show folder touches
nothing.

* fix(scanner): stat a podcast episode before probing it

The show parse stat'ed each episode after ffprobe read it, so a file
replaced during the probe was recorded with the old file's duration and
tracks but the new file's size and modification time, and looked current
to any later size and mtime check. Stat before probing, as the video
scanner does, so the row describes the file that was probed and a later
check sees the replacement.

* fix(scanner): probe a podcast episode again if it changes mid-probe

Stat'ing before the probe still let a replacement with the same size and
mtime, such as an atomic rename, go unnoticed: the row described the probed
file by size and mtime, which the replacement shared. The show parse now
stats each episode before and after probing it and compares file identity,
size and mtime. A file that changed is probed once more; one still
changing fails the show for this scan, so the next scan reads it again.

* fix(scanner): build and lint the podcast subtree change on current main

Main removed newDeadRootTestPool (#2817), so the podcast subtree DB tests
use newScannerTestPool. The concurrency test now waits in a select
instead of time.Sleep, and constant errors use errors.New, for the
forbidigo and perfsprint checks main enabled.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(scanner): skip a podcast episode still being written, count retags

An episode that keeps changing across both probes, such as a download
written in place, failed the whole show: a show folder scan returned an
error and indexed none of the show's other new episodes. The parse now
skips only that episode; its row stays present because the scan records
the listing first, and the next scan probes it again. A show whose only
episodes are still changing still fails for that scan.

A show folder scan also counted every episode that was already present
as unchanged, so a retagged or replaced episode reported no change and
the ingest published no catalog event. The scan now compares each row's
recorded size and modification time before and after indexing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(scanner): stat podcast episodes by their real names

Main now lists file names that are not UTF-8 in fspath encoding (#2571).
The stability check around each episode probe passed that encoded path to
os.Stat, so every episode in a show folder whose name needs encoding
failed to stat and the show scan failed with it. Use fspath.Stat and
compare with fspath.SameFile. The merge already moved the show folder
Lstat to fspath.

The new test parses a show folder whose name needs encoding; it fails
without this change.

* fix(scanner): count only the podcast episodes a show scan indexed

seenPaths holds every listed episode, including one skipped because it is
still being written. The counts treated such a new episode as New and a
returning one that stays missing as Updated, so each scan during a
download published a catalog event for a catalog that didn't change.
Count from the rows after indexing: skip a path with no row, and count a
restore only when the row is present again.

TestScanSubtreeCountsOnlyTheEpisodesItIndexed fails without the change.

* fix(scanner): skip a podcast episode that can't be probed while it changes

A download still being written, such as an M4A whose index isn't on
disk yet, makes ffprobe fail outright. probeStablePodcastFile returned
that error before its second stat, so the whole show failed instead of
skipping the one episode. A failed probe of a file that changed under
it now counts as a change; a failed probe of a stable file still fails.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(scanner): leave a nested library root alone when scanning a podcast show

A show folder scan reconciled every cataloged file under the show's
path, including files under a library root configured inside that show.
The show's listing never sees those files, so their shows were marked
missing and could be swept. A show scan now skips files whose most
specific library root is a different one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(scanner): write a podcast show in its show transaction

A show scan held its transaction and the show lock while the show item
and its episodes were committed through other pool connections. A scan
that stopped before the commit left a show with episodes but no files
or membership, which no later scan finds, so the next scan created the
show again. The scan also needed a second connection while it held the
first, so a one-connection pool, or two scans of one show on a small
pool, waited for good.

Find the show, write it and its episodes in the show transaction, next
to its files and membership. EpisodeRepository gains UpsertTx, which
runs Upsert's statements in the caller's transaction with each retried
attempt in a savepoint, and FileRepository gains
FindContentIDByRootPathTx and LockByPathsTx.

Holding these locks until the show commits must not invert the order
other writers take them in. The scan locks the show's file rows before
writing its episodes, as MarkMissing locks a file before its trigger
refreshes the episode's catalog entry, and updates an existing show's
item after its episodes, as artwork publication locks an episode before
its show. Episode membership cleanup takes a catalog entry before a
file, so no single order suits every writer: the show's transaction is
retried on a deadlock, as that cleanup already is, through the catalog's
existing retry helper.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(scanner): keep a stale podcast scan from undoing a newer one

Scans of one podcast library run side by side: a full scan next to show
folder scans, on one node or several. A scan that listed a show and was
still probing it while another scan indexed a change could undo that
change until the next scan of the show:

- Missing-file reconciliation re-read the rows after indexing, so it
  marked missing an episode that the other scan had just cataloged. The
  full scan now reads every root's rows before it lists any root, since
  roots can nest, and the show scan reuses the read it already takes
  before listing. Reconciliation marks only rows from those reads, as the
  generic scanner does, and holds just their ID, path and missing state.
- The show write rewrote every parsed episode as present, so an episode
  removed after the parse came back after the other scan marked it
  missing. With the show's file rows locked, the write now skips an
  episode it can no longer stat. A concurrent MarkMissing either
  committed before the lock, and the file is already gone, or waits on
  the lock and lands after the commit.

A full podcast scan that can't read the catalog before listing now
fails, as the show scan and the generic scanner already do, instead of
indexing and skipping reconciliation. A row deleted or relinked by
another scan since the read is skipped quietly, as the generic scanner
does.

TestStalePodcastScanLeavesNewerCatalogStateAlone holds the stale scan's
probe of one episode on a FIFO while another scan runs, and covers a
stale full scan, a stale full scan under a nested root listed first, and
a stale show scan with a new and with a removed episode.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Quick104 <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Tobechukwu-Njoku added a commit to Tobechukwu-Njoku/silo-server that referenced this pull request Nov 3, 2026
The Postgres tests for the list of skipped files never ran in CI. The six
that each cover a separate behavior of the repository or the scan are
now named in scripts/ci/db-contracts.txt: replacing rows and keeping
those under paths a scan could not read or verify, an older scan never
overwriting a newer count, add-only guarded scans across bounded
batches, list paging and search, a suspect empty root, and the row of a
folder holding an unreadable file. The add-only case joins the batching
test.

Dropped: the scan-result test that repeated the walk and protected-path
tests, the scanner test for an unreadable folder (its walk behavior is
now asserted in the existing walk test, and the repository test covers
the rows), and the scan-queue count copy. The name-cap and label checks
fold into their neighbours. The regression for a subtree scan under a
skipped library root, whose test Silo-Server#2817 removed, is a test that needs no
database. The component test keeps the cases where the section decides
something: folder labels and details, labels against the folder's own
library, and both failure states.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Tobechukwu-Njoku added a commit to Tobechukwu-Njoku/silo-server that referenced this pull request Nov 4, 2026
The Postgres tests for the list of skipped files never ran in CI. The six
that each cover a separate behavior of the repository or the scan are
now named in scripts/ci/db-contracts.txt: replacing rows and keeping
those under paths a scan could not read or verify, an older scan never
overwriting a newer count, add-only guarded scans across bounded
batches, list paging and search, a suspect empty root, and the row of a
folder holding an unreadable file. The add-only case joins the batching
test.

Dropped: the scan-result test that repeated the walk and protected-path
tests, the scanner test for an unreadable folder (its walk behavior is
now asserted in the existing walk test, and the repository test covers
the rows), and the scan-queue count copy. The name-cap and label checks
fold into their neighbours. The regression for a subtree scan under a
skipped library root, whose test Silo-Server#2817 removed, is a test that needs no
database. The component test keeps the cases where the section decides
something: folder labels and details, labels against the folder's own
library, and both failure states.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Quick104 added a commit that referenced this pull request Nov 5, 2026
#2817 deleted local_signup_policy_db_test.go because no CI job ran it. This
branch now runs TestSignupRechecksLocalPolicyBeforeSpendingInviteDB in the
serial auth DB job, and signup_policy_db_test.go uses its paused repository
helper, so restore the file unchanged.

#2817 also deleted TestInvitedAccountAtomicDB and
TestInvitedAccountWrappedPostgresDB; drop them from the DB contract list,
which fails on listed tests that do not exist.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Quick104 added a commit that referenced this pull request Nov 5, 2026
* test(auth): reproduce signup policy changing before commit

Co-authored-by: Codex <[email protected]>

* test(auth): seed the signup mapping invite creator

Co-authored-by: Codex <[email protected]>

* fix(auth): recheck signup policy before invited account commit

Serialize the signup decision with settings mutations before redeeming an invite. Keep account/profile writes and invite accounting atomic, and run the policy ordering and API mapping database contracts in CI.

Co-authored-by: Codex <[email protected]>

* test(auth): keep signup race coverage within lint limits

* test(auth): run the local-login signup recheck in the auth DB job

TestSignupRechecksLocalPolicyBeforeSpendingInviteDB turns the global
auth.local_password_login row off for part of its run. In the database
contract run every listed package shares one database and runs in
parallel, so invitation and Jellyfin login contract tests could fail
with "local password sign-in is turned off" while it ran. Run it in the
go-db-auth job, beside TestSignupRefusedWhileLocalLoginIsOffDB, where
these tests run one at a time in a fresh database.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(auth): restore the local-login signup recheck after rebase

#2817 deleted local_signup_policy_db_test.go because no CI job ran it. This
branch now runs TestSignupRechecksLocalPolicyBeforeSpendingInviteDB in the
serial auth DB job, and signup_policy_db_test.go uses its paused repository
helper, so restore the file unchanged.

#2817 also deleted TestInvitedAccountAtomicDB and
TestInvitedAccountWrappedPostgresDB; drop them from the DB contract list,
which fails on listed tests that do not exist.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(auth): bound signup fixture cleanup

Co-Authored-By: Codex (gpt-6-astra) <[email protected]>

---------

Co-authored-by: Codex <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Quick104 added a commit to bulderi/silo-server that referenced this pull request Nov 13, 2026
Main retired the /api/v1 bridge (Silo-Server#3200), so the v1 route test for
collection_type is gone with the handlers it called. Main also removed
TestCollectionProblemRendersInvalidArtworkAsValidationProblem (Silo-Server#2817);
the conflict keeps that removal and this branch's v2 test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Tobechukwu-Njoku added a commit to Tobechukwu-Njoku/silo-server that referenced this pull request Nov 23, 2026
The Postgres tests for the list of skipped files never ran in CI. The six
that each cover a separate behavior of the repository or the scan are
now named in scripts/ci/db-contracts.txt: replacing rows and keeping
those under paths a scan could not read or verify, an older scan never
overwriting a newer count, add-only guarded scans across bounded
batches, list paging and search, a suspect empty root, and the row of a
folder holding an unreadable file. The add-only case joins the batching
test.

Dropped: the scan-result test that repeated the walk and protected-path
tests, the scanner test for an unreadable folder (its walk behavior is
now asserted in the existing walk test, and the repository test covers
the rows), and the scan-queue count copy. The name-cap and label checks
fold into their neighbours. The regression for a subtree scan under a
skipped library root, whose test Silo-Server#2817 removed, is a test that needs no
database. The component test keeps the cases where the section decides
something: folder labels and details, labels against the folder's own
library, and both failure states.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go Pull requests that update go code javascript Pull requests that update javascript code needs-review Needs maintainer review to resolve uncertain classification, scope, or changed evidence. priority: P2 Limited scope, workaround exists, or polish size/XXXL 3000+ added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant