{
  "runAt": "2026-07-25T01:49:23.568Z",
  "endpoint": "https://kimik3.online/api/v1/chat/completions",
  "methodology": "Production KimiK3.online API; one request per task; temperature 1; high reasoning; no retries or output editing. A temporary test account, credits, and key were deleted after the run.",
  "upstreamBaseline": {
    "runAt": "2026-07-25T01:46:01.016Z",
    "endpoint": "https://api.moonshot.ai/v1/chat/completions",
    "methodology": "One request per task; temperature 1 (the only value accepted by the endpoint); high reasoning; no retries or output editing.",
    "results": [
      {
        "id": "range-merge",
        "title": "Repair an interval merge function",
        "prompt": "Return only JavaScript code. Fix this function so it does not mutate its input, merges overlapping or touching numeric intervals, handles unsorted input, and returns [] for []: function mergeRanges(ranges) { ranges.sort((a,b)=>a[0]-b[0]); const out=[ranges[0]]; for(const r of ranges.slice(1)){ const last=out[out.length-1]; if(r[0] < last[1]) last[1]=Math.max(last[1],r[1]); else out.push(r); } return out; }",
        "checks": [
          "explains no mutation through implementation",
          "uses <= or equivalent for touching intervals",
          "handles empty input"
        ],
        "model": "kimi-k3",
        "reasoningEffort": "high",
        "temperature": 1,
        "elapsedMs": 12239,
        "usage": {
          "prompt_tokens": 234,
          "completion_tokens": 394,
          "total_tokens": 628,
          "completion_tokens_details": {
            "reasoning_tokens": 256
          }
        },
        "output": "function mergeRanges(ranges) {\n  if (ranges.length === 0) return [];\n  const sorted = ranges.map(([start, end]) => [start, end]).sort((a, b) => a[0] - b[0]);\n  const out = [sorted[0]];\n  for (const r of sorted.slice(1)) {\n    const last = out[out.length - 1];\n    if (r[0] <= last[1]) last[1] = Math.max(last[1], r[1]);\n    else out.push(r);\n  }\n  return out;\n}",
        "finishReason": "stop"
      },
      {
        "id": "csv-parser",
        "title": "Implement a small CSV state machine",
        "prompt": "Return only TypeScript code. Implement parseCsvLine(line: string): string[] supporting commas, quoted fields, escaped double quotes represented by two quotes, empty fields, and a final empty field. Throw Error(\"Unclosed quote\") for malformed unclosed quotes. Do not use a CSV package.",
        "checks": [
          "tracks quoted state",
          "supports doubled quote escaping",
          "preserves empty and final fields",
          "throws on unclosed quote"
        ],
        "model": "kimi-k3",
        "reasoningEffort": "high",
        "temperature": 1,
        "elapsedMs": 24876,
        "usage": {
          "prompt_tokens": 178,
          "completion_tokens": 767,
          "total_tokens": 945,
          "completion_tokens_details": {
            "reasoning_tokens": 550
          }
        },
        "output": "export function parseCsvLine(line: string): string[] {\n  const fields: string[] = [];\n  let current = \"\";\n  let inQuotes = false;\n\n  for (let i = 0; i < line.length; i++) {\n    const ch = line[i];\n\n    if (inQuotes) {\n      if (ch === '\"') {\n        if (i + 1 < line.length && line[i + 1] === '\"') {\n          current += '\"';\n          i++;\n        } else {\n          inQuotes = false;\n        }\n      } else {\n        current += ch;\n      }\n    } else if (ch === \",\") {\n      fields.push(current);\n      current = \"\";\n    } else if (ch === '\"' && current === \"\") {\n      inQuotes = true;\n    } else {\n      current += ch;\n    }\n  }\n\n  if (inQuotes) {\n    throw new Error(\"Unclosed quote\");\n  }\n\n  fields.push(current);\n  return fields;\n}",
        "finishReason": "stop"
      },
      {
        "id": "react-accessibility",
        "title": "Review and repair an accessible React dialog",
        "prompt": "Return only TSX code. Rewrite this component as an accessible modal without external libraries. Requirements: labelled dialog, Escape closes, initial focus goes to Close, focus is restored to opener, background click closes but panel click does not, listener cleanup, SSR-safe. Input: export function Modal({open,onClose,children}) { if(!open)return null; return <div onClick={onClose}><div><button onClick={onClose}>Close</button>{children}</div></div> }",
        "checks": [
          "role dialog and aria-modal",
          "keyboard Escape handler with cleanup",
          "initial and restored focus",
          "overlay and panel click separation",
          "SSR-safe document access in effect"
        ],
        "model": "kimi-k3",
        "reasoningEffort": "high",
        "temperature": 1,
        "elapsedMs": 32199,
        "usage": {
          "prompt_tokens": 221,
          "completion_tokens": 1138,
          "total_tokens": 1359,
          "completion_tokens_details": {
            "reasoning_tokens": 632
          }
        },
        "output": "import { useEffect, useRef, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\n\ntype ModalProps = {\n  open: boolean;\n  onClose: () => void;\n  children: React.ReactNode;\n  label?: string;\n};\n\nexport function Modal({ open, onClose, children, label = \"Dialog\" }: ModalProps) {\n  const closeRef = useRef<HTMLButtonElement>(null);\n  const openerRef = useRef<HTMLElement | null>(null);\n  const [mounted, setMounted] = useState(false);\n\n  useEffect(() => {\n    setMounted(true);\n  }, []);\n\n  useEffect(() => {\n    if (!open || typeof document === \"undefined\") return;\n\n    openerRef.current = document.activeElement as HTMLElement | null;\n    closeRef.current?.focus();\n\n    const onKeyDown = (event: KeyboardEvent) => {\n      if (event.key === \"Escape\") {\n        event.stopPropagation();\n        onClose();\n      }\n    };\n\n    document.addEventListener(\"keydown\", onKeyDown);\n\n    return () => {\n      document.removeEventListener(\"keydown\", onKeyDown);\n      openerRef.current?.focus?.();\n      openerRef.current = null;\n    };\n  }, [open, onClose]);\n\n  if (!open || !mounted || typeof document === \"undefined\") return null;\n\n  return createPortal(\n    <div\n      onClick={onClose}\n      style={{\n        position: \"fixed\",\n        inset: 0,\n        background: \"rgba(0, 0, 0, 0.5)\",\n        display: \"flex\",\n        alignItems: \"center\",\n        justifyContent: \"center\",\n        zIndex: 1000,\n      }}\n    >\n      <div\n        role=\"dialog\"\n        aria-modal=\"true\"\n        aria-label={label}\n        onClick={(event) => event.stopPropagation()}\n        style={{\n          background: \"#fff\",\n          color: \"#000\",\n          borderRadius: 8,\n          padding: 24,\n          maxWidth: \"90vw\",\n          maxHeight: \"90vh\",\n          overflow: \"auto\",\n        }}\n      >\n        <button ref={closeRef} type=\"button\" onClick={onClose}>\n          Close\n        </button>\n        {children}\n      </div>\n    </div>,\n    document.body\n  );\n}",
        "finishReason": "stop"
      }
    ]
  },
  "results": [
    {
      "id": "range-merge",
      "title": "Repair an interval merge function",
      "prompt": "Return only JavaScript code. Fix this function so it does not mutate its input, merges overlapping or touching numeric intervals, handles unsorted input, and returns [] for []: function mergeRanges(ranges) { ranges.sort((a,b)=>a[0]-b[0]); const out=[ranges[0]]; for(const r of ranges.slice(1)){ const last=out[out.length-1]; if(r[0] < last[1]) last[1]=Math.max(last[1],r[1]); else out.push(r); } return out; }",
      "checks": [
        "explains no mutation through implementation",
        "uses <= or equivalent for touching intervals",
        "handles empty input"
      ],
      "model": "kimi-k3",
      "reasoningEffort": "high",
      "temperature": 1,
      "elapsedMs": 16132,
      "usage": {
        "prompt_tokens": 234,
        "completion_tokens": 458,
        "total_tokens": 692,
        "cached_tokens": 234,
        "completion_tokens_details": {
          "reasoning_tokens": 335
        },
        "prompt_tokens_details": {
          "cached_tokens": 234
        }
      },
      "output": "function mergeRanges(ranges) {\n  const sorted = ranges.map(r => [r[0], r[1]]).sort((a, b) => a[0] - b[0]);\n  const out = [];\n  for (const r of sorted) {\n    const last = out[out.length - 1];\n    if (last && r[0] <= last[1]) last[1] = Math.max(last[1], r[1]);\n    else out.push(r);\n  }\n  return out;\n}",
      "finishReason": "stop",
      "source": "KimiK3.online production API",
      "endpoint": "https://kimik3.online/api/v1/chat/completions"
    },
    {
      "id": "csv-parser",
      "title": "Implement a small CSV state machine",
      "prompt": "Return only TypeScript code. Implement parseCsvLine(line: string): string[] supporting commas, quoted fields, escaped double quotes represented by two quotes, empty fields, and a final empty field. Throw Error(\"Unclosed quote\") for malformed unclosed quotes. Do not use a CSV package.",
      "checks": [
        "tracks quoted state",
        "supports doubled quote escaping",
        "preserves empty and final fields",
        "throws on unclosed quote"
      ],
      "model": "kimi-k3",
      "reasoningEffort": "high",
      "temperature": 1,
      "elapsedMs": 13701,
      "usage": {
        "prompt_tokens": 178,
        "completion_tokens": 506,
        "total_tokens": 684,
        "cached_tokens": 178,
        "completion_tokens_details": {
          "reasoning_tokens": 262
        },
        "prompt_tokens_details": {
          "cached_tokens": 178
        }
      },
      "output": "function parseCsvLine(line: string): string[] {\n  const fields: string[] = [];\n  let current = \"\";\n  let inQuotes = false;\n  let i = 0;\n\n  while (i < line.length) {\n    const ch = line[i];\n\n    if (inQuotes) {\n      if (ch === '\"') {\n        if (line[i + 1] === '\"') {\n          current += '\"';\n          i += 2;\n        } else {\n          inQuotes = false;\n          i += 1;\n        }\n      } else {\n        current += ch;\n        i += 1;\n      }\n    } else {\n      if (ch === \",\") {\n        fields.push(current);\n        current = \"\";\n        i += 1;\n      } else if (ch === '\"' && current === \"\") {\n        inQuotes = true;\n        i += 1;\n      } else {\n        current += ch;\n        i += 1;\n      }\n    }\n  }\n\n  if (inQuotes) {\n    throw new Error(\"Unclosed quote\");\n  }\n\n  fields.push(current);\n  return fields;\n}",
      "finishReason": "stop",
      "source": "KimiK3.online production API",
      "endpoint": "https://kimik3.online/api/v1/chat/completions"
    },
    {
      "id": "react-accessibility",
      "title": "Review and repair an accessible React dialog",
      "prompt": "Return only TSX code. Rewrite this component as an accessible modal without external libraries. Requirements: labelled dialog, Escape closes, initial focus goes to Close, focus is restored to opener, background click closes but panel click does not, listener cleanup, SSR-safe. Input: export function Modal({open,onClose,children}) { if(!open)return null; return <div onClick={onClose}><div><button onClick={onClose}>Close</button>{children}</div></div> }",
      "checks": [
        "role dialog and aria-modal",
        "keyboard Escape handler with cleanup",
        "initial and restored focus",
        "overlay and panel click separation",
        "SSR-safe document access in effect"
      ],
      "model": "kimi-k3",
      "reasoningEffort": "high",
      "temperature": 1,
      "elapsedMs": 80044,
      "usage": {
        "prompt_tokens": 221,
        "completion_tokens": 2639,
        "total_tokens": 2860,
        "cached_tokens": 221,
        "completion_tokens_details": {
          "reasoning_tokens": 2169
        },
        "prompt_tokens_details": {
          "cached_tokens": 221
        }
      },
      "output": "import { useEffect, useRef } from 'react';\nimport type { ReactNode } from 'react';\n\ntype ModalProps = {\n  open: boolean;\n  onClose: () => void;\n  children: ReactNode;\n  ariaLabel?: string;\n  ariaLabelledby?: string;\n};\n\nexport function Modal({\n  open,\n  onClose,\n  children,\n  ariaLabel = 'Dialog',\n  ariaLabelledby,\n}: ModalProps) {\n  const closeRef = useRef<HTMLButtonElement>(null);\n  const openerRef = useRef<HTMLElement | null>(null);\n  const onCloseRef = useRef(onClose);\n\n  useEffect(() => {\n    onCloseRef.current = onClose;\n  }, [onClose]);\n\n  useEffect(() => {\n    if (typeof document === 'undefined' || typeof window === 'undefined' || !open) {\n      return;\n    }\n\n    openerRef.current =\n      document.activeElement instanceof HTMLElement ? document.activeElement : null;\n\n    const focusTimer = window.setTimeout(() => {\n      closeRef.current?.focus();\n    }, 0);\n\n    const onKeyDown = (event: KeyboardEvent) => {\n      if (event.key === 'Escape') {\n        event.preventDefault();\n        onCloseRef.current();\n      }\n    };\n\n    document.addEventListener('keydown', onKeyDown);\n\n    return () => {\n      window.clearTimeout(focusTimer);\n      document.removeEventListener('keydown', onKeyDown);\n\n      const opener = openerRef.current;\n      openerRef.current = null;\n      if (opener?.isConnected) {\n        opener.focus();\n      }\n    };\n  }, [open]);\n\n  if (!open) return null;\n\n  return (\n    <div role=\"presentation\" onClick={onClose}>\n      <div\n        role=\"dialog\"\n        aria-modal=\"true\"\n        aria-labelledby={ariaLabelledby}\n        aria-label={ariaLabelledby ? undefined : ariaLabel}\n        onClick={(event) => event.stopPropagation()}\n      >\n        <button ref={closeRef} type=\"button\" onClick={onClose}>\n          Close\n        </button>\n        {children}\n      </div>\n    </div>\n  );\n}",
      "finishReason": "stop",
      "source": "KimiK3.online production API",
      "endpoint": "https://kimik3.online/api/v1/chat/completions"
    }
  ]
}