From 2ddd676a4d2ea85b7110d1bf19030e80eeaa2127 Mon Sep 17 00:00:00 2001 From: Phil Leggetter Date: Thu, 5 Nov 2026 17:18:02 +0000 Subject: [PATCH 1/3] Open one regression alert per failing scenario The alert commented on whichever regression-alert issue was open, so every failure landed on one thread whatever caused it. On 26 October a harness `fetch failed` in regression-verification-001-generic-hmac was appended to an issue about a rubric in regression-filtering-001-regex-capability, and read as more of the same. Open or update one issue per failing scenario, titled `Regression failing: `. Label each failing cell by the step that failed: a red check is the agent or the scorer, and an errored eval step means the cell has no verdict, usually the harness, a provider or the agent CLI rather than the agent's answer. A provider refusal (#103's provider-refused-* artifact), a cancelled cell, a job outside the matrix, or a cell whose job name GitHub cut short goes to one run-level issue, because none of them is a verdict on a scenario. The logic moves to .github/scripts/regression-alert.sh behind a sparse checkout, so it can be dry-run against a past run. Dry-runs against 40277941276, 41397695283, 32696494086 (cancelled by hand), and a simulated refusal give the expected issues. shellcheck and actionlint pass. Co-Authored-By: Claude Opus 5.5 --- .github/scripts/regression-alert.sh | 140 ++++++++++++++++++++++++++++ .github/workflows/eval-refresh.yml | 60 +++--------- AGENTS.md | 10 ++ 3 files changed, 165 insertions(+), 45 deletions(-) create mode 100755 .github/scripts/regression-alert.sh diff --git a/.github/scripts/regression-alert.sh b/.github/scripts/regression-alert.sh new file mode 100755 index 0000000..7201757 --- /dev/null +++ b/.github/scripts/regression-alert.sh @@ -0,0 +1,140 @@ +#!/usr/bin/env bash +# Open or update one `regression-alert` issue per failing scenario. +# +# The first version kept a single issue and commented on whichever +# `regression-alert` issue was open. So every failure landed on the same +# thread whatever caused it: a harness `fetch failed` in +# `regression-verification-001-generic-hmac` on 26 October was appended to an +# issue about a rubric in `regression-filtering-001-regex-capability`, and read +# as more of the same. One issue per scenario keeps "this guard keeps failing" +# readable as one problem, and keeps unrelated failures off it. +# +# Each failing cell is classified by the step that failed, because the +# difference is the first thing a reader needs: a red check is either a +# guarded mistake returning or a scorer being wrong, and an errored eval step +# means the cell has no verdict — usually the harness, a provider or the agent +# CLI, not the agent's answer. +# +# Everything that is not a verdict on a scenario goes to one run-level issue: +# a job outside the matrix (`prepare`, `publish-results`), a cancelled cell, +# and above all a provider refusal. A refusal uploads a `provider-refused-*` +# artifact and cancels the run (#103), so every remaining cell arrives +# cancelled; filing those per scenario would open an issue for each guard +# over one empty credit balance. +# +# Env: GH_REPO, RUN_ID, RUN_URL. DRY_RUN=1 prints instead of writing. +set -euo pipefail + +: "${GH_REPO:?}" "${RUN_ID:?}" "${RUN_URL:?}" +dry_run="${DRY_RUN:-0}" + +RUN_LEVEL_TITLE="Weekly regression run is failing" + +jobs="$(gh api --paginate "repos/${GH_REPO}/actions/runs/${RUN_ID}/jobs?per_page=100" \ + --jq '.jobs[]' | jq -s '.')" + +refused="$(gh api --paginate "repos/${GH_REPO}/actions/runs/${RUN_ID}/artifacts?per_page=100" \ + --jq '.artifacts[].name | select(startswith("provider-refused-")) | ltrimstr("provider-refused-")')" + +# One line per failed cell: eval_id experiment what failed. +# Matrix job names are `run-evals (, , , )`, +# and GitHub cuts them at 100 characters with "...". The current ids leave the +# first two fields intact with room to spare; a cell whose id or experiment +# was cut is not filed under a guessed scenario, but goes to the run-level +# issue under its full job name. +# Failed only: a cancelled cell is not a verdict on its scenario. +# shellcheck disable=SC2016 # $q is a jq variable, not a shell one +truncated='(.name | ltrimstr("run-evals (") | split(", ")) as $q + | ($q | length) < 3 or ($q[0] | endswith("...")) or ($q[1] | endswith("..."))' +cells="" +if [ -z "$refused" ]; then + cells="$(jq -r " + .[] + | select(.name | startswith(\"run-evals (\")) + | select(.conclusion == \"failure\") + | select(${truncated} | not)"' + | (.name | ltrimstr("run-evals (") | rtrimstr(")") | split(", ")) as $p + | ([.steps[]? | select(.conclusion == "failure")][0].name // "") as $step + | [ + $p[0], $p[1], + (if $step == "Check the regression suite passed" then "checks failed: the scorer recorded a red check" + elif $step == "Run evals" then "errored: no verdict; usually the harness, a provider or the agent CLI, not the agent'"'"'s answer" + elif $step == "" then "failed, with no failed step recorded" + else "failed at step \"" + $step + "\"" end) + ] + | @tsv' <<<"$jobs")" +fi + +other_failures="$(jq -r --arg refused "$refused" " + .[] + | select(.name != \"regression-alert\") + | select(.conclusion == \"failure\" or .conclusion == \"cancelled\") + | select((\$refused != \"\") + or (.name | startswith(\"run-evals (\") | not) + or .conclusion == \"cancelled\" + or (${truncated}))"' + | "- `\(.name)`: \(.conclusion)"' <<<"$jobs")" + +open_issues="$(gh issue list --label regression-alert --state open --limit 100 \ + --json number,title)" + +guidance="Regression scenarios guard mistakes we have already seen and fixed, so +every agent passing is the expected state. A cell whose **checks failed** is one +of two things: the guarded mistake came back, or the scorer is wrong about a +correct answer. Read the transcript in the cell's \`raw-results-*\` artifact +before deciding which; the agent's own report is usually the fastest answer. +A cell that **errored** has no verdict: usually the harness, a provider or the +agent CLI, not the agent's answer." + +# Comment on the open issue whose title matches exactly, or open one. +post() { + local title="$1" body="$2"; shift 2 + local number + number="$(jq -r --arg t "$title" '[.[] | select(.title == $t)][0].number // empty' <<<"$open_issues")" + if [ "$dry_run" = "1" ]; then + echo "=== ${number:+comment on #$number}${number:-create}: $title" + echo "$body" + return + fi + if [ -n "$number" ]; then + gh issue comment "$number" --body "$body" + else + gh issue create --title "$title" --label regression-alert "$@" --body "$body" + fi +} + +if [ -n "$cells" ]; then + while IFS= read -r eval_id; do + lines="$(awk -F'\t' -v id="$eval_id" '$1 == id { printf "- `%s`: %s\n", $2, $3 }' <<<"$cells")" + body="The weekly regression run failed \`${eval_id}\`: ${RUN_URL} + +${lines} + +${guidance}" + post "Regression failing: ${eval_id}" "$body" --label scenario + done < <(cut -f1 <<<"$cells" | sort -u) +fi + +if [ -n "$refused" ]; then + refusing="$(awk '{ printf "- `%s`\n", $0 }' <<<"$refused")" + body="The weekly regression run was cancelled because a provider refused: ${RUN_URL} + +Refused in: +${refusing} + +A refusal is a credit, quota or auth failure, and the run cancels itself so +the remaining cells do not run and bill. No scenario has a verdict from this +run. Fix the provider account, then dispatch the regression suite. + +Jobs that failed or were cancelled: +${other_failures:-- none recorded}" + post "$RUN_LEVEL_TITLE" "$body" --label harness +elif [ -n "$other_failures" ] || [ -z "$cells" ]; then + body="The weekly regression run failed outside any single scenario verdict: ${RUN_URL} + +${other_failures:-- no failed job recorded; the run was failed or cancelled before any cell finished} + +This is the pipeline rather than an agent's answer: discovery, a provider +preflight, publishing, or a cancelled cell. Read the failed job's log first." + post "$RUN_LEVEL_TITLE" "$body" --label harness +fi diff --git a/.github/workflows/eval-refresh.yml b/.github/workflows/eval-refresh.yml index f692063..b16c4ab 100644 --- a/.github/workflows/eval-refresh.yml +++ b/.github/workflows/eval-refresh.yml @@ -899,53 +899,23 @@ jobs: if: ${{ (failure() || cancelled()) && github.event_name == 'schedule' }} runs-on: ubuntu-latest steps: - - name: Open or update the alert issue + # A sparse checkout of the alert script alone: the logic lives in a file + # so it can be run against a past run with DRY_RUN=1 before it is + # trusted, which an inline block cannot. + - name: Checkout + uses: actions/checkout@9f698171ed81b15d1823a05fc7211befd50c8ae0 # v6.0.3 + with: + sparse-checkout: .github/scripts + sparse-checkout-cone-mode: false + + - name: Open or update the alert issues env: GH_TOKEN: ${{ github.token }} - # This job has no checkout, so `gh` has no git remote to infer the - # repository from — and it does not fall back to `GITHUB_REPOSITORY`. - # Without this the alert step fails and notifies nobody, which is the - # failure it exists to prevent. + # Explicit even with a checkout: the first version of this job had + # none, `gh` could not infer the repository, and the alert step + # failed and notified nobody. GH_REPO: ${{ github.repository }} + RUN_ID: ${{ github.run_id }} RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} shell: bash - run: | - set -euo pipefail - - # One issue, reopened and commented rather than a new one each week. - # A suite that breaks and stays broken should read as one problem - # getting worse, not as four identical issues nobody closes. - existing="$(gh issue list --label regression-alert --state open \ - --json number --jq '.[0].number // empty')" - - # Indented for the YAML block scalar, then de-indented for GitHub: - # four or more leading spaces after a blank line is a markdown code - # block, so the first version of this rendered the whole alert as - # monospace with literal `**` and `1.` in it. - body="$(sed 's/^ //' <`, and each +failing cell is labelled by the step that failed: a red check is the agent or the +scorer, and an errored eval step means the cell has no verdict, usually the harness, a +provider or the agent CLI rather than the agent's answer. A provider refusal, a +cancelled cell, or a failure outside the matrix goes to one run-level issue instead, +because none of them is a verdict on a scenario. Until November there was one issue for +everything, and a harness `fetch failed` landed on a rubric thread and read as more of +the same. The logic is `.github/scripts/regression-alert.sh`; run it +with `DRY_RUN=1 GH_REPO=hookdeck/evals RUN_ID= RUN_URL=` against a past run +before changing it. **Measured on the first run**, 1 October 2026 ([run 36869979661](https://github.com/hookdeck/evals/actions/runs/36869979661)): eighteen cells, **seventeen passed**, fifty minutes of wall clock. The cells run one at a time From 73524448cc5408cd00277f5af1a4c1444c979a21 Mon Sep 17 00:00:00 2001 From: Phil Leggetter Date: Thu, 5 Nov 2026 17:38:02 +0000 Subject: [PATCH 2/3] File only verdicts per scenario, and alert even when the run can't be read Review of the first version found ways it would mis-file or stay silent: - A cell failing at setup (a missing secret, a registry outage) was filed per scenario, so one outage would open an issue for every guard. Only a red check or an errored eval step is now filed per scenario; everything else, timed-out cells included, goes to the run-level issue. - Under `set -e` one failed read killed the script before it posted, which is the silence it exists to prevent. Reads are retried. If the jobs can't be read, a run-level issue still opens. If the artifacts can't be read, no scenario issue opens, because a refusal can't be ruled out. If the issue list can't be read, the script creates rather than skips. - On a re-run, artifacts from the earlier attempt are ignored, so an old refusal can't suppress the new attempt's scenario issues. - A closed issue with the same title is reopened, not duplicated. - A scenario whose cells all errored is labelled `harness`, not `scenario`. - Any DRY_RUN value other than 0 or empty is a dry run; the dry-run header now names the action correctly. - The job's permissions narrow to contents and actions read, issues write. Tested through a fake gh on thirteen fixture cases, and dry-run against 40277941276, 41397695283 and 32696494086. shellcheck and actionlint pass. Co-Authored-By: Claude Opus 5.5 --- .github/scripts/regression-alert.sh | 255 +++++++++++++++++++--------- .github/workflows/eval-refresh.yml | 7 + AGENTS.md | 16 +- 3 files changed, 192 insertions(+), 86 deletions(-) diff --git a/.github/scripts/regression-alert.sh b/.github/scripts/regression-alert.sh index 7201757..e5fce1c 100755 --- a/.github/scripts/regression-alert.sh +++ b/.github/scripts/regression-alert.sh @@ -9,74 +9,173 @@ # as more of the same. One issue per scenario keeps "this guard keeps failing" # readable as one problem, and keeps unrelated failures off it. # -# Each failing cell is classified by the step that failed, because the -# difference is the first thing a reader needs: a red check is either a -# guarded mistake returning or a scorer being wrong, and an errored eval step -# means the cell has no verdict — usually the harness, a provider or the agent -# CLI, not the agent's answer. +# Only two failures are a verdict on a scenario, and only they are filed per +# scenario: # -# Everything that is not a verdict on a scenario goes to one run-level issue: -# a job outside the matrix (`prepare`, `publish-results`), a cancelled cell, -# and above all a provider refusal. A refusal uploads a `provider-refused-*` -# artifact and cancels the run (#103), so every remaining cell arrives -# cancelled; filing those per scenario would open an issue for each guard -# over one empty credit balance. +# - the regression check failed: a red check, so the guarded mistake came back +# or the scorer is wrong about a correct answer; +# - the eval step errored: the cell has no verdict, usually the harness, a +# provider or the agent CLI rather than the agent's answer. Filed per +# scenario because it is about that cell, labelled `harness` when no cell of +# the scenario has a red check. # -# Env: GH_REPO, RUN_ID, RUN_URL. DRY_RUN=1 prints instead of writing. +# Everything else goes to one run-level issue: a job outside the matrix +# (`prepare`, `publish-results`), a cell that failed at setup (a missing +# secret, a registry outage, which would otherwise open an issue for every +# scenario), a cancelled or timed-out cell, a cell whose job name GitHub cut +# short, and above all a provider refusal. A refusal uploads a +# `provider-refused-*` artifact and cancels the run (#103), so every remaining +# cell arrives cancelled and none has a verdict. +# +# A same-title issue that was closed is reopened rather than duplicated, so a +# guard that regresses again keeps its history in one thread. +# +# If the run cannot be read, the script still alerts: a red job that tells +# nobody is the failure this exists to prevent. +# +# Env: GH_REPO, RUN_ID, RUN_URL; RUN_ATTEMPT (default 1). +# DRY_RUN set to anything but 0 or empty prints instead of writing. set -euo pipefail : "${GH_REPO:?}" "${RUN_ID:?}" "${RUN_URL:?}" -dry_run="${DRY_RUN:-0}" +attempt="${RUN_ATTEMPT:-1}" +case "${DRY_RUN:-0}" in + 0 | "") dry_run=0 ;; + *) dry_run=1 ;; +esac RUN_LEVEL_TITLE="Weekly regression run is failing" +CHECK_STEP="Check the regression suite passed" +EVAL_STEP="Run evals" + +# GitHub's API answers the odd 502: three turned up in a 40-run sweep of the +# jobs endpoint. Retry each read before deciding the run is unreadable. Each +# attempt's output is captured whole, so a paginated read that fails partway +# does not leave its first pages behind to be repeated by the next attempt. +retry() { + local n out + for n in 1 2 3; do + if out="$("$@")"; then + printf '%s\n' "$out" + return 0 + fi + if [ "$n" -lt 3 ]; then sleep $((n * ${RETRY_DELAY:-5})); fi + done + return 1 +} + +issues="" +issues_read=0 +if issues="$(retry gh issue list --label regression-alert --state all --limit 200 \ + --json number,title,state)"; then + issues_read=1 +fi + +# Comment on the open issue with this exact title; reopen and comment on a +# closed one; otherwise open one. Without the issue list it opens one: a +# duplicate can be closed, a silent failure cannot be noticed. +post() { + local title="$1" body="$2" label="$3" + local match="" number="" state="" + if [ "$issues_read" = 1 ]; then + match="$(jq -r --arg t "$title" ' + [.[] | select(.title == $t)] + | (map(select(.state == "OPEN")) + map(select(.state != "OPEN")))[0] + | if . == null then "" else "\(.number) \(.state)" end' <<<"$issues")" + fi + if [ -n "$match" ]; then + number="${match%% *}" + state="${match#* }" + fi + + if [ "$dry_run" = 1 ]; then + local action="create" + if [ "$state" = "OPEN" ]; then + action="comment on #${number}" + elif [ -n "$number" ]; then + action="reopen #${number} and comment" + fi + echo "=== ${action}: ${title} [${label}]" + echo "$body" + return + fi + + if [ -z "$number" ]; then + gh issue create --title "$title" --label regression-alert --label "$label" \ + --body "$body" + return + fi + if [ "$state" != "OPEN" ]; then + gh issue reopen "$number" + fi + gh issue comment "$number" --body "$body" +} -jobs="$(gh api --paginate "repos/${GH_REPO}/actions/runs/${RUN_ID}/jobs?per_page=100" \ - --jq '.jobs[]' | jq -s '.')" +if ! jobs="$(retry gh api --paginate \ + "repos/${GH_REPO}/actions/runs/${RUN_ID}/attempts/${attempt}/jobs?per_page=100" \ + --jq '.jobs[]')"; then + post "$RUN_LEVEL_TITLE" "The weekly regression run failed, and its jobs could not be read to say which scenarios: ${RUN_URL} -refused="$(gh api --paginate "repos/${GH_REPO}/actions/runs/${RUN_ID}/artifacts?per_page=100" \ - --jq '.artifacts[].name | select(startswith("provider-refused-")) | ltrimstr("provider-refused-")')" +GitHub's API did not answer after three attempts. Open the run and read the failed jobs directly." harness + exit 0 +fi +jobs="$(jq -s '.' <<<"$jobs")" + +# Artifacts are listed for the whole run, every attempt included, so on a +# re-run keep only those made since this attempt started: a refusal before a +# credit top-up must not suppress the scenario issues of the re-run after it. +started="1970-01-01T00:00:00Z" +if [ "$attempt" -gt 1 ]; then + started="$(retry gh api "repos/${GH_REPO}/actions/runs/${RUN_ID}/attempts/${attempt}" \ + --jq '.run_started_at')" || started="" +fi +refused="" +refusal_unknown=0 +if [ -z "$started" ] || ! refused="$(retry gh api --paginate \ + "repos/${GH_REPO}/actions/runs/${RUN_ID}/artifacts?per_page=100" \ + --jq ".artifacts[] + | select(.created_at >= \"${started}\") + | .name | select(startswith(\"provider-refused-\")) + | ltrimstr(\"provider-refused-\")")"; then + refusal_unknown=1 + refused="" +fi -# One line per failed cell: eval_id experiment what failed. # Matrix job names are `run-evals (, , , )`, # and GitHub cuts them at 100 characters with "...". The current ids leave the -# first two fields intact with room to spare; a cell whose id or experiment -# was cut is not filed under a guessed scenario, but goes to the run-level -# issue under its full job name. -# Failed only: a cancelled cell is not a verdict on its scenario. -# shellcheck disable=SC2016 # $q is a jq variable, not a shell one -truncated='(.name | ltrimstr("run-evals (") | split(", ")) as $q - | ($q | length) < 3 or ($q[0] | endswith("...")) or ($q[1] | endswith("..."))' +# first two fields intact with room to spare; a cell whose id or experiment was +# cut is not filed under a guessed scenario. +# shellcheck disable=SC2016 # jq variables, not shell ones +defs=' + def is_cell: .name | startswith("run-evals ("); + def fields: .name | ltrimstr("run-evals (") | rtrimstr(")") | split(", "); + def cut_short: (.name | ltrimstr("run-evals (") | split(", ")) as $q + | ($q | length) < 3 or ($q[0] | endswith("...")) or ($q[1] | endswith("...")); + def failed_step: [.steps[]? | select(.conclusion == "failure")][0].name // ""; + def per_scenario($check; $eval): + is_cell and .conclusion == "failure" and (cut_short | not) + and (failed_step as $s | $s == $check or $s == $eval); +' + +# One line per scenario cell: eval_id experiment kind. cells="" -if [ -z "$refused" ]; then - cells="$(jq -r " +if [ -z "$refused" ] && [ "$refusal_unknown" = 0 ]; then + cells="$(jq -r --arg check "$CHECK_STEP" --arg eval "$EVAL_STEP" "${defs}"' .[] - | select(.name | startswith(\"run-evals (\")) - | select(.conclusion == \"failure\") - | select(${truncated} | not)"' - | (.name | ltrimstr("run-evals (") | rtrimstr(")") | split(", ")) as $p - | ([.steps[]? | select(.conclusion == "failure")][0].name // "") as $step - | [ - $p[0], $p[1], - (if $step == "Check the regression suite passed" then "checks failed: the scorer recorded a red check" - elif $step == "Run evals" then "errored: no verdict; usually the harness, a provider or the agent CLI, not the agent'"'"'s answer" - elif $step == "" then "failed, with no failed step recorded" - else "failed at step \"" + $step + "\"" end) - ] + | select(per_scenario($check; $eval)) + | fields as $p + | [$p[0], $p[1], (if failed_step == $check then "check" else "error" end)] | @tsv' <<<"$jobs")" fi -other_failures="$(jq -r --arg refused "$refused" " +other_failures="$(jq -r --arg check "$CHECK_STEP" --arg eval "$EVAL_STEP" \ + --arg filed "$([ -n "$cells" ] && echo 1 || echo 0)" "${defs}"' .[] - | select(.name != \"regression-alert\") - | select(.conclusion == \"failure\" or .conclusion == \"cancelled\") - | select((\$refused != \"\") - or (.name | startswith(\"run-evals (\") | not) - or .conclusion == \"cancelled\" - or (${truncated}))"' - | "- `\(.name)`: \(.conclusion)"' <<<"$jobs")" - -open_issues="$(gh issue list --label regression-alert --state open --limit 100 \ - --json number,title)" + | select(.name != "regression-alert") + | select(.conclusion == "failure" or .conclusion == "cancelled" or .conclusion == "timed_out") + | select($filed == "0" or (per_scenario($check; $eval) | not)) + | "- `\(.name)`: \(.conclusion)" + + (failed_step as $s | if $s == "" then "" else " at \"\($s)\"" end)' <<<"$jobs")" guidance="Regression scenarios guard mistakes we have already seen and fixed, so every agent passing is the expected state. A cell whose **checks failed** is one @@ -86,38 +185,28 @@ before deciding which; the agent's own report is usually the fastest answer. A cell that **errored** has no verdict: usually the harness, a provider or the agent CLI, not the agent's answer." -# Comment on the open issue whose title matches exactly, or open one. -post() { - local title="$1" body="$2"; shift 2 - local number - number="$(jq -r --arg t "$title" '[.[] | select(.title == $t)][0].number // empty' <<<"$open_issues")" - if [ "$dry_run" = "1" ]; then - echo "=== ${number:+comment on #$number}${number:-create}: $title" - echo "$body" - return - fi - if [ -n "$number" ]; then - gh issue comment "$number" --body "$body" - else - gh issue create --title "$title" --label regression-alert "$@" --body "$body" - fi -} - if [ -n "$cells" ]; then while IFS= read -r eval_id; do - lines="$(awk -F'\t' -v id="$eval_id" '$1 == id { printf "- `%s`: %s\n", $2, $3 }' <<<"$cells")" - body="The weekly regression run failed \`${eval_id}\`: ${RUN_URL} + lines="$(awk -F'\t' -v id="$eval_id" '$1 == id { + if ($3 == "check") what = "checks failed: the scorer recorded a red check" + else what = "errored: no verdict; usually the harness, a provider or the agent CLI, not the agent'"'"'s answer" + printf "- `%s`: %s\n", $2, what + }' <<<"$cells")" + label="harness" + if awk -F'\t' -v id="$eval_id" '$1 == id && $3 == "check" { found = 1 } END { exit !found }' <<<"$cells"; then + label="scenario" + fi + post "Regression failing: ${eval_id}" "The weekly regression run failed \`${eval_id}\`: ${RUN_URL} ${lines} -${guidance}" - post "Regression failing: ${eval_id}" "$body" --label scenario +${guidance}" "$label" done < <(cut -f1 <<<"$cells" | sort -u) fi if [ -n "$refused" ]; then refusing="$(awk '{ printf "- `%s`\n", $0 }' <<<"$refused")" - body="The weekly regression run was cancelled because a provider refused: ${RUN_URL} + post "$RUN_LEVEL_TITLE" "The weekly regression run was cancelled because a provider refused: ${RUN_URL} Refused in: ${refusing} @@ -126,15 +215,23 @@ A refusal is a credit, quota or auth failure, and the run cancels itself so the remaining cells do not run and bill. No scenario has a verdict from this run. Fix the provider account, then dispatch the regression suite. -Jobs that failed or were cancelled: -${other_failures:-- none recorded}" - post "$RUN_LEVEL_TITLE" "$body" --label harness +Jobs that failed, were cancelled or timed out: +${other_failures:-- none recorded}" harness +elif [ "$refusal_unknown" = 1 ]; then + post "$RUN_LEVEL_TITLE" "The weekly regression run failed, and its artifacts could not be read, so a provider refusal cannot be ruled out: ${RUN_URL} + +No scenario issue was opened, because filing a refused run per scenario would +blame every guard for one credit balance. Check the run's artifacts for +\`provider-refused-*\` before reading the cells below as agent results. + +Jobs that failed, were cancelled or timed out: +${other_failures:-- none recorded}" harness elif [ -n "$other_failures" ] || [ -z "$cells" ]; then - body="The weekly regression run failed outside any single scenario verdict: ${RUN_URL} + post "$RUN_LEVEL_TITLE" "The weekly regression run failed outside any single scenario verdict: ${RUN_URL} ${other_failures:-- no failed job recorded; the run was failed or cancelled before any cell finished} -This is the pipeline rather than an agent's answer: discovery, a provider -preflight, publishing, or a cancelled cell. Read the failed job's log first." - post "$RUN_LEVEL_TITLE" "$body" --label harness +This is the pipeline rather than an agent's answer: discovery, setup, a +provider preflight, publishing, or a cancelled cell. Read the failed job's log +first." harness fi diff --git a/.github/workflows/eval-refresh.yml b/.github/workflows/eval-refresh.yml index b16c4ab..41fabf8 100644 --- a/.github/workflows/eval-refresh.yml +++ b/.github/workflows/eval-refresh.yml @@ -898,6 +898,12 @@ jobs: # clone that could not rebase, and a re-run against a moved branch (#74). if: ${{ (failure() || cancelled()) && github.event_name == 'schedule' }} runs-on: ubuntu-latest + # Narrower than the workflow's: this job reads the run and writes issues, + # and nothing else. + permissions: + contents: read + actions: read + issues: write steps: # A sparse checkout of the alert script alone: the logic lives in a file # so it can be run against a past run with DRY_RUN=1 before it is @@ -916,6 +922,7 @@ jobs: # failed and notified nobody. GH_REPO: ${{ github.repository }} RUN_ID: ${{ github.run_id }} + RUN_ATTEMPT: ${{ github.run_attempt }} RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} shell: bash run: bash .github/scripts/regression-alert.sh diff --git a/AGENTS.md b/AGENTS.md index 08eff90..1e27bef 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -215,13 +215,15 @@ where a failure is a score — and the run opens or updates an issue labelled It is one issue per failing scenario, titled `Regression failing: `, and each failing cell is labelled by the step that failed: a red check is the agent or the scorer, and an errored eval step means the cell has no verdict, usually the harness, a -provider or the agent CLI rather than the agent's answer. A provider refusal, a -cancelled cell, or a failure outside the matrix goes to one run-level issue instead, -because none of them is a verdict on a scenario. Until November there was one issue for -everything, and a harness `fetch failed` landed on a rubric thread and read as more of -the same. The logic is `.github/scripts/regression-alert.sh`; run it -with `DRY_RUN=1 GH_REPO=hookdeck/evals RUN_ID= RUN_URL=` against a past run -before changing it. +provider or the agent CLI rather than the agent's answer. A provider refusal, a cell +that failed at setup, a cancelled or timed-out cell, or a failure outside the matrix +goes to one run-level issue instead, because none of them is a verdict on a scenario. A +closed issue with the same title is reopened, so a guard that regresses again keeps its +history. Until November there was one issue for everything, and a harness `fetch +failed` landed on a rubric thread and read as more of the same. The logic is +`.github/scripts/regression-alert.sh`; run it with +`DRY_RUN=1 GH_REPO=hookdeck/evals RUN_ID= RUN_URL=` against a past run before +changing it. **Measured on the first run**, 1 October 2026 ([run 36869979661](https://github.com/hookdeck/evals/actions/runs/36869979661)): eighteen cells, **seventeen passed**, fifty minutes of wall clock. The cells run one at a time From 32dae9ed636169f35d7aedf026ed4a6897b7261c Mon Sep 17 00:00:00 2001 From: Phil Leggetter Date: Thu, 5 Nov 2026 17:45:30 +0000 Subject: [PATCH 3/3] Treat a null attempt start time as unreadable On a re-run the script keeps only artifacts created since the attempt started. When that start time read as null, the string "null" sorted above every real timestamp, so a current provider refusal was filtered out and the run was filed per scenario. A reviewer reproduced it with a fixture. A start time that is not a timestamp now counts as unreadable: no scenario issues, and a run-level issue saying a refusal can't be ruled out. Co-Authored-By: Claude Opus 5.5 --- .github/scripts/regression-alert.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/scripts/regression-alert.sh b/.github/scripts/regression-alert.sh index e5fce1c..1a34048 100755 --- a/.github/scripts/regression-alert.sh +++ b/.github/scripts/regression-alert.sh @@ -127,7 +127,10 @@ jobs="$(jq -s '.' <<<"$jobs")" started="1970-01-01T00:00:00Z" if [ "$attempt" -gt 1 ]; then started="$(retry gh api "repos/${GH_REPO}/actions/runs/${RUN_ID}/attempts/${attempt}" \ - --jq '.run_started_at')" || started="" + --jq '.run_started_at // empty')" || started="" + # A null or missing start time is unreadable, not a timestamp: the string + # "null" sorts above every real one, so it would filter out a current refusal. + case "$started" in 20[0-9][0-9]-*) ;; *) started="" ;; esac fi refused="" refusal_unknown=0