Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 6 additions & 129 deletions .github/workflows/eval-browser-dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1754,9 +1754,10 @@ jobs:
with:
tokens: github-token

# The fallback leg: the same steps on the central fallback token, after
# the subscription leg handed off or found its token empty, and only when
# the fallback token is set. It is the last leg and never hands off.
# The fallback leg: the key leg's steps, commented there, on a fresh runner,
# on the central fallback token, after the subscription leg handed off or
# found its token empty, and only when the fallback token is set. It is the
# last leg and never hands off.
eval-fallback:
name: Eval Fallback
needs: [eval-key-credit, eval-subscription]
Expand Down Expand Up @@ -1789,8 +1790,6 @@ jobs:
sleep "$((RANDOM % (2 * i + 1)))"
done
echo "sha=$sha" >>"$GITHUB_OUTPUT"
# The default branch tip; on a dispatch, the dispatched commit, which the
# job if: holds to the default branch.
- name: Check out the default branch
if: github.event_name != 'pull_request' || steps.tip.outputs.sha != ''
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand All @@ -1811,8 +1810,6 @@ jobs:
value: ${{ vars.CLAUDE_LANES_DISABLED }}
repo-value: ${{ vars.CLAUDE_LANES_REPO_DISABLED }}

# Skips the run while Actions or npm installs report a degraded component,
# with a logged reason; fails open (.github/actions/check-upstream-status).
- name: Check upstream status
id: upstream
if: steps.kill.outputs.proceed == 'true'
Expand All @@ -1836,13 +1833,6 @@ jobs:
echo "::error::upstream-degraded: ${REASON} on its status page stops this run; dispatch it again once it recovers"
exit 1

# check-trusted-trigger needs a PR, and a dispatch names none, so the
# dispatcher is matched against the same list directly, by numeric id:
# it must be a listed human, and the lanes App bot is denied by id, as
# in pr-run-activity-write.yml. A re-run is refused: its re-runner's id
# is only in the run's record, which this job's token cannot read, and
# a login can pass to another account. Dispatch the workflow again
# instead.
- name: Check the dispatcher is a trusted human
if: github.event_name == 'workflow_dispatch'
env:
Expand Down Expand Up @@ -1878,9 +1868,6 @@ jobs:
trusted-actors-path: .base/.github/standards/trusted-actors/trusted-actors.json
triggering-actor: ${{ github.triggering_actor }}

# check-trusted-trigger accepts any listed actor; the label that spends
# the credential must come from a listed human, so a person opts in to
# each run.
- name: Stop on an untrusted pull request trigger
if: github.event_name == 'pull_request'
env:
Expand All @@ -1898,8 +1885,8 @@ jobs:
exit 1
fi

# Only whether each secret is set reaches the action, never its value.
# `present` is whether this leg runs the eval.
# Only whether the fallback token is set reaches the action, never its
# value. `present` is whether this leg runs the eval.
- name: Check the credential
id: credential
uses: melodic-software/ci-workflows/.github/actions/select-model-credential@5b5110ae015183e900dd098c631d4dcc68904067 # 5b5110a 2026-11-06
Expand All @@ -1909,9 +1896,6 @@ jobs:
credential-set: ${{ secrets.FALLBACK_CLAUDE_CODE_OAUTH_TOKEN != '' }}
reason: ${{ needs.eval-subscription.outputs.next-reason }}

# The plugin under test on a pull request: the label-time head, with full
# history so the next step diffs this same commit against its base. A
# checkout runs no code from it.
- name: Check out the pull request head
if: steps.credential.outputs.present == 'true' && github.event_name == 'pull_request'
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand All @@ -1921,9 +1905,6 @@ jobs:
fetch-depth: 0
persist-credentials: false

# The checked-out head's diff from its merge base with the pull
# request's base chooses the plugins; the target input does on a
# dispatch. Each line of `plugins` is a plugins/<name> path.
- name: Choose the plugins
id: plugins
if: steps.credential.outputs.present == 'true'
Expand Down Expand Up @@ -1961,9 +1942,6 @@ jobs:
echo "EOF"
} >>"$GITHUB_OUTPUT"

# validate-cases.py makes no model call. A FAIL is a case the binary
# rejects at load, so the job stops before any spend. On a deterministic
# run each suite is then copied without its judged cases.
- name: Validate and stage the suites
id: stage
if: steps.plugins.outputs.go == 'true'
Expand Down Expand Up @@ -2008,25 +1986,10 @@ jobs:
echo "EOF"
} >>"$GITHUB_OUTPUT"

# The tools and Chromium go under /opt, outside HOME, which each eval
# run replaces with a temporary one. Only these directories are made
# while sudo works; no third-party code runs before isolation.
- name: Create the tool directories
if: steps.stage.outputs.go == 'true'
run: sudo install -d -o "$(id -u)" -g "$(id -g)" /opt/tools /opt/pw

# A pull request supplies the prompts, and the eval's Read, Glob and Grep
# run without the Bash sandbox, so nothing else keeps them from the
# credential in /proc/<pid>/environ or the runner's own files. A
# root-owned managed settings file, which applies inside every eval run
# and which nothing in the run overrides (code.claude.com/docs/en/
# plugin-evals, "How runs are isolated"; code.claude.com/docs/en/
# settings, "Settings precedence", as of 2026-10-27), denies those
# paths. The runner's install directory is read from the Runner.Worker
# process above this step, not guessed; the job's _temp and _actions
# directories are denied beside it. Written while sudo is still there;
# the job stops if the runner directory is not found or the file cannot
# be written or read back. The probe step below proves the denial.
- name: Deny the eval's reads of process and runner state
id: deny
if: steps.stage.outputs.go == 'true' && github.event_name == 'pull_request'
Expand Down Expand Up @@ -2064,17 +2027,12 @@ jobs:
echo "runner-root=$runner_root" >>"$GITHUB_OUTPUT"
echo "Denied the runner directory $runner_root and $work/_temp, $work/_actions."

# Installs the bubblewrap and socat the Bash sandbox needs, lifts the
# Ubuntu 24.04 AppArmor user-namespace restriction, then removes sudo
# and docker access for the rest of the job.
- name: Isolate the runner
if: steps.stage.outputs.go == 'true'
uses: ./.base/.github/actions/setup-runner-isolation # zizmor: ignore[self-repository]
with:
install-subprocess-isolation: "true"

# Every binary this job runs comes from the locked root toolchain. Its
# install scripts run here, after sudo and docker access are gone.
- name: Install the locked root toolchain
timeout-minutes: 5
if: steps.stage.outputs.go == 'true'
Expand All @@ -2083,11 +2041,6 @@ jobs:
npm ci --prefix /opt/tools
echo "/opt/tools/node_modules/.bin" >> "$GITHUB_PATH"

# Eval cases whose scaffold renders frames (explainer-video, knowledge)
# name ffmpeg as a host tool, and the hosted image carries none. Same
# BtbN static build, tag and SHA-256 as pr-require-checks.yml's demo-video
# leg, into /opt/tools/bin, which every eval run's sandbox can read. After
# isolation, like shfmt below, so the binary never runs with sudo.
- name: Install ffmpeg for eval scaffolds
if: >-
steps.stage.outputs.go == 'true' &&
Expand Down Expand Up @@ -2115,10 +2068,6 @@ jobs:
[[ "$line" == *"$FFMPEG_BUILD"* ]] || { echo "::error::$tool reports '$line', not $FFMPEG_BUILD"; exit 1; }
done

# The guardrails hooks read every Bash command through shfmt and refuse the
# call without it, so a guardrails eval needs it on PATH. Same v3.14.1 pin
# and SHA-256 as pr-require-checks.yml. In /opt/tools, since each eval run
# replaces HOME.
- name: Install pinned shfmt for guardrails
if: steps.stage.outputs.go == 'true' && contains(steps.plugins.outputs.list, 'plugins/guardrails')
env:
Expand All @@ -2133,8 +2082,6 @@ jobs:
echo "/opt/tools/bin" >> "$GITHUB_PATH"
test "$(/opt/tools/bin/shfmt --version)" = "$SHFMT_VERSION"

# run-claude-cli's classifier, at the pin every lane runs it, for
# eval-handoff.mjs: lane.cjs and the three files it loads, nothing run here.
- name: Check out the launcher's classifier
if: steps.stage.outputs.go == 'true'
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand All @@ -2150,26 +2097,6 @@ jobs:
.github/scripts/resolve-npm-tool-version.cjs
sparse-checkout-cone-mode: false

# Proof that the managed policy holds before any pull request case runs,
# for each of the three tools a case can use to read a file: one Claude
# Code run is told to Read /proc/self/environ and the runner's .runner
# file, Grep /proc/self/environ, and Glob for environ under /proc/self. The job stops
# unless the result's permission_denials (code.claude.com/docs/en/
# agent-sdk/typescript, "SDKResultMessage", as of 2026-10-28) records
# each of the four calls as denied, or if the result holds the
# credential anywhere. Claude Code applies Read deny rules to Glob and
# Grep only on a best-effort basis (code.claude.com/docs/en/permissions,
# "Read & Edit"), so a Glob or Grep the policy does not stop fails here
# instead of reaching a case. The prompt names the run a policy self-test:
# asked only to read those paths, the model can decline them as credential
# harvesting and make no call. A session that ends with
# a call unmade proved nothing, so it runs again, up to three times; a call
# made and not denied stops the job at once, and calls still missing after
# three stop it as unproven, never as a policy failure (policy-probe.mjs
# judges the stream). The stream can hold what a
# call returned, so it stays in a file that is never printed and is
# removed after the check. A probe that the credential's own stop ended
# hands off instead (eval-handoff.mjs), so the next leg runs the eval.
- name: Probe that the policy denies those reads
id: probe
if: steps.stage.outputs.go == 'true' && github.event_name == 'pull_request'
Expand Down Expand Up @@ -2216,13 +2143,6 @@ jobs:
*) echo "::error::${reason:-policy-probe.mjs could not judge the probe}, so no pull request case runs"; exit 1 ;;
esac

# Chromium comes from the playwright that the locked playwright-cli
# and Playwright MCP server share. Without sudo there is no --with-deps: the hosted image already
# carries a browser's system libraries. A pull request run grants no
# Bash, so it needs no browser: it passes no --allow-tools, a case
# cannot widen that grant (plugins/evals/skills/plugin-eval/SKILL.md,
# the read-only suites paragraph), and select-plugins.mjs refuses a
# changed case's allowed_tools.
- name: Install Chromium
if: steps.stage.outputs.go == 'true' && github.event_name == 'workflow_dispatch'
env:
Expand All @@ -2231,13 +2151,6 @@ jobs:
node /opt/tools/node_modules/playwright/cli.js install chromium
command -v playwright-cli claude

# Every Bash call in an eval run goes through Claude Code's bubblewrap
# sandbox (code.claude.com/docs/en/sandboxing, "Set up Linux and WSL2",
# as of 2026-10-10). Starting bwrap here as the runner user, with the
# whole filesystem (so /opt/tools and the setup-node toolcache) bound
# read-only, fails the job with bwrap's own error if bwrap cannot start
# a sandbox, before any eval spends tokens. Its flags are not Claude
# Code's own, so a pass does not prove the full sandbox starts.
- name: Check bwrap starts a sandbox
if: steps.stage.outputs.go == 'true' && github.event_name == 'workflow_dispatch'
run: |
Expand Down Expand Up @@ -2266,14 +2179,6 @@ jobs:
DISPATCHER: ${{ github.actor }}
run: echo "::warning::CLAUDE_CODE_SUBPROCESS_ENV_SCRUB is off for this run; Bash subprocesses can see the Claude credentials. Dispatched by ${DISPATCHER}."

# One `claude plugin eval` per staged suite, each under its own
# --max-cost-usd. Its exit code is overloaded, so the summary step reads
# each JSON result instead. --keep-temp keeps each run's trace on the
# runner, outside the uploaded results, for the summary's health lines.
# A pull request run grants no tool, runs no scaffold, keeps env scrub on
# and uses each case's own run count. TMPDIR sits outside /tmp, which the
# run's own sandbox makes read-only to Bash, and within the short length
# the sandbox's sockets need (plugins/evals/skills/plugin-eval/reference/sandboxes.md).
- name: Run the plugin eval
id: eval
if: steps.stage.outputs.go == 'true' && steps.probe.outputs.handoff != 'true'
Expand Down Expand Up @@ -2354,12 +2259,6 @@ jobs:
echo "exit $status" >"$out/exit-code"
done <<<"$SUITES"

# Whether the credential's own stop ended any run, read from each errored
# run's kept trace by run-claude-cli's classifier; nothing here prints a
# trace. A probe's handoff stands. The leg's execution file carries only
# the suites' durationSeconds and costUsd, for the lane record. A leg
# that hands off summarizes and uploads nothing: the next leg reruns the
# eval.
- name: Judge the leg
id: judge
if: always() && steps.stage.outputs.go == 'true' && (steps.probe.outcome == 'success' || steps.probe.outcome == 'skipped')
Expand Down Expand Up @@ -2387,13 +2286,6 @@ jobs:
printf '%s\n' "$verdict" | tee -a "$GITHUB_OUTPUT"
echo "leg-result=$LEG_RESULT" >>"$GITHUB_OUTPUT"

# The verdict of record: summarize.mjs per result, PASS, FAIL or NOT
# COMPARABLE per case. A suite with no result fails the job too.
# A pull request run prints no case name, error or partial reason: the
# model output those can carry would land in the public job summary.
# The REST API returns no job summary, so each suite's summary is also
# printed to the job log, with workflow commands off, and kept as
# summary.md beside its results.json, which a dispatched run uploads.
- name: Summarize the results
if: always() && steps.stage.outputs.go == 'true' && steps.judge.outputs.handoff != 'true'
env:
Expand Down Expand Up @@ -2453,16 +2345,6 @@ jobs:
done <<<"$SUITES"
exit "$failed"

# Opt-in because the job log of this public repository is public. Prints,
# per run, at most 20 Bash calls whose tool_result has is_error true: the
# command cut to 300 characters, and the result text cut to its first 120
# and last 2500 characters when longer than 2620 (the end holds the daemon
# log), each JSON-quoted onto one line. A second line, `key:`, holds the lines of the
# full result that match FATAL, Check failed, ERROR:, sandbox, permission or errno
# patterns (the cause line that a long crash stack pushes out of the tail), minus the
# known .bashrc noise, de-duplicated, at most 15, each cut to 300 characters; it is
# omitted when nothing matches. Nothing else from the trace is printed. Trace text is
# tool output, so workflow commands are off while it prints.
- name: Print Bash error excerpts
if: always() && github.event_name == 'workflow_dispatch' && inputs.debug-errors && steps.stage.outputs.go == 'true' && steps.judge.outputs.handoff != 'true'
env:
Expand Down Expand Up @@ -2511,9 +2393,6 @@ jobs:
done
echo "::$token::"

# Only a dispatched run, whose cases merged through review, uploads its
# results: a pull request's prompts could steer model output into a
# public artifact.
- name: Scan the upload for credentials
id: scan-upload
if: >-
Expand All @@ -2531,8 +2410,6 @@ jobs:
path: ${{ runner.temp }}/eval-results/
if-no-files-found: warn
retention-days: 3
# The leg's lane-outcome record: its credential, outcome, handoff,
# fallback reason and durationMs, one record per leg.
- name: Record the leg
if: always() && steps.judge.outcome == 'success'
continue-on-error: true
Expand Down
Loading