{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "name": "theme-audit routing accuracy corpus",
  "version": "1.0.0",
  "purpose": "Routing-eval corpus for theme-audit (adia-ui-factory plugin, gh#2257 / LLD-0012). Each phrase declares whether theme-audit SHOULD be the routing target. Scored by the estate's TF-IDF routing-eval runner against the skill's description (heuristic token overlap).",
  "scoring_notes": "Heuristic signal, not ground truth. Treat misroutes as a prompt to tighten the skill description, never as a reason to keyword-stuff it. Real harness routing is LLM-driven.",
  "license": "internal",
  "scope": "theme-audit routing — does this phrase activate theme-audit (the consumer-side theme.css redundancy classifier), and does it correctly stay OUT of surface-qa (renders/grades a live surface), token-selection (which token to pick going forward), find-unused (JS/markup inertness after an upgrade), and forge's component-token-audit (framework-side, packages/web-components)?",
  "phrases": [
    {
      "id": "theme-restate-01",
      "phrase": "audit this app's theme.css for stuff that just restates what the kit already ships",
      "expected": "theme-audit",
      "expected_shape": "restated-defaults",
      "rationale": "Canonical class-1 phrasing — matches the skill's own 'restated defaults' framing."
    },
    {
      "id": "theme-restate-02",
      "phrase": "does this rule in our override css duplicate a default the primitive already sets?",
      "expected": "theme-audit",
      "expected_shape": "restated-defaults",
      "rationale": "Direct restated-default question, per-declaration framing."
    },
    {
      "id": "theme-token-01",
      "phrase": "we bumped @adia-ai/web-components — check our theme file for tokens we're now re-deriving that the framework already provides",
      "expected": "theme-audit",
      "expected_shape": "token-rederivation",
      "rationale": "Post-upgrade token re-derivation check, verbatim upgrade-trigger language from the description."
    },
    {
      "id": "theme-token-02",
      "phrase": "does our theme.css have custom properties that just alias an existing --a-* token?",
      "expected": "theme-audit",
      "expected_shape": "token-rederivation",
      "rationale": "Alias-of-alias class-2 sub-kind, named directly."
    },
    {
      "id": "theme-token-03",
      "phrase": "find fallback literals in our theme file for tokens the framework always defines anyway",
      "expected": "theme-audit",
      "expected_shape": "token-rederivation",
      "rationale": "fallback-literal class-2 sub-kind."
    },
    {
      "id": "theme-dead-01",
      "phrase": "find dead selectors in our override stylesheet that don't match anything on any page anymore",
      "expected": "theme-audit",
      "expected_shape": "dead-selectors",
      "rationale": "Class-3 dead-selector census, verbatim phrasing."
    },
    {
      "id": "theme-dead-02",
      "phrase": "check for selectors declared twice in our theme.css where the second one silently wins",
      "expected": "theme-audit",
      "expected_shape": "dead-selectors",
      "rationale": "last-wins sub-kind, static duplicate-selector detection."
    },
    {
      "id": "theme-handbuilt-01",
      "phrase": "is any of this custom css just reimplementing a chip or badge primitive we already ship?",
      "expected": "theme-audit",
      "expected_shape": "hand-built-component",
      "rationale": "Class-4 hand-built-component, name-intent signal."
    },
    {
      "id": "theme-handbuilt-02",
      "phrase": "our theme file styles a native <button> directly with custom borders and colors — should that be flagged?",
      "expected": "theme-audit",
      "expected_shape": "hand-built-component",
      "rationale": "native-leak class-4 sub-kind."
    },
    {
      "id": "theme-classify-01",
      "phrase": "classify what's redundant in this consumer theme file before we clean it up",
      "expected": "theme-audit",
      "expected_shape": "classify-redundancy",
      "rationale": "Verbatim 'classify' + 'redundant' + 'theme file' — the skill description's own vocabulary."
    },
    {
      "id": "theme-classify-02",
      "phrase": "run the theme-audit runner against src/app/styles/theme.css",
      "expected": "theme-audit",
      "expected_shape": "classify-redundancy",
      "rationale": "Direct invocation naming the skill/tool."
    },
    {
      "id": "theme-classify-03",
      "phrase": "before we sweep this app for unused code, first check if the theme.css itself is pulling its weight",
      "expected": "theme-audit",
      "expected_shape": "classify-redundancy",
      "rationale": "Lifecycle-moment phrasing — 'before a find-unused sweep' from the skill's own trigger list."
    },
    {
      "id": "theme-classify-04",
      "phrase": "run adia-theme-audit against the admin app's theme file and app root",
      "expected": "theme-audit",
      "expected_shape": "classify-redundancy",
      "rationale": "Bin-name invocation with the two required flags named informally."
    },
    {
      "id": "theme-classify-05",
      "phrase": "which declarations in our css can we safely delete because the framework already sets them?",
      "expected": "theme-audit",
      "expected_shape": "restated-defaults",
      "rationale": "Outcome-shaped phrasing for class 1/2 deletion candidates."
    },
    {
      "id": "theme-adv-01",
      "phrase": "verify this surface renders with zero console errors before we ship it",
      "expected": "surface-qa",
      "rationale": "Adversarial — rendering/grading a live surface is surface-qa's browser gate; theme-audit never renders anything or reads console output.",
      "expected_alternative_raw": "surface-qa (adia-ui-factory plugin)"
    },
    {
      "id": "theme-adv-02",
      "phrase": "which token should I reach for to color this new banner's background?",
      "expected": "token-selection",
      "rationale": "Adversarial — picking a token while authoring new UI is token-selection's forward-looking job; theme-audit only classifies CSS that already exists.",
      "expected_alternative_raw": "token-selection (adia-ui-factory plugin)"
    },
    {
      "id": "theme-adv-03",
      "phrase": "we bumped and nothing broke — what are we missing from 0.8.x that we never picked up in our JS and markup?",
      "expected": "find-unused",
      "rationale": "Adversarial — inert JS/markup after a non-breaking upgrade is find-unused's territory; theme-audit is the CSS-only sibling, scoped to one theme file.",
      "expected_alternative_raw": "find-unused (adia-ui-factory plugin)"
    },
    {
      "id": "theme-adv-04",
      "phrase": "audit packages/web-components for direct --md-sys-color usage bypassing the --a-* layer",
      "expected": null,
      "rationale": "Adversarial — framework-side token-layer audit against the framework's own source is forge's component-token-audit, a different repo surface entirely; theme-audit never touches packages/web-components.",
      "expected_alternative_raw": "component-token-audit (adia-ui-kit-forge plugin)"
    },
    {
      "id": "theme-adv-05",
      "phrase": "run an accessibility pass on the profile page",
      "expected": "surface-qa",
      "rationale": "Adversarial — a11y checking is surface-qa's rendered-page gate, not a static CSS classification.",
      "expected_alternative_raw": "surface-qa (adia-ui-factory plugin)"
    },
    {
      "id": "theme-adv-06",
      "phrase": "write unit tests for the new date-parsing utility function",
      "expected": null,
      "rationale": "Adversarial — generic unit-test authoring with no theme/CSS surface; no AdiaUI skill should activate."
    }
  ],
  "minimums_per_spec": {
    "trigger_phrases": 14,
    "adversarial_phrases": 6,
    "task_shapes_covered": "restated-defaults, token-rederivation, dead-selectors, hand-built-component, classify-redundancy",
    "adversarial_fraction": "30%"
  },
  "evaluator_notes": {
    "current_state": "20 cases (14 trigger + 6 adversarial). Each of the 5 task shapes has 2-3 trigger cases; adv-01/adv-05 target surface-qa (the highest-risk neighbor — both audit a 'surface'), adv-02 targets token-selection, adv-03 targets find-unused (the closest same-plugin sibling, same 'what's inert' intent but JS/markup not CSS), adv-04 targets forge's component-token-audit (framework- vs consumer-side split).",
    "promotion_criteria": "Promote to a CI gate (warn → hard-fail) when F1 ≥ 0.85 on this corpus across 3+ consecutive runs without description edits.",
    "review_cadence": "Re-run on every theme-audit description edit. Add 1-2 new cases per checkpoint reflecting newly-observed routing failure modes.",
    "known_limitations": "theme-adv-03 (find-unused) is the corpus's highest-value adversarial: both skills answer 'what did an upgrade leave behind', differing only by CSS vs JS/markup surface — the description's 'CSS-side sibling' framing is the intended disambiguator, not vocabulary overlap."
  }
}
