{
 "use_case": "audio-drama-studio",
 "title": "Rehearsal: an original radio script, parsed, cast, gated, produced and credentialed",
 "about": "An original short radio drama (Night Shift at Weather Station Nine, written for Decosa) is parsed into roles, lines and cues; one role is cast with a fictional performer from the consent-ledger demo whose consent covers a different project, which must be refused; the suggested house cast must pass; the episode renders to the podcast spec with library music, and the file must meet the loudness spec, carry a C2PA credential that links every role to its consent entry, and come with a signed record that verifies.",
 "licence": "Original script written for Decosa (2026), free to reuse. Voices are stock Kokoro-82M voicepacks (Apache-2.0); music was rendered with ACE-Step 1.5 (MIT) through the music-gen-cleared path; sound effects are CC0 / public-domain recordings or generated by code. Part of decosa-api, AGPL-3.0-or-later.",
 "inputs": [
  {
   "file": "inputs/night-shift.txt",
   "what": "A radio-play script: NAME: line, (directions), [SFX: ...] and [MUSIC: ...] cues, two scenes, a phone voice and an off-mic voice."
  }
 ],
 "steps": [
  {
   "id": "parse",
   "method": "POST",
   "path": "/drama/parse",
   "body": {
    "script": {
     "$file": "inputs/night-shift.txt"
    }
   },
   "timeout": 300
  },
  {
   "id": "badcast",
   "method": "POST",
   "path": "/drama/cast",
   "body": {
    "parse": {
     "$ref": "parse.parse"
    },
    "cast": {
     "rosa": "id_demo-arthur-penhale"
    }
   }
  },
  {
   "id": "cast",
   "method": "POST",
   "path": "/drama/cast",
   "body": {
    "parse": {
     "$ref": "parse.parse"
    },
    "cast": {
     "$ref": "parse.cast"
    }
   }
  },
  {
   "id": "episode",
   "method": "POST",
   "path": "/drama/episodes",
   "expect_status": 202,
   "body": {
    "parse": {
     "$ref": "parse.parse"
    },
    "parse_id": {
     "$ref": "parse.parse_id"
    },
    "cast": {
     "$ref": "parse.cast"
    },
    "spec": "podcast",
    "music": {
     "mode": "library",
     "style": "victorian-mystery"
    },
    "title": "Night Shift at Weather Station Nine"
   }
  },
  {
   "id": "done",
   "method": "GET",
   "path": "/drama/episodes/${episode.episode_id}",
   "until": {
    "path": "status",
    "in": [
     "done",
     "failed",
     "refused"
    ]
   },
   "interval": 3,
   "max_wait": 900
  },
  {
   "id": "record",
   "method": "GET",
   "path": "/drama/records/${episode.episode_id}",
   "auth": false
  },
  {
   "id": "verify",
   "method": "POST",
   "path": "/record/verify",
   "auth": false,
   "body": {
    "record": {
     "$ref": "record"
    }
   }
  }
 ],
 "checks": [
  {
   "says": "the script is read as a radio play",
   "path": "parse.parse.parser",
   "equals": "screenplay"
  },
  {
   "says": "four roles: narrator, Rosa, Dispatch and Teo",
   "path": "parse.parse.stats.roles",
   "equals": 4
  },
  {
   "says": "twenty spoken lines",
   "path": "parse.parse.stats.lines",
   "equals": 20
  },
  {
   "says": "every sound cue maps to a library sound or a stop",
   "path": "parse.parse.stats.sfx_unmatched",
   "equals": 0
  },
  {
   "says": "the phone voice is marked as a phone effect",
   "path": "parse.parse.blocks[role=dispatch].effect",
   "all_in": [
    "phone"
   ]
  },
  {
   "says": "a fictional performer outside their consented project is refused",
   "path": "badcast.decisions[role=rosa].code",
   "contains": "project_not_in_scope"
  },
  {
   "says": "the suggested house cast is allowed for every role",
   "path": "cast.all_allowed",
   "truthy": true
  },
  {
   "says": "the episode renders",
   "path": "done.status",
   "equals": "done"
  },
  {
   "says": "every spoken line passed the consent gate (one signed decision per line)",
   "path": "done.decisions",
   "equals": 20
  },
  {
   "says": "integrated loudness within -16 LUFS +/- 1 dB",
   "path": "done.files[0].checks.lufs_in_range",
   "truthy": true
  },
  {
   "says": "true peak at most -1 dBTP",
   "path": "done.files[0].checks.true_peak_ok",
   "truthy": true
  },
  {
   "says": "the MP3 carries chapter markers",
   "path": "done.files[0].chapters_in_file",
   "min": 2
  },
  {
   "says": "the file carries a C2PA credential with the consent link",
   "path": "done.files[0].c2pa.consent_link",
   "truthy": true
  },
  {
   "says": "captions, transcript, chapters, show notes and the sides pack are delivered",
   "path": "done.documents.name",
   "contains": [
    "captions.vtt",
    "transcript.json",
    "chapters.json",
    "transcript.txt",
    "sides.zip",
    "record.json",
    "show-notes.md"
   ]
  },
  {
   "says": "the signed production record verifies",
   "path": "verify.ok",
   "truthy": true
  },
  {
   "says": "every model call is receipted and signed",
   "receipts": "signed",
   "min": 1,
   "ignore_prefix": [
    "cd_"
   ]
  }
 ]
}