{
  "version": 1,
  "observedAt": "2026-10-06T06:18:36.315Z",
  "runtime": "v24.19.0",
  "source": "https://github.com/amartripathi0/tool-factory/blob/main/scripts/ai-visibility/benchmark.mjs",
  "sampleSize": 8,
  "passed": 8,
  "method": "Eight fixed synthetic fidelity cases run through the actual selected operation adapter. Expected outputs use repository regression expectations and explicit CSV text checks.",
  "results": [
    {
      "id": "union-columns",
      "operation": "JSONToCSV",
      "input": "[{\"name\":\"Ada\"},{\"name\":\"Lin\",\"extra\":\"kept\"}]",
      "args": [",", "\n"],
      "expected": "name,extra\nAda,\nLin,kept\n",
      "claim": "Includes fields from later records.",
      "passed": true,
      "actual": "name,extra\nAda,\nLin,kept\n",
      "error": null
    },
    {
      "id": "nested-rows",
      "operation": "JSONToCSV",
      "input": "[{\"a\":{\"b\":1}},{\"a\":{\"c\":2}}]",
      "args": [",", "\n"],
      "expected": "a.b,a.c\n1,\n,2\n",
      "claim": "Keeps separate nested records.",
      "passed": true,
      "actual": "a.b,a.c\n1,\n,2\n",
      "error": null
    },
    {
      "id": "quoted-cells",
      "operation": "JSONToCSV",
      "input": "[{\"a\":{},\"b\":[],\"c\":null,\"d\":\"a,\\\"b\\\"\\r\\nx\"}]",
      "args": [",", "\r\n"],
      "expected": "a,b,c,d\r\n{},[],null,\"a,\"\"b\"\"\r\nx\"\r\n",
      "claim": "Quotes embedded comma, quote, and line break.",
      "passed": true,
      "actual": "a,b,c,d\r\n{},[],null,\"a,\"\"b\"\"\r\nx\"\r\n",
      "error": null
    },
    {
      "id": "empty-records",
      "operation": "JSONToCSV",
      "input": "[{}, {\"a\":null}, {}, {\"a\":1}, {}]",
      "args": [",", "\n"],
      "expected": "a\n\nnull\n\n1\n\n",
      "claim": "Distinguishes missing fields from null.",
      "passed": true,
      "actual": "a\n\nnull\n\n1\n\n",
      "error": null
    },
    {
      "id": "duplicate-headers",
      "operation": "CSVToJSON",
      "input": "a,a\n1,2",
      "args": [",", "\n", "Array of dictionaries"],
      "expectedError": "duplicate",
      "claim": "Rejects duplicate dictionary headers.",
      "passed": true,
      "actual": null,
      "error": "Duplicate CSV header. Use unique names or choose Array of arrays."
    },
    {
      "id": "ragged-row",
      "operation": "CSVToJSON",
      "input": "a,b\n1",
      "args": [",", "\n", "Array of dictionaries"],
      "expectedError": "columns|cells|width",
      "claim": "Rejects inconsistent dictionary row widths.",
      "passed": true,
      "actual": null,
      "error": "CSV row 2 has 1 cells; expected 2. Use matching widths or Array of arrays."
    },
    {
      "id": "ambiguous-path",
      "operation": "JSONToCSV",
      "input": "{\"a.b\":1,\"a\":{\"b\":2}}",
      "args": [",", "\n"],
      "expectedError": "ambiguous|collision",
      "claim": "Rejects ambiguous nested field paths.",
      "passed": true,
      "actual": null,
      "error": "Ambiguous flattened path collision. Rename dotted keys or use one consistent nested structure."
    },
    {
      "id": "text-identifier",
      "operation": "CSVToJSON",
      "input": "id,value\n00123,2",
      "args": [",", "\n", "Array of dictionaries"],
      "expectedJson": [
        {
          "id": "00123",
          "value": "2"
        }
      ],
      "claim": "Keeps leading zeros in CSV text identifiers.",
      "passed": true,
      "actual": [
        {
          "id": "00123",
          "value": "2"
        }
      ],
      "error": null
    }
  ],
  "limitations": [
    "Synthetic samples do not represent all inputs.",
    "No speed, competitor, browser network, or citation performance was measured.",
    "CSV cell values remain strings. Nested JSON paths do not reconstruct on reverse conversion.",
    "These results do not establish general correctness or browser privacy."
  ]
}
