{
  "schemaVersion": 1,
  "id": "mcp-transport-reconnect",
  "function": "reconnect_decision",
  "starter": "def reconnect_decision(payload):\n    \"\"\"Implement the public contract; disclose assistance used.\"\"\"\n    raise NotImplementedError(\"mcp-transport-reconnect\")\n",
  "checks": [
    {
      "id": "same-session-resume",
      "input": {
        "transport": "streamable_http",
        "phase": "after_send",
        "operation": "write",
        "session_id": "session-1",
        "new_session_id": "session-1",
        "resume_supported": true,
        "last_event_id": "stream1-event9",
        "operation_key": "refund-1"
      },
      "expected": {
        "action": "resume",
        "reason": "stream_cursor",
        "operation_key": "refund-1",
        "last_event_id": "stream1-event9"
      },
      "error": null
    },
    {
      "id": "session-replaced-write-reconcile",
      "input": {
        "transport": "streamable_http",
        "phase": "after_send",
        "operation": "write",
        "session_id": "session-1",
        "new_session_id": "session-2",
        "resume_supported": true,
        "last_event_id": "stream1-event9",
        "operation_key": "refund-1"
      },
      "expected": {
        "action": "reconcile",
        "reason": "write_result_unknown",
        "operation_key": "refund-1",
        "last_event_id": null
      },
      "error": null
    },
    {
      "id": "no-replay-write-reconcile",
      "input": {
        "transport": "streamable_http",
        "phase": "after_send",
        "operation": "write",
        "session_id": "session-1",
        "new_session_id": "session-1",
        "resume_supported": false,
        "last_event_id": "stream1-event9",
        "operation_key": "refund-1"
      },
      "expected": {
        "action": "reconcile",
        "reason": "write_result_unknown",
        "operation_key": "refund-1",
        "last_event_id": null
      },
      "error": null
    },
    {
      "id": "before-send-retry-same-key",
      "input": {
        "transport": "streamable_http",
        "phase": "before_send",
        "operation": "write",
        "session_id": "session-1",
        "new_session_id": "session-1",
        "resume_supported": true,
        "last_event_id": "stream1-event9",
        "operation_key": "refund-1"
      },
      "expected": {
        "action": "retry",
        "reason": "not_sent",
        "operation_key": "refund-1",
        "last_event_id": null
      },
      "error": null
    },
    {
      "id": "response-already-known",
      "input": {
        "transport": "streamable_http",
        "phase": "after_response",
        "operation": "write",
        "session_id": "session-1",
        "new_session_id": "session-2",
        "resume_supported": true,
        "last_event_id": "stream1-event9",
        "operation_key": "refund-1"
      },
      "expected": {
        "action": "accept",
        "reason": "response_received",
        "operation_key": "refund-1",
        "last_event_id": null
      },
      "error": null
    },
    {
      "id": "read-can-retry",
      "input": {
        "transport": "streamable_http",
        "phase": "after_send",
        "operation": "read",
        "session_id": "session-1",
        "new_session_id": "session-1",
        "resume_supported": false,
        "last_event_id": "stream1-event9",
        "operation_key": null
      },
      "expected": {
        "action": "retry",
        "reason": "read_replay",
        "operation_key": null,
        "last_event_id": null
      },
      "error": null
    },
    {
      "id": "stdio-write-reconcile",
      "input": {
        "transport": "stdio",
        "phase": "after_send",
        "operation": "write",
        "session_id": null,
        "new_session_id": null,
        "resume_supported": false,
        "last_event_id": null,
        "operation_key": "refund-1"
      },
      "expected": {
        "action": "reconcile",
        "reason": "write_result_unknown",
        "operation_key": "refund-1",
        "last_event_id": null
      },
      "error": null
    },
    {
      "id": "stdio-read-retry",
      "input": {
        "transport": "stdio",
        "phase": "after_send",
        "operation": "read",
        "session_id": null,
        "new_session_id": null,
        "resume_supported": false,
        "last_event_id": null,
        "operation_key": null
      },
      "expected": {
        "action": "retry",
        "reason": "read_replay",
        "operation_key": null,
        "last_event_id": null
      },
      "error": null
    },
    {
      "id": "stdio-http-metadata-rejected",
      "input": {
        "transport": "stdio",
        "phase": "after_send",
        "operation": "write",
        "session_id": null,
        "new_session_id": null,
        "resume_supported": false,
        "last_event_id": "event9",
        "operation_key": "refund-1"
      },
      "expected": null,
      "error": "ValueError:transport_metadata"
    },
    {
      "id": "write-without-key",
      "input": {
        "transport": "streamable_http",
        "phase": "after_send",
        "operation": "write",
        "session_id": "session-1",
        "new_session_id": "session-1",
        "resume_supported": true,
        "last_event_id": "stream1-event9",
        "operation_key": null
      },
      "expected": null,
      "error": "ValueError:write_key"
    },
    {
      "id": "bool-capability-is-strict",
      "input": {
        "transport": "streamable_http",
        "phase": "after_send",
        "operation": "write",
        "session_id": "session-1",
        "new_session_id": "session-1",
        "resume_supported": "true",
        "last_event_id": "stream1-event9",
        "operation_key": "refund-1"
      },
      "expected": null,
      "error": "ValueError:input_shape"
    },
    {
      "id": "null-session-no-resume",
      "input": {
        "transport": "streamable_http",
        "phase": "after_send",
        "operation": "write",
        "session_id": null,
        "new_session_id": null,
        "resume_supported": true,
        "last_event_id": "stream1-event9",
        "operation_key": "refund-1"
      },
      "expected": {
        "action": "reconcile",
        "reason": "write_result_unknown",
        "operation_key": "refund-1",
        "last_event_id": null
      },
      "error": null
    },
    {
      "id": "no-event-cursor-no-resume",
      "input": {
        "transport": "streamable_http",
        "phase": "after_send",
        "operation": "write",
        "session_id": "session-1",
        "new_session_id": "session-1",
        "resume_supported": true,
        "last_event_id": null,
        "operation_key": "refund-1"
      },
      "expected": {
        "action": "reconcile",
        "reason": "write_result_unknown",
        "operation_key": "refund-1",
        "last_event_id": null
      },
      "error": null
    }
  ]
}
