{
 "use_case": "code",
 "title": "Private code assistant: one coding request with a signed receipt",
 "about": "One short coding request (a merge_intervals function with a docstring and three doctests) sent to the OpenAI-compatible chat route. The answer must hold the function and its doctests, and the call must carry a receipt that is public at /receipts/{id} and whose checks all pass. There is no verify route for a single completion, so there is no tamper step; the receipt's own checks are the proof.",
 "licence": "Synthetic: a coding prompt written for Decosa (the nightly smoke check's prompt). No real code base or people. Part of decosa-api, AGPL-3.0-or-later.",
 "inputs": [
  {
   "file": "inputs/prompt.txt",
   "what": "The coding request, as plain text (swap in a real task from your own code base later; it is sent as the user message)."
  }
 ],
 "steps": [
  {
   "id": "chat",
   "method": "POST",
   "path": "/v1/chat/completions",
   "timeout": 90,
   "body": {
    "model": "qwen3.8-27b",
    "max_tokens": 400,
    "temperature": 0.2,
    "chat_template_kwargs": {
     "enable_thinking": false
    },
    "messages": [
     {
      "role": "user",
      "content": {
       "$file": "inputs/prompt.txt"
      }
     }
    ]
   }
  },
  {
   "id": "receipt",
   "method": "GET",
   "path": "/receipts/${chat.receipt.id}",
   "auth": false
  }
 ],
 "checks": [
  {
   "says": "the answer defines merge_intervals",
   "path": "chat.choices[0].message.content",
   "contains": "def merge_intervals"
  },
  {
   "says": "the answer carries doctests",
   "path": "chat.choices[0].message.content",
   "contains": ">>> merge_intervals("
  },
  {
   "says": "the answer finished within the token limit",
   "path": "chat.choices[0].finish_reason",
   "equals": "stop"
  },
  {
   "says": "the route reports token usage",
   "path": "chat.usage.completion_tokens",
   "min": 1
  },
  {
   "says": "the answer carries a signed (hosted) or attested (self-hosted) receipt",
   "path": "chat.receipt.status",
   "in": [
    "signed",
    "attested"
   ]
  },
  {
   "says": "the receipt is public at /receipts/{id}",
   "path": "receipt.status",
   "in": [
    "signed",
    "attested"
   ]
  },
  {
   "says": "the public receipt lists its checks",
   "path": "receipt.checks",
   "count_min": 1
  },
  {
   "says": "every check on the receipt passes",
   "path": "receipt.checks[ok=false]",
   "count": 0
  },
  {
   "says": "every model call has a signed receipt",
   "receipts": "signed"
  }
 ]
}
