Score approvals against the pilots' approval rules, and each case once

Stacked on !102 (merged). Fixes what a review of bin/eval from !97 (merged) found in how it scores a run.

What does this MR do and why?

  • Approval rules. approval_rules keeps gitlab-bot from approving some low bumps on the pilot projects, so a flow with that step was scored as missing approvals it was right to withhold. 4 of the 14 low-labelled deps-pilots cases are stopped by one: bench-167 (goreleaser), bench-107 (a minor bump on a patch-only project), es-indexer-859 and es-indexer-865 (gitaly).
    • Each deps case names the rule that stops it as approval_rule, in the words approval_rules uses.
    • Like upstream, it binds only a variant whose flow has the step, which meta.json now records. There, approving such a case is a wrong approval, and "Approvable cases approved" leaves it out.
    • spec/eval/suites_spec.rb runs ApprovalRules.reason_for on every saved deps case, so a change to the rules fails the spec until the suite follows it.
  • By case. A new section counts each case once, however many of its passes went wrong, says how many of the wrong ones hang on a provisional label, and gives the exact binomial upper bound, at 95% confidence, on the rate of wrong cases. A suite of a couple of dozen cases with none wrong still leaves a rate in the teens possible, and the report now says so.
  • Upstream stage. "As expected" is split into "Judge as expected" (keep, raise) and "Fetch as expected" (check, incomplete). A run replays the fetch from saved output, so the second shows only that the flow reads that output as the fetch wrote it.
  • Summary. "Unlabelled approved" counts approvals of cases with no labels, whose tier nothing checks. "Unstable cases" is n/a after a single pass.
  • The README's deps-upstream example runs the default three passes, since the judge's answer varies.

Effect on an earlier run

Rescoring a three-pass deps-pilots run of the working tree's flow, with approval_rules recorded for its variant, "Approvable cases approved" goes from 27/39 to 27/27: the 12 misses were the four stopped cases' three passes. By case shows 0/23 cases approved wrongly, up to 12%. A results directory written before this MR has no approval_rules in meta.json, so it scores as it did.

Not in this MR

  • Confirming the provisional labels, which needs the rubric's owner.
  • More borderline cases that must not be rated low, such as runtime dependencies below 1.0 and minor bumps of auth or crypto libraries. Each needs a label and bin/eval snapshot.
  • Labels from outcomes, such as reviewer overrides and reverts, which gitlab-org/gitlab#637889's sample is for.

How to set up and validate locally

  1. make check
  2. ruby bin/eval score .scratch/evals/<run> rewrites an existing run's report.md with the new sections. It reads each session's recorded model, and makes no model call.

🤖 Generated with Claude Code

Merge request reports

Loading
Loading