Repository navigation
fix(tier3): explain failing scores and show baseline trial rows - #305
Conversation
A failing Tier 3 evaluator score could render as a bare 0.00. Graders already record why in reward.json details, but the drill-down kept only scores, evaluator cards read only a top-level reason and never the offending command, and when attempts of one case disagreed the card kept the first non-empty note, so a passing attempt's "no unsafe actions" text could hide a failing attempt's reason. Grader reasons were also embedded without credential redaction. The drill-down and steps chart read only with-skill trials, so baseline per-evaluator scores, steps and tokens could not be compared there. Add evaluation/tier3_findings to build one bounded, redacted reason per failing metric (up to three distinct parts from reason/message, failing and plain-string findings, failing behavior results, failed criteria except those the grader excluded, failed checks and the attribution note) and a short evidence excerpt. Redaction matches the terminal findings report: configured credential values, then credential patterns. Secret-detector findings never quote their pattern. Harbor and judge helpers are imported lazily, so report imports stay as light as before. Each normalized trial in both arms carries score_reasons, taken from the lowest-scoring row of a logical trial; failing drill-down cells show it as a tooltip. Evaluator cards redact grader text, add the built reason in a separate evidence "reason" field when the grader recorded none, add the excerpt for failing scores, open when the card fails, and show the lowest-scoring attempt's reason per case. Size limits drop these built reasons first. The canonical payload budget removes them before any existing stage and records failure_reasons under report_truncation.omitted, which the dashboard treats as a diagnostic. The HTML preview works on a copy without them, puts them back only into room left under the preview trigger, and otherwise runs the existing bounded walk without them, so they never displace the overview. The size notice now uses subscript lookups; notice.items resolved to the dict method and printed its repr. The drill-down lists with-skill and baseline rows with a Condition column and includes metrics scored only on baseline rows. Baseline rows get the trial sanitizer's bounds without added default fields; agents[*].trials, which nothing renders, is left as recorded. Steps per case are precomputed per agent and condition in reporting/trial_charts; a case with missing or partial telemetry stays a gap. The token chart remains with-skill only. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
rng1995
left a comment
There was a problem hiding this comment.
Automated review: 12 findings (0 P1, 2 P2, 10 P3); 12 posted inline.
Conflicted files: src/skillevaluator/reporting/html.py (imports). Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Card evidence: the built reason and excerpt are no longer part of the dedup fingerprint and are built only for new entries, so attempts that quote different commands under one grader reason collapse with occurrences again instead of filling the card and the evidence budget. - Card fallback reason leaves out failing behavior results, which the card already lists as failures. - Reason extraction falls back to a finding's type and skips blank candidates, so message-less findings cannot exhaust the candidate cap. - The scan window keeps whole words only (a word cut at its edge is dropped) and keeps line breaks through redaction, so a masked `key: value` pair ends at its line. - HTML preview: the unrendered top-level card copy no longer counts as a left-out reason; the drill-down row-cap note shows only when trial rows were capped and says how many. - Drill-down adds a column for metrics only baseline rows scored. - Steps chart is computed from the full display payload, capped at 200 cases with a note. - Tests cover the above, failures redaction, glued keys, the rendered size notice, and the lowest-scoring reason rule. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Also move this PR's CHANGELOG entries back under Unreleased > Fixed; the merge of main had left them after the new Security subsection. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Conflicted files: CHANGELOG.md (Unreleased > Fixed). Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
chrisknvidia
left a comment
There was a problem hiding this comment.
I read the findings builder, the card and drill-down changes, the preview and canonical size handling and the new chart module. The template side is fine: autoescape is on and the chart data goes through tojson. The thing I would fix first is the new excerpt text. It quotes raw agent commands and the shared redactor does not mask password flags, so a credential can reach the published HTML. The earlier comments on the dedup fingerprint and on the steps chart reading the bounded preview matter too.
Conflicted files: none. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rpts Grader excerpts quote raw command lines. Mask curl -u/--user user:pass, --password/--token style flags with a value, sshpass -p, attached MySQL -pVALUE and every Cookie header pair before the shared redaction runs. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
The curl -u fixture added to the grader reason redaction tests trips the curl-auth-user rule, and Gitleaks scans the full branch history, so a later edit cannot clear it. Allow that one value, in that one test file, for that one rule, and pin the scope of curl-auth-user allowlists. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Conflicted: CHANGELOG.md. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Clean merge of origin/main (f878f99); CHANGELOG.md auto-merged with this PR's entries kept under Unreleased. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
chrisknvidia
left a comment
There was a problem hiding this comment.
Follow-up on the current head. The masking now covers the cases from my last comment: curl -u/--user, quoted and unquoted --password/--token, attached -pVALUE, sshpass -p and whole Cookie: headers, while mkdir -p and mysql -u root stay intact. A 300-character quoted password is masked too. One small leftover, not blocking: curl's short cookie flag is left in clear (curl -b "session=abcdef123456" https://x), while --cookie is masked, because _CLI_SECRET_FLAG_RE only matches long flags. The other review fixes and the docs updates read correctly to me.
Redact cookie values passed with curl's short -b flag while preserving non-cookie uses. Signed-off-by: Christopher Kevin <[email protected]>
|
I added the fix for the |
…der-reasons-baseline Signed-off-by: Christopher Kevin <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
Resolve the CHANGELOG.md conflict: keep main's report finding-count entry (#310) and add this PR's baseline-trial drill-down entry after it. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Resolve the CHANGELOG.md conflict: keep main's Tier 2 JSON-in-prose entry (#297) and add this PR's failing-score explanation entries after it. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Resolve the docs/reports.mdx conflict: keep this PR's LLM and tool timing table and notes at the end of "Measured agent resources", followed by main's new "Failure reasons and per-trial rows" section (#305). Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Summary
Tier 3 HTML reports now say why an evaluator score failed, and the per-evaluator drill-down and steps chart cover both arms instead of only the with-skill trials. Large reports drop these explanations before any other detail.
evaluation/tier3_findings.pybuilds one bounded, redacted reason per failing metric from the grader'sdetails. It joins up to three distinct parts fromreason/message, failing findings (including plain-string findings from legacy and custom graders), failing behavior results, failed rubric criteria, failed named checks, and the securityattribution_explanation. It also builds a short excerpt from the first failing finding'sevidence._bounded_report_reason:_redact_configured_credentialsreplaces the exact values of configured credential environment variables, andredact_sensitive_textmasks credential patterns.redact_secrets_in_log_lineruns between them and also covers JWTs.excluded_criteria, through the findings report's_applicable_accuracy_criteria. A case with no expected skill therefore no longer reportsSKILL_IDENTIFIEDas failed.secret_leak(which stores its detection regex) andsecret_exposure(which stores a fixed placeholder) never become excerpts.tier3_report,reporting.htmlor the CLI loads the same Tier 3 modules as onmain._normalize_trialsaddsscore_reasonsto each trial in both arms, next to Share trace evidence, applicable scores and security checks #258'snot_applicable_metrics. When a logical trial spans several reward rows, the reason comes from the lowest-scoring failing row, not fromgroup[0]. A failing cell getstitle="<Metric>: <reason>"and a dotted underline.trials(with skill) and onagents[*].trials_baseline.agents[*].trials, which the drill-down does not read, drops them after flattening._metric_evidenceredacts the grader text it already showed innotesandfailures. When the grader recorded noreason, a failing entry gets the built reason in a separatereasonfield, sonotesstill holds only grader text and size limits can drop the built text first. The card shows it where the notes would be. Failing scores also get anexcerpt, rendered as<code class="t3-ev-excerpt">.failstatus opens its per-trial evidence._enforce_report_payload_budgetnow removes built reasons and excerpts before any stagemainalready had (comparison payloads, non-best-agent details, trials, evidence). The count is recorded asfailure_reasonsunderreport_truncation.omitted. The dashboard counts that section as a diagnostic, not a trial-coverage loss._bounded_tier3_previewworks on a private copy without reasons and excerpts. If that copy fits under the trigger, it renders in full and reasons are put back, in report order, while room remains. Otherwise the bounded walk runs on the copy exactly as onmain, without reasons. Either way the reasons never spend the preview budget ahead of the overview keys. The size notice says how many reasons or excerpts were left out, and the embedded canonical payload keeps all of them.trials, then baseline rows fromagents[*].trials_baseline._sanitize_tier3_agentruns public's_sanitize_tier3_trialonagents[*].trials_baselinewithfill_defaults=False. Baseline rows therefore get the same render-time bounds as with-skill rows: non-numeric or out-of-range scores, bool or negative steps, negative tokens and non-list warnings render as—instead of failing the report or showing raw values. Optional fields (agent,baseline_scores,lift_scores,warnings,error_recovery) are normalized only when present, so no empty defaults are added to every row.agents[*].trialsis left as recorded.score_reasonsonly as a mapping from metric to non-empty string, keyed like the scores, and a card'sreasonandexcerptonly when they are non-empty strings.With skill/Without skill) is added. The filter counter counts all rows. When the HTML preview capped rows (64 with-skill rows in total, 64 baseline rows per agent), a note under the filter says so.reporting/trial_charts.py(steps_by_case_chart) precomputes one series per agent and condition from the same bounded preview the page renders, andhtml.pypasses it to the template. It replaces the inline JS aggregation.null. Bool, negative, non-finite and overflowing step values are rejected, and the mean is overflow-safe.tier3_preview_notice.items, which Jinja resolves to the dict'sitemsmethod, so every bounded report printed<built-in method items of dict object at 0x...> items. It now uses subscript lookups.docs/reports.mdx, including the size-limit behavior. CHANGELOG:Unreleased> Changed (baseline rows and steps chart) and > Fixed (reasons, size notice).Not in this PR:
Trials: Ncounts only with-skill trials. The hero, tier card, overview and dashboard also call the best agent's score "overall".Coordination:
tier3/harbor/report._collect_fail_reasons(terminal findings report; metric-aware, all findings, per-finding attribution,attribution_completeness,error_recoverycorrections) and feat(tier3): case-first CLI summary and case-based report findings #255'stier3/case_summary._failed_reasons(what_to_fix.json;details[metric]["reason"]below 0.8). This PR keeps its own extractor because the HTML needs one short, bounded, per-trial reason built only from failing entries. It shares_applicable_accuracy_criteriaand the redaction steps with the findings report and, like it, reads plain-string findings. A follow-up can make the terminal report andcase_summaryreusetier3_findings.failure_reason, so all three explain a failure the same way.trial_na/na_reasonandtitle="{{ na_reason }}" data-not-applicableon the same drill-down score<td>, inside the{% for trial in tier3.trials %}loop this PR replaces witht3_condition_trial_rows; and it addstrial["not_applicable"]in_normalize_trialswhere this PR addsscore_reasons. The twotitleattributes do not overlap: the N/A title applies when the score is none and the reason title only when a score is present, so a merge can combine them.--skip-with-skill, open). Also editstier3_report.py,html.pyand the template (hero and evaluator table), so expect textual conflicts. Behavior is complementary: a baseline-only run's drill-down shows its baseline rows and their reasons.not_applicable_metricsnext to the lines that addscore_reasons; both are kept.Why
Security 0.00could render with no explanation. The grader had recorded the reason and the offending command inreward.json, but the report showed neither:reason, so graders that writemessage, findings or criteria showed nothing.Kept from public
_metric_evidencekeeps its scan limits, report budget, fingerprint deduplication withoccurrences, sampling metadata,custom_detailsprecedence (now shared through_metric_detail),failures/checks/evidence_refs, and its 512-character note cap.logical_trial_reward_groupsand per-row metric sets are respected when choosing a reason.—, and thetokens.prompt/completionkeys are unchanged.main's canonical budget stages and HTML preview limits are unchanged; this PR only puts its own reasons ahead of them. Probe: N trials per arm, 2 of 6 with-skill and 4 of 6 baseline metrics failing on every trial, about 200-character grader messages, display payload through_bounded_tier3_preview:main131 KB; this PR 238 KB, below the trigger, rendered in full with every reason.main165 KB; this PR 298 KB. The preview keeps the full overview (best agent, dimension ids, card ids) and every row, puts back as many reasons as fit, and says how many it left out.main339 KB, preview omits 7,609 characters and 116 items; this PR 613 KB, preview omits the same 7,609 characters and 116 items plus all reasons. The overview is intact in both.main; nearly all of it isredact_sensitive_text. With 64 findings of 2 KB each per metric it is about 24 s, because each redacted candidate keeps its 16 KiB scan window (see the redaction bullet). Typical runs, with fewer failing metrics and short messages, add well under a second._tier3_report_datarejects as untrustworthy (for example, no with-skill score) still renders the fallback stub.Tests
tests/reporting/test_tier3_failure_reasons.py(23 tests).details, and none for passing metrics.secret_leak/secret_exposureevidence is not quoted back.monkeypatch).excluded_criteriaare not reported as failed.score_reasonsandexcerptvalues are dropped at render time.message-only detail puts the built reason in the card'sreasonfield, notnotes, and the card shows it.failure_reasonsis omitted, agents and trials are otherwise unchanged, and the dashboard does not count it as lost trial coverage.tests/reporting/test_tier3_baseline_trial_views.py(21 tests).—while the with-skill row is unchanged.agents[*].trialsas recorded.tests/reporting/test_unified_tier3_report.pyfor the new titles. The JS partial-telemetry assertion is replaced by a check of the embedded chart data. The escape-heavy preview test now also checks the notice reads "HTML preview omitted N characters." without a method repr.pytest tests/reporting tests/evaluation tests/tier3 tests/test_oss_packaging.py tests/test_ci_change_classifier.py(-n 8): 7,578 passed, 13 failed. All 13 aretest_generated_custom_only_script_*intests/tier3/test_judge_failure_artifacts.py; they run the generated grader under the host'spython33.9, which rejectsint | float, and fail the same way on unmodifiedmain.tests/ci/test_native_reports.py,tests/test_harbor_html_report_failures.py,tests/test_publication_evidence.py,tests/test_public_benchmark_gate.py,tests/validators/test_security.pyand others): 1,959 passed, 5 skipped.ruff check src tests, andruff format --checkon the changed Python files: clean.scripts/check_oss_boundary.py: passed.🤖 Generated with Claude Code