# Score & Rate

> Score and rate text content using LLM-powered evaluation across multiple dimensions.

Source: https://docs.sommatic.ai/en/nodes/ai.score/

- Slug: `ai.score`
- Family: AI
- Version: 1.0.0
- Status: Available
- Execution: async

Score and rate text content using LLM-powered evaluation across multiple dimensions.

Evaluate quality, relevance, urgency, risk, or custom criteria with configurable scales and thresholds. Supports weighted multi-criteria scoring via custom rubrics loaded from Knowledge Resources.

**Operations:**
- **Quality:** Evaluate clarity, completeness, accuracy, and coherence.
- **Relevance:** Score semantic overlap and topic alignment against a reference.
- **Urgency:** Assess time sensitivity, impact severity, and stakeholder importance.
- **Risk:** Identify risk factors, likelihood, and potential impact.
- **Custom:** Define weighted criteria with descriptions and optional rubrics.

## Configuration

- `llm_provider_id` (string, optional): The `id` of a `LlmProviderModel` record (e.g. `wf-llm-provider-*`). The orchestrator delegates to the backend: `POST /cognitive-infrastructure/cognitive-assets/llm-provider/invoke` for sync mode, or `POST /chat/conversation/execute/stream-ephemeral` (SSE) for stream mode. The backend resolves endpoint + api-key + deployment from the record and routes to the correct adapter.
- `invocation_mode` (string, optional): Transport for the LLM call. `sync` blocks until the full response arrives. `stream` consumes tokens via SSE (required for long generations). Default `sync`. Default: `sync`. Allowed values: `sync`, `stream`.
- `timeout_ms` (integer, optional): Maximum time to wait for the invocation to complete (or idle timeout between chunks in stream mode). Default 30000 for sync, 600000 for stream.
- `scoring_mode` (string, optional): Predefined evaluation strategy or custom criteria. Default: `quality`. Allowed values: `quality`, `relevance`, `urgency`, `risk`, `custom`.
- `scale_min` (number, optional): Minimum value of the scoring scale. Default: `0`.
- `scale_max` (number, optional): Maximum value of the scoring scale. Default: `10`.
- `criteria` (array<object>, optional): Weighted criteria for custom scoring mode. Shown when: scoring_mode = `custom`.
- `reference_text` (string, optional, accepts expressions): Reference content to score relevance against. Shown when: scoring_mode = `relevance`.
- `knowledge_resource_id` (string, optional): Scoring rubric or policy to load criteria from.
- `thresholds` (object, optional): Score boundaries for routing to high/medium/low ports.
  - `high` (number, optional): Minimum score for high port. Default: `7`.
  - `medium` (number, optional): Minimum score for medium port. Default: `4`.
  - `low` (number, optional): Minimum score for low port. Default: `0`.
- `language` (string, optional): Language for evaluation output. Default: `en`.

Its configuration shows the shared execution settings, but this node does not apply retries (`retryOnFail`, `maxTries`) yet. `continueOnFail` is not applied by any node.

## Output ports

- `high` (default): Score meets or exceeds the high threshold.
- `medium`: Score is between medium and high thresholds.
- `low`: Score is below the medium threshold.
- `error`: Scoring failed.

## Input contract

- `text` (string, required): Content to score.
- `context` (string, optional): Optional context for evaluation.
- `reference` (string, optional): Optional reference content for relevance scoring.

## Output contract

- `score` (number, optional): Overall score on the configured scale.
- `normalized_score` (number, optional): Score normalized to 0-1 range.
- `level` (string, optional): Threshold level: high, medium, or low.
- `dimensions` (object, optional): Per-criterion scores and explanations.
- `explanation` (string, optional): Overall assessment summary.
- `factors` (array, optional): Key factors influencing the score.
- `recommendations` (array, optional): Suggestions for improvement.

## In expressions

What a later node can read from this node's output with `$("Score & Rate").item.json.<path>` (write your node's label instead of `Score & Rate`). **Editor** marks the paths the workflow editor suggests under Previous Nodes (the output contract); **Worker** marks the paths the worker really returns through `high`, from the output shown in Ports.

- `$("Score & Rate").item.json.score` (number) = `8`: Overall score on the configured scale.
- `$("Score & Rate").item.json.normalized_score` (number) = `0.8`: Score normalized to 0-1 range.
- `$("Score & Rate").item.json.level` (string) = `"high"`: Threshold level: high, medium, or low.
- `$("Score & Rate").item.json.dimensions` (object) = `{…}`: Per-criterion scores and explanations.
- `$("Score & Rate").item.json.explanation` (string) = `"Clear and accurate reply with one missing de…"`: Overall assessment summary.
- `$("Score & Rate").item.json.factors` (array) = `[…] (2)`: Key factors influencing the score.
- `$("Score & Rate").item.json.recommendations` (array) = `[…] (1)`: Suggestions for improvement.
- `$("Score & Rate").item.json.dimensions.clarity` (object) = `{…}` (Not suggested by the editor)
- `$("Score & Rate").item.json.dimensions.completeness` (object) = `{…}` (Not suggested by the editor)


## How it works

Scores `text` with the LLM on a configurable scale (quality, relevance, urgency, risk or your own weighted criteria) and routes to `high`, `medium` or `low` by comparing the score with the thresholds.

1. Resolves the node config: expressions in config keys are evaluated against the run; the incoming item is used as-is.
2. Merges the incoming item with the resolved config (config keys win) and reads the inputs from the result.
3. Requires `text`. Picks the instruction for `scoring_mode` (default `quality`). In `custom` mode it lists `criteria` plus the criteria found in the knowledge resource; with no criteria it falls back to `quality`.
4. Builds the user message: `text`, preceded by `context` when present. In `relevance` mode with a reference, the message is the reference followed by the text (the `context` is dropped).
5. Calls the LLM through the backend with the `llm_provider_id` record. `invocation_mode: "sync"` (default) waits for the full answer; `"stream"` reads it over SSE and joins the chunks.
6. Parses the JSON answer (temperature 0); `score` must be a number. `normalized_score` = (score − scale_min) / (scale_max − scale_min).
7. Routes by the raw score: ≥ `thresholds.high` (7) → `high`, ≥ `thresholds.medium` (4) → `medium`, otherwise `low`.

## In a workflow

### Node

```json
{
  "node_id": "node-score-reply",
  "label": "Score reply quality",
  "operator_slug": "ai.score",
  "operator_version": "1.0.0",
  "config": {
    "llm_provider_id": "<llm_provider_id>",
    "scoring_mode": "quality",
    "scale_min": 0,
    "scale_max": 10,
    "thresholds": {
      "high": 7,
      "medium": 4,
      "low": 0
    },
    "language": "en"
  }
}
```

### Envelope

```json
{
  "ok": true,
  "port": "high",
  "data": {
    "score": 8,
    "normalized_score": 0.8,
    "level": "high",
    "dimensions": {
      "clarity": {
        "score": 9,
        "explanation": "Short, direct sentences."
      },
      "completeness": {
        "score": 7,
        "explanation": "Missing the delivery date."
      }
    },
    "explanation": "Clear and accurate reply with one missing detail.",
    "factors": [
      "clear structure",
      "missing date"
    ],
    "recommendations": [
      "Add the expected delivery date."
    ]
  }
}
```

## Output ports (behaviour in the code)

### `high`

`score` ≥ `thresholds.high`.

```json
{
  "score": 8,
  "normalized_score": 0.8,
  "level": "high",
  "dimensions": {
    "clarity": {
      "score": 9,
      "explanation": "Short, direct sentences."
    },
    "completeness": {
      "score": 7,
      "explanation": "Missing the delivery date."
    }
  },
  "explanation": "Clear and accurate reply with one missing detail.",
  "factors": [
    "clear structure",
    "missing date"
  ],
  "recommendations": [
    "Add the expected delivery date."
  ]
}
```

### `medium`

`thresholds.medium` ≤ `score` < `thresholds.high`. Same shape with `level: "medium"`.

```json
{
  "score": 5,
  "normalized_score": 0.5,
  "level": "medium",
  "dimensions": {
    "clarity": {
      "score": 9,
      "explanation": "Short, direct sentences."
    },
    "completeness": {
      "score": 7,
      "explanation": "Missing the delivery date."
    }
  },
  "explanation": "Clear and accurate reply with one missing detail.",
  "factors": [
    "clear structure",
    "missing date"
  ],
  "recommendations": [
    "Add the expected delivery date."
  ]
}
```

### `low`

`score` < `thresholds.medium`. Same shape with `level: "low"`.

```json
{
  "score": 2,
  "normalized_score": 0.2,
  "level": "low",
  "dimensions": {
    "clarity": {
      "score": 9,
      "explanation": "Short, direct sentences."
    },
    "completeness": {
      "score": 7,
      "explanation": "Missing the delivery date."
    }
  },
  "explanation": "Clear and accurate reply with one missing detail.",
  "factors": [
    "clear structure",
    "missing date"
  ],
  "recommendations": [
    "Add the expected delivery date."
  ]
}
```

### `error`

Validation, the LLM call or parsing failed. `data` is `{ error }` (plus `response` when the backend returned a body).

```json
{
  "error": "Model did not return valid scoring output."
}
```

## Behaviour in the code

- `llm_provider_id`: Required at runtime although the schema does not mark it as required. It is the id of an LLM provider record; the backend resolves endpoint, deployment and credentials from it.
- `thresholds`: Compared with the raw score, not the normalized one: if you change `scale_min`/`scale_max`, change the thresholds too. `thresholds.low` is not used.
- `reference_text`: Used only in `relevance` mode. A `reference` field in the incoming item takes precedence over it.
- `knowledge_resource_id`: Read only in `custom` mode, from `structured_data.criteria` (`name`, `weight`, `description`). If it cannot be loaded, the failure is only logged.
- `criteria`: Used only in `custom` mode. The weighting is requested from the model in the prompt; the code does not compute a weighted score.
- `timeout_ms`: `timeout_ms` only takes effect in `stream` mode, as the idle time allowed between chunks (default 600000). In `sync` mode it is logged but the backend request has no timeout.

## Errors

| Message | Port | Cause and fix |
| --- | --- | --- |
| `Missing input text for scoring.` | `error` | The incoming item has no `text`. |
| `Model did not return valid scoring output.` | `error` | The answer had no JSON object with a numeric `score`. |
| `[AiScore] Missing 'llm_provider_id' in node config (LlmProviderModel.id, e.g. 'wf-llm-provider-*'). …` | `error` | The node has no `llm_provider_id`. Pick an LLM provider in the node config; the legacy `model_id` key is not accepted. |
| `LLM Invocation Error: <backend message>` | `error` | The backend rejected the call (unknown or inactive provider record, provider error, credentials). Check the provider record. |
| `LLM Invocation Error: empty response from backend (<reason>).` | `error` | The backend could not be reached or returned nothing in `sync` mode. |
| `RemoteApiService.stream: idle timeout after <timeout_ms>ms` | `error` | In `stream` mode no chunk arrived within `timeout_ms`. |

## Notes and limits

- The score is not clamped to the scale: a value outside it gives a `normalized_score` below 0 or above 1.
- The model’s own `level` is ignored; the code recomputes it from the thresholds.
- The model answer is parsed as JSON after removing Markdown code fences; if that fails, the text between the first `{` and the last `}` is parsed.
- Input fields are read from the incoming item (`$json`). A key with the same name in the node config, which may be an expression, takes precedence over the input.
- The worker also returns the provider response as `raw` outside `data`; the engine does not keep it.
- On success the worker returns `port` and `data` without an `ok` field; the engine routes on `port` only.
- `timeout_ms` only takes effect in `stream` mode, as the idle time allowed between chunks (default 600000). In `sync` mode it is logged but the backend request has no timeout.
- In `stream` mode the temperature this node sets is not forwarded to the provider, and `raw` is `null`.
- The engine does not apply `execution.retryOnFail`, `maxTries`, `waitBetweenTries` or `continueOnFail` to this node. Handle failures by wiring the `error` port.


## Contracts (JSON Schema)

### All (`*.definition.js`)

```json
{
  "slug": "ai.score",
  "name": "Score & Rate",
  "category": "ai",
  "version": "1.0.0",
  "description": "Score and rate text content using LLM-powered evaluation across multiple dimensions.\n\n  Evaluate quality, relevance, urgency, risk, or custom criteria with configurable scales and thresholds. Supports weighted multi-criteria scoring via custom rubrics loaded from Knowledge Resources.\n\n  **Operations:**\n  - **Quality:** Evaluate clarity, completeness, accuracy, and coherence.\n  - **Relevance:** Score semantic overlap and topic alignment against a reference.\n  - **Urgency:** Assess time sensitivity, impact severity, and stakeholder importance.\n  - **Risk:** Identify risk factors, likelihood, and potential impact.\n  - **Custom:** Define weighted criteria with descriptions and optional rubrics.",
  "capabilities": [
    "ai",
    "scoring",
    "evaluation",
    "rating"
  ],
  "config_schema": {
    "type": "object",
    "properties": {
      "llm_provider_id": {
        "type": "string",
        "title": "LLM Provider",
        "description": "The `id` of a `LlmProviderModel` record (e.g. `wf-llm-provider-*`). The orchestrator delegates to the backend: `POST /cognitive-infrastructure/cognitive-assets/llm-provider/invoke` for sync mode, or `POST /chat/conversation/execute/stream-ephemeral` (SSE) for stream mode. The backend resolves endpoint + api-key + deployment from the record and routes to the correct adapter.",
        "x-ui-widget": "llm-provider-picker",
        "x-llm-provider-capabilities": [
          "chat"
        ]
      },
      "invocation_mode": {
        "type": "string",
        "title": "Invocation Mode",
        "description": "Transport for the LLM call. `sync` blocks until the full response arrives. `stream` consumes tokens via SSE (required for long generations). Default `sync`.",
        "enum": [
          "sync",
          "stream"
        ],
        "default": "sync"
      },
      "timeout_ms": {
        "type": "integer",
        "title": "Timeout (ms)",
        "description": "Maximum time to wait for the invocation to complete (or idle timeout between chunks in stream mode). Default 30000 for sync, 600000 for stream.",
        "minimum": 1000
      },
      "scoring_mode": {
        "type": "string",
        "title": "Scoring Mode",
        "enum": [
          "quality",
          "relevance",
          "urgency",
          "risk",
          "custom"
        ],
        "default": "quality",
        "description": "Predefined evaluation strategy or custom criteria."
      },
      "scale_min": {
        "type": "number",
        "title": "Scale Min",
        "default": 0,
        "description": "Minimum value of the scoring scale."
      },
      "scale_max": {
        "type": "number",
        "title": "Scale Max",
        "default": 10,
        "description": "Maximum value of the scoring scale."
      },
      "criteria": {
        "type": "array",
        "title": "Scoring Criteria",
        "description": "Weighted criteria for custom scoring mode.",
        "items": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "Criterion name"
            },
            "weight": {
              "type": "number",
              "description": "Relative weight (0-1)"
            },
            "description": {
              "type": "string",
              "description": "What this criterion evaluates"
            }
          }
        },
        "displayOptions": {
          "show": {
            "scoring_mode": [
              "custom"
            ]
          }
        }
      },
      "reference_text": {
        "type": "string",
        "title": "Reference Text",
        "format": "expression",
        "description": "Reference content to score relevance against.",
        "displayOptions": {
          "show": {
            "scoring_mode": [
              "relevance"
            ]
          }
        }
      },
      "knowledge_resource_id": {
        "type": "string",
        "title": "Knowledge Resource",
        "description": "Scoring rubric or policy to load criteria from.",
        "ui_widget": "knowledge_resource_picker"
      },
      "thresholds": {
        "type": "object",
        "title": "Port Routing Thresholds",
        "description": "Score boundaries for routing to high/medium/low ports.",
        "properties": {
          "high": {
            "type": "number",
            "default": 7,
            "description": "Minimum score for high port."
          },
          "medium": {
            "type": "number",
            "default": 4,
            "description": "Minimum score for medium port."
          },
          "low": {
            "type": "number",
            "default": 0,
            "description": "Minimum score for low port."
          }
        }
      },
      "language": {
        "type": "string",
        "title": "Language",
        "default": "en",
        "description": "Language for evaluation output."
      },
      "execution": {
        "type": "object",
        "title": "Execution Settings",
        "properties": {
          "alwaysOutputData": {
            "type": "boolean",
            "title": "Always Output Data",
            "description": "Always output data, even on error (if configured).",
            "default": false
          },
          "retryOnFail": {
            "type": "boolean",
            "title": "Retry On Fail",
            "description": "Retry the execution if it fails.",
            "default": false
          },
          "maxTries": {
            "type": "integer",
            "title": "Max Retries",
            "description": "Number of retries.",
            "default": 3,
            "displayOptions": {
              "show": {
                "retryOnFail": [
                  true
                ]
              }
            }
          },
          "waitBetweenTries": {
            "type": "integer",
            "title": "Wait Between Retries (ms)",
            "default": 1000,
            "displayOptions": {
              "show": {
                "retryOnFail": [
                  true
                ]
              }
            }
          },
          "continueOnFail": {
            "type": "boolean",
            "title": "Continue On Fail",
            "description": "Do not crash workflow on error.",
            "default": false
          },
          "timeout_ms": {
            "type": "integer",
            "title": "Timeout (ms)",
            "description": "Max execution time for this node before it is killed, in milliseconds. Honored by long-running operators (e.g. OCR/extraction, inline code). Default 300000 (5 min).",
            "default": 300000
          }
        }
      }
    }
  },
  "input_contract_schema": {
    "type": "object",
    "properties": {
      "text": {
        "type": "string",
        "description": "Content to score."
      },
      "context": {
        "type": "string",
        "description": "Optional context for evaluation."
      },
      "reference": {
        "type": "string",
        "description": "Optional reference content for relevance scoring."
      }
    },
    "required": [
      "text"
    ]
  },
  "output_contract_schema": {
    "type": "object",
    "properties": {
      "score": {
        "type": "number",
        "description": "Overall score on the configured scale."
      },
      "normalized_score": {
        "type": "number",
        "description": "Score normalized to 0-1 range."
      },
      "level": {
        "type": "string",
        "description": "Threshold level: high, medium, or low."
      },
      "dimensions": {
        "type": "object",
        "description": "Per-criterion scores and explanations."
      },
      "explanation": {
        "type": "string",
        "description": "Overall assessment summary."
      },
      "factors": {
        "type": "array",
        "description": "Key factors influencing the score."
      },
      "recommendations": {
        "type": "array",
        "description": "Suggestions for improvement."
      }
    }
  },
  "ports": [
    {
      "port_id": "high",
      "label": "High Score",
      "description": "Score meets or exceeds the high threshold.",
      "is_default": true,
      "supports_condition": true
    },
    {
      "port_id": "medium",
      "label": "Medium Score",
      "description": "Score is between medium and high thresholds.",
      "is_default": false,
      "supports_condition": true
    },
    {
      "port_id": "low",
      "label": "Low Score",
      "description": "Score is below the medium threshold.",
      "is_default": false,
      "supports_condition": true
    },
    {
      "port_id": "error",
      "label": "Error",
      "description": "Scoring failed.",
      "is_default": false,
      "supports_condition": false
    }
  ],
  "execution_mode": "async",
  "tags": [
    "ai",
    "scoring",
    "evaluation",
    "quality",
    "risk"
  ],
  "is_stateful": false,
  "publisher": {
    "identity": "org_sommatic_ai",
    "profile": {
      "name": "Sommatic AI",
      "verified": true,
      "url": "https://me.veripass.com/sommatic",
      "logo_url": null
    }
  }
}
```

### config_schema

```json
{
  "type": "object",
  "properties": {
    "llm_provider_id": {
      "type": "string",
      "title": "LLM Provider",
      "description": "The `id` of a `LlmProviderModel` record (e.g. `wf-llm-provider-*`). The orchestrator delegates to the backend: `POST /cognitive-infrastructure/cognitive-assets/llm-provider/invoke` for sync mode, or `POST /chat/conversation/execute/stream-ephemeral` (SSE) for stream mode. The backend resolves endpoint + api-key + deployment from the record and routes to the correct adapter.",
      "x-ui-widget": "llm-provider-picker",
      "x-llm-provider-capabilities": [
        "chat"
      ]
    },
    "invocation_mode": {
      "type": "string",
      "title": "Invocation Mode",
      "description": "Transport for the LLM call. `sync` blocks until the full response arrives. `stream` consumes tokens via SSE (required for long generations). Default `sync`.",
      "enum": [
        "sync",
        "stream"
      ],
      "default": "sync"
    },
    "timeout_ms": {
      "type": "integer",
      "title": "Timeout (ms)",
      "description": "Maximum time to wait for the invocation to complete (or idle timeout between chunks in stream mode). Default 30000 for sync, 600000 for stream.",
      "minimum": 1000
    },
    "scoring_mode": {
      "type": "string",
      "title": "Scoring Mode",
      "enum": [
        "quality",
        "relevance",
        "urgency",
        "risk",
        "custom"
      ],
      "default": "quality",
      "description": "Predefined evaluation strategy or custom criteria."
    },
    "scale_min": {
      "type": "number",
      "title": "Scale Min",
      "default": 0,
      "description": "Minimum value of the scoring scale."
    },
    "scale_max": {
      "type": "number",
      "title": "Scale Max",
      "default": 10,
      "description": "Maximum value of the scoring scale."
    },
    "criteria": {
      "type": "array",
      "title": "Scoring Criteria",
      "description": "Weighted criteria for custom scoring mode.",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Criterion name"
          },
          "weight": {
            "type": "number",
            "description": "Relative weight (0-1)"
          },
          "description": {
            "type": "string",
            "description": "What this criterion evaluates"
          }
        }
      },
      "displayOptions": {
        "show": {
          "scoring_mode": [
            "custom"
          ]
        }
      }
    },
    "reference_text": {
      "type": "string",
      "title": "Reference Text",
      "format": "expression",
      "description": "Reference content to score relevance against.",
      "displayOptions": {
        "show": {
          "scoring_mode": [
            "relevance"
          ]
        }
      }
    },
    "knowledge_resource_id": {
      "type": "string",
      "title": "Knowledge Resource",
      "description": "Scoring rubric or policy to load criteria from.",
      "ui_widget": "knowledge_resource_picker"
    },
    "thresholds": {
      "type": "object",
      "title": "Port Routing Thresholds",
      "description": "Score boundaries for routing to high/medium/low ports.",
      "properties": {
        "high": {
          "type": "number",
          "default": 7,
          "description": "Minimum score for high port."
        },
        "medium": {
          "type": "number",
          "default": 4,
          "description": "Minimum score for medium port."
        },
        "low": {
          "type": "number",
          "default": 0,
          "description": "Minimum score for low port."
        }
      }
    },
    "language": {
      "type": "string",
      "title": "Language",
      "default": "en",
      "description": "Language for evaluation output."
    },
    "execution": {
      "type": "object",
      "title": "Execution Settings",
      "properties": {
        "alwaysOutputData": {
          "type": "boolean",
          "title": "Always Output Data",
          "description": "Always output data, even on error (if configured).",
          "default": false
        },
        "retryOnFail": {
          "type": "boolean",
          "title": "Retry On Fail",
          "description": "Retry the execution if it fails.",
          "default": false
        },
        "maxTries": {
          "type": "integer",
          "title": "Max Retries",
          "description": "Number of retries.",
          "default": 3,
          "displayOptions": {
            "show": {
              "retryOnFail": [
                true
              ]
            }
          }
        },
        "waitBetweenTries": {
          "type": "integer",
          "title": "Wait Between Retries (ms)",
          "default": 1000,
          "displayOptions": {
            "show": {
              "retryOnFail": [
                true
              ]
            }
          }
        },
        "continueOnFail": {
          "type": "boolean",
          "title": "Continue On Fail",
          "description": "Do not crash workflow on error.",
          "default": false
        },
        "timeout_ms": {
          "type": "integer",
          "title": "Timeout (ms)",
          "description": "Max execution time for this node before it is killed, in milliseconds. Honored by long-running operators (e.g. OCR/extraction, inline code). Default 300000 (5 min).",
          "default": 300000
        }
      }
    }
  }
}
```

### input_contract_schema

```json
{
  "type": "object",
  "properties": {
    "text": {
      "type": "string",
      "description": "Content to score."
    },
    "context": {
      "type": "string",
      "description": "Optional context for evaluation."
    },
    "reference": {
      "type": "string",
      "description": "Optional reference content for relevance scoring."
    }
  },
  "required": [
    "text"
  ]
}
```

### output_contract_schema

```json
{
  "type": "object",
  "properties": {
    "score": {
      "type": "number",
      "description": "Overall score on the configured scale."
    },
    "normalized_score": {
      "type": "number",
      "description": "Score normalized to 0-1 range."
    },
    "level": {
      "type": "string",
      "description": "Threshold level: high, medium, or low."
    },
    "dimensions": {
      "type": "object",
      "description": "Per-criterion scores and explanations."
    },
    "explanation": {
      "type": "string",
      "description": "Overall assessment summary."
    },
    "factors": {
      "type": "array",
      "description": "Key factors influencing the score."
    },
    "recommendations": {
      "type": "array",
      "description": "Suggestions for improvement."
    }
  }
}
```

### ports

```json
[
  {
    "port_id": "high",
    "label": "High Score",
    "description": "Score meets or exceeds the high threshold.",
    "is_default": true,
    "supports_condition": true
  },
  {
    "port_id": "medium",
    "label": "Medium Score",
    "description": "Score is between medium and high thresholds.",
    "is_default": false,
    "supports_condition": true
  },
  {
    "port_id": "low",
    "label": "Low Score",
    "description": "Score is below the medium threshold.",
    "is_default": false,
    "supports_condition": true
  },
  {
    "port_id": "error",
    "label": "Error",
    "description": "Scoring failed.",
    "is_default": false,
    "supports_condition": false
  }
]
```
