{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "name": "screen-composition routing accuracy corpus",
  "version": "2.1.0",
  "purpose": "Routing-eval corpus for screen-composition (adia-ui-factory plugin). Each phrase declares whether screen-composition 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": "screen-composition routing \u2014 does this phrase activate screen-composition (build-time, one-shot screen construction from the light-DOM catalog)?",
  "phrases": [
    {
      "id": "compose-generic-01",
      "phrase": "build a settings screen for our app",
      "expected": "screen-composition",
      "expected_shape": "generic-build",
      "rationale": "Canonical 'build a screen' ask \u2014 the skill's own description phrase."
    },
    {
      "id": "compose-generic-02",
      "phrase": "generate UI for a dashboard",
      "expected": "screen-composition",
      "expected_shape": "dashboard-generation",
      "rationale": "'generate UI for' is the skill description's own trigger phrase."
    },
    {
      "id": "compose-generic-03",
      "phrase": "compose a form from the catalog",
      "expected": "screen-composition",
      "expected_shape": "form-composition",
      "rationale": "Explicit 'compose ... from the catalog' \u2014 the skill's core loop."
    },
    {
      "id": "compose-prd-01",
      "phrase": "turn this PRD into a working screen",
      "expected": "screen-composition",
      "expected_shape": "prd-to-ui",
      "rationale": "PRD-shaped input needing UI \u2014 triggers the spec-to-ui precondition gate."
    },
    {
      "id": "compose-spec-01",
      "phrase": "here's the product spec \u2014 build the UI for it",
      "expected": "screen-composition",
      "expected_shape": "spec-to-ui",
      "rationale": "Spec-shaped input needing UI, per the skill description's 'PRD/spec/mockup needs UI'."
    },
    {
      "id": "compose-mockup-01",
      "phrase": "implement this mockup screenshot as adia-ui components",
      "expected": "screen-composition",
      "expected_shape": "mockup-to-ui",
      "rationale": "Mockup-to-components composition, explicit adia-ui target."
    },
    {
      "id": "compose-mockup-02",
      "phrase": "convert this Figma export into adia-ui markup for our checkout app",
      "expected": "screen-composition",
      "expected_shape": "mockup-to-ui",
      "rationale": "Consumer-side mockup composition into catalog primitives (distinct from figma-generate-* MCP skills, which push code INTO Figma, not the reverse)."
    },
    {
      "id": "compose-schema-01",
      "phrase": "given this user schema, generate the settings form",
      "expected": "screen-composition",
      "expected_shape": "spec-to-ui",
      "rationale": "Schema-shaped input driving form generation - screen-composition still gates on a scored Domain Plan before the first tag (gh#1207 moved the ladder itself to domain-planning, planning-side)."
    },
    {
      "id": "compose-userstory-01",
      "phrase": "as a user I want to filter my orders \u2014 build the screen for that",
      "expected": "screen-composition",
      "expected_shape": "user-story-to-ui",
      "rationale": "User-story input needing a built screen."
    },
    {
      "id": "compose-dashboard-02",
      "phrase": "put together an analytics dashboard with charts and a legend",
      "expected": "screen-composition",
      "expected_shape": "dashboard-generation",
      "rationale": "Dashboard build using chart-ui/chart-legend-ui catalog primitives."
    },
    {
      "id": "compose-nav-01",
      "phrase": "compose the sidebar navigation pattern for the app",
      "expected": "screen-composition",
      "expected_shape": "navigation-pattern",
      "rationale": "Navigation pattern composition \u2014 nav-ui/nav-item-ui selection, per description's 'navigation pattern' trigger."
    },
    {
      "id": "compose-nav-02",
      "phrase": "build a command palette for quick actions",
      "expected": "screen-composition",
      "expected_shape": "navigation-pattern",
      "rationale": "command-ui composition \u2014 a named component-selection pick in the skill."
    },
    {
      "id": "compose-form-02",
      "phrase": "wire up a multi-step form using field-ui and select-ui",
      "expected": "screen-composition",
      "expected_shape": "form-composition",
      "rationale": "Explicit catalog primitive names (field-ui, select-ui) \u2014 screen markup composition."
    },
    {
      "id": "compose-theme-01",
      "phrase": "theme this screen with our brand tokens and add dark mode",
      "expected": "screen-composition",
      "expected_shape": "theming",
      "rationale": "Theming via --a-* tokens and scheme toggle \u2014 the skill's step 4."
    },
    {
      "id": "compose-theme-02",
      "phrase": "apply the --a-* token set and wire the scheme toggle for this page",
      "expected": "screen-composition",
      "expected_shape": "theming",
      "rationale": "Direct --a-* token + <toggle-scheme-ui> mention, matches description's 'themes via --a-* tokens'."
    },
    {
      "id": "compose-project-comp-01",
      "phrase": "the catalog has nothing for a rating stepper \u2014 author a project component in our checkout app to compose it",
      "expected": "screen-composition",
      "expected_shape": "project-component-authoring",
      "rationale": "'Author only what's missing' \u2014 a light-DOM PROJECT component in a consumer app, step 3 of the compose loop (distinct from primitive-authoring's framework primitives, see compose-adv-04)."
    },
    {
      "id": "compose-project-comp-02",
      "phrase": "no primitive fits this bespoke billing-summary widget; build it as a project component for our app",
      "expected": "screen-composition",
      "expected_shape": "project-component-authoring",
      "rationale": "Consumer-app project component authored to fill a catalog gap, still inside screen-composition's remit."
    },
    {
      "id": "compose-empty-01",
      "phrase": "add an empty state to the search results screen",
      "expected": "screen-composition",
      "expected_shape": "generic-build",
      "rationale": "empty-state-ui selection inside an existing screen \u2014 ordinary composition edit."
    },
    {
      "id": "compose-table-01",
      "phrase": "build a data table screen listing all invoices",
      "expected": "screen-composition",
      "expected_shape": "generic-build",
      "rationale": "table-ui composition for a new screen."
    },
    {
      "id": "compose-modal-01",
      "phrase": "compose a confirmation modal flow for deleting a record",
      "expected": "screen-composition",
      "expected_shape": "overlay-composition",
      "rationale": "confirm-dialog-ui/modal-ui overlay selection and wiring."
    },
    {
      "id": "compose-genui-boundary-01",
      "phrase": "generate UI for a one-off pricing page from this spec, right now, as part of the build",
      "expected": "screen-composition",
      "expected_shape": "prd-to-ui",
      "rationale": "Boundary case (direction 1 of 2, paired with compose-adv-01): 'generate UI' language, but the ask is a single build-time authoring pass, not an end-user-triggered runtime experience \u2014 stays screen-composition."
    },
    {
      "id": "compose-adv-01",
      "phrase": "wire up the a2ui runtime so end users can generate their own dashboard layout at runtime",
      "expected": "gen-ui-wiring",
      "rationale": "Adversarial (direction 2 of 2, paired with compose-genui-boundary-01) \u2014 END USERS trigger generation at runtime via a2ui-root/gen-root; screen-composition's description NEG-fences 'runtime gen-UI (gen-ui-wiring)'.",
      "expected_alternative_raw": "gen-ui-wiring (adia-factory plugin)"
    },
    {
      "id": "compose-adv-02",
      "phrase": "pick a shell for the admin app with a sidebar and topbar",
      "expected": "shell-selection",
      "rationale": "Adversarial \u2014 shell CHROME selection (admin/chat/editor/simple/embed), not screen content inside one; screen-composition's description NEG-fences 'shell chrome (shell-selection)'.",
      "expected_alternative_raw": "shell-selection (adia-factory plugin)"
    },
    {
      "id": "compose-adv-03",
      "phrase": "set up index.html and SSR registration for our Next.js adia-ui app",
      "expected": "host-wiring",
      "rationale": "Adversarial \u2014 host bootstrap/registration/SSR wiring; screen-composition's description NEG-fences 'host wiring (host-wiring)'.",
      "expected_alternative_raw": "host-wiring (adia-factory plugin)"
    },
    {
      "id": "compose-adv-04",
      "phrase": "add a new primitive component to packages/web-components in the adia-ui monorepo",
      "expected": "primitive-authoring",
      "rationale": "Adversarial \u2014 authoring a FRAMEWORK primitive inside the monorepo itself, not a project component in a consumer app; this is primitive-authoring's remit ('primitives, shells, demos, component yaml SoTs'), the subtle authoring-side-of-the-house boundary paired with compose-project-comp-01/02.",
      "expected_alternative_raw": "primitive-authoring (adia-ui-forge plugin)"
    },
    {
      "id": "compose-adv-05",
      "phrase": "run the browser QA gate on the settings screen we just built and check for console errors",
      "expected": "surface-qa",
      "rationale": "Adversarial \u2014 QA of an already-built screen (headless render, console errors, a11y checks), not composing or fixing the UI; surface-qa's description owns 'verify/QA this page'.",
      "expected_alternative_raw": "surface-qa (adia-factory plugin)"
    },
    {
      "id": "compose-adv-06",
      "phrase": "wire up state hydration for this island using signals",
      "expected": "data-wiring",
      "rationale": "Adversarial \u2014 data/state/hydration pattern choice, not screen markup; data-wiring's description owns 'wire up the data' / 'hydrate the island'.",
      "expected_alternative_raw": "data-wiring (adia-factory plugin)"
    }
  ],
  "minimums_per_spec": {
    "trigger_phrases": 21,
    "adversarial_phrases": 6,
    "task_shapes_covered": "generic-build, dashboard-generation, form-composition, prd-to-ui, spec-to-ui, mockup-to-ui, user-story-to-ui, navigation-pattern, theming, project-component-authoring, overlay-composition",
    "adversarial_fraction": "22%"
  },
  "evaluator_notes": {
    "current_state": "27 cases (21 trigger + 6 adversarial). Each of the 11 task shapes has at least 1 trigger case; the two highest-collision task shapes (dashboard-generation, form-composition, navigation-pattern) get 2 each. The gen-ui-wiring boundary is covered in both directions (compose-genui-boundary-01 stays screen-composition; compose-adv-01 routes away to gen-ui-wiring) since the build-time/runtime distinction is the sharpest and most-collided fence in the factory plugin.",
    "promotion_criteria": "Promote to a CI gate (warn \u2192 hard-fail) when F1 \u2265 0.85 on this corpus across 3+ consecutive runs without description edits.",
    "review_cadence": "Re-run on every screen-composition description edit. Add 1-2 new cases per checkpoint reflecting newly-observed routing failure modes, especially at the gen-ui-wiring and primitive-authoring (forge) fences.",
    "known_limitations": "compose-project-comp-01/02 vs compose-adv-04 (primitive-authoring) share heavy token overlap ('primitive', 'component', 'author') \u2014 the heuristic TF-IDF scorer may not disambiguate monorepo-internal authoring from consumer-app project-component authoring; the harness's live project-context probe (`isFrameworkMonorepo`) disambiguates this in practice, which the heuristic corpus cannot see."
  }
}
