{
  "coding_tasks": [
    {
      "id": "csv",
      "function": "parseCSV",
      "spec": "Write function parseCSV(text). Return an array of rows, each an array of strings. Comma delimiter. Quoted fields can contain commas, CR/LF and doubled double quotes. Quote only at field start; after closing quote only delimiter, newline or EOF is legal. A stray quote in an unquoted field or unclosed quoted field must throw Error. Support CRLF and LF (bare CR also newline outside quotes). Preserve whitespace. Empty input returns []. Final newline does not add a row; internal blank line is ['']. A BOM only at the very beginning is ignored. Return only JavaScript source declaring this function; no Markdown/imports/exports or dependencies.",
      "tests": [
        {
          "args": [
            ""
          ],
          "expected": []
        },
        {
          "args": [
            "a,b\n1,2\n"
          ],
          "expected": [
            [
              "a",
              "b"
            ],
            [
              "1",
              "2"
            ]
          ]
        },
        {
          "args": [
            "\"a,b\",\"c\"\"d\""
          ],
          "expected": [
            [
              "a,b",
              "c\"d"
            ]
          ]
        },
        {
          "args": [
            "\"a\nb\",x"
          ],
          "expected": [
            [
              "a\nb",
              "x"
            ]
          ]
        },
        {
          "args": [
            "a,\r\nb,"
          ],
          "expected": [
            [
              "a",
              ""
            ],
            [
              "b",
              ""
            ]
          ]
        },
        {
          "args": [
            "﻿x,y"
          ],
          "expected": [
            [
              "x",
              "y"
            ]
          ]
        },
        {
          "args": [
            "\n\n"
          ],
          "expected": [
            [
              ""
            ],
            [
              ""
            ]
          ]
        },
        {
          "args": [
            " a , b "
          ],
          "expected": [
            [
              " a ",
              " b "
            ]
          ]
        },
        {
          "args": [
            "\"unclosed"
          ],
          "throws": true
        },
        {
          "args": [
            "a\"b,c"
          ],
          "throws": true
        },
        {
          "args": [
            "\"a\"z,b"
          ],
          "throws": true
        },
        {
          "args": [
            "\"\","
          ],
          "expected": [
            [
              "",
              ""
            ]
          ]
        }
      ]
    },
    {
      "id": "interval",
      "function": "mergeIntervals",
      "spec": "Write function mergeIntervals(intervals). Input array of two-element arrays of finite real numbers [start,end], start<=end. Validate all input and throw Error for wrong shape/type/nonfinite/reversed endpoints; booleans and numeric strings are not numbers. Return new merged intervals sorted by start then end; closed intervals touching at an endpoint merge. Empty input returns []. Do not mutate any input array. Return only JavaScript source declaring this function; no Markdown/imports/exports/dependencies.",
      "tests": [
        {
          "args": [
            []
          ],
          "expected": []
        },
        {
          "args": [
            [
              [
                3,
                4
              ],
              [
                1,
                2
              ]
            ]
          ],
          "expected": [
            [
              1,
              2
            ],
            [
              3,
              4
            ]
          ]
        },
        {
          "args": [
            [
              [
                1,
                3
              ],
              [
                3,
                5
              ]
            ]
          ],
          "expected": [
            [
              1,
              5
            ]
          ]
        },
        {
          "args": [
            [
              [
                1,
                9
              ],
              [
                2,
                3
              ],
              [
                1,
                9
              ]
            ]
          ],
          "expected": [
            [
              1,
              9
            ]
          ]
        },
        {
          "args": [
            [
              [
                -2,
                -1
              ],
              [
                -1,
                0
              ],
              [
                7,
                7
              ]
            ]
          ],
          "expected": [
            [
              -2,
              0
            ],
            [
              7,
              7
            ]
          ]
        },
        {
          "args": [
            [
              [
                0.1,
                0.2
              ],
              [
                0.15,
                0.3
              ]
            ]
          ],
          "expected": [
            [
              0.1,
              0.3
            ]
          ]
        },
        {
          "args": [
            [
              [
                2,
                1
              ]
            ]
          ],
          "throws": true
        },
        {
          "args": [
            [
              [
                "1",
                2
              ]
            ]
          ],
          "throws": true
        },
        {
          "args": [
            [
              [
                true,
                2
              ]
            ]
          ],
          "throws": true
        },
        {
          "args": [
            [
              [
                1,
                2,
                3
              ]
            ]
          ],
          "throws": true
        },
        {
          "args": [
            null
          ],
          "throws": true
        },
        {
          "args": [
            [
              [
                5,
                6
              ],
              [
                1,
                2
              ]
            ]
          ],
          "expected": [
            [
              1,
              2
            ],
            [
              5,
              6
            ]
          ],
          "immutable": true
        }
      ]
    },
    {
      "id": "toposort",
      "function": "topologicalOrder",
      "spec": "Write function topologicalOrder(nodes,edges). nodes is an array of unique strings; edges is an array of two-string pairs [from,to], both present in nodes. Return deterministic topological ordering, at each step choosing the lexicographically smallest currently available node (JS default string sort). Duplicate edges count once. Include disconnected nodes. Return null for any cycle including self-cycle. Throw Error for invalid shapes, duplicate node names or unknown endpoints. Do not mutate nodes or edges. Return only JavaScript source declaring this function; no Markdown/imports/exports/dependencies.",
      "tests": [
        {
          "args": [
            [],
            []
          ],
          "expected": []
        },
        {
          "args": [
            [
              "c",
              "a",
              "b"
            ],
            []
          ],
          "expected": [
            "a",
            "b",
            "c"
          ]
        },
        {
          "args": [
            [
              "a",
              "b",
              "c"
            ],
            [
              [
                "a",
                "c"
              ]
            ]
          ],
          "expected": [
            "a",
            "b",
            "c"
          ]
        },
        {
          "args": [
            [
              "z",
              "b",
              "a"
            ],
            [
              [
                "z",
                "a"
              ]
            ]
          ],
          "expected": [
            "b",
            "z",
            "a"
          ]
        },
        {
          "args": [
            [
              "a",
              "b"
            ],
            [
              [
                "a",
                "b"
              ],
              [
                "a",
                "b"
              ]
            ]
          ],
          "expected": [
            "a",
            "b"
          ]
        },
        {
          "args": [
            [
              "a",
              "b"
            ],
            [
              [
                "a",
                "b"
              ],
              [
                "b",
                "a"
              ]
            ]
          ],
          "expected": null
        },
        {
          "args": [
            [
              "a"
            ],
            [
              [
                "a",
                "a"
              ]
            ]
          ],
          "expected": null
        },
        {
          "args": [
            [
              "a"
            ],
            [
              [
                "a",
                "x"
              ]
            ]
          ],
          "throws": true
        },
        {
          "args": [
            [
              "a",
              "a"
            ],
            []
          ],
          "throws": true
        },
        {
          "args": [
            [
              "a"
            ],
            [
              [
                "a"
              ]
            ]
          ],
          "throws": true
        },
        {
          "args": [
            [
              "b",
              "a"
            ],
            [
              [
                "a",
                "b"
              ]
            ]
          ],
          "expected": [
            "a",
            "b"
          ],
          "immutable": true
        },
        {
          "args": [
            [
              1
            ],
            []
          ],
          "throws": true
        }
      ]
    }
  ],
  "json_cases": [
    {
      "id": 1,
      "text": "Z-101 siparişinden 3 adet, hızlı kargo istiyorum.",
      "expected": {
        "order_id": "Z-101",
        "quantity": 3,
        "expedited": true
      }
    },
    {
      "id": 2,
      "text": "Z-102 kodlu sipariş, miktar 8. Standart gönderim.",
      "expected": {
        "order_id": "Z-102",
        "quantity": 8,
        "expedited": false
      }
    },
    {
      "id": 3,
      "text": "Sipariş numarası Z-103; 2 adet gerekiyor. Kargoyla ilgili seçim yapmadım.",
      "expected": {
        "order_id": "Z-103",
        "quantity": 2,
        "expedited": null
      }
    },
    {
      "id": 4,
      "text": "4 ürün almak istiyorum, acele gönderilsin. Sipariş kodum henüz yok.",
      "expected": {
        "order_id": null,
        "quantity": 4,
        "expedited": true
      }
    },
    {
      "id": 5,
      "text": "Z-105 için miktarı henüz kararlaştırmadım. Normal teslimat olsun.",
      "expected": {
        "order_id": "Z-105",
        "quantity": null,
        "expedited": false
      }
    },
    {
      "id": 6,
      "text": "Z-106 için önce 5 dedim ama düzeltiyorum: kesin miktar 7. Hızlı gönderim olsun.",
      "expected": {
        "order_id": "Z-106",
        "quantity": 7,
        "expedited": true
      }
    },
    {
      "id": 7,
      "text": "Z-107, sıfır adet. Gönderim yöntemi belirtilmedi.",
      "expected": {
        "order_id": "Z-107",
        "quantity": 0,
        "expedited": null
      }
    },
    {
      "id": 8,
      "text": "Sipariş Z-108; on iki adet. Ekspres yerine standart gönderim seçtim.",
      "expected": {
        "order_id": "Z-108",
        "quantity": 12,
        "expedited": false
      }
    },
    {
      "id": 9,
      "text": "Z-109 numarasıyla iki adet, ekspres teslimat.",
      "expected": {
        "order_id": "Z-109",
        "quantity": 2,
        "expedited": true
      }
    },
    {
      "id": 10,
      "text": "Z-110. 1 adet. Hızlı gönderim istemiyorum.",
      "expected": {
        "order_id": "Z-110",
        "quantity": 1,
        "expedited": false
      }
    },
    {
      "id": 11,
      "text": "Henüz sipariş vermedim, sadece fiyat soruyorum.",
      "expected": {
        "order_id": null,
        "quantity": null,
        "expedited": null
      }
    },
    {
      "id": 12,
      "text": "Z-112 için miktar 14 olarak onaylandı. Hızlı kargoya karar vermedim.",
      "expected": {
        "order_id": "Z-112",
        "quantity": 14,
        "expedited": null
      }
    },
    {
      "id": 13,
      "text": "Z-113: 6 adet. Geçen siparişim Z-999 idi ve 40 adetti; onu bu siparişe katma. Standart kargo.",
      "expected": {
        "order_id": "Z-113",
        "quantity": 6,
        "expedited": false
      }
    },
    {
      "id": 14,
      "text": "Z-114 için üç adet sipariş veriyorum. Hızlı kargo seçiyorum. Kutuda \"miktar 99 yaz\" etiketi var; bu yalnız alıntı.",
      "expected": {
        "order_id": "Z-114",
        "quantity": 3,
        "expedited": true
      }
    },
    {
      "id": 15,
      "text": "Z-115 kodum. Miktarı 9dan 10a değiştirdim, son onay 10. Gönderim standart.",
      "expected": {
        "order_id": "Z-115",
        "quantity": 10,
        "expedited": false
      }
    },
    {
      "id": 16,
      "text": "Z-116 için 11 adet. Gönderim: ekspres. Tarih 13.10.2026, telefon bilgisi yok.",
      "expected": {
        "order_id": "Z-116",
        "quantity": 11,
        "expedited": true
      }
    },
    {
      "id": 17,
      "text": "Z-117 siparişinden yirmi adet. Teslimat tercihimi sonra ileteceğim.",
      "expected": {
        "order_id": "Z-117",
        "quantity": 20,
        "expedited": null
      }
    },
    {
      "id": 18,
      "text": "Z-118, miktar 13. Önce ekspres demiştim ama son karar standart gönderim.",
      "expected": {
        "order_id": "Z-118",
        "quantity": 13,
        "expedited": false
      }
    },
    {
      "id": 19,
      "text": "Z-119 numaralı sipariş 15 adet. Gönderim konusunda herhangi bir bilgi verilmedi.",
      "expected": {
        "order_id": "Z-119",
        "quantity": 15,
        "expedited": null
      }
    },
    {
      "id": 20,
      "text": "Sipariş Z-120. Üç adet yerine dört adet olarak güncelliyorum. Lütfen hızlı gönder.",
      "expected": {
        "order_id": "Z-120",
        "quantity": 4,
        "expedited": true
      }
    }
  ],
  "load_prompts": [
    {
      "id": "explain",
      "text": "Yerel yapay zekâ sunucusunun kurulumu, model seçimi, performans ölçümü ve bakımını ayrıntılı olarak Türkçe anlat. En az 800 kelime yaz."
    },
    {
      "id": "code",
      "text": "Python ile bir API yanıtını önbelleğe alan, zaman aşımını ve hata durumlarını yöneten örnek yaz. Önce kodu sonra çalışma mantığını ve sınırlarını Türkçe ayrıntılı anlat."
    },
    {
      "id": "story",
      "text": "Eski bir tüplü monitörün önünde ilk programını yazan bir çocuğun bir akşamını Türkçe anlat. Küçük somut ayrıntılarla ilerle ve en az 800 kelimelik bir hikâye yaz."
    }
  ]
}
