Skip to content

fix(tier3): keep custom_only grading policy on unscored conditions - #287

Merged
rng1995 merged 10 commits into
mainfrom
naren/port-custom-only-metric-label
Nov 3, 2026
Merged

rng1995 merged 10 commits into
mainfrom
naren/port-custom-only-metric-label

Conversation

@rng1995

@rng1995 rng1995 commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

When a Tier 3 condition produces no scoreable reward, the Harbor collector cannot infer a metric set from rewards and falls back to the standard metric set. It did this even in grading.mode: custom_only runs, which never grade standard metrics. The collector did not know the run's grading mode at all: the runner resolved it but did not pass it to collect_harbor_results.

This PR:

  • adds a keyword-only grading_mode parameter to collect_harbor_results and passes the runner's normalized grading mode to it;
  • derives a fallback metric set, metric list and score policy from that mode (custom-only / () / custom-overall-v1 for custom_only, the standard set and skill-evaluator-dimension-mean-v1 otherwise);
  • uses that fallback for the run-level metric_set, metrics, score_policy and attempt_policy, the per-condition defaults, conditions whose logical reward list is empty, and the summaries written for Harbor jobs that never started;
  • leaves observed rewards in charge of their own metric set. The fallback applies only when an arm has no logical reward.

In default and default_plus_custom modes, and for direct callers that omit grading_mode, the fallback equals the previous hardcoded values, so their output is unchanged.

Why

In a custom_only run, an arm whose attempts all failed (for example, a lost sandbox connection) or whose Harbor job never started was published with:

  • metric_set: skill-evaluator-default-v2 and the six standard metrics in its summary.json and in the agent's metrics_with_skill/metrics_without_skill;
  • score_policy: skill-evaluator-dimension-mean-v1 on the agent and condition;
  • the dimension-mean formula as the score definition in attempt_policy.json and in the report header when no agent succeeded.

Downstream, the report and tier3 result commands decide whether an agent is custom-only from these recorded policies, so the failed agent was treated as a standard agent. No score was wrong, because failed conditions already have their scores cleared, but the labels contradicted the requested grading mode. A custom_only run in which every attempt failed reported the standard dimension-mean formula.

Kept from public

  • Public's reward-driven metric selection (metric_set_for_rewards, average_metrics) and its score-policy recovery (_score_policy_for_rewards, ambiguity handling, mixed-policy conflict checks) are unchanged. The fallback only replaces the empty-reward default, and _score_policy_for_rewards([], ()) already yields custom-overall-v1.
  • Public's run-level policy selection from successful agents, which ranks custom-only agents against standard agents, is unchanged.
  • The runner's existing grading-mode normalization and validation, including the legacy aces_* aliases, are unchanged. The collector receives the canonical name.
  • No other collector behavior changes, including failure classification, partial-reward preservation and summary publication.

Tests

  • New tests/test_harbor_unscored_grading_policy.py:

    • failed with-skill-only and paired runs under every grading mode (none, default, default_plus_custom, custom_only). Each checks the run, agent, summary.json, attempt_policy.json and report-payload metric set and policy;
    • missing Harbor jobs (launch failure) under default and custom_only;
    • successful rewards under every mode still determine their own metric set (standard or custom-only), regardless of the requested mode.
  • tests/test_tier3_config_key_parity.py: the end-to-end config test now asserts that the normalized grading mode (default_plus_custom from the legacy aces_plus_custom spelling) reaches result collection.

  • On unmodified main, the custom_only cases fail with skill-evaluator-default-v2 != custom-only, and the routing assertion fails. The default cases pass on main too, which confirms that default output is unchanged.

  • Neighbouring suites pass: all tests/test_harbor_* and tests/test_tier3_*, tests/tier3, tests/evaluation, tests/reporting, tests/test_commands.py, tests/test_judge_lift_integrity.py, tests/test_accuracy_arithmetic.py and tests/test_issue55_collector_truth.py. Local failures not caused by this PR:

  • Timing-sensitive tests failed under parallel load and pass in isolation: test_bounded_harbor_process_timeout_preserves_redacted_diagnostic_tail (0.1 s timeout), the two FIFO tests in tests/tier3/test_workflow.py (5 s subprocess timeout) and the two Bedrock assume-role preflight probe cases.

  • The test_generated_custom_only_script_* cases in tests/tier3/test_judge_failure_artifacts.py run the generated custom-grader script with the machine's python3, which is 3.9 here, and it uses int | float in isinstance. They fail the same way on unmodified main. This PR does not touch that script.

  • The *sidecar_retains_* tests in test_harbor_secure_docker_environment.py need local Docker Compose state.

  • ruff check and ruff format --check pass on all changed Python files. The OSS boundary check passes.

🤖 Generated with Claude Code

When a Tier 3 condition produced no scoreable reward, for example because
every attempt failed or its Harbor job never started, the collector fell
back to the standard metric set and the skill-evaluator-dimension-mean-v1
score policy. It did so even in grading.mode custom_only runs, because the
runner resolved the grading mode but never passed it to result collection.
The failed condition's summary.json, the agent's recorded metrics and
score policies, attempt_policy.json and the report's score definition then
described standard grading, and downstream report and result commands
treated a failed custom-only agent as a standard one. Scores themselves
were already cleared for these conditions.

Pass the normalized grading mode to collect_harbor_results and derive a
fallback metric set, metric list and score policy from it. Use that
fallback for the run-level defaults, conditions with no logical reward and
missing-job summaries. Observed rewards still determine their own metric
set, and default and default_plus_custom output is unchanged.

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 diff plus collector.py/runner.py in context, and ran lint and the tests locally. No P1/P2/P3 findings.

Checked: the fallback only applies when an arm has no logical reward, so observed rewards still decide their own metric set; default, default_plus_custom, and direct callers that omit grading_mode keep the old values; run-level policy conflict detection only considers succeeded agents, so a failed custom_only agent now carrying custom-overall-v1 cannot create a false conflict; the only call site (runner) passes the normalized mode. CHANGELOG is under Unreleased/Fixed and the custom-graders doc note matches.

Local results: ruff check clean, changed files format-clean; test_harbor_unscored_grading_policy.py and test_tier3_config_key_parity.py pass (32 passed with the neighboring collector tests).

Reviewed with Claude Code.

Conflicted files: CHANGELOG.md.

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

@chrisknvidia chrisknvidia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I traced grading_mode from the runner into the collector and through every place that used the empty-reward default, then ran scratch collections for failed, never-started and mixed success/failure agents under default and custom_only. The fallback only applies to arms with no logical reward, observed rewards still win, and default output is unchanged. One non-blocking note about the summaries written for jobs that never started.

rng1995 and others added 8 commits November 3, 2026 04:31
Conflicts resolved in CHANGELOG.md and src/skillevaluator/tier3/harbor/collector.py.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Conflicted files: CHANGELOG.md (kept main's new read-only /etc/passwd
mount entry and placed this PR's custom_only entry after it under
Unreleased > Fixed); src/skillevaluator/tier3/harbor/collector.py (kept
both collect_harbor_results docstring notes, skip_with_skill then
grading_mode; the auto-merged skip_with_skill paths use the PR's grading
fallback).

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

The with-skill and without-skill summary.json written for a job that never
started was overwritten by a second write that dropped metric_set and
score_policy. Fold the fields into the surviving write, drop the first write,
and assert both persisted summaries.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
When a Harbor job never started, the collector wrote the condition's
summary.json twice. The second write, which had no metric_set (and, for
with-skill, no score_policy), always replaced the first, so the requested
custom_only labels reached only the returned result. Drop the overwritten
first write and record the fallback metric_set and score_policy in the
surviving one, keeping metrics as []. A skipped with-skill arm writes the
same summary as before.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
No textual conflicts; src/skillevaluator/tier3/harbor/collector.py merged
cleanly but was adjusted: the single surviving with-skill summary write
records the requested metric set and score policy for a job that never
started, while a --skip-with-skill arm keeps main's ungraded shape
(metrics [] and no score policy), matching score_policy_with_skill = None.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Conflicted: CHANGELOG.md (Unreleased > Fixed) - kept main's new BENCHMARK.md score-transition entry (#269) unchanged and placed this PR's custom_only entry after it, separated by a blank line.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…om-only-metric-label

Conflicts in CHANGELOG.md, src/skillevaluator/tier3/harbor/collector.py and tests/test_harbor_unscored_grading_policy.py; never-started summaries keep metrics [] to match the returned result, and the job_failure assertion is kept.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…om-only-metric-label

No conflicts.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rng1995
rng1995 merged commit 9d131bd into main Nov 3, 2026
21 checks passed
@rng1995
rng1995 deleted the naren/port-custom-only-metric-label branch November 3, 2026 20:05
rng1995 added a commit that referenced this pull request Nov 6, 2026
* docs(changelog): move entries released in 0.7.0-0.7.2 out of Unreleased

0.7.0 (#314) and 0.7.1 (#327) never cut their sections on main, and 0.7.2
(#335) added its section below the whole Unreleased block, so Unreleased
still listed work that had already shipped.

Place each Unreleased entry under the release that shipped the PR that
added it:

- 0.7.0: the published section from the 0.7.0 tag, verbatim. It already
  holds the six entries that main had filed under 0.6.0, so 0.6.0 again
  matches the v0.6.0 tag, including the original run_config.json entry.
- 0.7.1: #264 #271 #274 #281 #284 #289 #293 #299 #316 #317 #318 #323
  #324 #326 #327, plus the #320 wording of the Windows Git-root entry,
  since #320 changed that 0.7.0 fix in 0.7.1.
- 0.7.2: #263 #265 #269 #270 #276 #279 #287 #290 #296 #309 #328 #330
  merged with the existing #335 entries.

Only post-v0.7.2 entries stay under Unreleased, with one heading per
subsection. Entry text is unchanged, apart from the published tag wording
in 0.7.0 and 0.6.0.

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

* chore(release): prepare v0.8.0

Set the package, fallback, lock, citation and developer-guide versions to
0.8.0 and move every entry merged since v0.7.2 under
'## 0.8.0 - 2026-11-05', leaving Unreleased empty.

The refusal-fallback documentation test now reads the release section
that names CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK, requires it to be 0.8.0,
and requires exactly one entry there to name the switch.

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

* chore(release): pin the verified 0.8.0 Tier 1 image and add its CI bundle

Pin onboarding to the Tier 1 image published by the reviewed main revision
55d2d04 in "Build and publish Tier 1 image" run 42158955180:
ghcr.io/nvidia/skillevaluator-tier1@sha256:9d5483243918937be4f2178f74cf7c622a531dee41e3176906994d52fa14950a
(config sha256:d17d6f5105ec5f1bf0cbe4dff0d693aae4ecf01e9c1c6a6ddb7830518acace33).
The workflow and publisher refs both move to 55d2d04.

ci/bundles/0.8.0 mirrors the 0.7.2 bundle. The templates, README and
release.json are the run's github-actions-onboarding artifact and match
ci/render_templates.py output for these pins byte for byte. The scanner
inventory and verification receipt come from the build's runtime-stage
version step, the five-case smoke receipt, the onboarding job's anonymous
pull, and the public manifest, whose config digest equals the smoke-tested
image ID. The ZIP uses the 0.7.2 layout (sorted members, inner checksums,
1980 timestamps, 0644, deflate level 9) and rebuilds to identical bytes.

Point the current-bundle links at 0.8.0 and list 0.7.2 as historical.

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

---------

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

2 participants