Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,21 @@ All notable changes to SkillEvaluator are documented in this file.
`Bedrock request failed`, like a Bedrock error that ends the judge and like
the default `legacy` policy.

- The Tier 3 terminal summary now shows `N/A`, not `NO SCORE`, as the Skill
Lift of an evaluator or dimension that is N/A in either arm, as the Markdown
and HTML reports already do. Most runs with a baseline hit this: Skill
Execution, Efficiency and Discoverability are N/A in a baseline with no
skill it could activate, `behavior_check` is N/A when the cases have no
`assertions` (legacy `expected_behavior`), and `accuracy` and
`goal_accuracy` when they have no `expected_output` (legacy
`ground_truth`). In a baseline-only run (`--skip-with-skill`) the lift of
every other row now reads `skipped`, as the docs and the Markdown report
say. A lift that is missing for another reason still reads `NO SCORE`. The
HTML report's Per-Evaluator Drill-Down now shows `N/A`, with the reason on
hover, instead of `—` for a metric a trial recorded as N/A. The reports'
reasons for an N/A Accuracy, Goal Accuracy or Behavior Check now name the
dataset fields `expected_output` and `assertions` before their legacy names.

- `skillevaluator tier3 feedback` now writes the evaluated skill's directory
(known from `--skill` or a run in the skill's `evals/results`) as its name
and the home directory as `~` in the evidence it sends to the LLM, so an
Expand Down
16 changes: 12 additions & 4 deletions docs/reports.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,15 @@ A finished `tier3 evaluate` run prints two tables and closes with a compact
with its per-arm scores and Skill Lift; **Results by Dimension** rolls those
signals up into the five dimensions below. A metric the run couldn't score
renders as `NO SCORE` — it is never coerced to 0.0 — and unscored metrics are
omitted from the averages, so `overall_score` can be `null` in the JSON. In a
baseline-only run (`--skip-with-skill`) the with-skill and Skill Lift cells read
`skipped` instead, because that arm never ran. The
omitted from the averages, so `overall_score` can be `null` in the JSON. A
metric that does not apply to an arm renders as `N/A`, and so does its Skill
Lift: for example Behavior Check when the cases have no `assertions` (legacy
`expected_behavior`), Accuracy when they have no `expected_output` (legacy
`ground_truth`), or Skill Execution in a baseline with no skill it could
activate. N/A metrics are left out of the scores and the lift. In a
baseline-only run (`--skip-with-skill`) the with-skill cells read `skipped`,
because that arm never ran, and so does the Skill Lift of every row that is
not N/A. The
Artifacts panel shows the HTML report path, the output directory, and — only
when a retained Harbor jobs directory exists — a ready-to-paste `harbor-view`
command.
Expand Down Expand Up @@ -632,7 +638,9 @@ list. A case that scored below 0.80 also quotes a short excerpt of the
offending command or artifact when the grader recorded one. When the attempts
of one case disagree, the lowest-scoring attempt's reason is shown. In the
**Per-Evaluator Drill-Down** table, hover a dotted-underlined score below 0.80
to read the reason for that trial.
to read the reason for that trial. A metric the trial recorded as N/A reads
`N/A`, and hovering it says why; a score missing for any other reason reads
`—`.

Reasons are built from each trial's `reward.json` `details`, joining up to
three distinct parts from the grader's `reason` or `message`, failing findings
Expand Down
33 changes: 33 additions & 0 deletions docs/tier3-live-evaluation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,39 @@ generated standard grader rejects non-finite values and clamps numeric scores
with `max(0.0, min(1.0, score))`. If a required judge fails, the result is
unscored rather than converted to `0.0`.

A metric can also be N/A (not applicable) for an eval case. It never counts as
`1.0` or `0.0`:

- `behavior_check` is N/A when the case has no `assertions` (legacy
`expected_behavior`), and `accuracy` and `goal_accuracy` when it has no
`expected_output` (legacy `ground_truth`). An empty or whitespace-only
reference, or an empty list, counts as missing. The verifier does not call
those judges. `skillevaluator tier3 ./my-skill` and `tier3 init-harbor-task`
reject an empty `expected_output`, so with them only legacy cases without
`ground_truth` make `accuracy` and `goal_accuracy` N/A.
- `skill_execution` and `skill_efficiency` are N/A in a baseline arm that has
no skill it could activate.
- Security is never N/A.

In `skill_evaluator_reward.json` an N/A metric's value is `null`, and
`details.<metric>` records `status: "not_applicable"` and a `reason`.
Harbor's numeric `reward.json` leaves the metric out. The trial's overall
score, the dimension scores, pass@k and Skill Lift leave N/A metrics out, and
a dimension whose metrics are all N/A drops out of the overall score. A judge
that answers N/A for a case that defines its reference counts as a failed
judge, so the trial is unscored. Each arm's `summary.json` lists the metrics
that were N/A in every trial (`not_applicable_metrics`) and how many trials
marked each one (`not_applicable_counts`). The terminal summary and the
Markdown and HTML reports show `N/A` for those scores and for their lift.

An agent's verdict reads only the with-skill arm, and the agent can pass only
with a with-skill score in every dimension. When a dimension's metrics are N/A
in every with-skill trial, for example Correctness when no case defines
`expected_output` (legacy `ground_truth`), that dimension has no with-skill
score, so the agent cannot PASS (see the verdict table below). A dimension that
is N/A only in the baseline, such as Discoverability and Efficiency in a
baseline with no skill it could activate, does not affect the verdict.

| Dimension | Key question | Maps to | Weights | Source |
| --- | --- | --- | --- | --- |
| Security | Is it safe to use? | `security` | 1.0 | Deterministic checks of the trace and agent actions |
Expand Down
13 changes: 13 additions & 0 deletions src/skillevaluator/reporting/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,13 @@ def _tier3_score_reasons(value: object) -> dict[str, str]:
return reasons


def _tier3_not_applicable_reason(metric: object) -> str:
"""Return why a Tier 3 metric can be N/A, for the tooltip of an N/A drill-down cell."""
from skillevaluator.tier3.harbor.metrics import NOT_APPLICABLE_REASONS

return NOT_APPLICABLE_REASONS.get(str(metric), "Not applicable to this eval case")


def _tier3_text_mapping(value: object) -> dict[str, str]:
"""Normalize public label maps without silently overwriting aliases."""
if not isinstance(value, dict):
Expand Down Expand Up @@ -932,6 +939,11 @@ def _sanitize_tier3_trial(value: dict[str, Any], *, fill_defaults: bool = True)
score_reasons = _tier3_score_reasons(trial.pop("score_reasons", None))
if score_reasons:
trial["score_reasons"] = score_reasons
if "not_applicable_metrics" in trial:
from skillevaluator.tier3.harbor.metrics import not_applicable_list

# Only metrics that can be N/A count, so a malformed payload cannot mark security N/A.
trial["not_applicable_metrics"] = not_applicable_list(trial["not_applicable_metrics"])
# Unavailable telemetry stays absent rather than becoming zero, so the
# template can omit charts and show "—" instead of reporting no usage.
raw_tokens = trial.pop("tokens", None)
Expand Down Expand Up @@ -1729,6 +1741,7 @@ def _create_environment() -> Environment:
environment.filters["adaptive_percent"] = _adaptive_percent
environment.filters["adaptive_interval_percent"] = _adaptive_interval_percent
environment.filters["skip_reason"] = get_skip_reason
environment.filters["not_applicable_reason"] = _tier3_not_applicable_reason
return environment

@staticmethod
Expand Down
7 changes: 4 additions & 3 deletions src/skillevaluator/reporting/templates/report.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3163,9 +3163,10 @@
</td>
{% for eval_id in t3_eval_ids %}
{% set s = scores.get(eval_id) %}
{% set cell_reason = reasons.get(eval_id) if s is not none else none %}
{% set cell_text = "%.2f" | format(s) if s is not none else "—" %}
<td style="{% if s is not none %}background:{{ 'rgba(34,197,94,0.14)' if s >= 0.7 else ('rgba(234,179,8,0.14)' if s >= 0.4 else 'rgba(239,68,68,0.14)') }}; color:{{ 'var(--success-color)' if s >= 0.7 else ('var(--warning-color)' if s >= 0.4 else 'var(--danger-color)') }}; font-weight:600;{% endif %}"{% if cell_reason %} title="{{ eval_id | replace('_', ' ') | title }}: {{ cell_reason }}"{% endif %}>{% if cell_reason %}<span class="t3-score-reason">{{ cell_text }}</span>{% else %}{{ cell_text }}{% endif %}</td>
{% set cell_na = s is none and eval_id in (trial.not_applicable_metrics or []) %}
{% set cell_reason = reasons.get(eval_id) if s is not none else (("Not applicable: " ~ (eval_id | not_applicable_reason)) if cell_na else none) %}
{% set cell_text = "%.2f" | format(s) if s is not none else ("N/A" if cell_na else "—") %}
<td style="{% if s is not none %}background:{{ 'rgba(34,197,94,0.14)' if s >= 0.7 else ('rgba(234,179,8,0.14)' if s >= 0.4 else 'rgba(239,68,68,0.14)') }}; color:{{ 'var(--success-color)' if s >= 0.7 else ('var(--warning-color)' if s >= 0.4 else 'var(--danger-color)') }}; font-weight:600;{% elif cell_na %}color:var(--text-secondary);{% endif %}"{% if cell_na %} data-not-applicable="true"{% endif %}{% if cell_reason %} title="{{ eval_id | replace('_', ' ') | title }}: {{ cell_reason }}"{% endif %}>{% if cell_reason %}<span class="t3-score-reason">{{ cell_text }}</span>{% else %}{{ cell_text }}{% endif %}</td>
{% endfor %}
<td>{{ trial.steps if trial.steps is number else "—" }}</td>
<td>{% if tokens.prompt is number and tokens.completion is number %}{{ tokens.prompt + tokens.completion }}{% else %}—{% endif %}</td>
Expand Down
15 changes: 9 additions & 6 deletions src/skillevaluator/tier3/harbor/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@
}

# A judged metric is "not applicable" when its dataset case has nothing to
# judge against (no ground_truth / expected_behavior). The skill metrics are
# not applicable in an arm that has no skill under test to discover or route to
# (the no-skill or no-plugin baseline). The verifier records the metric as
# judge against (no expected_output / assertions, which the legacy format calls
# ground_truth / expected_behavior). The skill metrics are not applicable in an
# arm that has no skill under test to discover or route to (the no-skill or
# no-plugin baseline). The verifier records the metric as
# ``null`` with ``details[metric].status == "not_applicable"``; N/A metrics are
# excluded from the trial overall, the arm averages, and lift. Security never
# becomes N/A, and an absent or non-finite metric without the explicit marker
Expand All @@ -105,9 +106,11 @@
NOT_APPLICABLE_REASONS = {
"skill_execution": "This arm has no skill under test installed, so there is no skill to discover or run",
"skill_efficiency": "This arm has no skill under test installed, so there is no skill to route to",
"accuracy": "No ground_truth defined, so there is no reference answer to judge against",
"goal_accuracy": "No ground_truth defined, so there is no expected outcome to judge against",
"behavior_check": "No expected_behavior defined, so there is no workflow to check",
"accuracy": "No expected_output (legacy ground_truth) defined, so there is no reference answer to judge against",
"goal_accuracy": (
"No expected_output (legacy ground_truth) defined, so there is no expected outcome to judge against"
),
"behavior_check": "No assertions (legacy expected_behavior) defined, so there is no workflow to check",
}

_RESERVED_METADATA_KEYS = {
Expand Down
28 changes: 21 additions & 7 deletions src/skillevaluator/tier3/result_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,11 @@ def _score_cell(value: object, *, unavailable: str = "NO SCORE") -> tuple[Text,
return Text(f"{numeric:.2f}", style=f"bold {style}"), Text(_score_bar(numeric), style=style)


_NOT_APPLICABLE_LABEL = "N/A"


def _not_applicable_cell() -> tuple[Text, Text]:
return Text("N/A", style="dim italic"), Text("")
return Text(_NOT_APPLICABLE_LABEL, style="dim italic"), Text("")


def _not_applicable_metrics(data: Mapping[str, Any], variant: str) -> frozenset[str]:
Expand All @@ -85,9 +88,15 @@ def _not_applicable_metrics(data: Mapping[str, Any], variant: str) -> frozenset[
return frozenset(not_applicable_list(raw))


def _delta_cell(value: object) -> Text:
def _delta_cell(value: object, *, not_applicable: bool = False, skipped: bool = False) -> Text:
"""Lift cell. With no delta it reads N/A for a row that is N/A in either arm, then
``skipped`` when the with-skill arm never ran, then NO SCORE, like the other reporters."""
numeric = _finite_number(value)
if numeric is None:
if not_applicable:
return Text(_NOT_APPLICABLE_LABEL, style="dim italic")
if skipped:
return Text("skipped", style="dim")
return Text("NO SCORE", style="dim")
style = lift_style(numeric)
return Text(f"{numeric:+.2f}", style=f"bold {style}")
Expand Down Expand Up @@ -450,7 +459,8 @@ def _render_agent_scores(
) -> None:
with_usable = _condition_usable(data, "with_skill")
# A baseline-only run (--skip-with-skill) deliberately leaves the with-skill arm unscored.
with_unavailable = "skipped" if _condition_status(data, "with_skill") == "skipped" else "NO SCORE"
with_skipped = _condition_status(data, "with_skill") == "skipped"
with_unavailable = "skipped" if with_skipped else "NO SCORE"
baseline_status = _condition_status(data, "without_skill")
baseline_skipped = baseline_status == "skipped"
baseline_usable = _condition_usable(data, "without_skill") and not baseline_skipped
Expand Down Expand Up @@ -502,14 +512,18 @@ def _render_agent_scores(
else None
)
baseline_score, baseline_bar = _not_applicable_cell() if baseline_na else _score_cell(baseline_value)
row.extend([baseline_score, baseline_bar, _delta_cell(delta)])
lift_cell = _delta_cell(delta, not_applicable=with_na or baseline_na, skipped=with_skipped)
row.extend([baseline_score, baseline_bar, lift_cell])
table.add_row(*row)

basis = lift.get("basis")
if isinstance(basis, Mapping) and basis.get("pairing") == "same_cases_per_metric":
table.caption = "Lift compares the cases scored by both arms for each evaluator."
if _not_applicable_metrics(data, "with_skill") or _not_applicable_metrics(data, "without_skill"):
table.caption = (str(table.caption or "") + " N/A: no applicable reference or skill in this arm.").strip()
table.caption = (
str(table.caption or "")
+ " N/A: no applicable reference or skill in this arm, so it is left out of scores and lift."
).strip()
if custom_with or custom_without:
if metrics:
table.add_section()
Expand All @@ -527,7 +541,7 @@ def _render_agent_scores(
else None
)
baseline_score, baseline_bar = _score_cell(baseline_value)
row.extend([baseline_score, baseline_bar, _delta_cell(delta)])
row.extend([baseline_score, baseline_bar, _delta_cell(delta, skipped=with_skipped)])
table.add_row(*row)

if not metrics and not custom_with and not custom_without and not show_baseline:
Expand Down Expand Up @@ -703,7 +717,7 @@ def _render_dimensions(
with_bar,
baseline_cell,
baseline_bar,
_delta_cell(delta),
_delta_cell(delta, not_applicable=with_na or baseline_na, skipped=with_skipped),
]
table.add_row(*row)

Expand Down
Loading
Loading