{
 "use_case": "ma-dd-redflags",
 "title": "DD red flags: a sixteen-document data room with eleven planted problems, then a clean one",
 "about": "Project Kestrel: an invented buyer (Halvard Capital) acquiring an invented target (Brightwater Analytics). Sixteen documents: a customer MSA, an inbound software licence, a reseller agreement, a supply agreement, a county services agreement, a credit agreement, a contractor agreement, the IP assignment register, the CEO employment agreement, an office lease, an NDA, two sets of board minutes, the disclosure schedule, revenue by customer and a financial summary. Planted: change of control in the MSA and a single-trigger CEO payment, a key-person clause, an anti-assignment clause that reaches mergers, exclusivity binding affiliates, MFN pricing, uncapped data-breach liability, a leverage covenant breach (3.42x against 3.00x), a contractor who kept the IP and has no assignment on file, a demand letter in the March minutes that the disclosure schedule leaves out, and one customer at 41.1% of revenue. The run must find them with verbatim quotes, keep the NDA clean, sign a record that verifies and fails when changed, and then return no flags on Project Linnet, a clean room of near misses.",
 "licence": "Synthetic: every company, person, clause and number is invented (scripts/madd_rooms.py, decosa_api/verticals/madd/data/rooms.json). Part of decosa-api, AGPL-3.0-or-later.",
 "inputs": [
  {
   "file": "inputs/room.json",
   "what": "Project Kestrel: target, buyer and the sixteen documents as text."
  },
  {
   "file": "inputs/clean-room.json",
   "what": "Project Linnet: the same kinds of documents with near misses and no planted flags."
  }
 ],
 "steps": [
  {
   "id": "review",
   "method": "POST",
   "path": "/madd/review",
   "body": {
    "room": {
     "$file": "inputs/room.json"
    },
    "synthetic": true
   },
   "timeout": 900
  },
  {
   "id": "verify",
   "method": "POST",
   "path": "/record/verify",
   "auth": false,
   "body": {
    "record": {
     "$ref": "review.record"
    }
   }
  },
  {
   "id": "tampered",
   "method": "POST",
   "path": "/record/verify",
   "auth": false,
   "body": {
    "record": {
     "$ref": "review.record"
    }
   },
   "tamper": {
    "at": "record.statement.counts.flags",
    "set": 0
   }
  },
  {
   "id": "clean",
   "method": "POST",
   "path": "/madd/review",
   "body": {
    "room": {
     "$file": "inputs/clean-room.json"
    },
    "synthetic": true
   },
   "timeout": 900
  }
 ],
 "checks": [
  {
   "says": "the customer MSA's change-of-control termination right is flagged",
   "path": "review.flags[doc=MSA-BRI,category=change_of_control]",
   "count_min": 1
  },
  {
   "says": "the demand letter in the March minutes, missing from the disclosure schedule, is flagged",
   "path": "review.flags[category=undisclosed_litigation][0].doc",
   "equals": "MIN-2026Q1"
  },
  {
   "says": "the covenant breach is flagged with the figure",
   "path": "review.flags[category=debt_covenant][0].quote",
   "contains": "3.42x"
  },
  {
   "says": "the 41.1% customer is flagged from the revenue table",
   "path": "review.flags[category=customer_concentration][0].doc",
   "equals": "REV-FY2025"
  },
  {
   "says": "the contractor who kept the IP is flagged",
   "path": "review.flags[category=ip_assignment_gap]",
   "count_min": 1
  },
  {
   "says": "at least ten flags in all",
   "path": "review.counts.flags",
   "min": 10
  },
  {
   "says": "nothing is flagged in the plain NDA",
   "path": "review.flags[doc=NDA-BRI]",
   "count": 0
  },
  {
   "says": "the memo is written for counsel and says it is not legal advice",
   "path": "review.markdown",
   "contains": "not legal advice"
  },
  {
   "says": "every search is tied to one index hash",
   "path": "review.record.statement.index_hash",
   "truthy": true
  },
  {
   "says": "the signed record verifies",
   "path": "verify.ok",
   "equals": true
  },
  {
   "says": "the record fails once its flag count is changed",
   "path": "tampered.ok",
   "equals": false
  },
  {
   "says": "the clean room comes back with at most one flag",
   "path": "clean.counts.flags",
   "max": 1
  },
  {
   "says": "every model call has a signed receipt",
   "receipts": "signed",
   "min": 10
  }
 ]
}