{
 "schema": "ouro-crm-upsert-repair-receipt/1.0",
 "generated_at": "2026-08-23T16:30:00Z",
 "handler": "coils/crm-upsert (canonical, repaired 2026-08-23)",
 "adapters": "fully mocked Ouro datasets adapter; zero real CRM mutations, zero email sends",
 "sanitization": "all contacts synthetic *.invalid; no real CRM rows, names, or message ids appear",
 "summary": {
  "cases_total": 16,
  "cases_passed": 16,
  "all_passed": true,
  "crm_mutations_real": 0,
  "emails_sent": 0
 },
 "guard_semantics": {
  "write_once": "first_outbound_at / first_outbound_email_id / date_sent written exactly once, only on the to-sent transition, only as the complete canonical set; later changes rejected, identical re-supplies dropped as no-ops",
  "follow_up_sent": "exact lowercase 'true'/'false' enforced before any mutation; any other casing or type rejected with the stored row byte-identical",
  "lifecycle": "identified->drafted->sent->replied/no_reply/blocked; do_not_contact terminal; blocked recoverable; sent requires first-send evidence",
  "sparsity": "payload is id + supplied fields only; unrelated columns never rewritten"
 },
 "cases": [
  {
   "case_id": "C1a-first-send-write-once",
   "passed": true,
   "errors": [],
   "first_send_transition": true,
   "fields_written": [
    "status",
    "date_sent",
    "first_outbound_at",
    "first_outbound_email_id",
    "email_id",
    "last_outbound_at",
    "last_outbound_email_id",
    "reply_received",
    "follow_up_sent",
    "next_action",
    "id"
   ]
  },
  {
   "case_id": "C1b-sparse-followup",
   "passed": true,
   "errors": [],
   "first_send_transition": false,
   "fields_written": [
    "last_outbound_at",
    "last_outbound_email_id",
    "email_id",
    "follow_up_sent",
    "next_action",
    "id"
   ]
  },
  {
   "case_id": "C1c-reply-update",
   "passed": true,
   "errors": [],
   "first_send_transition": false,
   "fields_written": [
    "status",
    "reply_received",
    "last_inbound_at",
    "last_inbound_email_id",
    "next_action",
    "id"
   ]
  },
  {
   "case_id": "C1d-crm-only-sparse",
   "passed": true,
   "errors": [],
   "first_send_transition": false,
   "fields_written": [
    "next_action",
    "id"
   ]
  },
  {
   "case_id": "C1e-write-once-conflict",
   "passed": true,
   "errors": [],
   "rejected_with": "write_once_conflict"
  },
  {
   "case_id": "C1f-identical-resupply-noop",
   "passed": true,
   "errors": [],
   "first_send_transition": false,
   "fields_written": [
    "next_action",
    "id"
   ]
  },
  {
   "case_id": "C2a-bad-casing-True",
   "passed": true,
   "errors": [],
   "rejected_with": "invalid_follow_up_sent"
  },
  {
   "case_id": "C2b-bad-boolean-type",
   "passed": true,
   "errors": [],
   "rejected_with": "invalid_follow_up_sent"
  },
  {
   "case_id": "C2c-lowercase-true-accepted",
   "passed": true,
   "errors": [],
   "first_send_transition": false,
   "fields_written": [
    "follow_up_sent",
    "next_action",
    "id"
   ]
  },
  {
   "case_id": "C3a-sent-to-identified",
   "passed": true,
   "errors": [],
   "rejected_with": "invalid_status_transition"
  },
  {
   "case_id": "C3b-dnc-terminal",
   "passed": true,
   "errors": [],
   "rejected_with": "invalid_status_transition"
  },
  {
   "case_id": "C4-incomplete-first-send-set",
   "passed": true,
   "errors": [],
   "rejected_with": "incomplete_first_send_fields"
  },
  {
   "case_id": "C5-new-row-sent-without-evidence",
   "passed": true,
   "errors": [],
   "rejected_with": "sent_requires_first_send_evidence"
  },
  {
   "case_id": "C6-identified-to-drafted",
   "passed": true,
   "errors": [],
   "first_send_transition": false,
   "fields_written": [
    "status",
    "next_action",
    "id"
   ]
  },
  {
   "case_id": "C7-blocked-to-sent-recovery",
   "passed": true,
   "errors": [],
   "first_send_transition": true,
   "fields_written": [
    "status",
    "date_sent",
    "first_outbound_at",
    "first_outbound_email_id",
    "email_id",
    "last_outbound_at",
    "last_outbound_email_id",
    "follow_up_sent",
    "id"
   ]
  },
  {
   "case_id": "C8-triage-sweep",
   "passed": true,
   "errors": [],
   "first_send_transition": false,
   "fields_written": [
    "next_action",
    "id"
   ]
  }
 ],
 "live_verification": {
  "description": "The repaired canonical handler was executed against the REAL Ouro CRM (read-only lookups; guards fire before any mutation). Three guard attempts on one real sent row: a first_outbound_at change, a 'True'-cased follow_up_sent, and a sent->identified transition. All three were rejected with the correct error code and the stored row was re-read byte-identical. No email was sent and no CRM row was mutated.",
  "checks": [
   {
    "check": "write_once_conflict_live",
    "rejected": true,
    "error_code": "write_once_conflict",
    "ok": true
   },
   {
    "check": "bad_casing_live",
    "rejected": true,
    "error_code": "invalid_follow_up_sent",
    "ok": true
   },
   {
    "check": "invalid_transition_live",
    "rejected": true,
    "error_code": "invalid_status_transition",
    "ok": true
   }
  ],
  "row_unchanged": true,
  "crm_mutations": 0,
  "sends": 0,
  "all_ok": true
 }
}