Repository navigation
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Filter app-relative paths and verify reconciliation internal/metadata/artwork_reconcile.go, internal/metadata/artwork_reconcile_test.go, scripts/ci/db-contracts.txt |
The predicate excludes paths beginning with /. Database-backed tests verify that reconciliation skips bundled posters, produces no sweep errors, and preserves the poster URL, hash, and template flag. A database contract covers this behavior. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Possibly related PRs
- Silo-Server/silo-server#3088: Changes the artwork reconciliation predicate to exclude uploaded sources from bulk reset and verify those rows individually.
Suggested labels: bug, go, size/L
Suggested reviewers: rhainland
Merge Risk: 
Minimal · up to 0b86a
-
Bundled artwork is excluded from storage checks. No merge-blocking risk was identified.
Security architecture risk: 
Low · up to 947ae
-
Bundled poster paths are no longer mistaken for storage objects, and the test shows they remain unchanged. No security issue was confirmed, but the full set of ways such paths can be written and the resulting certification behavior have not been fully established.
Retained concerns
No architecture-level concerns identified.Security review details
-
Security Blast Radius
- inferred — The direct behavioral change is to storage checks and reconciliation state for leading-slash artwork references, not to the authority of the storage checker. The extent to which untrusted users can write those references remains unverified.
Trust Boundaries and Controls
- observed — The exclusion prevents a bundled poster path from reaching the storage checker. Separately, the inspected bundled-image handler normalizes paths and rejects traversal before serving embedded assets; this does not establish validation at every poster write path.
-
Pre-merge checks: 
5
-
Full details: Linked Issues check
-
Explanation
Issue
#1131requires the artwork reconcile sweep to skip app-relative paths such as/images/collection-templates/<id>.jpg.artworkSweepSurface.cachedPredicatenow excludes paths that start with/. The shared predicate therefore excludes these paths from reconcile operations.TestArtworkReconcileSkipsBundledPostersDBverifies that storage does not receive the path, the sweep reports no error, and the row remains unchanged. The test is registered inscripts/ci/db-contracts.txt.
Full details: Out of Scope Changes check
-
Explanation
The production change is limited to artwork reconcile filtering. The database test, fake object checker, and CI registration directly support issue
#1131. The reported diff shows no unrelated production behavior or stored-data mutation.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 2 files. (1 skipped: 1 unsupported.)
Full details: Description check
-
Explanation
The pull request description directly explains the artwork reconciliation defect, the change to skip app-relative paths, the affected tests, and validation results. It is clearly related to the changeset.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
47a868f to
947aea7
Compare
This comment has been minimized.
This comment has been minimized.
|
Still needed on |
947aea7 to
a81b45f
Compare
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:
|
|
The admin Reconcile Artwork Cache task now completes and certifies storage instead of failing on bundled poster paths; add before-and-after screenshots of the same admin execution-history surface showing the failed and successful results, with the surface and build/commit for each capture. The PR body currently has no Evidence section. Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness. Posted via Macroscope — Visible change evidence |
a81b45f to
5cee6e0
Compare
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:
|
5cee6e0 to
268d71a
Compare
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:
|
268d71a to
0b86a57
Compare
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:
|
0b86a57 to
e45d560
Compare
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:
|
e45d560 to
168040d
Compare
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:
|
cc22728 to
ed45745
Compare
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:
|
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]>
…ulk 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]>
Quick104
left a comment
There was a problem hiding this comment.
🤖 T3 Code / Claude Code (claude-opus-5-5)
The fix itself holds up: every storage backend rejects a key that starts with /, the only writer of such paths is the collection-template default, and the count, probe, bulk reset and sweep all share cachedPredicate. One finding, on the regression test. I'm fixing it in a commit on this branch, so there's no need to change it yourself. I'm also rebasing the branch onto current main to clear the scripts/ci/db-contracts.txt conflict.
ed45745 to
5f36d1f
Compare
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:
|
|
🤖 T3 Code / Claude Code (claude-opus-5-5) Review summary, reviewed head 5f36d1f The branch was rewritten. It is rebased onto current Addressed
Checked and left as is
Remaining: nothing. Verification
Validated features: I couldn't check them. The validation board query failed for lack of project read access. The change only alters which rows the Reconcile Artwork Cache task checks and resets. It changes no API, playback or catalog read path, so the PR body's User manual: unaffected. The manual doesn't describe which rows the reconcile task checks. Apple/Android parity: not applicable. This is a server-only scheduled-task change with no client-visible API. Fit: 9/10 · Readiness: 9/10 — ready (assuming CI is green)
|
Requested by Tobechukwu Njoku
Problem
Closes #1131
Related issue: N/A
Validation tasks: none
Reconcile Artwork Cache fails on every run for any server with a collection that still points at a bundled template poster (
/images/collection-templates/<id>.jpg). The sweep sends that path to artwork storage,blobstore.ValidateKeyrejects it (keys can't start with/), and each such row counts as a sweep error. The task never finishes, and the storage identity is never certified.Collections keep that path when they were created before template posters were copied into storage, or when the copy did not happen (no artwork store at the time, or the bundled file could not be read or stored). Nothing rewrites those rows later, so the failure repeats until an admin replaces each poster by hand.
Approach
artworkSweepSurface.cachedPredicatealready skips empty values and provider URLs. It now also skips paths starting with/. A path like that can never be a valid storage key, on S3 or on local artwork storage, and elsewhere the server already treats one as an asset bundled with the frontend (serveBundledAssetin the compat image handler). The count, probe, bulk reset and per-row sweep all share this predicate, so they all skip these rows. The rows are left unchanged. Main's upload filter on the same predicate is kept, and uploaded images live underlocal/keys, so they are still checked.I considered making the per-row check treat
ErrInvalidKeyas "skip" rather than as an error. I didn't, because that would also hide genuinely corrupt keys, which should still show up as errors.Validation
TestArtworkReconcileSkipsBundledPostersDB(inartwork_reconcile_bulk_db_test.go) seeds a template collection with a bundled poster next to one with an ordinary cached poster, in an isolated schema, and runs thecollection posterssurface through both the verify sweep and the bulk reset. In each, only the cached key is checked, no sweep errors are recorded, and the template row keeps its URL, thumbhash andposter_from_template. It is listed inscripts/ci/db-contracts.txt. On the pre-fix base both subtests fail: the verify sweep checks the bundled path, and the bulk reset clears the template poster.-raceon a freshly migrated Postgres 18 database, andgo test ./internal/metadata/passes.go build ./internal/...,gofmt,go vetandmake lint-changedare clean.main(blobstore: invalid keyfor the bundled path in the log) and completes on this branch, leaving the poster path unchanged.make test-goon this base; CI runs the full suite.Evidence
Surface and build: Admin → Scheduled Tasks → Reconcile Artwork Cache, execution history, desktop web. Before:
mainc851bf4. After: this branch at 0b86a57. The production Go change is identical at the current head; later commits only rebased the branch and reworked the regression test. Both runs use the same local database with one collection holding a bundled template poster. In the after capture, the two failed runs are the earliermainruns; the completed run is this branch.Risks
None identified. The sweep now checks fewer rows. It changes no stored data, and nothing a path starting with
/refers to lives in artwork storage.Checklist
AI Disclosure
claude-opus-5-5) for Claude Code;gpt-6-astra(Max) andgpt-6.1-solfor Codex;gemini-3.8-flash-highfor Antigravityclaude-opus-5-5) in T3 Code rebased the branch onto currentmainand reworked the regression test to cover the bulk reset path in an isolated schema. A cross-provider review by Codex (gpt-6.1-sol) of the rebased change found no defects.mainseparately, without editing code. They covered the shared predicate in the count, probe, bulk reset and sweep paths, uploaded artwork, checkpoint resume and SQL construction, and Codex re-ran the focused tests with-raceon Postgres 18. Neither found a code defect. Both noted that the regression test returned before the sweep on a clean database; the test now seeds an ordinary cached poster so the sweep runs.Note
Skip app-relative paths in artwork reconcile sweep predicate
Extends
artworkSweepSurface.cachedPredicatein artwork_reconcile.go to also exclude paths beginning with/, so bundled app-relative artwork is not treated as cached during reconciliation sweeps or bulk resets. AddsTestArtworkReconcileSkipsBundledPostersDBin artwork_reconcile_bulk_db_test.go, which verifies both the sweep and bulk reset leave bundled poster URL, thumbhash, and template flag unchanged. Registers the test in db-contracts.txt.Macroscope summarized 5f36d1f.