Lock api.yaml v1.2.0 bulk-resolve-libraries contract for cross-cache-identity pivot#104
Merged
Merged
Conversation
…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.
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.
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.BulkResolve*prefix (request, response, provenance, per-track identity)LMLBearerAuth) — distinct fromBearerAuth(Better Auth JWT); LML uses a staticLML_API_KEYbearerReconciledIdentity,IdentitySource,IdentityMethod,CacheStats,ApiErrorResponseinfo.versionbumped 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 fromlibrary_idand discriminates the response. Three response kinds:single_artist | compilation | unresolved. Compilation results carry per-track identity intracks[]. 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, cleannpm run generate:python— pydantic models regenerated, cleannpm test— 391/391 across 12 suitesnpm run lint— cleannpm run check:breaking— no breaking changes detectedDownstream
This contract unblocks:
Closes #103