{
 "use_case": "eu-trial-lay-summary",
 "title": "Lay summary check: a side-effects section with one wrong count and one false claim",
 "about": "The ONWARDS 4 trial (NCT04880850, insulin icodec weekly vs insulin glargine daily) as posted on ClinicalTrials.gov, and a three-sentence side-effects section: the glargine count is right (25 of 291), the icodec count is wrong (23; the table says 22), and 'No one in the trial died' is false (the table has 2 and 1 deaths). The check must trace the right sentence to its cell and have the grounding judge support it, flag the wrong count with cell C114 as the nearest figure, flag the death claim against the table, and sign a record that verifies and fails once changed. Sources first come back with no model call.",
 "licence": "Study record: ClinicalTrials.gov NCT04880850 (US National Library of Medicine registry; results are facts reported by the sponsor, reproduced unchanged). Draft: written for this bundle (CC0). Part of decosa-api, AGPL-3.0-or-later.",
 "inputs": [
  {
   "file": "inputs/study.json",
   "what": "The ClinicalTrials.gov API v2 study record with posted results (fetched 26 Sep 2026)."
  },
  {
   "file": "inputs/draft.md",
   "what": "A three-sentence side-effects section with one wrong count and one false claim, citing results cells."
  }
 ],
 "steps": [
  {
   "id": "sources",
   "method": "POST",
   "path": "/laysummary/sources",
   "auth": false,
   "body": {
    "study": {
     "$file": "inputs/study.json"
    }
   }
  },
  {
   "id": "check",
   "method": "POST",
   "path": "/laysummary/check",
   "body": {
    "study": {
     "$file": "inputs/study.json"
    },
    "draft": {
     "$file": "inputs/draft.md"
    }
   }
  },
  {
   "id": "verify",
   "method": "POST",
   "path": "/record/verify",
   "auth": false,
   "body": {
    "record": {
     "$ref": "check.record"
    }
   }
  },
  {
   "id": "tampered",
   "method": "POST",
   "path": "/record/verify",
   "auth": false,
   "body": {
    "record": {
     "$ref": "check.record"
    }
   },
   "tamper": {
    "at": "record.statement.draft_sha256",
    "set": "0000000000000000000000000000000000000000000000000000000000000000"
   }
  }
 ],
 "checks": [
  {
   "says": "the results are read into cells with no model call, and the icodec serious side-effect count is cell C114 (22 of 291)",
   "path": "sources.cells[id=C114][0].raw",
   "equals": "22"
  },
  {
   "says": "the correct glargine sentence is traced to its cell and passes",
   "path": "check.sentences[0].status",
   "equals": "ok"
  },
  {
   "says": "the grounding judge supports it",
   "path": "check.sentences[0].grounding.verdict",
   "equals": "supported"
  },
  {
   "says": "the wrong icodec count (23) is flagged as a mismatch",
   "path": "check.sentences[1].numbers[0].status",
   "equals": "mismatch"
  },
  {
   "says": "with the table's own figure as the nearest",
   "path": "check.sentences[1].numbers[0].nearest.cell",
   "equals": "C114"
  },
  {
   "says": "'No one in the trial died' is flagged against the table",
   "path": "check.doc_flags.kind",
   "contains": "contradicts_table"
  },
  {
   "says": "the signed record verifies",
   "path": "verify.ok",
   "equals": true
  },
  {
   "says": "a record whose draft hash was changed no longer verifies",
   "path": "tampered.ok",
   "equals": false
  },
  {
   "says": "every model call has a signed receipt",
   "receipts": "signed",
   "min": 2
  }
 ]
}