Commit graph

12 commits

Author SHA1 Message Date
Deluan
947eb5de85 feat(artwork): explain disc and media file artwork from the CLI
`artwork explain` rejected `dc` and `mf` because it validated against RecheckKinds,
the list of kinds the backfill revisits. Those are different questions: a kind with no
recheck path still has artwork someone can report as wrong.

Disc artwork now walks DiscArtPriority under a trace, so explain reports which entry won
and why the others lost, including entries that map to no source at all (external is
unsupported, a disc with no subtitle, an album folder with no images). Media file artwork
traces its single embedded candidate, separating "EnableMediaFileCoverArt is off" from
"the track has no embedded art" — stored state cannot tell those apart.

Each command now validates against the kinds it can actually serve: explain takes all six,
refresh takes artwork.RefreshableKinds (which nativeapi now shares instead of keeping its
own copy), reprocess still takes RecheckKinds. Disc artwork stays out of refresh: the
worker cannot resolve it, so the queue row would be rejected on every drain.

WalksPriorityChain becomes Explainable, and ResolveArtist/ResolveAlbum collapse into
Resolve(kind, id).
2026-08-14 18:20:31 -04:00
Deluan
b04d0c42cc refactor(artwork): own the kind list and the chain predicate in the package
Export RecheckKinds and add WalksPriorityChain so the CLI stops keeping its
own copies of both, and unexport externalCandidate, which nothing outside the
package consumes.
2026-08-14 15:22:37 -04:00
Deluan
8e1ed55ca6 refactor(artwork): export the trace types directly
ChainTrace and TraceStep were unexported types re-exported through aliases,
which existed only so the CLI had a name to refer to them by. The types are
public API — Resolver.Steps returns []TraceStep and the CLI constructs a
ChainTrace — so name them that way and drop the indirection.

Encapsulation is unchanged: add, mu and steps stay unexported, so only this
package can write a step.
2026-08-14 15:13:55 -04:00
Deluan
ceb0be482e refactor(artwork): make the trace nil-safe in one place only
add already handles a nil trace, so record's own guard was dead; Steps was the
odd one out and would panic where every other method tolerates nil.
2026-08-14 15:13:55 -04:00
Deluan
cf2b4df36b refactor(artwork): drop the unreachable breaker branch from the tracing gate
--live wires the tracing gate straight to passthroughGate, so errBreakerOpen can
never reach it; the test only passed by injecting a fake gate.
2026-08-14 15:13:55 -04:00
Deluan
a1b9976521 refactor(artwork): export the trace outcome vocabulary
The CLI hardcoded the outcome literals and the "external:" prefix, so renaming a
constant's value in core/artwork left cmd compiling and the suite green while
`artwork explain` silently degraded its verdict.

Renaming a value now fails the golden vocabulary test in core/artwork and the
explainResult tests in cmd.
2026-08-14 15:13:55 -04:00
Deluan
e3c78a9cb1 feat(artwork): expose a tracing resolver for the CLI 2026-08-14 15:13:55 -04:00
Deluan
90a7cb4706 feat(artwork): trace external agents at the gate seam 2026-08-14 15:13:55 -04:00
Deluan
fe67ec68d0 refactor(artwork): report never-evaluated candidates as skipped 2026-08-14 15:13:55 -04:00
Deluan
62eb781e8d fix(artwork): record priority candidates the chain never evaluated 2026-08-14 15:13:55 -04:00
Deluan
4bad716e0b feat(artwork): trace the local priority chain 2026-08-14 15:13:54 -04:00
Deluan
bda549f8a8 feat(artwork): add a resolution chain trace collector 2026-08-14 15:13:54 -04:00