{
  "study": "41 Hours of AI Provider Outages, and the 1 Hour That Mattered",
  "date": "2026-11-07",
  "notes": {
    "code_counts": "Lines in the files behind each feature at one commit of ModelRiver's private repository; a 5,650-line file that mixes features is excluded, so counts are low. They include multi-tenant work, so they measure what it took ModelRiver, not what one app needs.",
    "fix_commits": "Non-merge commits touching a feature whose subject says fix, bug, regression, race, leak, crash, hotfix or broken.",
    "benchmarks": "Local server built from the same commit, mock provider answering in exactly 200 ms (failures instant), response cache off. 'production-like' = production logging level, no code reloading; 'development defaults' = unmodified development settings. One Apple M1 laptop (8 cores); each scenario started below a 1-minute load average of 4."
  },
  "features": {
    "gateway_failover": {
      "title": "Multi-provider gateway and failover",
      "production_lines": 8726,
      "test_lines": 4497,
      "decisions_made": 12,
      "background_workers": 0,
      "in_memory_caches": 0,
      "database_tables": 3,
      "commits": 65,
      "fix_commits": 17,
      "changed_since": "2025-11"
    },
    "async_realtime": {
      "title": "Async requests delivered to the browser over WebSocket",
      "production_lines": 6824,
      "test_lines": 2614,
      "decisions_made": 13,
      "background_workers": 3,
      "in_memory_caches": 2,
      "database_tables": 2,
      "commits": 91,
      "fix_commits": 33,
      "changed_since": "2025-11"
    },
    "webhooks": {
      "title": "Signed webhooks with retries",
      "production_lines": 2324,
      "test_lines": 5659,
      "decisions_made": 9,
      "background_workers": 1,
      "in_memory_caches": 0,
      "database_tables": 3,
      "commits": 22,
      "fix_commits": 9,
      "changed_since": "2025-11"
    },
    "callbacks_pipelines": {
      "title": "Event-driven callbacks to your backend (multi-step pipelines)",
      "production_lines": 3500,
      "test_lines": 3067,
      "decisions_made": 5,
      "background_workers": 2,
      "in_memory_caches": 1,
      "database_tables": 4,
      "commits": 35,
      "fix_commits": 10,
      "changed_since": "2026-01"
    },
    "streaming": {
      "title": "Token streaming (SSE and WebSocket)",
      "production_lines": 2881,
      "test_lines": 544,
      "decisions_made": 8,
      "background_workers": 0,
      "in_memory_caches": 0,
      "database_tables": 0,
      "commits": 25,
      "fix_commits": 4,
      "changed_since": "2026-05"
    },
    "sessions": {
      "title": "Conversation memory (sessions)",
      "production_lines": 2244,
      "test_lines": 3530,
      "decisions_made": 6,
      "background_workers": 0,
      "in_memory_caches": 0,
      "database_tables": 3,
      "commits": 17,
      "fix_commits": 5,
      "changed_since": "2026-08"
    },
    "response_cache": {
      "title": "Response cache",
      "production_lines": 694,
      "test_lines": 961,
      "decisions_made": 3,
      "background_workers": 0,
      "in_memory_caches": 1,
      "database_tables": 1,
      "commits": 9,
      "fix_commits": 1,
      "changed_since": "2025-11"
    },
    "structured_outputs": {
      "title": "Structured output (JSON Schema) validation",
      "production_lines": 499,
      "test_lines": 580,
      "decisions_made": 1,
      "background_workers": 0,
      "in_memory_caches": 0,
      "database_tables": 1,
      "commits": 3,
      "fix_commits": 1,
      "changed_since": "2026-08"
    },
    "budgets": {
      "title": "Spend caps (budgets)",
      "production_lines": 1502,
      "test_lines": 844,
      "decisions_made": 5,
      "background_workers": 0,
      "in_memory_caches": 1,
      "database_tables": 1,
      "commits": 7,
      "fix_commits": 0,
      "changed_since": "2026-07"
    },
    "guardrails": {
      "title": "Input guardrails (content moderation)",
      "production_lines": 1408,
      "test_lines": 1539,
      "decisions_made": 9,
      "background_workers": 0,
      "in_memory_caches": 2,
      "database_tables": 1,
      "commits": 9,
      "fix_commits": 2,
      "changed_since": "2026-06"
    },
    "logs_usage": {
      "title": "Request logs and cost tracking",
      "production_lines": 1595,
      "test_lines": 562,
      "decisions_made": 3,
      "background_workers": 1,
      "in_memory_caches": 0,
      "database_tables": 4,
      "commits": 33,
      "fix_commits": 2,
      "changed_since": "2025-11"
    }
  },
  "totals": {
    "production_lines": 32197,
    "test_lines": 24397,
    "decisions_made": 74,
    "background_workers": 7,
    "in_memory_caches": 7,
    "commits": 160,
    "fix_commits": 48,
    "commits_last_90_days": 57
  },
  "benchmarks": {
    "production_like": {
      "profile": "production-like",
      "machine_load": {
        "sync_overhead": {
          "waited_s": 50,
          "load1_at_start": 3.95,
          "load1_at_end": 3.87,
          "quiet_threshold": 4
        },
        "failover": {
          "waited_s": 0,
          "load1_at_start": 3.87,
          "load1_at_end": 2.2,
          "quiet_threshold": 4
        },
        "async_delivery": {
          "waited_s": 0,
          "load1_at_start": 2.2,
          "load1_at_end": 2.45,
          "quiet_threshold": 4
        },
        "event_driven": {
          "waited_s": 0,
          "load1_at_start": 2.45,
          "load1_at_end": 8.02,
          "quiet_threshold": 4
        },
        "footprint": {
          "waited_s": 65,
          "load1_at_start": 3.91,
          "load1_at_end": 3.61,
          "quiet_threshold": 4
        },
        "webhook_retry": {
          "waited_s": 0,
          "load1_at_start": 2.1,
          "load1_at_end": 2.49,
          "quiet_threshold": 4
        },
        "throughput": {
          "waited_s": 0,
          "load1_at_start": 2.49,
          "load1_at_end": 4.75,
          "quiet_threshold": 4
        }
      },
      "sync": {
        "end_to_end_ms": {
          "n": 300,
          "p50": 238,
          "p95": 246,
          "p99": 252.8
        },
        "provider_ms": {
          "n": 300,
          "p50": 204,
          "p95": 206,
          "p99": 208
        },
        "added_by_modelriver_ms": {
          "n": 300,
          "p50": 33.2,
          "p95": 41.6,
          "p99": 46.8
        }
      },
      "failover": {
        "primary_ok": {
          "requests": 150,
          "answered": 150,
          "end_to_end_ms": {
            "n": 150,
            "p50": 236.3,
            "p95": 242,
            "p99": 246.8
          }
        },
        "primary_500_then_backup": {
          "requests": 150,
          "answered": 150,
          "end_to_end_ms": {
            "n": 150,
            "p50": 253.2,
            "p95": 267.8,
            "p99": 279.9
          }
        },
        "primary_429_then_backup": {
          "requests": 150,
          "answered": 150,
          "end_to_end_ms": {
            "n": 150,
            "p50": 253.4,
            "p95": 266.9,
            "p99": 289.9
          }
        },
        "two_failures_then_backup_2": {
          "requests": 150,
          "answered": 150,
          "end_to_end_ms": {
            "n": 150,
            "p50": 270.5,
            "p95": 294.8,
            "p99": 311.4
          }
        },
        "added_ms": {
          "one_failover_500": {
            "n": 150,
            "p50": 18.4,
            "p95": 32.6,
            "p99": 41.5
          },
          "one_failover_429": {
            "n": 150,
            "p50": 18.3,
            "p95": 32.6,
            "p99": 48.9
          },
          "two_failovers": {
            "n": 150,
            "p50": 35,
            "p95": 57.3,
            "p99": 75
          }
        }
      },
      "async": {
        "requests": 200,
        "delivered_live": 200,
        "accepted_ms": {
          "n": 200,
          "p50": 24.8,
          "p95": 41.9,
          "p99": 59.8
        },
        "browser_connected_ms": {
          "n": 200,
          "p50": 2,
          "p95": 4,
          "p99": 5.4
        },
        "queue_wait_ms": {
          "n": 200,
          "p50": 7.5,
          "p95": 9.7,
          "p99": 11.7
        },
        "accepted_to_result_ms": {
          "n": 200,
          "p50": 228.8,
          "p95": 238.8,
          "p99": 266.3
        },
        "accepted_to_webhook_ms": {
          "n": 200,
          "p50": 251.9,
          "p95": 273.8,
          "p99": 326.9
        }
      },
      "orchestrated": {
        "requests": 100,
        "completed": 100,
        "accepted_to_final_ms": {
          "n": 100,
          "p50": 313.5,
          "p95": 373.1,
          "p99": 461.5
        }
      },
      "per_request_footprint": {
        "sync_request": {
          "provider_calls": 1,
          "background_jobs": 0,
          "database_rows": 1,
          "webhooks": 0,
          "live_updates": 0
        },
        "sync_request_with_failover": {
          "provider_calls": 2,
          "background_jobs": 0,
          "database_rows": 2,
          "webhooks": 0,
          "live_updates": 0
        },
        "async_request_with_webhook": {
          "provider_calls": 1,
          "background_jobs": 2,
          "database_rows": 2,
          "webhooks": 1,
          "live_updates": 1
        },
        "event_driven_request_with_callback": {
          "provider_calls": 1,
          "background_jobs": 5,
          "database_rows": 3,
          "webhooks": 1,
          "live_updates": 4
        }
      },
      "webhook_retries": {
        "attempts": 3,
        "gaps_s": [
          17.2,
          20.1
        ]
      },
      "throughput_indicative": [
        {
          "concurrency": 1,
          "requests": 40,
          "errors": 0,
          "req_per_s": 4.2,
          "end_to_end_ms": {
            "n": 40,
            "p50": 239.1,
            "p95": 246.9,
            "p99": 253.8
          }
        },
        {
          "concurrency": 5,
          "requests": 200,
          "errors": 0,
          "req_per_s": 21.1,
          "end_to_end_ms": {
            "n": 200,
            "p50": 238.1,
            "p95": 249.1,
            "p99": 253
          }
        },
        {
          "concurrency": 10,
          "requests": 400,
          "errors": 0,
          "req_per_s": 40.5,
          "end_to_end_ms": {
            "n": 400,
            "p50": 247.3,
            "p95": 262.3,
            "p99": 328.7
          }
        },
        {
          "concurrency": 25,
          "requests": 1000,
          "errors": 0,
          "req_per_s": 92.1,
          "end_to_end_ms": {
            "n": 1000,
            "p50": 270.9,
            "p95": 291.2,
            "p99": 298.7
          }
        },
        {
          "concurrency": 50,
          "requests": 2000,
          "errors": 0,
          "req_per_s": 168.9,
          "end_to_end_ms": {
            "n": 2000,
            "p50": 294.3,
            "p95": 324.3,
            "p99": 339.2
          }
        }
      ]
    },
    "production_like_repeat": {
      "profile": "production-like, repeat run",
      "machine_load": {
        "sync_overhead": {
          "waited_s": 360,
          "load1_at_start": 3.88,
          "load1_at_end": 1.9,
          "quiet_threshold": 4
        },
        "failover": {
          "waited_s": 0,
          "load1_at_start": 1.9,
          "load1_at_end": 1.81,
          "quiet_threshold": 4
        },
        "async_delivery": {
          "waited_s": 0,
          "load1_at_start": 1.81,
          "load1_at_end": 1.8,
          "quiet_threshold": 4
        },
        "event_driven": {
          "waited_s": 0,
          "load1_at_start": 1.8,
          "load1_at_end": 1.79,
          "quiet_threshold": 4
        }
      },
      "sync": {
        "end_to_end_ms": {
          "n": 300,
          "p50": 236.5,
          "p95": 243.3,
          "p99": 249.2
        },
        "provider_ms": {
          "n": 300,
          "p50": 204,
          "p95": 205,
          "p99": 205
        },
        "added_by_modelriver_ms": {
          "n": 300,
          "p50": 32.4,
          "p95": 39,
          "p99": 45.2
        }
      },
      "failover": {
        "primary_ok": {
          "requests": 150,
          "answered": 150,
          "end_to_end_ms": {
            "n": 150,
            "p50": 235.1,
            "p95": 240.2,
            "p99": 242
          }
        },
        "primary_500_then_backup": {
          "requests": 150,
          "answered": 150,
          "end_to_end_ms": {
            "n": 150,
            "p50": 251.6,
            "p95": 260.7,
            "p99": 277.5
          }
        },
        "primary_429_then_backup": {
          "requests": 150,
          "answered": 150,
          "end_to_end_ms": {
            "n": 150,
            "p50": 251.7,
            "p95": 261.1,
            "p99": 396.1
          }
        },
        "two_failures_then_backup_2": {
          "requests": 150,
          "answered": 150,
          "end_to_end_ms": {
            "n": 150,
            "p50": 268.3,
            "p95": 281.3,
            "p99": 303.5
          }
        },
        "added_ms": {
          "one_failover_500": {
            "n": 150,
            "p50": 16.9,
            "p95": 26.4,
            "p99": 43.8
          },
          "one_failover_429": {
            "n": 150,
            "p50": 17.1,
            "p95": 32.3,
            "p99": 162.3
          },
          "two_failovers": {
            "n": 150,
            "p50": 33.9,
            "p95": 49.8,
            "p99": 70.4
          }
        }
      },
      "async": {
        "requests": 200,
        "delivered_live": 200,
        "accepted_ms": {
          "n": 200,
          "p50": 24.3,
          "p95": 29.2,
          "p99": 39.1
        },
        "browser_connected_ms": {
          "n": 200,
          "p50": 1.9,
          "p95": 2.7,
          "p99": 4.4
        },
        "queue_wait_ms": {
          "n": 200,
          "p50": 7.5,
          "p95": 8.8,
          "p99": 22.4
        },
        "accepted_to_result_ms": {
          "n": 200,
          "p50": 229.4,
          "p95": 233.8,
          "p99": 244.2
        },
        "accepted_to_webhook_ms": {
          "n": 200,
          "p50": 252.3,
          "p95": 259.9,
          "p99": 276.5
        }
      },
      "orchestrated": {
        "requests": 100,
        "completed": 100,
        "accepted_to_final_ms": {
          "n": 100,
          "p50": 284.3,
          "p95": 295.1,
          "p99": 313.7
        }
      }
    },
    "development_defaults": {
      "profile": "development defaults",
      "machine_load": {
        "sync_overhead": {
          "waited_s": 10,
          "load1_at_start": 3.79,
          "load1_at_end": 2.39,
          "quiet_threshold": 4
        },
        "failover": {
          "waited_s": 0,
          "load1_at_start": 2.39,
          "load1_at_end": 2.33,
          "quiet_threshold": 4
        },
        "async_delivery": {
          "waited_s": 0,
          "load1_at_start": 2.33,
          "load1_at_end": 3.51,
          "quiet_threshold": 4
        }
      },
      "sync": {
        "end_to_end_ms": {
          "n": 300,
          "p50": 346,
          "p95": 358.6,
          "p99": 386
        },
        "provider_ms": {
          "n": 300,
          "p50": 204,
          "p95": 204,
          "p99": 205
        },
        "added_by_modelriver_ms": {
          "n": 300,
          "p50": 142.6,
          "p95": 154.6,
          "p99": 183
        }
      },
      "failover": {
        "primary_ok": {
          "requests": 150,
          "answered": 150,
          "end_to_end_ms": {
            "n": 150,
            "p50": 349.3,
            "p95": 358.5,
            "p99": 362.1
          }
        },
        "primary_500_then_backup": {
          "requests": 150,
          "answered": 150,
          "end_to_end_ms": {
            "n": 150,
            "p50": 358.9,
            "p95": 373.7,
            "p99": 438.1
          }
        },
        "primary_429_then_backup": {
          "requests": 150,
          "answered": 150,
          "end_to_end_ms": {
            "n": 150,
            "p50": 358.2,
            "p95": 372.2,
            "p99": 380.2
          }
        },
        "two_failures_then_backup_2": {
          "requests": 150,
          "answered": 150,
          "end_to_end_ms": {
            "n": 150,
            "p50": 368.6,
            "p95": 384.9,
            "p99": 416.5
          }
        },
        "added_ms": {
          "one_failover_500": {
            "n": 150,
            "p50": 10.1,
            "p95": 35.7,
            "p99": 87.5
          },
          "one_failover_429": {
            "n": 150,
            "p50": 10.6,
            "p95": 35.6,
            "p99": 47.6
          },
          "two_failovers": {
            "n": 150,
            "p50": 21.9,
            "p95": 44.9,
            "p99": 61.7
          }
        }
      },
      "async": {
        "requests": 200,
        "delivered_live": 200,
        "accepted_ms": {
          "n": 200,
          "p50": 116.9,
          "p95": 126.6,
          "p99": 145.3
        },
        "browser_connected_ms": {
          "n": 200,
          "p50": 91.5,
          "p95": 96.5,
          "p99": 98.5
        },
        "queue_wait_ms": {
          "n": 168,
          "p50": 7,
          "p95": 7.8,
          "p99": 8.5
        },
        "accepted_to_result_ms": {
          "n": 200,
          "p50": 226.1,
          "p95": 228.9,
          "p99": 233.3
        },
        "accepted_to_webhook_ms": {
          "n": 200,
          "p50": 241.2,
          "p95": 245.5,
          "p99": 271.4
        }
      }
    }
  },
  "sdk_reconnect_check": {
    "first_connection_with_token": "join ok",
    "second_connection_with_same_token": "socket rejected",
    "connection_with_token_from_reconnect_endpoint": "join ok"
  },
  "incident_overlap": {
    "window": [
      "2026-08-09T00:00:00+00:00",
      "2026-11-07T00:00:00+00:00"
    ],
    "window_hours": 2160.0,
    "anthropic_api": {
      "incidents": 29,
      "hours_under_incident": 41.0,
      "share_of_window": 0.01898
    },
    "openai_text_generation": {
      "hours_under_incident": 55.6,
      "share_of_window": 0.02574
    },
    "openai_all_api": {
      "hours_under_incident": 72.51,
      "share_of_window": 0.03357
    },
    "overlap_anthropic_and_openai_text": {
      "hours": 0.99,
      "windows": [
        [
          "2026-10-06T12:24:32.621000+00:00",
          "2026-10-06T12:43:02.988000+00:00"
        ],
        [
          "2026-10-27T15:09:08.926000+00:00",
          "2026-10-27T15:50:17.700000+00:00"
        ]
      ]
    },
    "anthropic_union_intervals": [
      [
        "2026-08-12T13:50:28.450000+00:00",
        "2026-08-12T18:07:11.547000+00:00"
      ],
      [
        "2026-08-13T14:33:45.150000+00:00",
        "2026-08-13T16:08:35.730000+00:00"
      ],
      [
        "2026-08-14T20:30:36.280000+00:00",
        "2026-08-14T21:58:12.691000+00:00"
      ],
      [
        "2026-08-16T21:58:56.939000+00:00",
        "2026-08-16T22:34:39.037000+00:00"
      ],
      [
        "2026-08-17T13:56:41.046000+00:00",
        "2026-08-17T15:29:25.545000+00:00"
      ],
      [
        "2026-08-18T16:20:22.231000+00:00",
        "2026-08-18T19:01:45.447000+00:00"
      ],
      [
        "2026-08-19T09:42:37.402000+00:00",
        "2026-08-19T11:02:18.264000+00:00"
      ],
      [
        "2026-08-20T18:32:13.285000+00:00",
        "2026-08-20T19:01:03.844000+00:00"
      ],
      [
        "2026-08-20T19:16:24.923000+00:00",
        "2026-08-20T19:42:38.692000+00:00"
      ],
      [
        "2026-08-24T05:06:39.483000+00:00",
        "2026-08-24T08:30:47.615000+00:00"
      ],
      [
        "2026-09-02T21:17:58.696000+00:00",
        "2026-09-02T21:44:28.095000+00:00"
      ],
      [
        "2026-09-03T12:37:31.757000+00:00",
        "2026-09-03T12:56:26.632000+00:00"
      ],
      [
        "2026-09-03T13:26:04.191000+00:00",
        "2026-09-03T16:23:12.052000+00:00"
      ],
      [
        "2026-09-10T21:43:40.209000+00:00",
        "2026-09-10T23:24:22.978000+00:00"
      ],
      [
        "2026-09-11T14:19:51.466000+00:00",
        "2026-09-11T14:37:11.146000+00:00"
      ],
      [
        "2026-09-15T09:48:23.066000+00:00",
        "2026-09-15T11:14:44.380000+00:00"
      ],
      [
        "2026-09-22T00:57:26.117000+00:00",
        "2026-09-22T02:35:23.836000+00:00"
      ],
      [
        "2026-09-29T14:21:37.180000+00:00",
        "2026-09-29T16:27:21.369000+00:00"
      ],
      [
        "2026-10-01T16:20:40.767000+00:00",
        "2026-10-01T22:36:22.210000+00:00"
      ],
      [
        "2026-10-05T13:05:44.480000+00:00",
        "2026-10-05T13:21:37.611000+00:00"
      ],
      [
        "2026-10-06T12:24:32.621000+00:00",
        "2026-10-06T12:43:02.988000+00:00"
      ],
      [
        "2026-10-21T19:49:06.486000+00:00",
        "2026-10-21T20:29:17.844000+00:00"
      ],
      [
        "2026-10-23T23:37:42.659000+00:00",
        "2026-10-24T00:11:20.874000+00:00"
      ],
      [
        "2026-10-24T00:31:37.594000+00:00",
        "2026-10-24T00:37:17.808000+00:00"
      ],
      [
        "2026-10-24T05:16:50.579000+00:00",
        "2026-10-24T05:53:30.600000+00:00"
      ],
      [
        "2026-10-25T06:14:18.088000+00:00",
        "2026-10-25T07:53:39.004000+00:00"
      ],
      [
        "2026-10-25T08:17:08.277000+00:00",
        "2026-10-25T08:49:29.501000+00:00"
      ],
      [
        "2026-10-27T09:14:35.040000+00:00",
        "2026-10-27T09:56:46.355000+00:00"
      ],
      [
        "2026-10-27T15:09:08.926000+00:00",
        "2026-10-27T15:50:17.700000+00:00"
      ]
    ],
    "openai_text_union_intervals": [
      [
        "2026-08-31T22:27:56.967000+00:00",
        "2026-09-01T19:05:46.393000+00:00"
      ],
      [
        "2026-09-11T09:08:15.860000+00:00",
        "2026-09-11T11:21:43.949000+00:00"
      ],
      [
        "2026-09-17T20:20:00+00:00",
        "2026-09-17T21:20:00+00:00"
      ],
      [
        "2026-09-29T17:52:52.793000+00:00",
        "2026-09-29T23:14:02.002000+00:00"
      ],
      [
        "2026-09-30T17:05:46.207000+00:00",
        "2026-09-30T20:35:46.643000+00:00"
      ],
      [
        "2026-10-06T05:00:00+00:00",
        "2026-10-06T17:50:00+00:00"
      ],
      [
        "2026-10-19T13:31:52.025000+00:00",
        "2026-10-19T14:14:03.492000+00:00"
      ],
      [
        "2026-10-21T02:26:28.282000+00:00",
        "2026-10-21T02:48:17.850000+00:00"
      ],
      [
        "2026-10-21T15:34:47.254000+00:00",
        "2026-10-21T16:44:09.764000+00:00"
      ],
      [
        "2026-10-22T02:18:32.195000+00:00",
        "2026-10-22T08:50:43.240000+00:00"
      ],
      [
        "2026-10-27T15:02:15.929000+00:00",
        "2026-10-27T16:20:06.360000+00:00"
      ]
    ]
  },
  "modelriver_uptime_90d": {
    "source": "https://status.modelriver.com",
    "api_uptime_percent": "99.97",
    "checks": 128159,
    "failed_checks": 35
  },
  "reliability": {
    "window_hours": 2160.0,
    "both_providers_in_incident_hours": 0.99,
    "modelriver_api_uptime_percent": "99.97",
    "modelriver_unhealthy_hours": 0.59,
    "primary_anthropic_backup_openai": {
      "without_modelriver_hours": 41.0,
      "without_modelriver_share_of_time": 0.01898,
      "with_modelriver_hours_worst_case": 1.58,
      "with_modelriver_share_of_time": 0.00073,
      "reduction": 0.9615
    },
    "primary_openai_backup_anthropic": {
      "without_modelriver_hours": 55.6,
      "without_modelriver_share_of_time": 0.02574,
      "with_modelriver_hours_worst_case": 1.58,
      "with_modelriver_share_of_time": 0.00073,
      "reduction": 0.9716
    }
  },
  "cost_model": {
    "inputs": {
      "cocomo": {
        "A": 2.94,
        "B": 0.91,
        "C": 3.67,
        "D": 0.28,
        "scale_factors_nominal": [
          3.72,
          3.04,
          4.24,
          3.29,
          4.68
        ],
        "E": 1.0997,
        "hours_per_person_month": 152,
        "source": "COCOMO II Model Definition Manual v2.1, USC Center for Software Engineering"
      },
      "wage": {
        "usd_per_year": 135980,
        "usd_per_working_day": 523.0,
        "source": "US BLS OEWS May 2025, SOC 15-1252 Software Developers, national median annual wage (series OEUN000000000000015125213)"
      }
    },
    "core_four_features": {
      "production_code_lines_excluding_comments": 16991,
      "floor_our_engineer_days": 84,
      "floor_salary_usd": 43932,
      "fix_engineer_days_per_year": 24,
      "fix_salary_usd_per_year": 12552,
      "all_engineer_days_per_year": 104,
      "ceiling_cocomo_person_months": 66.3,
      "ceiling_cocomo_engineer_days": 1259,
      "ceiling_cocomo_schedule_months": 13.9,
      "ceiling_salary_usd": 658457
    }
  },
  "desk_share": {
    "source_lines": 27894,
    "modelriver_wrapper_lines": 274,
    "share_lower_bound": 0.0098,
    "share_upper_bound": 0.1546,
    "modelriver_lines_for_those_features": 22270,
    "infra_lines_as_share_of_desk_size": 0.798
  },
  "lines_you_write": [
    {
      "label": "Minimal async integration: backend route",
      "code_lines": 14
    },
    {
      "label": "Minimal async integration: frontend",
      "code_lines": 8
    },
    {
      "label": "Webhook signature verifier (webhook-test-server)",
      "code_lines": 21
    },
    {
      "label": "Desk's full ModelRiver API wrapper (production app)",
      "code_lines": 199
    }
  ],
  "modelriver_pricing": {
    "source": "https://modelriver.com/pricing (2026-11-07)",
    "free": "$0/month, 25,000 requests",
    "pro": "$49/month, 500,000 requests, then $10 per 100,000",
    "scale": "$299/month, 5,000,000 requests, then $6 per 100,000"
  }
}
