{
 "use_case": "settlement-video",
 "title": "Settlement video: the Whitlock matter (fictional) from chronology to MP4 and cite sheet",
 "about": "Dana Whitlock is fictional (the medical chronology's sample packet). The matter adds itemized bills from five providers and her signed statement, plus stand-in photos with no person in them. The run drafts the 7-scene script from the chronology (every line cited and checked), ties the bills out in code, then renders the approved lines with captions only (no narration) and signs a record. Planted in the bills: one statement's printed total is $18 off its own lines, one therapy charge is billed twice, a 2022 visit comes before the injury, and one therapy charge falls in the break in care with no record. It takes about a minute: one script call, one check per line, and about 3 minutes of frames drawn on CPU. The sample matter ships with the API (GET /settlement/samples/whitlock): the chronology report, Exhibits 1-7 and the stand-in photos, so the bundle needs no input files.",
 "licence": "Synthetic: the client, providers, dates, bills and statement are invented (decosa_api/verticals/chronology/synth.py, decosa_api/verticals/settlement/synth.py). Stand-in photos: public domain or CC0, no person shown (decosa_api/verticals/settlement/data/photos/licences.json). Part of decosa-api, AGPL-3.0-or-later.",
 "inputs": [],
 "steps": [
  {
   "id": "draft",
   "method": "POST",
   "path": "/settlement/draft",
   "timeout": 300,
   "body": {
    "sample": "whitlock"
   }
  },
  {
   "id": "render",
   "method": "POST",
   "path": "/settlement/render",
   "body": {
    "draft_id": {
     "$ref": "draft.draft_id"
    },
    "edit": {
     "lines": {
      "$ref": "draft.lines[status=ok]"
     },
     "approved": {
      "before": true,
      "incident": true,
      "timeline": true,
      "injuries": true,
      "treatment": true,
      "bills": true,
      "after": true
     }
    },
    "narration": {
     "mode": "none"
    }
   }
  },
  {
   "id": "job",
   "method": "GET",
   "path": "/settlement/jobs/${render.job_id}",
   "until": {
    "path": "status",
    "in": [
     "done",
     "error"
    ]
   },
   "interval": 5,
   "max_wait": 600
  },
  {
   "id": "record",
   "method": "GET",
   "path": "/settlement/jobs/${render.job_id}/record.json"
  },
  {
   "id": "verify",
   "method": "POST",
   "path": "/record/verify",
   "auth": false,
   "body": {
    "record": {
     "$ref": "record"
    }
   }
  },
  {
   "id": "tampered",
   "method": "POST",
   "path": "/record/verify",
   "auth": false,
   "body": {
    "record": {
     "$ref": "record"
    }
   },
   "tamper": {
    "at": "record.statement.title",
    "set": "changed"
   }
  }
 ],
 "checks": [
  {
   "says": "the bills tie to $24,331.00 in code",
   "path": "draft.tie.specials_cents",
   "equals": 2433100
  },
  {
   "says": "the statement whose printed total is off its own lines is flagged",
   "path": "draft.tie.flags[kind=mis_total]",
   "count": 1
  },
  {
   "says": "the duplicate therapy charge is flagged and counted once",
   "path": "draft.tie.flags[kind=duplicate]",
   "count": 1
  },
  {
   "says": "the 2022 charge before the injury is left out",
   "path": "draft.tie.flags[kind=pre_incident]",
   "count": 1
  },
  {
   "says": "the therapy charge with no matching record is flagged",
   "path": "draft.tie.flags[kind=no_record]",
   "count": 1
  },
  {
   "says": "most lines pass the checks and carry cites",
   "path": "draft.lines[status=ok]",
   "count_min": 12
  },
  {
   "says": "the other side's points are listed for the lawyer (the 138-day gap among them)",
   "path": "draft.raise[kind=gap]",
   "count": 1
  },
  {
   "says": "the render finishes",
   "path": "job.status",
   "equals": "done"
  },
  {
   "says": "the cite sheet lists the cited lines",
   "path": "job.outputs.cited_lines",
   "min": 10
  },
  {
   "says": "the signed record verifies",
   "path": "verify.ok",
   "equals": true
  },
  {
   "says": "a changed record fails",
   "path": "tampered.ok",
   "equals": false
  }
 ],
 "properties": [
  "Every on-screen fact carries an exhibit, page and box cite attached in code from the chronology entry or statement paragraph it rests on.",
  "The bills figure is the sum of the itemized lines with a matching visit, computed in code; the $18 statement error, the duplicate, the pre-injury charge and the no-record charge are each flagged and left out.",
  "A line whose spinal level is not a valid level (the scanned MRI reads 'L4-15') is held back for the lawyer.",
  "The render refuses until every scene is approved and every line passes or is marked as the attorney's own words.",
  "The MP4 carries a C2PA credential that names it a composite (no generative video model), and the record signs every file, line, cite and consent decision by hash."
 ]
}