{
 "use_case": "collections-call-qa",
 "title": "Collections call QA: a first collection call and its 8-call log",
 "about": "Nine script lines (twelve diarized segments) of a role-played first collection call and the account call log. The agent threatens the sheriff; the log has 8 counted calls in 7 days and one call at 7:10 a.m. in the mobile number's time zone (Denver). All three must be flagged, the call-log findings must also come back with no model call, and the signed record must verify with a three-year retention date.",
 "licence": "Synthetic role-play written from 12 CFR part 1006: Harbor Ridge Recovery, Brightwater Card Company and every person are fictional; phone numbers are in the 555-01xx fiction range. Audio spoken by Decosa house voices (Kokoro-82M stock voicepacks, Apache-2.0), each allowed by the consent ledger for project decosa-collections-demo; the segments are the diarizer output with its errors kept. Part of decosa-api, AGPL-3.0-or-later.",
 "inputs": [
  {
   "file": "inputs/segments.json",
   "what": "The diarized call: a list of {start, end, speaker, text} (or send plain text as transcript)."
  },
  {
   "file": "inputs/call-log.json",
   "what": "The account call log: account, the consumer's time zones and numbers, every call with its time and result, and which call was recorded."
  },
  {
   "file": "inputs/consent.json",
   "what": "How recording consent was obtained."
  },
  {
   "file": "inputs/speakers.json",
   "what": "Speaker labels to roles."
  }
 ],
 "links": [
  {
   "url": "/samples/cq-tb1-showcase.m4a",
   "what": "The audio this transcript came from (optional)."
  }
 ],
 "steps": [
  {
   "id": "qa",
   "method": "POST",
   "path": "/collections/check",
   "body": {
    "segments": {
     "$file": "inputs/segments.json"
    },
    "call_log": {
     "$file": "inputs/call-log.json"
    },
    "consent": {
     "$file": "inputs/consent.json"
    },
    "speakers": {
     "$file": "inputs/speakers.json"
    },
    "title": "Rehearsal: HRR-1201 (fictional)"
   }
  },
  {
   "id": "log",
   "method": "POST",
   "path": "/collections/log",
   "body": {
    "call_log": {
     "$file": "inputs/call-log.json"
    }
   }
  },
  {
   "id": "noconsent",
   "method": "POST",
   "path": "/collections/check",
   "expect_status": 400,
   "body": {
    "segments": {
     "$file": "inputs/segments.json"
    },
    "call_log": {
     "$file": "inputs/call-log.json"
    }
   }
  },
  {
   "id": "verify",
   "method": "POST",
   "path": "/record/verify",
   "auth": false,
   "body": {
    "record": {
     "$ref": "qa.record"
    }
   }
  },
  {
   "id": "tampered",
   "method": "POST",
   "path": "/record/verify",
   "auth": false,
   "body": {
    "record": {
     "$ref": "qa.record"
    }
   },
   "tamper": {
    "at": "record.statement.flags",
    "set": 0
   }
  }
 ],
 "checks": [
  {
   "says": "at least six call checks ran",
   "path": "qa.checklist[basis=call]",
   "count_min": 6
  },
  {
   "says": "every call check got a typed answer",
   "path": "qa.checklist[basis=call][answer=null]",
   "count": 0
  },
  {
   "says": "the planted sheriff threat is flagged",
   "path": "qa.checklist[id=false_misleading][0].status",
   "equals": "flag"
  },
  {
   "says": "the threat flag points at a time in the recording",
   "path": "qa.checklist[id=false_misleading][0].at",
   "exists": true
  },
  {
   "says": "8 counted calls in 7 days are flagged",
   "path": "qa.checklist[id=freq_7in7][0].max_in_7_days",
   "equals": 8
  },
  {
   "says": "the 7:10 a.m. call in the Denver zone is flagged",
   "path": "qa.checklist[id=calling_hours][0].status",
   "equals": "flag"
  },
  {
   "says": "the log-only route flags the same two findings with no model call",
   "path": "log.items[status=flag].id",
   "all_in": [
    "freq_7in7",
    "calling_hours"
   ]
  },
  {
   "says": "a check without a consent statement is refused",
   "path": "noconsent.error",
   "contains": "consent is required"
  },
  {
   "says": "the record keeps the recording three years after the call",
   "path": "qa.retain_until",
   "equals": "2029-03-08"
  },
  {
   "says": "the signed record verifies",
   "path": "verify.ok",
   "equals": true
  },
  {
   "says": "a record with its flag count changed no longer verifies",
   "path": "tampered.ok",
   "equals": false
  },
  {
   "says": "every model call has a signed receipt",
   "receipts": "signed",
   "min": 2
  }
 ]
}