From 7017be83993b0fbd593932afc9b1bb8a87324744 Mon Sep 17 00:00:00 2001 From: Andy Wang Date: Sun, 15 Nov 2026 10:07:11 +0800 Subject: [PATCH] Say when a run reached only ungated groups instead of "every gate met" An ungated group's gate row is met without being held to a bar. A report whose every result sat in ungated groups therefore had only met rows, and GateCheck#message (what assert_meets_pass_gates and the RSpec matcher print) said "every pass gate met", as did `evals run --wait` ("Gates: every gate met"), even when every answer had failed. The verdict is kept: the docs promise an ungated group never fails the run, and a catalog set marked `gated: false` is tested to report gates_met true. Only the wording changes. GateCheck says every group the run covered is ungated and no answer was held to a bar, and the CLI prints "Gates: every group reached is ungated (N); nothing was held to a bar." The evaluations and CLI guides note it, and point at --min-pass-rate for a run that should still fail CI. --- CHANGELOG.md | 13 +++++++++++++ docs/framework/cli.md | 4 +++- docs/framework/evaluations.md | 4 +++- lib/active_agent/cli/eval_commands.rb | 8 +++++++- lib/active_agent/evals/gate_check.rb | 5 ++++- test/cli/cli_test.rb | 15 +++++++++++++++ test/evals/gate_check_test.rb | 12 ++++++++++++ 7 files changed, 57 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50e736f6..2431dd31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Fixed + +- **A run of only ungated groups no longer reads as "every gate met"** + (`activeagent`). An ungated group's row is met without being held to a + bar, so a report whose every result sat in ungated groups said "every + pass gate met" (`GateCheck`, `assert_meets_pass_gates`, the RSpec + matcher) and `evals run --wait` printed `Gates: every gate met`, even + when every answer had failed. The verdict is unchanged, since an ungated + group never fails the run, but the message now says that every group + covered is ungated and nothing was held to a bar. + ## [1.9.8] - 2026-11-12 The dashboard holds a run to its catalog's pass bars: a product's and a diff --git a/docs/framework/cli.md b/docs/framework/cli.md index 248eabe3..97e1e318 100644 --- a/docs/framework/cli.md +++ b/docs/framework/cli.md @@ -129,7 +129,9 @@ FAIL Here the whole run clears 80% and still fails, because the critical group is held to 100%. A group with `gated: false` is reported and never fails -the run. `--json` adds the run's `gates` beside `pass_rate` and `verdict`. +the run; a run that reached only ungated groups prints `Gates: every group +reached is ungated (N); nothing was held to a bar.` in place of `every gate +met`, so add `--min-pass-rate` if such a run should still fail CI. `--json` adds the run's `gates` beside `pass_rate` and `verdict`. A run without gates is gated on its status and pass rate alone, as before, and without `--wait` or `--min-pass-rate` the command returns once the run starts, before any gate exists. diff --git a/docs/framework/evaluations.md b/docs/framework/evaluations.md index 49628854..3b7eac7c 100644 --- a/docs/framework/evaluations.md +++ b/docs/framework/evaluations.md @@ -775,7 +775,9 @@ and `pass_rate` (a 0..1 fraction) beside the true when the rate reaches the bar, and always for an ungated group. `Report#passed?` is every gate met, and a report with no gate (a selection that matched nothing, or every scenario dropped as `production_only`) does -not pass. +not pass. A report whose every result sits in an ungated group passes, +since such a group never fails the run, but nothing in it was held to a +bar, and `GateCheck#message` says so rather than "every pass gate met". `Report#failures(group:)` lists the results that did not pass — failed and errored, in run order — and `failures_markdown(group:)` writes them one per line. diff --git a/lib/active_agent/cli/eval_commands.rb b/lib/active_agent/cli/eval_commands.rb index 2cde4d34..e853b53f 100644 --- a/lib/active_agent/cli/eval_commands.rb +++ b/lib/active_agent/cli/eval_commands.rb @@ -247,7 +247,13 @@ def run_gates(run) def print_gates(gates, missed) unmet = gates.reject { |gate| gate["met"] == true } unless missed - @out.puts "Gates: every gate met (#{gates.size})." + # Ungated rows are met without being held to a bar, so a run that + # reached only those says so rather than "every gate met". + if gates.none? { |gate| gate["gated"] != false } + @out.puts "Gates: every group reached is ungated (#{gates.size}); nothing was held to a bar." + else + @out.puts "Gates: every gate met (#{gates.size})." + end return end diff --git a/lib/active_agent/evals/gate_check.rb b/lib/active_agent/evals/gate_check.rb index 720ebc1a..75249668 100644 --- a/lib/active_agent/evals/gate_check.rb +++ b/lib/active_agent/evals/gate_check.rb @@ -45,7 +45,9 @@ def unmet end # The text a failing assertion prints. The first line counts the gates - # not met, or is the one line "every pass gate met" when none is; then + # not met, or is the one line "every pass gate met" when none is (a + # report whose every row is an ungated group's says that instead: its + # rows are met because nothing held them to a bar); then # each unmet gate as Gate#to_s; then, after a blank line, the failures # to read: for each group with an unmet gate, in gates order, " # failures:" over Report#failures_markdown for that group. An unmet All @@ -59,6 +61,7 @@ def message return "no result reached a pass gate; the run evaluated nothing" if all.empty? unmet = all.reject(&:met?) + return "every group the run covered is ungated; no answer was held to a bar" if all.none?(&:gated) return "every pass gate met" if unmet.empty? lines = [ "#{unmet.size} of #{all.size} pass gates not met", *unmet.map { |gate| "- #{gate}" } ] diff --git a/test/cli/cli_test.rb b/test/cli/cli_test.rb index 54440b0c..7f78de9a 100644 --- a/test/cli/cli_test.rb +++ b/test/cli/cli_test.rb @@ -347,6 +347,21 @@ def test_evals_run_trusts_the_dashboards_verdict_on_its_gates assert_includes out, "Gates: no gate was reached." end + # An ungated group never fails the run, so the verdict stands; the line + # under it no longer claims a gate was met when none held anything. + def test_evals_run_says_when_every_group_the_run_reached_is_ungated + stub_tool("evaluations_run", run_payload("pending")) + ungated = [ gate_row("experimental", "Experimental", 0, 2, 0.8, gated: false) ] + stub_tool("evaluation_runs_get", run_payload("complete", passed: 0, evaluated: 2, gates: ungated, gates_met: true)) + + code, out, = cli("evals", "run", "7", "--wait") + + assert_equal CLI::EXIT_SUCCESS, code + assert_includes out, "Gates: every group reached is ungated (1); nothing was held to a bar." + refute_includes out, "every gate met" + assert_match(/PASS$/, out) + end + def test_evals_run_json_adds_the_gates_and_keeps_the_payload stub_tool("evaluations_run", run_payload("pending")) stub_tool("evaluation_runs_get", gated_run) diff --git a/test/evals/gate_check_test.rb b/test/evals/gate_check_test.rb index c0a66a67..68b05a9e 100644 --- a/test/evals/gate_check_test.rb +++ b/test/evals/gate_check_test.rb @@ -38,6 +38,18 @@ def test_a_report_with_no_results_is_not_met_and_says_it_evaluated_nothing assert_equal "no result reached a pass gate; the run evaluated nothing", check.message end + # An ungated group never fails the run, so a report of nothing else is + # met; its message says why instead of "every pass gate met". + def test_a_report_with_only_ungated_groups_is_met_and_says_nothing_was_held_to_a_bar + experiment = grouped("exp_1", "Draft a reply in the customer's tone.", "experimental", "Experimental") + report = Report.new(results: [ result(experiment, gpt, replay(answer: "Dear customer."), score: 0.1) ], models: [ gpt ], pass_thresholds: THRESHOLDS) + check = GateCheck.new(report) + + assert check.met? + assert_empty check.unmet + assert_equal "every group the run covered is ungated; no answer was held to a bar", check.message + end + def test_the_message_counts_the_unmet_gates_then_lists_them_and_each_groups_failures report = gated_report check = GateCheck.new(report)