Skip to content

fix(reporting): show judge-mixed lift exclusions on Tier 3 evaluator cards - #418

Merged
rng1995 merged 5 commits into
mainfrom
naren/port-report-tier3-evaluator-judge-mixed-note
Nov 12, 2026
Merged

rng1995 merged 5 commits into
mainfrom
naren/port-report-tier3-evaluator-judge-mixed-note

Conversation

@rng1995

@rng1995 rng1995 commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

When a case's arms were scored by different judge models, for example after a judge fallback in one arm, that judge metric's lift leaves the case out while both arm scores keep it. This is the documented design (docs/reports.mdx), but the evaluator card never said so. It could show Baseline 0.20 and With skill 0.50 next to a -0.40 lift, with no explanation on the card. Only the dimension reasoning had a note.

Why

A reader compares the two bars with the lift pill. When a judge fallback scored one arm of a case, the bars can be 0.30 apart while the lift is -0.40, and the card gives no hint that the lift compares a different set of cases. The JSON had only per-metric counts in lift.json, so a consumer could not tell which cases or evidence entries were affected.

Kept from public

  • The documented design stays: arm scores keep every scored case, and evaluator, dimension and overall lift use the eligible comparisons. This change does not take mixed cases out of the arm scores; it only explains the gap.
  • The lift itself still comes from public's _judge_aware_lift and the collector's pair_metric_scores. The new code only reads the cases they left out. No change to collector.py.
  • The dimension reasoning note (Cases scored by different judge models are excluded from lift.) and the report budget stages are unchanged. When the budget drops card evidence, the card keeps comparison_basis and its note. Only the per-trial labels go with the evidence.
  • No new top-level judge_mixed_cases field and no report-loader change: the report reads the counts from the lift it already rebuilds.

Tests

  • tests/test_judge_lift_integrity.py (27 new cases, 47 in the module):
    • test_evaluator_card_names_the_cases_its_lift_left_out (one and all cases mixed): collected run. Arm scores stay 0.50/0.20, the lift stays -0.40 or unavailable, and the evaluator count, card comparison_basis, evidence flags and the top-level card copy are checked. The rendered HTML card has the Lift leaves out or No lift note, one label per mixed case and balanced markup. No other card gets a note.
    • test_comparison_basis_counts_repeated_attempts_apart_from_na_and_unpaired_cases: three attempts of a mixed case count as 2 excluded attempts (the N/A one has no score), and a case only the baseline scored is not counted.
    • test_matching_judges_add_no_lift_note: with matching judges there is no lift_excluded_cases, comparison_basis, evidence flag, note or label.
    • test_saved_run_without_the_mixed_case_rewards_shows_only_the_recorded_count: a legacy lift.json without the mixed case's reward keeps the recorded lift and count. The card has no case IDs and null attempt counts, and the HTML shows the count without labels.
    • test_trimmed_card_evidence_keeps_the_lift_note: when the report budget drops card evidence, the card keeps comparison_basis, and the HTML shows the note with no labels and balanced markup.
    • test_never_activated_agent_gets_no_lift_note: a never-activated agent with a judge fallback has no lift_excluded_cases, comparison_basis, note or label.
    • test_html_ignores_a_malformed_comparison_basis_and_flag (6 cases: True, "3", -1, 2**70, 1.0 and a list): the HTML shows no note, and comparison_excluded: "yes" adds no label.
    • test_html_keeps_comparison_basis_fields_only_in_their_types: the HTML sanitizer turns malformed attempt counts into null, a string case_ids into [] and a non-string reason into "", and drops a non-boolean evidence flag.
    • test_comparison_basis_caps_case_ids_and_lists_each_cut_id_once: 72 mixed cases give 64 sorted keys of at most 256 characters, two keys that match once cut appear once, and excluded_cases stays 72.
    • test_comparison_basis_leaves_out_trials_without_a_resolved_case: a mixed pair of trials without a case ID is neither listed nor flagged.
    • test_attempt_counts_stay_null_unless_the_load_identifies_every_left_out_case (2 cases): a with-skill trial whose rows name two cases, and a lift.json count of 2 when the loaded rewards identify 1. Both publish null attempt counts, and the card says No lift: ....
    • test_lift_note_mentions_arm_scores_only_when_both_arms_have_one: with a failed baseline condition the note and reason leave out the arm-scores clause.
    • test_recorded_exclusion_count_is_published_only_when_json_carries_it_exactly (4 cases): 3 and 2^53 - 1 are published, while 2^53 and 10^30 are left out with no comparison_basis.
    • test_comparison_basis_publishes_both_attempt_counts_or_neither (4 cases).
  • Fail-before: with src/ from main (d717f22cf), 17 of the 27 new cases fail. The 10 that pass pin behavior main already has: no note with matching judges, no fields for a never-activated agent, no note for a malformed comparison_basis, and no count above 2^53 - 1.
  • Each of these guards was removed in turn, and each removal fails at least one test: the never-activated reset, the is True evidence-flag check, the 64-key cap, the 256-character cut, the single listing of cut keys, the unresolved-case filter, the identified-case check, the complete-load check, the null-together rule, the sanitizer's checks on both attempt counts, the JSON-safe count bound, the No lift wording, and the arm-scores clause in the note and in reason.
  • 69 test modules on the merge with main d717f22cf (pytest -n 4): the 63 that import the Tier 3 report builder or the HTML reporter, tests/ci/test_image_build.py and tests/test_oss_packaging.py, which read report.html.j2 and docs/reports.mdx, and tests/test_ci_workflows.py, tests/test_ci_change_classifier.py, tests/test_harbor_claude_refusal_fallback.py and tests/test_harbor_metrics_truth.py: 4147 passed, 4 skipped.
  • Full suite (pytest -n 6 tests): 27393 passed, 35 skipped, 5 failed. The 5 also fail on main d717f22cf on the same machine: two secure Docker sidecar tests and three CI bootstrap and feedback launcher tests that depend on the local Python setup.
  • 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 3 commits November 7, 2026 21:02
…cards

A case whose arms were scored by different judge models (for example
after a judge fallback in one arm) is left out of that judge metric's
lift, while both arm scores keep it. An evaluator card could therefore
show Baseline 0.20 and With skill 0.50 next to a -0.40 lift with nothing
on the card explaining the gap.

The report now works out which cases each judge metric's lift left out
from the logical attempts the lift rebuild already compares, and falls
back to the recorded per-metric count when the loaded rewards no longer
identify them. The evaluator records the count in lift_excluded_cases,
its card records comparison_basis (count, case IDs, with-skill attempt
counts, reason), and matching evidence entries carry
comparison_excluded. The HTML card adds a note under the lift pill and
labels those cases in its per-trial evidence. Scores and lift are
unchanged.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Publish the card's excluded_attempts and contributing_attempts only
  when the logical load the lift rebuild compares is complete, the lift
  basis describes the metric and every left-out case is identified;
  otherwise publish both as null.
- List each comparison_basis case key once after cutting it to 256
  characters.
- Leave lift_excluded_cases out when the recorded count is above the
  largest integer JSON carries exactly, instead of publishing null.
- Say "No lift: ... no comparable result remains" on a card without a
  lift, and claim that the arm scores include the cases only when both
  arm scores exist, in the note and in comparison_basis.reason.
- Pin the never-activated, HTML sanitizer, 64-key cap and unresolved
  case guards with tests.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
State that comparison_basis.case_ids holds the lift's case keys (no
attempt suffix, cut to 256 characters, listed once, at most 64), that
both attempt counts are null unless the loaded rewards are complete and
identify every left-out case, and that a never-activated agent gets none
of these fields. Move the CHANGELOG entry ahead of the Tier 2 context
deduplication entry so it no longer shares an insertion point with
another pending Fixed entry.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rng1995
rng1995 marked this pull request as ready for review November 9, 2026 19:50
rng1995 and others added 2 commits November 10, 2026 14:12
…ed-note

Brings in the main changes since e5c100a. Three files conflicted, all
where main's plain-language deductions (#399) added the
evidence_unavailable_reason evidence field on the same lines that this
branch adds comparison_excluded. Both fields are kept:

- src/skillevaluator/evaluation/tier3_report.py: _metric_evidence keeps
  main's _METRIC_EVIDENCE_REF_METRICS import next to this branch's
  _entry_id import, and sets comparison_excluded for a judge-mixed case
  before main's evidence_unavailable_reason block.
- src/skillevaluator/reporting/html.py: keeps this branch's
  _sanitize_tier3_comparison_basis helper ahead of main's new
  _sanitize_tier3_evaluator_card signature (keyword
  include_evidence_unavailable_default), and keeps the
  comparison_excluded check followed by main's evidence_unavailable_reason
  default.
- src/skillevaluator/reporting/templates/report.html.j2: takes main's
  per-case dedup_map seed (with evidence_unavailable_reason and reason, at
  main's indentation) and adds this branch's comparison_excluded default;
  keeps both per-evidence update lines.

CHANGELOG.md and docs/reports.mdx merged cleanly; this branch's Fixed
entry stays under Unreleased next to the same neighbours.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The merge put this branch's collector import ahead of main's eval_core
import in _metric_evidence; ruff's import sorting wants eval_core first.

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 266da5d: 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.

@rng1995
rng1995 merged commit d55b240 into main Nov 12, 2026
22 checks passed
@rng1995
rng1995 deleted the naren/port-report-tier3-evaluator-judge-mixed-note branch November 12, 2026 18:29
rng1995 added a commit that referenced this pull request Nov 16, 2026
…eports and docs (#561)

* fix(reporting): name the exception Harbor recorded under a failed Tier 3 job

When a Harbor job's statistics miss a trial, the collector names the
first trial or step exception Harbor recorded under it as
`trial <label> recorded <Type>: <message>`, and that job failure is the
arm's first error. The coverage notice only looked for an exception type
at the start of an error or after `: `, so a step exception such as
`RewardFileNotFoundError` left `failure` null, and a later typed error
could be named instead of the first one.

Also accept a type that follows ` recorded `. The type still has to be a
CamelCase name ending in Error or Exception and be followed by `:` or the
end of the error, so a typeless recorded message or a trial label shaped
like a type names nothing.

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

* docs(tier3): limit the empty expected_output rejection to the object shape

The N/A section said `tier3 ./my-skill` and `tier3 init-harbor-task`
reject an empty `expected_output`. Only a `{"skill_name", "evals"}`
dataset is checked for it. A flat dataset (a JSON or YAML list,
`{"cases": [...]}`, or any `evals.jsonl`) loads as legacy, so an empty
or whitespace-only `expected_output` or `ground_truth` is accepted there
and makes `accuracy` and `goal_accuracy` N/A.

Say so, and pin the wording with a test that runs `init-harbor-task` on
each shape.

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

* fix(reporting): name only the shared outcome of a Not applicable dimension

A Not applicable row in the HTML Tier 3 dimension table ended with "It
has no score, so the agent's verdict stays NEUTRAL and cannot PASS.",
and docs/reports.mdx said the same twice. Since #414 an agent with a
scored dimension below 0.40 is FAIL even when another dimension has no
score, so the row contradicted the report's own verdict. The reason
before that sentence also had no closing period.

The row and the docs now say only "It has no score, so the agent cannot
PASS.", the wording docs/tier3-live-evaluation.mdx already uses, and the
row adds the missing period after the reason. A test renders a failing
run with a Not applicable dimension, and a docs test keeps verdict names
out of the reports page's Not applicable sentences. The CHANGELOG entry
also covers the coverage notice fix for an exception Harbor recorded.

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

* docs(reporting): say how the HTML labels a failed run's verdict

docs/reports.mdx said a failed run keeps `neutral`, "which the HTML
labels Changes required". The HTML labels `neutral` as Neutral. A
failed run reads Changes required because the HTML report turns its
verdict into `fail`, also in the full Tier 3 payload it embeds; only
the run's payload keeps `neutral`.

Say that, and that a successful run's `neutral` verdict reads Neutral.
The completed-agent docs test now checks both runs against the rendered
HTML and the embedded payload.

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

* fix(reporting): say when the loaded results cannot confirm a judge-mixed lift

An evaluator card with no lift said its judge-mixed cases left "no
comparable result". The lift is also withheld when the loaded rewards
cannot confirm the comparison, for example when a logical trial's rows
name two cases or `lift.json` records more mixed cases than the rewards
identify. Matching-judge cases can still exist then.

Keep "no comparable result remains" for a card whose comparison basis
records `contributing_attempts` as 0, which needs a complete load. Any
other card with no lift now says "the loaded results cannot confirm the
comparison". Update docs/reports.mdx and the Unreleased CHANGELOG entry
from #418 to match.

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

* docs(changelog): quote only the end of a recorded Tier 3 job failure

The Fixed entry for the coverage notice said the collector reports the
job failure as `trial <label> recorded <Type>: <message>`. The job
failure opens with `Harbor evaluation statistics account for N/M
completed trials; `, so that clause is only how it ends. The entry now
says so, and a test checks the live job failure and the entry.

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

* docs(changelog): say plainly when a card with no lift cannot confirm it

The Unreleased entry for the judge-mixed lift note said a card with no
lift says the loaded results cannot confirm the comparison "when they
do not show that no attempt was left to compare". It now says the card
says no comparable result remains when the loaded results show that no
attempt fed the lift, and otherwise that they cannot confirm the
comparison. A test checks that wording in the entry and the matching
docs/reports.mdx paragraph.

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

* docs(changelog): rewrap the judge-mixed lift entry

The previous wording change left one line of the Unreleased entry for
the judge-mixed lift note over 90 characters. Rewrap the rest of the
paragraph. The text is unchanged.

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

* docs(reports): name the JSON report's Tier 3 payload as the one that keeps neutral

The completed-agent section said "The payload keeps `neutral` for a failed
run" in the same sentence that says the payload embedded in the HTML report
records `fail`, so a reader could not tell which payload keeps `neutral`.
Name the `tier3` object of a `validate --tier3` JSON report. The later
lift sentence also said the payload records the failed run's verdict as
`neutral`, which the HTML-embedded payload does not; it now says only that
both payloads keep the lift in `summary.overall_lift`.

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

* docs(changelog): record the two Tier 3 docs corrections under Documentation

The branch corrects two docs sentences but recorded neither in the
changelog. Add Unreleased Documentation entries: the live evaluation guide
now limits the empty expected_output rejection to the {"skill_name",
"evals"} dataset, and Reports & Results now says the HTML report and its
embedded Tier 3 payload show a failed run's verdict as fail (Changes
required) while the JSON report's tier3 object keeps neutral. Tests pin
both entries' text and their place under Unreleased Documentation.

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

* test(tier3): pin the empty expected_output rule for the tier3 PATH dataset step

The docs say both `skillevaluator tier3 ./my-skill` and `tier3 init-harbor-task`
reject an empty `expected_output` only in a {"skill_name", "evals"} dataset.
The test ran only `init-harbor-task`, so a stricter check added only to the
`tier3 PATH` dataset step would not have failed it.

The test now also runs that step on each dataset shape: it accepts the flat
JSON list, `{"cases": [...]}` in .json and .yml, the YAML list and the JSONL
file, rejects the object shape in .json and .yml, and leaves the evals folder
unchanged. The object shape in YAML and `{"cases": [...]}` in .yml are new
cases for both commands.

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

* test: let the two docs-correction CHANGELOG checks survive a release cut

Two tests required their CHANGELOG entries to sit under Unreleased, so a
release that moves Unreleased into a dated section would fail them. They
now find each entry by its opening words in any section, still require
the Documentation subsection, and fail only when the entry sits in 0.9.0
or an older released section.

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

* docs(reports): say which Tier 3 reports label a failed run Changes required

A default `validate --tier3` run keeps Tier 3 advisory, so its report
labels a failed run's `fail` verdict Failed (advisory), and its command
status follows the required tiers. Only the standalone Tier 3 report.html
and the report of a `validate --block-on-agent-eval` run read Changes
required. Reports & Results and the CHANGELOG entry now say so.

The CHANGELOG entry also no longer implies that every failed run keeps
`neutral` in the JSON `tier3` object: a `validate --block-on-agent-eval`
run without a valid Tier 3 source fails before any agent runs and records
`fail` there too.

Tests run `validate --tier3` with and without --block-on-agent-eval, and
without a valid Tier 3 source, and check the texts against its reports.

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

* docs(reports): say when a failed Tier 3 run keeps neutral in the JSON report

The `tier3` object of a `validate --tier3` JSON report keeps `neutral`
when the run's collected results record the failure, for example when
one of several agents fails. When the execution backend reports a
failure after the agents scored, such as a Harbor job that exits with an
error after its trials, the run is marked failed but the payload keeps
those scores, its `summary.overall_score` and the verdict they give,
such as `pass` or `fail`, in advisory and blocking runs alike. A
blocking run without a valid Tier 3 source is no longer described as
the only failed run that records `fail` there.

The CHANGELOG entry and Reports & Results now say this, and a test runs
`validate --tier3` on a scored run the backend marks failed to pin the
JSON verdict, the agent status, the HTML labels and the documented text.

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

* docs(reports): shorten the failed Tier 3 run entry and note budget-stopped runs

The CHANGELOG entry for the failed-run label correction now gives the
rule: the HTML reports show a failed run's verdict as `fail`, labelled
Changes required in the standalone Tier 3 report.html and in a
`validate --block-on-agent-eval` report, and Failed (advisory) in a
default `validate --tier3` report, while the `tier3` object of the JSON
report can still record `neutral` or the verdict the agents' scores give.
Reports & Results keeps the per-case detail.

A failed run whose budget left planned attempts not run records
`incomplete` in the `tier3` object, and the HTML reports label its
verdict Incomplete; the standalone report's command status reads
Incomplete too. Reports & Results and the entry now say so. A new test
runs that case, for a failed peer agent and for a backend error, through
`validate --tier3` with and without `--block-on-agent-eval`.

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

* docs(changelog): shorten the failed Tier 3 run entry to the rule

The entry now states the rule and points to Reports & Results for the detail: the HTML reports show a failed run as fail, labelled Changes required or Failed (advisory) by gate, while the JSON tier3 object can still carry neutral or the verdict the scores give. The tests pin the shorter wording.

Signed-off-by: Christopher Kevin <[email protected]>

---------

Signed-off-by: Narendran Raghavan <[email protected]>
Signed-off-by: Christopher Kevin <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Christopher Kevin <[email protected]>
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