{
 "use_case": "deposition",
 "title": "Deposition digest: two fictional depositions that disagree",
 "about": "Two short fictional deposition transcripts (page:line layout) from the same fictional case. The witnesses disagree about when the fall happened (2:15 pm against 11:30 am). The digest must cite page:line, find that contradiction, export to Markdown and end in a signed record that verifies.",
 "licence": "Fictional: written for Decosa, no real case or people. CC0.",
 "inputs": [
  {
   "file": "inputs/fictional-pruitt.txt",
   "what": "Deposition of Dana Pruitt (fictional), pp. 4-6, 25 numbered lines per page."
  },
  {
   "file": "inputs/fictional-okafor.txt",
   "what": "Deposition of Marcus Okafor (fictional), pp. 4-6."
  }
 ],
 "steps": [
  {
   "id": "parse",
   "method": "POST",
   "path": "/deposition/parse",
   "raw_file": "inputs/fictional-pruitt.txt",
   "content_type": "text/plain"
  },
  {
   "id": "digest",
   "method": "POST",
   "path": "/deposition/digest",
   "stream": "sse",
   "timeout": 240,
   "body": {
    "transcripts": [
     {
      "text": {
       "$file": "inputs/fictional-pruitt.txt"
      },
      "title": "Deposition of Dana Pruitt (fictional)",
      "cite_as": "Pruitt Dep.",
      "witnesses": [
       "Dana Pruitt"
      ]
     },
     {
      "text": {
       "$file": "inputs/fictional-okafor.txt"
      },
      "title": "Deposition of Marcus Okafor (fictional)",
      "cite_as": "Okafor Dep.",
      "witnesses": [
       "Marcus Okafor"
      ]
     }
    ]
   }
  },
  {
   "id": "export",
   "method": "GET",
   "path": "/deposition/digests/${digest.done.digest_id}/export?format=md",
   "as": "text"
  },
  {
   "id": "verify",
   "method": "POST",
   "path": "/record/verify",
   "auth": false,
   "body": {
    "$ref": "digest.lanes.record.data"
   }
  },
  {
   "id": "tampered",
   "method": "POST",
   "path": "/record/verify",
   "auth": false,
   "body": {
    "$ref": "digest.lanes.record.data"
   },
   "tamper": {
    "at": "entries[1].cite_as",
    "set": "Edited Dep."
   }
  }
 ],
 "checks": [
  {
   "says": "the transcript parses into 3 pages of numbered page:line lines",
   "path": "parse.pages",
   "equals": 3
  },
  {
   "says": "the parser recognises the numbered deposition layout",
   "path": "parse.layout",
   "equals": "numbered"
  },
  {
   "says": "the digest finishes without errors",
   "path": "digest.errors",
   "count": 0
  },
  {
   "says": "the digest has every lane: transcript, flags, digest, verifier, contradictions, record",
   "path": "digest.lanes",
   "has_keys": [
    "transcript",
    "flags",
    "digest",
    "verifier",
    "contradictions",
    "record"
   ]
  },
  {
   "says": "the time-of-fall contradiction (2:15 against 11:30) is found",
   "path": "digest.lanes.contradictions.data.pairs[verdict=INCONSISTENT]",
   "contains": [
    "2:15",
    "11:30"
   ]
  },
  {
   "says": "the Markdown export cites the depositions by page and line",
   "path": "export",
   "contains": "Pruitt Dep."
  },
  {
   "says": "the signed record verifies",
   "path": "verify.ok",
   "equals": true
  },
  {
   "says": "a record with one entry edited no longer verifies",
   "path": "tampered.ok",
   "equals": false
  },
  {
   "says": "every model call has a signed receipt",
   "receipts": "signed"
  }
 ]
}
