{
 "use_case": "music-gen-cleared",
 "title": "Rights-cleared music: the prompt guard and the similarity check",
 "about": "Three music briefs and two audio files. A brief naming an artist must be refused by code with no model call, the same brief in strip mode must come back with the name removed, a brief that describes an artist without naming it must be refused by the typed judgment, and an original brief must be allowed with a signed receipt. A pitch-shifted copy of a catalogue track must be flagged as a near-copy of that track and a synthetic tone must come back clear. No render: renders take about a minute of shared GPU and the runner cannot yet poll a queued job, so the certificate (and its tamper check) is exercised in the hosted demo, not here.",
 "licence": "Prompts: written for Decosa (CC0). near-copy-breeze-funk-pitch-up-2.mp3: \"Breeze Funk\" by Malaventura, Free Music Archive (fma_small, track 113025), Public Domain Mark 1.0, pitch-shifted +2 semitones for the Decosa eval. original-tone.wav: synthetic tones generated by code (CC0).",
 "inputs": [
  {
   "file": "inputs/prompt-original.txt",
   "what": "An original brief: genre, mood, tempo, instruments, no names. Your own briefs go here."
  },
  {
   "file": "inputs/prompt-named-artist.txt",
   "what": "A brief that names a living artist (sent twice: refuse mode and strip mode)."
  },
  {
   "file": "inputs/prompt-described-artist.txt",
   "what": "A brief that points at an artist without naming them."
  },
  {
   "file": "inputs/near-copy-breeze-funk-pitch-up-2.mp3",
   "what": "A planted near-copy of a catalogue track (30 s MP3). Swap in any track you want triaged: WAV, MP3, FLAC or OGG up to 20 MB."
  },
  {
   "file": "inputs/original-tone.wav",
   "what": "12 s of synthetic tones that resemble nothing in the catalogue."
  }
 ],
 "steps": [
  {
   "id": "named",
   "method": "POST",
   "path": "/music/guard",
   "body": {
    "prompt": {
     "$file": "inputs/prompt-named-artist.txt"
    },
    "mode": "refuse"
   }
  },
  {
   "id": "stripped",
   "method": "POST",
   "path": "/music/guard",
   "body": {
    "prompt": {
     "$file": "inputs/prompt-named-artist.txt"
    },
    "mode": "strip"
   }
  },
  {
   "id": "described",
   "method": "POST",
   "path": "/music/guard",
   "body": {
    "prompt": {
     "$file": "inputs/prompt-described-artist.txt"
    },
    "mode": "strip"
   }
  },
  {
   "id": "original",
   "method": "POST",
   "path": "/music/guard",
   "body": {
    "prompt": {
     "$file": "inputs/prompt-original.txt"
    },
    "mode": "refuse"
   }
  },
  {
   "id": "near_copy",
   "method": "POST",
   "path": "/music/check",
   "raw_file": "inputs/near-copy-breeze-funk-pitch-up-2.mp3",
   "content_type": "application/octet-stream"
  },
  {
   "id": "tone",
   "method": "POST",
   "path": "/music/check",
   "raw_file": "inputs/original-tone.wav",
   "content_type": "application/octet-stream"
  }
 ],
 "checks": [
  {
   "says": "the named-artist brief is refused",
   "path": "named.guard.allowed",
   "equals": false
  },
  {
   "says": "the refusal comes from the code rules, with no model call",
   "path": "named.guard.decided_by",
   "equals": "code"
  },
  {
   "says": "no model call is spent on the named-artist refusal",
   "path": "named.receipts",
   "count": 0
  },
  {
   "says": "in strip mode the named-artist brief comes back as stripped, not refused",
   "path": "stripped.guard.decision",
   "equals": "stripped"
  },
  {
   "says": "in strip mode the artist's name is removed from the prompt that would be rendered",
   "path": "stripped.guard.rendered_prompt",
   "not_contains": "Taylor Swift"
  },
  {
   "says": "the described-but-unnamed artist is refused",
   "path": "described.guard.allowed",
   "equals": false
  },
  {
   "says": "the original brief is allowed",
   "path": "original.guard.allowed",
   "equals": true
  },
  {
   "says": "the original brief's check has a model receipt",
   "path": "original.receipts",
   "count_min": 1
  },
  {
   "says": "the pitch-shifted copy is flagged as a near-copy",
   "path": "near_copy.verdict",
   "equals": "near_copy"
  },
  {
   "says": "its closest catalogue match is the track it was copied from (Breeze Funk)",
   "path": "near_copy.top[0].id",
   "equals": "fma-113025"
  },
  {
   "says": "the synthetic tone is clear of the catalogue",
   "path": "tone.verdict",
   "equals": "clear"
  },
  {
   "says": "every model call has a signed receipt",
   "receipts": "signed"
  }
 ]
}
