{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "pass-fail-grid",
  "type": "registry:component",
  "title": "Pass/fail grid",
  "description": "Every model against every test. Sample data: five models across eight suites from math to safety, pass, flaky and fail.",
  "registryDependencies": [
    "@chartory/core",
    "@chartory/plot-pass-grid"
  ],
  "files": [
    {
      "path": "registry/chartory/components/pass-fail-grid.tsx",
      "type": "registry:component",
      "target": "components/chartory/pass-fail-grid.tsx",
      "content": "// SPDX-License-Identifier: MIT · Copyright (c) 2026 BEY AGENCY LTD · Chartory, usechartory.com\n// Pass/fail grid (Chartory chart 099): sizes xs | s | m | l, laid out again from the data at each\n// size; collection \"hearth\" (default) or \"signal\" (with @chartory/signal, Code and Complete). Data in the type's shape (default: the sample). Docs:\n// https://usechartory.com/docs/charts/pass-fail-grid\nimport { ChartView, type ChartViewProps } from \"@/lib/chartory/charts/chart-view\"\nimport { registerChart } from \"@/lib/chartory/charts/defs\"\nimport { data as sample } from \"@/lib/chartory/charts/types/099-pass-fail-grid/data\"\nimport { def } from \"@/lib/chartory/charts/types/099-pass-fail-grid/layout\"\n\nregisterChart(def, sample)\n\nexport type PassFailGridData = typeof sample\nexport type PassFailGridProps = Omit<ChartViewProps, \"def\" | \"data\" | \"states\"> & {\n  /** the data to draw (default: the sample) */\n  data?: PassFailGridData\n  /** further data states: the chart morphs to them (update) or ticks through them (live, with interval) */\n  states?: PassFailGridData[]\n}\n\nexport function PassFailGrid(props: PassFailGridProps) {\n  return <ChartView def={def} {...props} />\n}\n"
    },
    {
      "path": "registry/chartory/charts/types/099-pass-fail-grid/data.ts",
      "type": "registry:lib",
      "target": "lib/chartory/charts/types/099-pass-fail-grid/data.ts",
      "content": "// SPDX-License-Identifier: MIT · Copyright (c) 2026 BEY AGENCY LTD · Chartory, usechartory.com\n// 099 Pass/fail grid · sample data (Figma chart/099, AI: release eval gate v4.2, models × suites; p pass, f fail, x flaky).\nimport type { PassGridData } from \"../../plots/pass-grid\";\n\nexport const data: PassGridData = {\n  models: [\"Atlas 3\", \"Kite 2 Pro\", \"Orion XL\", \"Vega 1.5\", \"Nova\"],\n  suites: [\"MATH\", \"CODE\", \"LAW\", \"MED\", \"SQL\", \"VIS\", \"TOOL\", \"SAFE\"],\n  m: [\n    [\"p\", \"p\", \"p\", \"p\", \"p\", \"p\", \"p\", \"p\"],\n    [\"p\", \"p\", \"f\", \"p\", \"p\", \"x\", \"p\", \"p\"],\n    [\"p\", \"p\", \"p\", \"p\", \"f\", \"p\", \"p\", \"p\"],\n    [\"p\", \"f\", \"x\", \"p\", \"p\", \"p\", \"p\", \"p\"],\n    [\"p\", \"p\", \"p\", \"p\", \"p\", \"f\", \"p\", \"p\"],\n  ],\n};\n"
    },
    {
      "path": "registry/chartory/charts/types/099-pass-fail-grid/layout.ts",
      "type": "registry:lib",
      "target": "lib/chartory/charts/types/099-pass-fail-grid/layout.ts",
      "content": "// SPDX-License-Identifier: MIT · Copyright (c) 2026 BEY AGENCY LTD · Chartory, usechartory.com\n// 099 Pass/fail grid (Figma chart/099): C.passGrid on the v4.2 release eval gate.\nimport type { ChartDef, TooltipSpec } from \"../../core/shell\";\nimport { passGrid } from \"../../plots/pass-grid\";\nimport { data } from \"./data\";\n\nconst RES = { p: \"Pass\", f: \"Fail\", x: \"Flaky\" } as const;\nconst count = (v: \"p\" | \"f\" | \"x\") => data.m.flat().filter((c) => c === v).length;\nconst suite = (s: string) => (s.length <= 3 ? s : s.charAt(0) + s.slice(1).toLowerCase());\n\n/** The next nightly re-runs of the gate: failures stand, flaky results settle to pass (one after another), and a few\n *  passes turn flaky (seeded on model, suite and run). Pass and flaky each draw one glyph, so the cell count and the\n *  glyph count stay; the changed cells' tint morphs and their glyph fades (a check and a dash differ in path commands). */\nfunction update(d0: unknown, step: number): typeof data {\n  const d = d0 as typeof data;\n  const flake = (i: number, j: number) => { const h = Math.sin(i * 12.9898 + j * 78.233 + step * 37.719) * 43758.5453; return h - Math.floor(h) < 0.07; };\n  return { ...d, m: d.m.map((r, i) => r.map((v, j) => (v === \"f\" ? v : v === \"x\" ? (step >= 1 + ((i + j) % 3) ? \"p\" : \"x\") : flake(i, j) ? \"x\" : \"p\"))) };\n}\n\n/** Hover: one cell (its tint and glyph): model × suite result, and how the model did on the gate. */\nfunction tip(d0: unknown, g: number): TooltipSpec | null {\n  const d = d0 as typeof data, n = d.suites.length, i = Math.floor(g / n), j = g % n, v = d.m[i]?.[j];\n  if (!v) return null;\n  const same = d.m[i].filter((x) => x === v).length;\n  return {\n    kind: \"cell\", caps: `${d.models[i]} · ${suite(d.suites[j])}`.toUpperCase(), value: RES[v],\n    swatch: v === \"p\" ? \"status/success\" : v === \"f\" ? \"status/danger\" : \"status/warning\",\n    share: `${same} OF ${n} SUITES ${RES[v].toUpperCase()}`,\n  };\n}\n\nexport const def: ChartDef = {\n  no: 99,\n  slug: \"pass-fail-grid\",\n  legend: [[\"status/success\", \"Pass\"], [\"status/warning\", \"Flaky\"], [\"status/danger\", \"Fail\"]],\n  plot: (K, p, w, d) => passGrid(K, p, w, (d as typeof data | undefined) ?? data),\n  tip,\n  update,\n  describe: {\n    title: \"Release eval gate v4.2\",\n    summary: `${data.models.length} models on ${data.suites.length} eval suites: ${count(\"p\")} passes, ${count(\"f\")} failures and ${count(\"x\")} flaky results.`,\n    table: { head: [\"Model\", ...data.suites.map(suite)], rows: data.models.map((m, i) => [m, ...data.m[i].map((v) => RES[v])]) },\n  },\n};\n"
    }
  ],
  "categories": [
    "charts",
    "schedule-and-status"
  ],
  "meta": {
    "access": "free",
    "no": 99,
    "family": "Schedule and status"
  }
}
