Skip to content

Add the community metadata lookup (Phase 1.5) - #36

Merged
KodeStar merged 2 commits into
mainfrom
meta-lookup
Jul 11, 2026
Merged

Add the community metadata lookup (Phase 1.5)#36
KodeStar merged 2 commits into
mainfrom
meta-lookup

Conversation

@KodeStar

Copy link
Copy Markdown
Owner

Server half of the Phase 1.5 pair (frontend: audiosilo-frontend book-meta). Adds internal/meta (metaserve client + enrichment composition + bounded TTL cache), GET /libraries/{id}/meta?path=, the metadata.{enabled,base_url} config section, and the metadata capability 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.

KodeStar added 2 commits July 11, 2026 23:02
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.
@KodeStar
KodeStar merged commit 66fa8d5 into main Jul 11, 2026
2 checks passed
@KodeStar
KodeStar deleted the meta-lookup branch July 11, 2026 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant