docs(adr): ADR-0031 — canonical curator-assigned song identity (schema v10) - #157
Conversation
…a v10) Proposes the Phase-1 prerequisite the reachability-lab Phase 0 audit named: a canonical song identity so song-level holdout (and the benchmark's source-identity splits) is implementable fail-closed. Decision: add an optional, curator-assigned SourceRef.song_id: Option<SongId> (schema v10) at the Work level — griff already has the Manifestation level (SourceRef.sha256, v9) and the span level (EnsembleRef, v4). Follows the established optional-field, forward-compatible pattern (pre-v10 records load as None, round-trip byte-identically). Curator-assigned, never content-derived (like rights v7); groups files that are the same composition for leakage-safe holdout only — no cover-detection, arrangement-equivalence, or production- scoring claim. HoldoutTargetSong requires song_id and fails closed without it. Status: Proposed — binds nothing until accepted; implementation is a separate red->green slice (characterization tests first, SPEC hard rule 5). Prior art (FRBR, MusicBrainz Work/ISWC) surveyed in decisions.log. ADR index + the #154 audit's Phase-1-prerequisite note back-reference the ADR. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012T7SRMiXmZe5v1imtrKMPi
|
Warning Review limit reached
Next review available in: 51 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughChangesCanonical song identity
Estimated code review effort: 1 (Trivial) | ~4 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7837533019
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - `HoldoutTargetSong` — requires `song_id`; a record without it **cannot** be | ||
| song-held-out and is a typed refusal in that mode (or is migrated), never a | ||
| basename/title fallback. A song holdout excludes every chunk whose source | ||
| carries the target `song_id`. |
There was a problem hiding this comment.
Enforce corpus-wide song-ID coverage for song holdout
When the target has a song_id but an alternate transcription of that composition is a pre-v10 or uncurated record with song_id = None, the specified equality filter retains that record and leaks the held-out song into the corpus. Refusing only a target that lacks an ID therefore does not make the experiment fail-closed; song-holdout mode must also reject, migrate, or exclude every participating source with unknown identity (and validate the corpus-wide mapping) before material construction.
Useful? React with 👍 / 👎.
… (Codex) Codex P1: refusing only a target that lacks song_id is not fail-closed. An alternate transcription of the target composition that is a pre-v10 / uncurated record (song_id = None) would be silently retained by an equality filter, re-leaking the held-out song. Strengthen the HoldoutTargetSong contract: it requires song_id COVERAGE over the corpus and additionally excludes (or refuses on) every source with song_id = None before material construction — an unidentified record cannot be proven not to be an alternate of the target, so it must not remain; the manifest `songs` cross-check validates coverage. Consequences note aligned. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012T7SRMiXmZe5v1imtrKMPi
|
@codex — accepted, sharp catch. Fixed in You're right: guarding only the target isn't fail-closed. An alternate transcription of the target composition that is a pre-v10 / uncurated record ( Strengthened the Still a Proposed, docs-only ADR (binds nothing); the schema-v10 implementation will carry this contract into its red→green tests. Not merging without an explicit human GO. |
Review OutcomeThe requested P1 feedback is already fully addressed in commit
No further code or documentation changes were necessary, so I did not create another commit or pull request. Testing
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/adr/0031-canonical-song-identity.md`:
- Around line 68-78: Clarify the cover-version rule in the ADR section
describing song_id scope: either remove the curator override and require all
composition-sharing covers to use the same song_id, or define the exact
conditions for assigning a different ID and the required rationale field or
schema location. Ensure holdout grouping remains deterministic and does not
depend on an undocumented musical-similarity judgment.
In `@docs/audit/2026-07-generator-reachability-metric-inventory.md`:
- Around line 208-210: Align the audit’s holdout eligibility contract with
ADR-0031 by replacing canonical_song_id with the ADR-defined SourceRef.song_id
name, unless an intentional projection rename is required; in that case,
explicitly document the mapping and identify the authoritative source of truth.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 8f3a7c34-c255-495f-af1c-404218772bcb
📒 Files selected for processing (4)
docs/adr/0031-canonical-song-identity.mddocs/adr/README.mddocs/audit/2026-07-generator-reachability-metric-inventory.mddocs/decisions.log.md
…ge, corpus invariants, unify song_id (arbiter) Four arbiter findings: 1. Cover override destroyed Work identity. Removed it: every manifestation / arrangement / edition / cover of one composition MUST share one song_id; musical/arrangement distinctness never changes Work identity. Splitting expressions/arrangements is a separate arrangement_id/expression_id or an explicit split policy, not an override on song_id. 2. Naming mismatch. The audit's eligibility DTO used canonical_song_id; unified to song_id everywhere, copied verbatim from the authoritative SourceRef.song_id (ADR-0031). 3. Coverage contract underdefined. Initial contract is now strict refusal: HoldoutTargetSong preflight MUST refuse the run when any participating unique source lacks song_id. Conservative exclusion of all None is a separate, explicitly versioned policy (it shrinks the corpus / changes population). 4. SHA-to-SongId invariants added: (1) all chunks sharing a sha256 carry the same song_id (else split song_id per chunk re-introduces chunk-level leakage); (2) no sha256 maps to two SongIds; (3) manifest<->song_id agree both ways. Manifest is a convenience/typo check, not the coverage proof — coverage is proven by the preflight scan. Still a Proposed docs-only ADR; binds nothing. Implementation carries these contracts into its red->green tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012T7SRMiXmZe5v1imtrKMPi
|
All four accepted and fixed in
Still a Proposed docs-only ADR (binds nothing); the schema-v10 implementation will carry these contracts into its red→green tests. Not merging without an explicit human GO. |
…ult (arbiter) The Decision set the default HoldoutTargetSong policy to strict refusal (refuse the run when any participating source lacks song_id; exclusion of unknown sources is a separate versioned policy), but a Consequences bullet still said a run "excludes every such record" — leaving two normative answers. Rewrote the bullet to the strict-refusal default, with conservative exclusion permitted only under the separate versioned policy. Decision and Consequences now agree. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012T7SRMiXmZe5v1imtrKMPi
|
Fixed in The Consequences "out of scope" bullet still said a
So Decision and Consequences now give one normative answer: default = refuse; exclusion = separate versioned policy. Verified the ADR has no other stale "exclude the None records and continue" wording (the remaining Docs-only; head is now |
What
ADR-0031 proposes a canonical song identity for the corpus — the Phase-1 prerequisite the Generator Reachability Lab Phase 0 audit (#154) named: without it, song-level holdout is not implementable fail-closed (two transcriptions of one song have different
sha256, so a "song holdout" silently keeps one and excludes the other), which also weakens the human-similarity benchmark's "split by source identity" law (#153).Docs-only; Status: Proposed — binds nothing until accepted (
docs/adr/README.md). Implementation is a separate red→green slice once accepted.The decision
Add an optional, curator-assigned
SourceRef.song_id: Option<SongId>(schema v10) at the Work level:SourceRef.sha256, v9) and the span level (EnsembleRef, v4) — this adds the missing Work (composition) level above them.rightsv7,EnsembleRefv4,sha256v9): pre-v10 records load asNoneand round-trip byte-identically.HoldoutTargetSongrequiressong_id; a record without it can't be song-held-out (typed refusal / migrate), never a basename/title fallback.Prior art
Surveyed in
decisions.log.md(prior-art-first rule): FRBR (Work → Expression → Manifestation → Item) and MusicBrainz (Work ↔ Recording ↔ Release, ISWC work code) — both separate the abstract work from its manifestations.SongIdis the Work level; no external id scheme (ISWC/MBID) is adopted as the stored value.Also
docs/adr/README.md— index row 0031.docs/decisions.log.md— prior-art Y-statement.…-metric-inventory.md§3 — back-reference to the ADR from the Phase-1-prerequisite note.Docs-only → CI (Rust-only) green. Not merging without an explicit human GO.
🤖 Generated with Claude Code
https://claude.ai/code/session_012T7SRMiXmZe5v1imtrKMPi
Summary by CodeRabbit