> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omnia-voice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a criterion

> Changing judge_prompt, judge_model, population, or population_family VOIDS the calibration (metrics and confusion rows) — they describe an instrument that no longer exists. unit is create-only and rejected. Online-monitor config (online_enabled, online_percent, population, population_family, online_cap_usd) has full parity with the dashboard's Monitor dialog — same validation, no forked rules. online_cap_usd never voids calibration: money config is not instrument config.



## OpenAPI

````yaml /openapi.json patch /v1/criteria/{id}
openapi: 3.1.0
info:
  title: Omnia Management API
  description: >-
    The management API behind the improvement loop: capture and setup, request
    logs and datasets, grades (labels), judges (criteria), evals and deploy
    gates, fine-tuning and reinforcement learning, dedicated GPU endpoints, and
    model aliases and versions. Authenticated with a workspace API key
    (sk_sovereign_...). The inference API (chat, embeddings, rerank, responses)
    is OpenAI-compatible and documented separately.


    Responses are snake_case, list endpoints on the loop products use the
    {"object": "list", "data": [...]} envelope, and refusals use the same nested
    error shape the gateway emits: {"error": {"message", "type", "code"}}.
    Request bodies on the loop products (logs, labels, criteria, evals,
    datasets, aliases) are snake_case; the training and infrastructure products
    (fine-tuning, GRPO, environment tools, dedicated, model-version adoption)
    validate camelCase bodies, and each schema below says which it is. Endpoints
    that spend money require a key minted by a workspace owner or admin and
    return 403 otherwise.
  version: 1.0.0
servers:
  - url: https://gateway.omnia-voice.com
    description: Production
  - url: https://platform.omnia-voice.com/api
    description: Production (legacy alias — same API, older base URL)
security:
  - bearerAuth: []
paths:
  /v1/criteria/{id}:
    patch:
      summary: Update a criterion
      description: >-
        Changing judge_prompt, judge_model, population, or population_family
        VOIDS the calibration (metrics and confusion rows) — they describe an
        instrument that no longer exists. unit is create-only and rejected.
        Online-monitor config (online_enabled, online_percent, population,
        population_family, online_cap_usd) has full parity with the dashboard's
        Monitor dialog — same validation, no forked rules. online_cap_usd never
        voids calibration: money config is not instrument config.
      operationId: patchCriteria
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                description:
                  type: string
                judge_prompt:
                  type: string
                judge_model:
                  type: string
                population:
                  type: string
                population_family:
                  type: string
                  description: >-
                    Auto-detected traffic segment scope (a `segment` value from
                    GET /v1/logs); '' clears it. Changing it voids calibration.
                online_enabled:
                  type: boolean
                online_percent:
                  type: integer
                online_cap_usd:
                  type: number
                status:
                  type: string
                  enum:
                    - draft
                    - retired
                  description: >-
                    Lifecycle transition. retired stops online scoring and hides
                    the criterion from pickers; metrics are kept and the
                    criterion can be un-retired by patching back to draft.
      responses:
        '200':
          description: Updated criterion
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Criterion'
      security:
        - bearerAuth: []
components:
  schemas:
    Criterion:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
          example: Complete final answer
        description:
          type:
            - string
            - 'null'
        judge_prompt:
          type: string
          description: >-
            The binary instruction the judge applies. State precisely what makes
            a response FAIL.
        judge_model:
          type: string
        status:
          type: string
          enum:
            - draft
            - retired
          description: >-
            Lifecycle only: draft (in use) or retired (excluded from online
            scoring and pickers; set via PATCH). Alignment QUALITY is never
            stored here — read tier, tpr, tnr, and aligned_at. A criterion can
            be fully aligned and still say status=draft; that is by design, not
            a missing promotion.
        source:
          type: string
          enum:
            - human
            - assist_suggested
        tier:
          type: string
          enum:
            - aligned
            - weak
            - misaligned
            - unmeasured
          description: >-
            LEGACY point-estimate badge, kept for continuity. Computed by
            comparing the raw TPR/TNR to fixed thresholds, so it cannot
            distinguish 9-of-10 from 90-of-100. Read `trust` instead — that is
            what every gate uses.
        trust:
          type: string
          enum:
            - trustworthy
            - under-measured
            - borderline
            - misaligned
            - unmeasured
          description: >-
            What this judge's evidence PROVES, derived from the 95% Wilson
            interval rather than the point estimate. `trustworthy` = both lower
            bounds clear the 90% bar. `under-measured` = straddles it, and more
            grading would settle it (see fail_grades_needed /
            pass_grades_needed). `borderline` = straddles it with the rate
            hugging the bar, so more grading will NOT settle it — narrow what
            the judge asks instead. `misaligned` = an upper bound sits below the
            bar, i.e. proven wrong rather than merely unproven. `unmeasured` =
            no interval at all (never calibrated, or one-class grades).
            Auto-routing and RL rewards require `trustworthy`; dataset curation
            also accepts `under-measured`.
        tpr_ci:
          type:
            - array
            - 'null'
          items:
            type: number
          minItems: 2
          maxItems: 2
          nullable: true
          description: >-
            95% Wilson interval [low, high] for `tpr` — the evidence `trust` was
            derived from. Null when no human-failed grades exist. A tpr of 1.0
            with tpr_ci [0.646, 1.0] means the judge caught every failure it was
            shown, and was shown seven.
        tnr_ci:
          type:
            - array
            - 'null'
          items:
            type: number
          minItems: 2
          maxItems: 2
          nullable: true
          description: >-
            95% Wilson interval [low, high] for `tnr`. Null when no human-passed
            grades exist.
        fail_grades_needed:
          type:
            - integer
            - 'null'
          nullable: true
          description: >-
            Additional grades OF FAILING TRACES needed for TPR's lower bound to
            clear the bar, assuming the judge keeps its observed rate. TPR is
            measured only on human-failed rows, so grading more passes does not
            move it. Null when already proven, already below the bar, or too
            close to it for grading to help.
        pass_grades_needed:
          type:
            - integer
            - 'null'
          description: The same for TNR, measured only on human-passed rows.
        tpr:
          type:
            - number
            - 'null'
          description: >-
            P(judge says fail | you said fail) — how often it catches real
            failures.
        tnr:
          type:
            - number
            - 'null'
          description: P(judge says pass | you said pass).
        kappa:
          type:
            - number
            - 'null'
          description: >-
            Cohen's κ — chance-corrected agreement (raw agreement is inflated by
            class imbalance).
        alignment_n:
          type:
            - integer
            - 'null'
        aligned_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type: string
          format: date-time
        unit:
          type: string
          enum:
            - request
            - trace
          description: >-
            What this judge grades: one exchange, or a whole agent run /
            trace-grouped conversation. Fixed at creation.
        population:
          type: string
          description: >-
            The tag this criterion judges online AND aligns against ('' = all
            logged traffic). Changing it voids alignment.
        population_family:
          type: string
          description: >-
            The auto-detected traffic segment this judge is scoped to ('' =
            none): a `segment` value from GET /v1/logs. Scopes what it judges
            online AND which grades it calibrates against, together with
            population (tag) and unit. Changing it voids calibration.
        online_enabled:
          type: boolean
          description: >-
            Whether the online monitor is scoring a sample of fresh logged
            traffic with this judge.
        online_percent:
          type: integer
          description: >-
            Percent of eligible fresh traffic the online monitor samples —
            deterministic, never double-judging a request.
        drift_status:
          type: string
          enum:
            - ok
            - flagged
          description: >-
            flagged = the judge may have drifted on live traffic (stale
            calibration or an anomalous corrected-quality drop); re-calibrate on
            fresh grades.
        online_cap_usd:
          type: number
          description: >-
            Weekly online-judging spend ceiling in USD (0 = uncapped). Reaching
            it pauses this criterion's online scoring until the week rolls over.
        online_spent_usd:
          type: number
          description: Online judging spend in the current weekly window.
        drift_signal:
          type:
            - string
            - 'null'
          description: >-
            Which signal raised the flag: "stale" (calibration aged out) or
            "quality_drop" (live corrected rate fell below what the judge
            validated at). Null when drift_status is ok.
          enum:
            - stale
            - quality_drop
            - null
        drift_reason:
          type:
            - string
            - 'null'
          description: Human-readable receipt behind a flagged drift_status.
        drift_checked_at:
          type:
            - string
            - 'null'
          description: >-
            When the drift sweep last examined this judge; null for a judge it
            has never reached.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your workspace API key, e.g. `sk_sovereign_...`, sent as `Authorization:
        Bearer <key>`.

````