Add the community metadata lookup (Phase 1.5) - #36
Merged
Merged
Conversation
New internal/meta package: a read-only client for the metaserve API
(meta.audiosilo.app) and a Service that composes a book's enrichment
envelope (work + matched recording + series rails, each entry carrying
its own web_url) from lookup -> works/{id} -> series/{id}, behind a
bounded in-memory TTL cache (24h positive / 1h not-found / 2min
transport-error; caller-cancelled requests are never cached so an
aborted fetch cannot poison a book with 502s).
GET /libraries/{id}/meta?path= resolves the book's asin/isbn (backfilled
via book_enrichment) through the service - authed and scope-checked like
item; no ids or no match -> 200 {"matched": false}; upstream down -> 502.
Config metadata.{enabled,base_url} (env AUDIOSILO_METADATA_*) defaults on
and is the one-key privacy off-switch; the /server capabilities map gains
"metadata". Frontend pair: audiosilo-frontend book-meta.
Simplification: unexport the metaserve client (package-internal), drop the dead Service.now field and unread upstream mirror fields, trim the base URL once. Review fixes: a partial envelope (a series rail lost to a transient upstream failure) is now short-cached (errorTTL) instead of held for the 24h positive TTL; the series fan-out is bounded by attempts rather than successes so odd upstream data cannot multiply outbound calls; compose runs under its own 15s deadline so a slow-but-alive upstream cannot eat the API's request budget - and that deadline firing under a live caller is cached like any upstream failure. The returned envelope is documented as shared/immutable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Server half of the Phase 1.5 pair (frontend: audiosilo-frontend
book-meta). Addsinternal/meta(metaserve client + enrichment composition + bounded TTL cache),GET /libraries/{id}/meta?path=, themetadata.{enabled,base_url}config section, and themetadatacapability flag. Tested incl. the allowed/denied scope pair and live end-to-end against a local metaserve. Seam documented in workspace CROSS-REPO.md §17.