{
 "use_case": "interview-themes",
 "title": "Two public-domain interviews coded against an approved codebook: themes, checked quotes and a signed record",
 "about": "The first two interviews of the hosted sample study (NASA's Houston We Have a Podcast, first 21 minutes of episodes 407 and 409, transcribed with speakers separated) and the study's approved 10-code codebook. The coder must code participant talk only, every theme quote must be word for word in a participant's turn, a draft codebook must be refused, and the signed record must verify and fail when changed.",
 "licence": "Interview audio and NASA's transcripts are US government works (public domain in the US, 17 U.S.C. 105). The transcripts here are Decosa's machine transcription of that audio; the codebook was proposed by Decosa's tool and renamed by us. Part of decosa-api, AGPL-3.0-or-later.",
 "inputs": [
  {
   "file": "inputs/interviews.json",
   "what": "Two interviews as the tool's transcript turns (speaker, role, start, end, text)."
  },
  {
   "file": "inputs/codebook.json",
   "what": "The sample study's approved codebook (10 codes)."
  },
  {
   "file": "inputs/codebook-draft.json",
   "what": "The same codebook, not yet approved."
  }
 ],
 "steps": [
  {
   "id": "analyze",
   "method": "POST",
   "path": "/themes/analyze",
   "stream": "sse",
   "timeout": 600,
   "body": {
    "interviews": {
     "$file": "inputs/interviews.json"
    },
    "codebook": {
     "$file": "inputs/codebook.json"
    },
    "question": "How do people who work in human spaceflight describe the challenges and rewards of their work?"
   }
  },
  {
   "id": "draft",
   "method": "POST",
   "path": "/themes/analyze",
   "expect_status": 400,
   "body": {
    "interviews": {
     "$file": "inputs/interviews.json"
    },
    "codebook": {
     "$file": "inputs/codebook-draft.json"
    }
   }
  },
  {
   "id": "verify",
   "method": "POST",
   "path": "/record/verify",
   "auth": false,
   "body": {
    "record": {
     "$ref": "analyze.events[type=result][0].record"
    }
   }
  },
  {
   "id": "tampered",
   "method": "POST",
   "path": "/record/verify",
   "auth": false,
   "body": {
    "record": {
     "$ref": "analyze.events[type=result][0].record"
    }
   },
   "tamper": {
    "at": "record.statement.title",
    "set": "changed"
   }
  }
 ],
 "checks": [
  {
   "says": "at least 40 passages of participant talk were coded",
   "path": "analyze.events[type=result][0].units",
   "count_min": 40
  },
  {
   "says": "no passage comes from the interviewer or another voice",
   "path": "analyze.events[type=result][0].units.speaker",
   "all_in": [
    "S1"
   ]
  },
  {
   "says": "at least three themes",
   "path": "analyze.events[type=result][0].themes",
   "count_min": 3
  },
  {
   "says": "every quote of the first theme is word for word in a participant's turn",
   "path": "analyze.events[type=result][0].themes[0].quotes.ok",
   "all_in": [
    true
   ]
  },
  {
   "says": "a draft codebook is refused",
   "path": "draft.error",
   "contains": "approve"
  },
  {
   "says": "the signed record verifies",
   "path": "verify.ok",
   "equals": true
  },
  {
   "says": "a changed record fails",
   "path": "tampered.ok",
   "equals": false
  },
  {
   "says": "every model call has a signed receipt",
   "receipts": "signed",
   "min": 5
  }
 ]
}