/**
 * thresholds.ts — Quality thresholds for readiness gates and regression alerts.
 *
 * Used by:
 * - `npx @sanity/ailf report readiness` (launch readiness checklist)
 * - `npx @sanity/ailf run --publish` (severity-aware sink routing)
 * - `npx @sanity/ailf run --compare` (regression alerting)
 *
 * @see docs/archive/exec-plans/scenario-matrix-implementation/phase-5-readiness-thresholds.md
 */

import { defineThresholds } from "../_vendor/ailf-core/index.js"

export default defineThresholds({
  // Global defaults (apply to all areas unless overridden)
  defaults: {
    composite: 50,
    dimensions: {
      "task-completion": 40,
      "code-correctness": 30,
      "doc-coverage": 30,
    },
    "doc-lift": 0, // docs must not hurt
    ceiling: 40, // minimum ceiling score (doc quality floor)
  },

  // Per-area overrides (inherit from defaults, override specific values)
  areas: {
    groq: {
      composite: 60, // GROQ is critical — higher bar
      dimensions: {
        "task-completion": 50,
      },
    },
    // "visual-editing": {
    //   composite: 45, // currently at 36, set achievable near-term target
    // },
  },

  // Regression thresholds (for comparison reports)
  regression: {
    composite: -3, // alert if composite drops more than 3 points
    "per-area": -5, // alert if any area drops more than 5 points
    "per-dimension": -8, // alert if any dimension drops more than 8 points
  },

  // Severity classification
  severity: {
    critical: {
      "composite-below": 30,
      "negative-doc-lift": true,
    },
    warning: {
      "composite-below": 50,
      "regression-exceeds": -3,
    },
    info: {
      "composite-below": 60,
    },
  },
})
