{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "name": "table-composition-routing-corpus",
  "version": "1.1.0",
  "purpose": "Routing floor for the table-composition knowledge pack: table-display/organization asks (contained vs uncontained, striping, resize, column/header conventions, cell types, inline-edit grids, tree tables) reach it; composition, data-wiring, other-pattern-lookup, and framework-authoring 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. Fences against screen-composition (screen composition), data-wiring (data/state wiring), pattern-catalog (the general pattern index, including OTHER data-table-category patterns), token-selection (color-role lookup), surface-qa (render QA), and primitive-authoring (framework-side primitive authoring, forge plugin).",
  "phrases": [
    {
      "id": "tables-basic-01",
      "phrase": "how do I show a table of data in this app",
      "expected": "table-composition",
      "expected_shape": "basic-table",
      "rationale": "The pack's flagship ask — which table shape/props to reach for."
    },
    {
      "id": "tables-chrome-01",
      "phrase": "should this table sit inside a card with bleed or stand alone",
      "expected": "table-composition",
      "expected_shape": "contained-uncontained",
      "rationale": "The contained vs uncontained/bleed chrome-mode question — a DIFFERENT axis from [raw] (own-vs-consumer-owned body); real consumer usage never combines bleed with [raw]."
    },
    {
      "id": "tables-chrome-02",
      "phrase": "table has doubled-looking corners when I put it in a card",
      "expected": "table-composition",
      "expected_shape": "contained-uncontained",
      "rationale": "Symptom of overriding --table-radius (or skipping <section bleed>'s padding removal) inside a card — the doubly-rounded-corners gotcha table.css's own comment names. NOT a [raw] question — corrected after independent review found the original draft wrongly routed doubled chrome through [raw]."
    },
    {
      "id": "tables-default-01",
      "phrase": "is striped the default look for table-ui or do I need to set it",
      "expected": "table-composition",
      "expected_shape": "default-behavior",
      "rationale": "Striped is opt-in, not default — a defaults-table lookup."
    },
    {
      "id": "tables-default-02",
      "phrase": "why can't I resize this table column",
      "expected": "table-composition",
      "expected_shape": "default-behavior",
      "rationale": "Resize defaults FLIP by form: opt-out (default ON, col.resizable !== false) for a JS .columns object; opt-in (absent attribute = false) for a declarative <col-def> — the answer depends on which form the consumer used, not a single universal default."
    },
    {
      "id": "tables-column-01",
      "phrase": "add click-to-sort and a filter dropdown to these table columns",
      "expected": "table-composition",
      "expected_shape": "column-convention",
      "rationale": "Header/column affordance wiring."
    },
    {
      "id": "tables-column-02",
      "phrase": "what fields does the table's sort event detail carry",
      "expected": "table-composition",
      "expected_shape": "column-convention",
      "rationale": "detail.key/detail.dir vs .column/.direction — an event-contract lookup."
    },
    {
      "id": "tables-column-03",
      "phrase": "pin the actions column to the right edge of the table",
      "expected": "table-composition",
      "expected_shape": "column-convention",
      "rationale": "Column pinning convention."
    },
    {
      "id": "tables-celltype-01",
      "phrase": "which table cell type renders a currency value formatted",
      "expected": "table-composition",
      "expected_shape": "cell-type",
      "rationale": "Built-in cell-type catalog lookup."
    },
    {
      "id": "tables-toolbar-01",
      "phrase": "add a search box and column-visibility toggle above this table",
      "expected": "table-composition",
      "expected_shape": "toolbar-pairing",
      "rationale": "table-toolbar-ui pairing question."
    },
    {
      "id": "tables-loading-01",
      "phrase": "the table doesn't show anything while data is still loading",
      "expected": "table-composition",
      "expected_shape": "loading-empty",
      "rationale": "Skeleton-row loading behavior + empty-state overlay."
    },
    {
      "id": "tables-inline-edit-01",
      "phrase": "build an editable spreadsheet-style grid where every cell is an input",
      "expected": "table-composition",
      "expected_shape": "inline-edit",
      "rationale": "The advanced spreadsheet-cells inline-edit shape."
    },
    {
      "id": "tables-inline-edit-02",
      "phrase": "let the user edit one row of this table at a time with save and cancel",
      "expected": "table-composition",
      "expected_shape": "inline-edit",
      "rationale": "The single-editing-row (default) inline-edit shape."
    },
    {
      "id": "tables-tree-01",
      "phrase": "show a nested expandable hierarchy like an org chart or file tree",
      "expected": "table-composition",
      "expected_shape": "tree-table",
      "rationale": "Tree-table shape — tree-ui + tree-item-ui, not a flat table."
    },
    {
      "id": "tables-tree-02",
      "phrase": "how deep can rows nest in a tree table before it stops reading",
      "expected": "table-composition",
      "expected_shape": "tree-table",
      "rationale": "The depth-caps-at-4 composition rule."
    },
    {
      "id": "tables-adv-01",
      "phrase": "build the members screen with a sidebar, a table, and a detail drawer",
      "expected": "screen-composition",
      "rationale": "Adversarial — whole-screen composition consumes table knowledge, the ask is a build.",
      "expected_alternative_raw": "screen-composition (adia-ui-factory)"
    },
    {
      "id": "tables-adv-02",
      "phrase": "wire this table's rows to fetch from our backend and hydrate on load",
      "expected": "data-wiring",
      "rationale": "Adversarial — data/hydration ownership, not table shape.",
      "expected_alternative_raw": "data-wiring (adia-ui-factory)"
    },
    {
      "id": "tables-adv-03",
      "phrase": "is there an existing pattern for a bulk-action toolbar over selected rows",
      "expected": "pattern-catalog",
      "rationale": "Adversarial — a DIFFERENT data-table-category pattern lookup; table-composition only owns table-ui/tree-ui and the named inline-edit-and-tree pattern.",
      "expected_alternative_raw": "pattern-catalog (adia-ui-factory)"
    },
    {
      "id": "tables-adv-04",
      "phrase": "which token should the striped row background use",
      "expected": "token-selection",
      "rationale": "Adversarial — color ROLE choice, not table prop/shape.",
      "expected_alternative_raw": "token-selection (adia-ui-factory)"
    },
    {
      "id": "tables-adv-05",
      "phrase": "the table renders blank with console errors after my change",
      "expected": "surface-qa",
      "rationale": "Adversarial — a broken render is the browser gate's territory.",
      "expected_alternative_raw": "surface-qa (adia-ui-factory)"
    },
    {
      "id": "tables-adv-06",
      "phrase": "add a new virtual-scrolling prop to table-ui itself",
      "expected": "primitive-authoring",
      "rationale": "Adversarial — framework-side primitive AUTHORING is forge-side, not this consumer-side pack.",
      "expected_alternative_raw": "primitive-authoring (adia-ui-forge)"
    },
    {
      "id": "tables-adv-07",
      "phrase": "render a virtualized list of 10,000 chat threads without lagging the page",
      "expected": null,
      "expected_shape": "huge-collection",
      "rationale": "Adversarial — table-ui has no virtual-scroll mode ([virtual] is a documented anti-pattern) and [paginate] only scales to the hundreds; this is list-window-ui's territory, a different (non-table-shaped) primitive this pack only points at.",
      "expected_alternative_raw": "list-window-ui (packages/web-components/components/list-window) — not an adia-ui-factory skill, a different primitive"
    }
  ],
  "minimums_per_spec": {
    "trigger_phrases": 15,
    "adversarial_phrases": 7,
    "task_shapes_covered": "basic-table, contained-uncontained, default-behavior, column-convention, cell-type, toolbar-pairing, loading-empty, inline-edit, tree-table",
    "adversarial_fraction": "32%"
  },
  "evaluator_notes": {
    "known_limitations": "The pattern-catalog adversarial case (tables-adv-03) is a fine boundary — both packs legitimately mention the data-table category; the fence is 'the named inline-edit-and-tree pattern and table-ui/tree-ui themselves' vs 'every other data-table pattern', not a clean vocabulary split.",
    "promotion_criteria": "F1 >= 0.85 across 3+ runs",
    "review_cadence": "on any description edit; on /eval-run findings"
  }
}
