Skip to content

Lock api.yaml v1.2.0 bulk-resolve-libraries contract for cross-cache-identity pivot#104

Merged
jakebromberg merged 2 commits into
mainfrom
feat/103-bulk-resolve-libraries-contract
May 10, 2026
Merged

Lock api.yaml v1.2.0 bulk-resolve-libraries contract for cross-cache-identity pivot#104
jakebromberg merged 2 commits into
mainfrom
feat/103-bulk-resolve-libraries-contract

Conversation

@jakebromberg

Copy link
Copy Markdown
Member

Summary

Per the cross-cache-identity architecture pivot (WXYC/Backend-Service#800, 2026-05-09), Backend stops composing cross-cache identity from multiple PG schemas; LML becomes the sole composer. This PR locks the HTTP contract for the new seam: POST /api/v1/identity/bulk-resolve-libraries.

  • 7 new schemas under the BulkResolve* prefix (request, response, provenance, per-track identity)
  • 1 new endpoint
  • 1 new security scheme (LMLBearerAuth) — distinct from BearerAuth (Better Auth JWT); LML uses a static LML_API_KEY bearer
  • Reuses existing ReconciledIdentity, IdentitySource, IdentityMethod, CacheStats, ApiErrorResponse
  • info.version bumped 1.1.0 → 1.2.0; no breaking changes (additions only)

Contract shape

Request is uniform: {library_id, artist_name, album_title} — LML auto-detects V/A from library_id and discriminates the response. Three response kinds: single_artist | compilation | unresolved. Compilation results carry per-track identity in tracks[]. Provenance always returned (empty array if no source resolved).

Full V/A track matcher behaviour ships under WXYC/library-metadata-lookup#271.

Test plan

  • npm run generate:typescript — regenerated, clean
  • npm run generate:python — pydantic models regenerated, clean
  • npm test — 391/391 across 12 suites
  • npm run lint — clean
  • npm run check:breaking — no breaking changes detected

Downstream

This contract unblocks:

Closes #103

…identity pivot

Per the cross-cache-identity architecture pivot (WXYC/Backend-Service#800, 2026-05-09), Backend stops composing cross-cache identity from multiple PG schemas; LML becomes the sole composer. This commit locks the HTTP contract for the new seam: POST /api/v1/identity/bulk-resolve-libraries.

Adds 7 schemas (BulkResolveLibrariesRequest, BulkResolveInput, BulkResolveResultKind, BulkResolveProvenanceEntry, BulkResolveTrackIdentity, BulkResolveResult, BulkResolveLibrariesResponse), 1 endpoint, 1 security scheme (LMLBearerAuth, distinct from BearerAuth which is Better Auth JWT). Reuses ReconciledIdentity, IdentitySource, IdentityMethod, CacheStats, ApiErrorResponse for cross-spec consistency.

Request shape is uniform per #103: {library_id, artist_name, album_title}. LML auto-detects V/A from library_id and returns a kind discriminator on the response (single_artist | compilation | unresolved). Provenance always returned (empty array if no source resolved); no optional knobs. Compilation results carry per-track identity in tracks[]; full V/A matcher behaviour ships under WXYC/library-metadata-lookup#271.

info.version bumped 1.1.0 to 1.2.0. No breaking changes (additions only).
…confidence, add examples

Three changes from the PR review pass:

- BulkResolveResult.tracks: drop `nullable: true`. The field is optional (not in `required`), so consumers see two states (present-array or absent) rather than three (null, [], [...]). Description updated to match.

- BulkResolveProvenanceEntry.confidence: make nullable. When `external_id` is NULL (source ran but produced no candidate), confidence is undefined, not zero. Description updated to document the coupling: confidence is NULL iff external_id is NULL.

- Added `example:` to BulkResolveLibrariesRequest and BulkResolveLibrariesResponse showing all three response kinds (single_artist with cross-source agreement, compilation with one resolved track, unresolved with a source that ran but found no match). Makes the contract concrete for LML#272 / BS#802 implementers.
@jakebromberg jakebromberg merged commit 01f7f26 into main May 10, 2026
2 checks passed
@jakebromberg jakebromberg deleted the feat/103-bulk-resolve-libraries-contract branch May 10, 2026 17:07
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.

api.yaml v0.7 — POST /api/v1/identity/bulk-resolve-libraries schema

1 participant