{
 "use_case": "grounding",
 "title": "Grounding check: a support answer against a product manual",
 "about": "A support answer about a fictional thermostat, checked sentence by sentence against its manual. Two claims conflict with the manual (battery life, 240 V heaters), so the gate must block it, and the signed report must verify and catch a changed verdict.",
 "licence": "Synthetic: a fictional product (Halden T3) and manual written for Decosa, no real people or products. Part of decosa-api, AGPL-3.0-or-later.",
 "inputs": [
  {"file": "inputs/answer.txt", "what": "The text to check (swap in your own draft later)."},
  {"file": "inputs/sources.json", "what": "The sources it must rest on: a list of {title, text}."},
  {"file": "inputs/question.txt", "what": "The question the answer replies to (optional)."}
 ],
 "steps": [
  {"id": "check", "method": "POST", "path": "/grounding/check",
   "body": {"text": {"$file": "inputs/answer.txt"}, "sources": {"$file": "inputs/sources.json"}, "question": {"$file": "inputs/question.txt"}}},
  {"id": "verify", "method": "POST", "path": "/grounding/verify", "auth": false,
   "body": {"report": {"$ref": "check.report"}, "text": {"$file": "inputs/answer.txt"}, "sources": {"$file": "inputs/sources.json"}}},
  {"id": "tampered", "method": "POST", "path": "/grounding/verify", "auth": false,
   "body": {"report": {"$ref": "check.report"}},
   "tamper": {"at": "report.sentences[verdict=contradicted].verdict", "set": "supported"}}
 ],
 "checks": [
  {"says": "the claims gate blocks the answer", "path": "check.decision", "equals": "block"},
  {"says": "every claim sentence got a verdict (none errored)", "path": "check.sentences[verdict=error]", "count": 0},
  {"says": "the battery-life sentence is contradicted or not backed", "path": "check.sentences[text~two years][0].verdict", "in": ["contradicted", "unsupported", "partial"]},
  {"says": "the 240 V heater sentence is contradicted or not backed", "path": "check.sentences[text~240 V][0].verdict", "in": ["contradicted", "unsupported", "partial"]},
  {"says": "the factory-reset sentence is supported", "path": "check.sentences[text~factory settings][0].verdict", "equals": "supported"},
  {"says": "the signed report verifies against the same text and sources", "path": "verify.valid_signature", "equals": true},
  {"says": "the verified report matches the text", "path": "verify.text_matches", "not_equals": false},
  {"says": "the verified report matches the sources", "path": "verify.sources_match", "not_equals": false},
  {"says": "a report with one verdict changed no longer verifies", "path": "tampered.valid_signature", "equals": false},
  {"says": "every model call has a signed receipt", "receipts": "signed"}
 ]
}
