{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "name": "chart-selection-routing-corpus",
  "version": "1.0.0",
  "purpose": "Routing floor for the chart-selection knowledge pack: 'which chart component / how do I wire it' asks reach it; screen composition, data hydration, token-role, and chat-primitive asks route past it.",
  "scoring_notes": "Heuristic TF-IDF proxy (scripts/skills/run-skill-evals.mjs); the real harness routes on descriptions. Treat misroutes as description-tightening signals.",
  "license": "internal",
  "scope": "adia-ui-factory plugin, consumer-side. Covers chart-ui, chart-legend-ui, and heatmap-ui (the chart family); explicitly excludes chat-thread-ui (chat/messaging primitive, unrelated despite the name collision with 'chart').",
  "phrases": [
    {
      "id": "charts-which-01",
      "phrase": "add a bar chart showing monthly revenue",
      "expected": "chart-selection",
      "expected_shape": "which-component",
      "rationale": "Flagship ask — chart type to component mapping."
    },
    {
      "id": "charts-which-02",
      "phrase": "what component do I use for a donut chart",
      "expected": "chart-selection",
      "expected_shape": "which-component",
      "rationale": "Type-to-component lookup."
    },
    {
      "id": "charts-which-03",
      "phrase": "show a sparkline inside a KPI card",
      "expected": "chart-selection",
      "expected_shape": "which-component",
      "rationale": "stat-ui + chart-ui[type=sparkline] composition, still this pack's territory."
    },
    {
      "id": "charts-which-04",
      "phrase": "add a calendar heatmap like GitHub contributions",
      "expected": "chart-selection",
      "expected_shape": "which-component",
      "rationale": "heatmap-ui is a chart-family sibling, not chart-ui itself, but the ask is chart-shaped."
    },
    {
      "id": "charts-which-05",
      "phrase": "which chart type works for a signup-to-purchase conversion funnel",
      "expected": "chart-selection",
      "expected_shape": "which-component",
      "rationale": "type=funnel lookup from the catalog."
    },
    {
      "id": "charts-which-06",
      "phrase": "add a gauge showing progress toward a target number",
      "expected": "chart-selection",
      "expected_shape": "which-component",
      "rationale": "type=gauge lookup; distinct from progress-ui's completion-bar territory."
    },
    {
      "id": "charts-data-01",
      "phrase": "my chart-ui data isn't showing anything on the page",
      "expected": "chart-selection",
      "expected_shape": "data-binding",
      "rationale": "Blank-chart triage — data shape check per chart.js's own shape-warning."
    },
    {
      "id": "charts-data-02",
      "phrase": "how do I pass an array of data objects to chart-ui",
      "expected": "chart-selection",
      "expected_shape": "data-binding",
      "rationale": "The x/y-keyed row shape, not the Chart.js envelope."
    },
    {
      "id": "charts-compose-01",
      "phrase": "wire a legend so clicking a series hides it in the chart",
      "expected": "chart-selection",
      "expected_shape": "composition-legend",
      "rationale": "chart-legend-ui [for] auto-mirror + toggle wiring."
    },
    {
      "id": "charts-theme-01",
      "phrase": "how do I recolor just one series in a multi-line chart",
      "expected": "chart-selection",
      "expected_shape": "theming",
      "rationale": "--color-{key} per-series override mechanics."
    },
    {
      "id": "charts-theme-02",
      "phrase": "make the chart values display as currency",
      "expected": "chart-selection",
      "expected_shape": "theming",
      "rationale": "format=currency prop + --chart-currency-prefix token."
    },
    {
      "id": "charts-responsive-01",
      "phrase": "the chart looks huge and stretched on a wide screen",
      "expected": "chart-selection",
      "expected_shape": "responsive",
      "rationale": "Container-based sizing + --chart-max-height cap."
    },
    {
      "id": "charts-events-01",
      "phrase": "listen for hover events on chart datapoints",
      "expected": "chart-selection",
      "expected_shape": "events",
      "rationale": "chart-hover/chart-leave/chart-select payload contract."
    },
    {
      "id": "charts-adv-01",
      "phrase": "build the analytics dashboard screen with charts and stat cards",
      "expected": "screen-composition",
      "rationale": "Adversarial — screen/grid composition consumes the answer; the ask is a build.",
      "expected_alternative_raw": "screen-composition (adia-ui-factory)"
    },
    {
      "id": "charts-adv-02",
      "phrase": "which color role should a warning badge use",
      "expected": "token-selection",
      "rationale": "Adversarial — a token-role ask with no chart in it at all.",
      "expected_alternative_raw": "token-selection (adia-ui-factory)"
    },
    {
      "id": "charts-adv-03",
      "phrase": "fetch the chart's data from our backend API",
      "expected": "data-wiring",
      "rationale": "Adversarial — data hydration/fetch is data-wiring's territory; this pack only covers the .data shape once it arrives.",
      "expected_alternative_raw": "data-wiring (adia-ui-factory)"
    },
    {
      "id": "charts-adv-04",
      "phrase": "add a chat thread showing the conversation with the assistant",
      "expected": null,
      "rationale": "Adversarial — chat-thread-ui is a chat/messaging primitive, unrelated to the chart family despite the name collision; resolved explicitly out of scope for this pack (gh#381).",
      "expected_alternative_raw": "chat/messaging surface (chat-shell / chat-thread-ui) — not this pack"
    },
    {
      "id": "charts-adv-05",
      "phrase": "add a progress bar showing 40 percent complete",
      "expected": null,
      "rationale": "Adversarial — a completion bar is progress-ui's territory, not a chart type; stat.yaml's own rule draws this exact boundary.",
      "expected_alternative_raw": "progress-ui (not a chart-family primitive)"
    },
    {
      "id": "charts-adv-06",
      "phrase": "the page renders blank after I added a chart",
      "expected": "surface-qa",
      "rationale": "Adversarial — a broken render is the browser gate's territory, not a chart-usage question.",
      "expected_alternative_raw": "surface-qa (adia-ui-factory)"
    }
  ],
  "minimums_per_spec": {
    "trigger_phrases": 13,
    "adversarial_phrases": 6,
    "task_shapes_covered": "which-component, data-binding, composition-legend, theming, responsive, events",
    "adversarial_fraction": "32%"
  },
  "evaluator_notes": {
    "known_limitations": "The chat-thread-ui exclusion (charts-adv-04) is the corpus's only defense against the reporter's original ambiguity (gh#381 linked chat-thread alongside chart/chart-legend) — treat any future misroute here as a description regression, not noise.",
    "promotion_criteria": "F1 >= 0.85 across 3+ runs",
    "review_cadence": "on any description edit; on /eval-run findings"
  }
}
