Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ All notable changes to SkillEvaluator are documented in this file.

### Changed

- HTML and `BENCHMARK.md` reports explain each Tier 3 dimension in plain
language with its evidence source and whether the run has a no-skill baseline
for it. Dimensions that could not be scored or do not apply stay listed with
the reason instead of disappearing or reading `Not available`, and baseline-only
cards show the baseline score. A short key in both reports separates the
verdict, dimension and overall scores, Skill Lift (uplift), pass@k, the Tier 1
Quality Score, and publication eligibility.

- Align terminal grade and lift colors across compact, full, and direct Tier 3
reports; displayed zero lift is neutral. Narrow terminals stack complete
condition score/bar groups. Full-report Details retain successful quality and
Expand Down
23 changes: 23 additions & 0 deletions docs/reports.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,20 @@ difference of the two displayed scores, so a cell such as
`58.4% → 94.8% (+36.4 points)` always adds up. A score outside 0–1 is shown as
`Not available`.

A missing score is never shown as zero. A dimension whose signal produced no
with-skill score reads `Not scored with the skill — baseline 50.0%; uplift
unavailable` (or `Not scored — a signal this dimension needs produced no
score` without a baseline), one whose signals had nothing to judge in any eval
case reads `Not applicable`, and a baseline-only run shows `Baseline 67.0% —
baseline-only run; no with-skill score or uplift`.

The collapsed **Scoring Methodology** section lists, for every dimension, the
question it answers in plain words, its weighted signals, where their evidence
comes from (deterministic trace or trajectory checks, or an LLM judge), and
whether this run has a no-skill baseline score for it. It ends with a short key
that separates the overall verdict, dimension scores, the Overall row, uplift,
pass@k, and the Tier 1 Quality Score.

The card carries one overall verdict — `PASS`, `NEUTRAL`, `FAIL`, or
`INCOMPLETE`. It fails closed: if a required scanner produced no trustworthy
evidence, the verdict is `INCOMPLETE` and the card explicitly says not to use
Expand Down Expand Up @@ -550,6 +564,15 @@ arms; if you ran with `--skip-baseline`, there is no lift to report. In
`custom_only` grading, your own grader defines the score and lift — see
[Custom Graders & Tasks](custom-graders.mdx).

The HTML **Dimension Scores and Skill Lift** table shows each dimension's
plain-language meaning and evidence source beside its score, and keeps a
dimension listed when it could not be scored: its score reads N/A with a note
such as **not scored with the skill**, its verdict reads **No verdict**, and a
dimension whose signals had nothing to judge reads **Not applicable**. A
collapsed **What each number means** panel under the Tier 3 overview cards
separates the verdict, Overall Score, Skill Lift, pass@k, the Tier 1 Quality
Score, and publication eligibility.

When the HTML report has no lift for an agent or dimension, its label says
why. **no baseline** means that row has no baseline score, for example after
`--skip-baseline`. **comparison unavailable** means a baseline score was
Expand Down
10 changes: 10 additions & 0 deletions src/skillevaluator/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,16 @@
"efficiency": "Uses the skill and tools productively without wasted work.",
}

# Where each Tier 3 signal's evidence comes from, in plain words.
SIGNAL_EVIDENCE_SOURCES: dict[str, str] = {
"security": "deterministic checks of the agent's commands and outputs",
"accuracy": "an LLM judge comparing the final answer with the reference answer",
"skill_execution": "deterministic checks of the agent's trajectory",
"goal_accuracy": "an LLM judge of whether the user's goal was met",
"behavior_check": "an LLM judge of the expected workflow",
"skill_efficiency": "deterministic checks of the agent's trajectory",
}

# Token-efficiency evaluator: derived locally from ``trial.tokens`` (the
# per-trial trajectory token counters). Per-trial sub-score uses a
# soft asymptote ``1 / (1 + total / TOKEN_EFFICIENCY_HALF_LIFE)`` over the
Expand Down
134 changes: 125 additions & 9 deletions src/skillevaluator/reporting/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
DIMENSION_MAPPING,
DIMENSION_VERDICT_NEUTRAL_THRESHOLD,
DIMENSION_VERDICT_PASS_THRESHOLD,
SIGNAL_EVIDENCE_SOURCES,
TIER3_LIFT_FAIL_THRESHOLD,
TIER3_LIFT_PASS_THRESHOLD,
)
Expand Down Expand Up @@ -466,12 +467,14 @@ def _render_results_at_a_glance(
lines.append("| " + " | ".join(_md_cell(header, private_labels) for header in headers) + " |")
lines.append("|---|" + "|".join(["---:"] * len(agents)) + "|")

baseline_only = (ae or {}).get("mode") == "baseline_only"
overall_row = ["Overall"]
overall_row.extend(
_score_transition_values(
agent.get("baseline"),
agent.get("with_skill", agent.get("overall_score")),
skill_never_activated=_mapping(agent.get("skill_activation")).get("status") == "never_activated",
baseline_only=baseline_only,
)
for agent in agents.values()
)
Expand All @@ -485,11 +488,13 @@ def _render_results_at_a_glance(
if dimension and dimension.get("partial"):
has_partial = True
row.append(
_score_transition(
dimension,
_dimension_cell(
agent,
dim_id,
skill_never_activated=(
_mapping(agent.get("skill_activation")).get("status") == "never_activated"
),
baseline_only=baseline_only,
)
)
lines.append("| " + " | ".join(_md_cell(value, private_labels) for value in row) + " |")
Expand All @@ -509,6 +514,12 @@ def _render_results_at_a_glance(
"45.0 percentage points above its 47.0% no-skill baseline."
),
"",
(
"**Not scored** means a signal the dimension needs produced no score, and **Not applicable** "
"means no eval case gave its signals anything to judge; neither is a score of zero. "
"Scoring Methodology below explains each dimension and where its evidence comes from."
),
"",
]
)
if has_partial:
Expand Down Expand Up @@ -687,14 +698,29 @@ def _render_methodology(
"<details>",
"<summary>Show dimension definitions, source signals, and thresholds</summary>",
"",
"| Dimension | Question | Scored signals |",
"|---|---|---|",
"| Dimension | What it measures | Scored signals | Evidence source | Baseline in this run |",
"|---|---|---|---|---|",
]
)
agents = _agents(ae)
baseline_only = (ae or {}).get("mode") == "baseline_only"
for dim_id, config in DIMENSION_MAPPING.items():
signals = _weighted_signals(config)
question = config.get("question") or DIMENSION_HINTS.get(dim_id, "")
lines.append(f"| {dim_id.title()} | {_trusted_md_cell(question)} | {_trusted_md_cell(signals)} |")
meaning = " ".join(
part for part in (config.get("question"), DIMENSION_HINTS.get(dim_id)) if isinstance(part, str) and part
)
evidence = "; ".join(
dict.fromkeys(
SIGNAL_EVIDENCE_SOURCES[signal]
for signal in config.get("evaluators", [])
if signal in SIGNAL_EVIDENCE_SOURCES
)
)
baseline = _baseline_coverage(agents, dim_id, baseline_only=baseline_only)
lines.append(
f"| {dim_id.title()} | {_trusted_md_cell(meaning)} | {_trusted_md_cell(signals)} | "
f"{_trusted_md_cell(evidence[:1].upper() + evidence[1:])} | {_trusted_md_cell(baseline)} |"
)

lines.extend(
[
Expand Down Expand Up @@ -729,6 +755,35 @@ def _render_methodology(
"- Token efficiency is a separate report-only signal. It does not change a dimension "
"score or the overall verdict."
),
(
"- The baseline is the same eval cases run by the same agent without the skill. Every "
"dimension is compared with it when the baseline arm ran and scored that dimension."
),
"",
"Which number answers which question:",
"",
(
"- **Overall verdict** (top of this card): whether the evidence supports publishing the skill. "
"It needs every required tier, not only Tier 3 scores."
),
(
"- **Dimension score**: how well the agent did on one question above when it had the skill, "
"from 0% to 100%."
),
"- **Overall** row: the equal-weight mean of the five dimension scores with the skill.",
(
"- **Uplift** (Skill Lift in other reports): the skill score minus the no-skill baseline score. "
"It shows whether the skill helped; it does not set the verdict."
),
(
"- **pass@k** (HTML report and `pass_at_k_lift.json`): the share of eval cases with at least "
"one passing attempt out of k. It measures how repeatable success is, separately from the "
"dimension scores."
),
(
"- **Quality Score** (Tier 1, out of 100): a static review of the skill's files. It is not an "
"input to any Tier 3 score or uplift."
),
"",
]
)
Expand Down Expand Up @@ -1171,27 +1226,88 @@ def _agent_dimension(agent: dict[str, Any], dim_id: str) -> dict[str, Any] | Non
return None


def _score_transition(dimension: dict[str, Any] | None, *, skill_never_activated: bool = False) -> str:
def _score_transition(
dimension: dict[str, Any] | None,
*,
skill_never_activated: bool = False,
baseline_only: bool = False,
) -> str:
if not dimension:
return "Not available"
return _score_transition_values(
dimension.get("baseline"),
dimension.get("with_skill", dimension.get("score")),
skill_never_activated=skill_never_activated,
baseline_only=baseline_only,
)


def _score_transition_values(baseline: object, score: object, *, skill_never_activated: bool = False) -> str:
def _single_score_label(score: float) -> str:
decimal_places = _score_display_decimal_places(score)
return _format_percentage(_percentage_point_units(score, decimal_places), decimal_places)


def _baseline_coverage(agents: dict[str, dict[str, Any]], dim_id: str, *, baseline_only: bool) -> str:
"""Say whether this run has a no-skill baseline score for one dimension."""
if not agents:
return "Compared when the baseline arm runs"
with_baseline = 0
for agent in agents.values():
baseline = _number((_agent_dimension(agent, dim_id) or {}).get("baseline"))
if baseline is not None and 0 <= baseline <= 1:
with_baseline += 1
if baseline_only:
return "Baseline only; no with-skill arm ran" if with_baseline else "Not scored in this run"
if with_baseline == len(agents):
return "Yes, a no-skill baseline was scored"
if with_baseline == 0:
return "No baseline score; uplift unavailable"
return f"Baseline for {with_baseline} of {len(agents)} agents"


def _dimension_cell(
agent: dict[str, Any],
dim_id: str,
*,
skill_never_activated: bool = False,
baseline_only: bool = False,
) -> str:
"""Render one Results at a Glance dimension cell, explaining a missing score."""
dimension = _agent_dimension(agent, dim_id)
if dimension is not None:
return _score_transition(dimension, skill_never_activated=skill_never_activated, baseline_only=baseline_only)
not_applicable = agent.get("not_applicable_dimensions")
if isinstance(not_applicable, list) and any(
isinstance(entry, dict) and entry.get("id") == dim_id for entry in not_applicable
):
return "Not applicable — no eval case gave its signals anything to judge"
if isinstance(agent.get("dimensions"), list):
return "Not scored — a signal this dimension needs produced no score"
Comment thread
chrisknvidia marked this conversation as resolved.
Resolved
return "Not available"


def _score_transition_values(
baseline: object,
score: object,
*,
skill_never_activated: bool = False,
baseline_only: bool = False,
) -> str:
"""Render ``baseline → score (uplift)`` so the visible arithmetic is exact.

Scores are fractions in [0, 1]. A missing, non-finite, or out-of-range score,
or a recorded baseline that is not a valid score, is reported as unavailable
rather than clamped or published.
"""
parsed_score = _number(score)
parsed_baseline = _number(baseline)
if score is None and parsed_baseline is not None and 0 <= parsed_baseline <= 1:
baseline_label = _single_score_label(parsed_baseline)
if baseline_only:
return f"Baseline {baseline_label} — baseline-only run; no with-skill score or uplift"
return f"Not scored with the skill — baseline {baseline_label}; uplift unavailable"
if parsed_score is None or not 0 <= parsed_score <= 1:
return "Not available"
parsed_baseline = _number(baseline)
if skill_never_activated:
# No uplift is shown, so the baseline neither sets the precision nor withholds the score.
parsed_baseline = None
Expand Down
28 changes: 23 additions & 5 deletions src/skillevaluator/reporting/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,15 @@
from jinja2 import BaseLoader, Environment

from skillevaluator import __version__
from skillevaluator.constants import QUALITY_GRADE_THRESHOLDS, TIER3_LIFT_FAIL_THRESHOLD, TIER3_LIFT_PASS_THRESHOLD
from skillevaluator.constants import (
DIMENSION_HINTS,
DIMENSION_VERDICT_NEUTRAL_THRESHOLD,
DIMENSION_VERDICT_PASS_THRESHOLD,
QUALITY_GRADE_THRESHOLDS,
SIGNAL_EVIDENCE_SOURCES,
TIER3_LIFT_FAIL_THRESHOLD,
TIER3_LIFT_PASS_THRESHOLD,
)
from skillevaluator.publication_evidence import result_publication_evidence_dict
from skillevaluator.reporting.base import (
AGENT_EVAL_EXACT_TEXT_KEYS,
Expand Down Expand Up @@ -1038,7 +1046,8 @@ def _sanitize_tier3_display_payload(value: dict[str, Any]) -> dict[str, Any]:
if not isinstance(payload.get(key), dict):
payload[key] = {}
payload["metric_labels"] = _tier3_text_mapping(payload.get("metric_labels"))
payload["dimension_hints"] = _tier3_text_mapping(payload.get("dimension_hints"))
payload["dimension_hints"] = _tier3_text_mapping(payload.get("dimension_hints")) or dict(DIMENSION_HINTS)
payload["signal_evidence"] = dict(SIGNAL_EVIDENCE_SOURCES)
evaluator_paths = payload["provenance"].get("evaluator_paths")
payload["provenance"]["evaluator_paths"] = evaluator_paths if isinstance(evaluator_paths, dict) else {}
if "source_validation" in payload["provenance"]:
Expand Down Expand Up @@ -1078,14 +1087,21 @@ def _sanitize_tier3_display_payload(value: dict[str, Any]) -> dict[str, Any]:
if (card := _sanitize_tier3_evaluator_card(item)) is not None
]
payload["cases"] = _dict_list(payload.get("cases"))
# Unscored dimensions stay listed so the report can explain them.
payload["dimensions"] = [
dimension
for item in _dict_list(payload.get("dimensions"))
if (
(dimension := _sanitize_tier3_dimension(item)).get("score") is not None
or dimension.get("with_skill") is not None
if any(
(dimension := _sanitize_tier3_dimension(item)).get(key) is not None
for key in ("score", "with_skill", "baseline")
Comment thread
chrisknvidia marked this conversation as resolved.
Resolved
)
]
scored_dimension_ids = {dimension.get("id") for dimension in payload["dimensions"]}
payload["not_applicable_dimensions"] = [
{"id": dimension_id, "reason": reason if isinstance(reason := item.get("reason"), str) else ""}
for item in _dict_list(payload.get("not_applicable_dimensions"))
if (dimension_id := _tier3_display_identifier(item.get("id"))) and dimension_id not in scored_dimension_ids
]
for key in ("conclusions", "recommendations", "suggestions_v2"):
payload[key] = _sanitize_tier3_insight_items(payload.get(key))
payload["dataset"] = [_sanitize_tier3_dataset_case(item) for item in _dict_list(payload.get("dataset"))]
Expand Down Expand Up @@ -3355,6 +3371,8 @@ def _attach_quality_scores(skills: dict[str, dict[str, Any]]) -> None:
tier2_results=tier2_results,
tier3_lift_pass_threshold=TIER3_LIFT_PASS_THRESHOLD,
tier3_lift_fail_threshold=TIER3_LIFT_FAIL_THRESHOLD,
tier3_dimension_pass_threshold=DIMENSION_VERDICT_PASS_THRESHOLD,
tier3_dimension_neutral_threshold=DIMENSION_VERDICT_NEUTRAL_THRESHOLD,
quality_min_score=quality_min_score,
quality_grade_legend=QUALITY_GRADE_LEGEND,
verdict_words=VERDICT_WORDS,
Expand Down
Loading
Loading