{
  "suite": "send-and-log fault injection (mock adapters only)",
  "handler_under_test": "coils/send-and-log/handler.py",
  "generated_at": "2026-08-23T18:03:28.404330Z",
  "mock_only": true,
  "real_emails_sent": 0,
  "real_crm_mutations": 0,
  "cases": [
    {
      "case_id": "F0-control-clean-first-send",
      "boundary": "none (control)",
      "injected_fault": "none",
      "passed": true,
      "mock_message_count": 1,
      "crm_state": {
        "row_exists": true,
        "id": "c2b00000-0000-4000-8000-000000000002",
        "status": "sent",
        "date_sent": "2026-08-23",
        "first_outbound_at": "2026-08-23T18:03:28.389893Z",
        "first_outbound_email_id": "mock-2001",
        "last_outbound_at": "2026-08-23T18:03:28.389893Z",
        "last_outbound_email_id": "mock-2001",
        "email_id": "mock-2001",
        "reply_received": "false",
        "follow_up_sent": "false",
        "next_action": "Wait for reply. Follow up once ~7 days out."
      },
      "invariant": "1 message + complete CRM record",
      "errors": []
    },
    {
      "case_id": "F1-failure-before-resend",
      "boundary": "before Resend",
      "injected_fault": "Resend 503 on attempt 1; retry same key",
      "passed": true,
      "mock_message_count": 1,
      "crm_state": {
        "row_exists": true,
        "id": "c2b00000-0000-4000-8000-000000000002",
        "status": "sent",
        "date_sent": "2026-08-23",
        "first_outbound_at": "2026-08-23T18:03:28.391594Z",
        "first_outbound_email_id": "mock-2001",
        "last_outbound_at": "2026-08-23T18:03:28.391594Z",
        "last_outbound_email_id": "mock-2001",
        "email_id": "mock-2001",
        "reply_received": "false",
        "follow_up_sent": "false",
        "next_action": "Wait for reply. Follow up once ~7 days out."
      },
      "invariant": "0 sends + no CRM write on failure; retry -> 1 send + complete record",
      "errors": []
    },
    {
      "case_id": "F2-death-after-send-before-persistence",
      "boundary": "between Resend success and CRM write",
      "injected_fault": "process death after send; replay same idempotency key",
      "passed": true,
      "mock_message_count": 1,
      "crm_state": {
        "row_exists": true,
        "id": "c2b00000-0000-4000-8000-000000000002",
        "status": "sent",
        "date_sent": "2026-08-23",
        "first_outbound_at": "2026-08-23T18:03:28.393259Z",
        "first_outbound_email_id": "mock-2001",
        "last_outbound_at": "2026-08-23T18:03:28.393259Z",
        "last_outbound_email_id": "mock-2001",
        "email_id": "mock-2001",
        "reply_received": "false",
        "follow_up_sent": "false",
        "next_action": "Wait for reply. Follow up once ~7 days out."
      },
      "invariant": "exactly 1 message + 1 complete CRM record after replay (no duplicate, no unlogged send)",
      "errors": []
    },
    {
      "case_id": "F3-death-during-crm-persistence",
      "boundary": "during CRM persistence",
      "injected_fault": "partial column flush then death; replay same idempotency key",
      "passed": true,
      "mock_message_count": 1,
      "crm_state": {
        "row_exists": true,
        "id": "c2b00000-0000-4000-8000-000000000002",
        "status": "sent",
        "date_sent": "2026-08-23",
        "first_outbound_at": "2026-08-23T18:03:28.395746Z",
        "first_outbound_email_id": "mock-2001",
        "last_outbound_at": "2026-08-23T18:03:28.395746Z",
        "last_outbound_email_id": "mock-2001",
        "email_id": "mock-2001",
        "reply_received": "false",
        "follow_up_sent": "false",
        "next_action": "Wait for reply. Follow up once ~7 days out."
      },
      "invariant": "half-written row detected as first-send (write-once fields absent) and repaired complete; 1 message total",
      "errors": []
    },
    {
      "case_id": "F4-replay-after-success",
      "boundary": "after success (idempotency)",
      "injected_fault": "duplicate submission with same key",
      "passed": true,
      "mock_message_count": 1,
      "crm_state": {
        "row_exists": true,
        "id": "c2b00000-0000-4000-8000-000000000002",
        "status": "sent",
        "date_sent": "2026-08-23",
        "first_outbound_at": "2026-08-23T18:03:28.397018Z",
        "first_outbound_email_id": "mock-2001",
        "last_outbound_at": "2026-08-23T18:03:28.397989Z",
        "last_outbound_email_id": "mock-2001",
        "email_id": "mock-2001",
        "reply_received": "false",
        "follow_up_sent": "false",
        "next_action": "Await their reply."
      },
      "invariant": "dedup returns original message id; still 1 message",
      "errors": []
    },
    {
      "case_id": "G1-daily-cap-guard",
      "boundary": "guard (pre-send)",
      "injected_fault": "daily_outbound_count=8 for cold/followup/nudge, then reply",
      "passed": true,
      "mock_message_count": 1,
      "crm_state": {
        "refused_branch": {
          "row_exists": false
        },
        "reply_at_cap_branch": {
          "row_exists": true,
          "id": "c2b00000-0000-4000-8000-000000000002",
          "status": "replied",
          "date_sent": null,
          "first_outbound_at": "2026-08-15T14:00:00.000Z",
          "first_outbound_email_id": "mock-1001",
          "last_outbound_at": "2026-08-23T18:03:28.401662Z",
          "last_outbound_email_id": "mock-2001",
          "email_id": "mock-2001",
          "reply_received": "Replied: asked about licensing.",
          "follow_up_sent": "true",
          "next_action": "Await their reply."
        }
      },
      "invariant": "cold/followup/nudge refused at cap with 0 sends; live-thread reply still allowed, write-once fields intact",
      "errors": []
    },
    {
      "case_id": "G2-controller-handoff-guard",
      "boundary": "guard (thread-read orchestration)",
      "injected_fault": "inbound Matt reply on thread; then clean thread as negative control",
      "passed": true,
      "mock_message_count": 1,
      "crm_state": {
        "blocked_branch": {
          "row_exists": true,
          "id": "c2b00000-0000-4000-8000-000000000002",
          "status": "replied",
          "date_sent": null,
          "first_outbound_at": "2026-08-15T14:00:00.000Z",
          "first_outbound_email_id": "mock-1001",
          "last_outbound_at": "2026-08-15T14:00:00.000Z",
          "last_outbound_email_id": "mock-1001",
          "email_id": null,
          "reply_received": "Replied: interested.",
          "follow_up_sent": "true",
          "next_action": "Matt/Will is driving this thread; do not reply unless asked."
        },
        "clear_branch": {
          "row_exists": true,
          "id": "c2b00000-0000-4000-8000-000000000002",
          "status": "replied",
          "date_sent": null,
          "first_outbound_at": "2026-08-15T14:00:00.000Z",
          "first_outbound_email_id": "mock-1001",
          "last_outbound_at": "2026-08-23T18:03:28.404284Z",
          "last_outbound_email_id": "mock-2001",
          "email_id": "mock-2001",
          "reply_received": "Replied: interested.",
          "follow_up_sent": "true",
          "next_action": "Await their reply."
        }
      },
      "invariant": "inbound controller reply -> hard stop, 0 sends, stand-down CRM-only write; outbound CC never trips guard",
      "errors": []
    }
  ],
  "summary": {
    "total": 7,
    "passed": 7,
    "failed": 0
  }
}