Skip to content

fix(tier3): show N/A for N/A metrics in the terminal Skill Lift and the HTML trial drill-down - #411

Merged
rng1995 merged 11 commits into
mainfrom
naren/port-tier3-judge-not-applicable
Nov 12, 2026
Merged

rng1995 merged 11 commits into
mainfrom
naren/port-tier3-judge-not-applicable

Conversation

@rng1995

@rng1995 rng1995 commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The Tier 3 terminal summary printed NO SCORE in every Skill Lift cell it could not compute. The Markdown, HTML and CLI reports print N/A for a row that is N/A in either arm, then skipped when the with-skill arm never ran, and NO SCORE only for anything else. The HTML report's per-trial drill-down printed — for an N/A metric, the same as for a missing score.

  • tier3/result_display.py: the lift cell in Results by Evaluator and Results by Dimension now follows the same order. It reads N/A when either arm records the row as N/A, then skipped in a baseline-only run (--skip-with-skill), then NO SCORE. Numeric lifts are unchanged. Custom metric rows can read skipped but never N/A.
  • The evaluator table caption now says N/A metrics are left out of scores and lift.
  • HTML report, Per-Evaluator Drill-Down table: a cell reads N/A when the trial recorded the metric as N/A, with data-not-applicable="true" and a Not applicable: <reason> tooltip. A score missing for another reason still reads —.
    • The template reads the trial's not_applicable_metrics, which the report payload already records (evaluation/tier3_report.py). It is set only when every row of the logical trial records the metric as N/A.
    • reporting/html.py keeps only names that can be N/A in that list, so a malformed saved payload cannot turn a security cell into N/A. A new not_applicable_reason template filter reads the reason from NOT_APPLICABLE_REASONS in tier3/harbor/metrics.py.
  • tier3/harbor/metrics.py: the reasons in NOT_APPLICABLE_REASONS for accuracy, goal_accuracy and behavior_check named only the legacy fields ground_truth and expected_behavior. They now name expected_output and assertions first, for example No assertions (legacy expected_behavior) defined, so there is no workflow to check. The HTML report shows these reasons in its Not applicable evaluators list and in the drill-down tooltips, and the report payload's not_applicable_evaluators carries them. The verifier's own reasons in skill_evaluator_reward.json are unchanged.
  • Docs: docs/tier3-live-evaluation.mdx (Reading results) now explains N/A scores. The public docs did not describe them before. The section covers:
    • when each metric is N/A, named by the current dataset fields (assertions, expected_output) and their legacy names
    • that an empty or whitespace-only reference, or an empty list, counts as missing
    • that 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. Other entry points accept an empty expected_output, and the verifier then records both metrics as N/A.
    • how skill_evaluator_reward.json (null value, status and reason under details.<metric>) and reward.json (metric left out) record it
    • what leaves N/A out: the trial overall, dimensions, pass@k and Skill Lift
    • that the agent's verdict reads only the with-skill arm: a dimension whose metrics are N/A in every with-skill trial (for example Correctness when no case defines expected_output) has no with-skill score, so the agent cannot PASS. The sentence names no other verdict and points to the verdict table: which one applies depends on the other dimensions and on whether the skill activated. A dimension that is N/A only in the baseline (Discoverability and Efficiency without the skill) does not affect the verdict.
    • that a judge answering N/A for a case with a reference leaves the trial unscored
    • the summary.json fields
  • docs/reports.mdx:
    • The terminal summary: N/A rows read N/A in their score and lift cells, and in a baseline-only run the lift of every row that is not N/A reads skipped.
    • Failure reasons and per-trial rows: an N/A drill-down cell reads N/A and says why on hover, and a score missing for another reason reads —.
  • Tests for four verifier N/A behaviors that main's tests did not pin, for the drill-down cells, for the N/A reasons and for the verdict rule the docs describe. See Tests.
  • CHANGELOG entry under Unreleased > Fixed.
  • Not in this PR: N/A cells in tier3 compare, which still prints - for them. Open PR fix(tier3): show the run's Overall lift in tier3 compare when a metric is N/A in one arm #386 changes how compare reads the same summaries, so this is a follow-up after fix(tier3): show the run's Overall lift in tier3 compare when a metric is N/A in one arm #386.

The closed plugin-evaluation PR #28 carried a version of this fix inside its larger change; this PR lands the generic part on its own.

Why

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). For example, on main a run whose cases have no assertions prints these rows in Results by Evaluator (score bars left out):

Evaluator         With Skill   No Skill   Lift
Skill Execution   1.00         N/A        NO SCORE
Behavior Check    N/A          N/A        NO SCORE

and this in Results by Dimension:

Dimension         With Skill   No Skill   Lift
Discoverability   1.00         N/A        NO SCORE

NO SCORE reads like a failed or missing measurement, while the metric was never applicable. With this PR these lift cells read N/A.

In a baseline-only run every lift cell also read NO SCORE, while docs/reports.mdx and the Markdown and CLI reports say skipped. With this PR an Accuracy row reads skipped 0.60 skipped, and a Skill Execution row, which is N/A in the baseline, reads skipped N/A N/A, as in the other reports.

The N/A reasons in the HTML report's Not applicable evaluators list, and now in the drill-down tooltips, named only ground_truth and expected_behavior. Datasets in the current format have neither field: they use expected_output and assertions, and the docs this PR adds name those first. The reasons now name both.

Kept from public

Main already has the scoring part of this fix (#258, released in 0.7.0), so this PR changes only the terminal and drill-down cells, the report-side N/A reasons, docs and tests:

  • Judges return N/A without calling the LLM when the reference is missing, and 0, 0.0 and false count as references: templates/eval.py judge_accuracy, judge_goal_accuracy, judge_behavior_check and _has_judge_reference, mirrored in eval_core/llm_judge.py.
  • _call_required_judge(..., allow_not_applicable=...) turns an N/A answer for a case with a reference into a judge error, and the trial stays unscored.
  • The no-trajectory path keeps reference-less judges N/A. _reward_overall averages each dimension over its applicable metrics. reward.json drops N/A metrics, and skill_evaluator_reward.json keeps null with status: "not_applicable" under details.<metric>.
  • The collector, metrics.py (metric_is_not_applicable, mark_not_applicable, dimension_scores), lift (lift_basis.py), pass@k, summary.json (not_applicable_metrics, not_applicable_counts) and the report payload already handle N/A. Their sidecar reads stay bounded and no-follow.
  • Main's tests already cover N/A in the judges, metrics, the collector, lift, pass@k and saved-run reports (tests/tier3/test_metric_applicability_producer.py, tests/reporting/test_applicability_saved_runs.py). They did not pin four verifier behaviors or the verdict rule the docs now describe, so this PR adds tests for them. See Tests.
  • The verdict rule is unchanged. _agent_quality_verdict (evaluation/tier3_report.py) already reads only the with-skill dimension scores; this PR documents that.
  • The verifier's own N/A reasons (_NO_GROUND_TRUTH_REASON and _NO_EXPECTED_BEHAVIOR_REASON in templates/eval.py and eval_core/llm_judge.py), which skill_evaluator_reward.json records, keep main's text. Open PR fix(tier3): treat placeholder expected_script and behavior values as no expectation #402 edits the code next to them.
  • The drill-down keeps main's per-trial N/A rule (not_applicable_metrics: N/A in every row of the logical trial) rather than adding a second per-trial field.
  • templates/metric.py, which the adapter copies into each generated dataset, still rejects a reward that leaves out an N/A metric. Main pins that check (test_standalone_metric_rejects_incomplete_or_invalid_default_rewards), and Harbor 0.24 runs a dataset's metric.py only for package datasets, not for the local datasets SkillEvaluator runs. This PR leaves it alone.

Open PRs, checked against the open PRs listed today, and main at 35ef01e6:

Tests

  • tests/tier3/test_metric_applicability_display.py, 2 new tests:
    • test_terminal_lift_reads_na_when_either_arm_is_na renders a two-arm agent with N/A metrics in one arm and in both arms, a metric that is missing but not N/A, and scored metrics. N/A evaluator and dimension rows read N/A in the lift column, the missing metric still reads NO SCORE, and scored rows keep +0.40.
    • test_terminal_lift_reads_skipped_in_a_baseline_only_run_unless_the_row_is_na renders a --skip-with-skill result. Scored rows read skipped in the with-skill and lift cells, and rows that are N/A in the baseline read N/A in the lift.
  • tests/tier3/test_metric_applicability_producer.py, 15 new cases for the Harbor verifier that runs in each trial:
    • test_template_trial_without_trajectory_keeps_reference_less_judges_na: a trial with no trajectory fails the judges its case defines, keeps the others N/A, and does not pull the arm's mean down.
    • test_template_baseline_trial_without_trajectory_keeps_skill_metrics_na: a baseline trial (has_skill: false) with no trajectory leaves skill_execution and skill_efficiency out of reward.json and records them as N/A in skill_evaluator_reward.json, like the baseline trials that ran.
    • test_template_trial_is_unscored_when_a_judge_claims_na_for_a_defined_reference (3 cases, one per judge): main() exits 1, the sidecar records the judge error, and the collector cannot score the trial.
    • test_template_reference_check_counts_false_and_zero_but_not_empty_values (10 cases): the verifier's own _has_judge_reference counts 0, 0.0, False and "0" as references and None, empty, blank and empty-list values as missing. Main tested only the host copy in eval_core/llm_judge.py.
  • tests/reporting/test_tier3_baseline_trial_views.py, 4 new cases for the HTML drill-down:
    • test_drilldown_reads_na_for_not_applicable_trial_cells: an N/A with-skill Accuracy cell and N/A baseline Skill Execution and Skill Efficiency cells read N/A with data-not-applicable="true" and the reason in the tooltip. A Goal Accuracy score missing without the N/A marker still reads —, and scored cells keep their scores.
    • test_display_keeps_only_eligible_na_metric_names (3 cases): a saved trial whose list also names security and an unknown metric keeps only accuracy, a list stored as a string or a mapping becomes empty, and the Security cell stays —.
  • tests/reporting/test_applicability_saved_runs.py, 7 new cases on saved runs:
    • test_verdict_reads_only_with_skill_na_dimensions (2 cases). With N/A Discoverability and Efficiency in the baseline and 0.95 everywhere with the skill, the verdict is pass. When accuracy and goal_accuracy are also N/A in every with-skill trial, Correctness has no with-skill score and the verdict is neutral.
    • test_with_skill_na_dimension_never_lets_the_agent_pass (3 cases): with Correctness N/A in every with-skill trial, the verdict is not pass when the other dimensions score 0.95, when Security scores 0.1, or when the skill never activated. It checks only what the docs promise, so it holds on main and with feat(tier3): fail cases on unmet goals and security issues, independent of lift #395 (neutral, neutral, inconclusive) and with fix(tier3): report FAIL when a scored dimension is below 0.40 even if another is N/A #414 (neutral, fail, inconclusive).
    • test_docs_name_only_the_shared_outcome_of_a_with_skill_na_dimension: the docs paragraph on N/A with-skill dimensions says the agent cannot PASS and names no other verdict.
    • test_na_evaluator_reasons_name_the_dataset_field_and_its_legacy_name: the report's not_applicable_evaluators reasons start with No expected_output (legacy ground_truth) defined for accuracy and goal_accuracy and No assertions (legacy expected_behavior) defined for behavior_check. mark_not_applicable records the same text.
  • Fail-before:
    • With src/ from main and this PR's tests, the 2 new display tests fail (['0.80', 'N/A', 'NO SCORE'] == ['0.80', 'N/A', 'N/A'] and ['skipped', '0.50', 'NO SCORE'] == ['skipped', '0.50', 'skipped']). The other 42 tests in the two applicability modules pass.
    • With src/ from main, the 4 new drill-down cases fail ('—' == 'N/A', and the unsanitized lists come back as stored), and so does the reason test ('No ground_truth defined, so there is no reference answer to judge against' does not start with No expected_output). The other 43 tests in the two reporting modules pass.
    • With src/ from this branch before the reason commit, the reason test and the drill-down tooltip check fail, and the other 46 tests in the two reporting modules pass.
    • The docs test fails on this branch's earlier wording, which said the verdict is NEUTRAL (the paragraph does not contain so the agent cannot PASS), and on main's docs, which have no such paragraph.
    • The 15 producer cases pin behavior main already has, so they pass on main. I broke the verifier template one change at a time, and each change fails its tests: scoring every judge 0 on the no-trajectory path fails the no-trajectory test; deleting the if not skill_metrics_on: block on the no-trajectory path fails the baseline no-trajectory test; passing allow_not_applicable=True to all three judges fails the 3 unscored-trial cases; making _has_judge_reference return bool(value) fails 5 reference cases (0, 0.0, False, blank, blank items).
    • The 2 verdict cases and the 3 never-pass cases also pin behavior main has, for the docs. Making _agent_quality_verdict skip a dimension with no with-skill score fails the neutral case and the never-pass case whose other dimensions score 0.95, and making it also require a baseline score fails the pass case.
  • The two applicability modules: 44 passed (42 on main). tests/reporting/test_tier3_baseline_trial_views.py: 29 passed (25 on main). tests/reporting/test_applicability_saved_runs.py: 19 passed (18 with src/ from main).
  • On the merge with main 35ef01e6, the modules that render the terminal summary or read the changed docs or CHANGELOG: 1165 passed. They are tests/test_tier3_result_display.py, tests/test_tier3_case_summary.py, tests/test_commands.py, tests/test_cli.py, tests/test_harbor_timeout_recovery.py, tests/test_harbor_claude_refusal_fallback.py, tests/reporting/test_terminal_polish.py, tests/reporting/test_skill_activation_reporting.py, tests/reporting/test_shared_run_status.py, tests/tier3/test_skip_with_skill.py, tests/tier3/test_metric_applicability_display.py, tests/tier3/test_metric_applicability_producer.py, tests/test_accuracy_arithmetic.py, tests/test_benchmark_rollout_docs.py, tests/test_ci_change_classifier.py, tests/test_oss_packaging.py, tests/test_tier3_public_runtime.py, tests/ci/test_image_build.py, tests/tier3/test_private_loose_source.py and tests/test_ci_workflows.py.
  • On the same merge: tests/tier3, 9716 passed and 3 skipped. tests/reporting, which renders the HTML report, 1821 passed.
  • On the branch itself, the four changed test modules: 92 passed.
  • ruff check and ruff format --check are clean on the changed Python files, and scripts/check_oss_boundary.py passes.

🤖 Generated with Claude Code

rng1995 and others added 11 commits November 6, 2026 23:03
The Tier 3 terminal summary printed NO SCORE in the Skill Lift column of
an evaluator or dimension that is N/A in either arm. The Markdown, HTML
and CLI reporter tables already print N/A there. Most runs with a
baseline hit this: Skill Execution, Efficiency and Discoverability are
N/A in a baseline with no skill it could activate, and the judged
metrics are N/A when the cases have no ground_truth or
expected_behavior.

The lift cell now reads N/A when either arm records the row as N/A and
there is no delta. A lift missing for any other reason still reads
NO SCORE. The evaluator table caption says N/A metrics are left out of
scores and lift.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Describe when accuracy, goal_accuracy, behavior_check, skill_execution
and skill_efficiency are N/A, how the reward files record them, that
scores, dimensions, pass@k and Skill Lift leave them out, and that the
terminal summary shows N/A for their scores and lift.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
In a baseline-only run (--skip-with-skill) the terminal summary printed
NO SCORE in every Skill Lift cell, while the docs and the Markdown and
CLI reporters say skipped. The lift cell now 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, in the same order as the other reporters.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Pin three behaviors of the Harbor verifier that no test caught:

- A trial with no trajectory fails the judges its case defines, but a
  judge without its reference stays N/A, so the arm's mean keeps the
  scored trials' value.
- A judge that answers N/A for a case that defines its reference makes
  main() exit 1, and the collector cannot score the trial.
- The verifier's own reference check counts 0, 0.0 and False as
  references and empty values as missing.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Name the current fields: behavior_check is N/A without assertions
(legacy expected_behavior), accuracy and goal_accuracy without
expected_output (legacy ground_truth). Say that an empty reference
counts as missing, instead of a 0/false example users cannot author.
Say that details.<metric> holds the not_applicable status and reason,
that an all-N/A dimension makes the agent's verdict NEUTRAL, and that in
a baseline-only run the lift of every row that is not N/A reads skipped.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A baseline trial with no trajectory must keep skill_execution and
skill_efficiency N/A, like the baseline trials that ran. Scoring them 0
would turn the baseline's Discoverability and Efficiency into 0.0 and
give the with-skill arm lift from skill activation alone. No test pinned
this branch of the verifier's no-trajectory path.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…l-down

The HTML report's Per-Evaluator Drill-Down printed a dash for every
metric a trial did not score, so an N/A metric looked the same as a
missing score. The cell now reads N/A, says why on hover and carries
data-not-applicable="true". It reads the trial's not_applicable_metrics,
which the report payload already records, and the display layer keeps
only metric names that can be N/A.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Only `skillevaluator tier3 ./my-skill` and `tier3 init-harbor-task`
reject an empty expected_output. Other entry points accept it, and the
verifier then records accuracy and goal_accuracy as N/A.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The docs said an all-N/A dimension makes the agent's verdict NEUTRAL
without naming the arm. The verdict reads only the with-skill arm, so
Discoverability and Efficiency, which are N/A in a baseline with no
skill it could activate, never block a PASS. Say so, give the
with-skill example (Correctness without expected_output), and pin both
cases with a saved-run test.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The reasons for an N/A accuracy, goal_accuracy or behavior_check named
only the legacy fields ground_truth and expected_behavior. The HTML
report's Not applicable evaluators list and drill-down tooltips showed
them for agentskills datasets too, whose fields are expected_output and
assertions. Name the current field first and the legacy name after it.

The verifier's own sidecar reasons are unchanged.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The N/A paragraph said a dimension with no with-skill score makes the
agent's verdict NEUTRAL. That is not always so: a skill that never
activated gives INCONCLUSIVE, and the verdict table on the same page
gives FAIL when another dimension is below 0.40. The paragraph now says
only that the agent cannot PASS and points to the verdict table.

A new test checks that claim on saved runs with a passing rest, with
Security below 0.40 and with a skill that never activated, and another
checks that the paragraph names no other verdict.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the full production diff, callers, report/runner contracts and affected regression coverage; no actionable findings. Existing CI on reviewed head b4902e3: 20 successful checks, 2 skipped; no failed or pending checks. Fresh merge-tree verification against current main ce52a09 succeeds without conflicts. No code changes or local test rerun were needed. #425 remains stacked on this PR.

@rng1995
rng1995 merged commit 5b2cd25 into main Nov 12, 2026
22 checks passed
@rng1995
rng1995 deleted the naren/port-tier3-judge-not-applicable branch November 12, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant