Skip to content

refactor(ci): add scripts for the eval-dispatch leg steps and pinned ffmpeg - #16025

Merged
kyle-sexton merged 1 commit into
mainfrom
refactor/r2-7-eval-leg-scripts
Nov 13, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
refactor/r2-7-eval-leg-scripts

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Closes #16021

session: Simplify E2 A

Summary

Adds five scripts under .github/scripts/ for the eval-dispatch leg steps and the pinned ffmpeg install (R2-7, part of #15695). Only the call sites that are safe before this merges switch here: the three bwrap checks and the required-checks ffmpeg install. As the issue says, choose-plugins.sh, stage-suites.sh and check-label-sender.sh get their pull request path callers in R2-8.

Scope exception: the issue owner allowed scripts/eval-leg-scripts.test.sh beyond the issue's file list (#16021 comment).

Fix

  • New scripts, mode 100755, #!/usr/bin/env bash and set -e, with no pipefail:
    • plugin-eval/check-bwrap.sh, choose-plugins.sh, stage-suites.sh, check-label-sender.sh: each holds its step's run: body verbatim (18, 27, 35 and 8 lines) and reads the same environment names. They keep [ ] tests to stay verbatim, so each carries a file-level shellcheck disable for SC2292 and for SC2154, the env the step sets, as other .github/scripts files do.
    • lib/install-pinned-ffmpeg.sh <bin-dir> [cache-dir]: holds the release, build and SHA-256. With a cache dir it keeps the archive there and downloads only when missing. Without one it downloads to RUNNER_TEMP and removes the archive after extracting. Both forms check each tool is executable and reports the pinned build. Error lines are the steps' own.
  • Calls switched:
    • The three "Check bwrap starts a sandbox" steps keep name and if:. They run bash .base/.github/scripts/plugin-eval/check-bwrap.sh. Checkout: the step's if: holds it to workflow_dispatch, the job if: holds a dispatch to the default branch, and .base is then github.sha (eval-browser-dispatch.yml:235-241), the commit the YAML comes from.
    • "Install ffmpeg for demo-video" keeps its name, timeout-minutes and LEG_PLAN gate lines. It drops its env: pin and runs bash .github/scripts/lib/install-pinned-ffmpeg.sh "$HOME/.local/bin" "$HOME/.cache/ci-tools-ffmpeg". Checkout: test-bash checks out the PR tree at the workspace root (pr-require-checks.yml:3537-3540), which holds the new script. The cache key is unchanged.
  • Comments: the eval-dispatch ffmpeg comment, in the key leg only, names install-pinned-ffmpeg.sh as the pin's home. The demo-video comment says the script installs both tools.
  • Added beyond the issue's file list: scripts/eval-leg-scripts.test.sh, a behavior test that runs each script. Without it nothing runs three of the scripts until R2-8, and review asked the same of R2-1's scripts (refactor(ci): move the lane-token revoke and pinned PyYAML install into lib scripts #15970).

Verification

  • install-pinned-ffmpeg.sh against the real release: the cache form downloaded and verified the archive, the cache-hit form reused it, the temp form left nothing in RUNNER_TEMP, and each printed ffmpeg version n8.1.3-9-g29e619e767-20260930 and the ffprobe line. No argument is a usage error.
  • scripts/eval-leg-scripts.test.sh: 13/13, covering each refusal line and exit code, choose-plugins.sh and stage-suites.sh outputs, the SHA-256 refusal on a downloaded and a cached archive, and no download on a cache hit.
  • shellcheck --rcfile .shellcheckrc and shfmt -d (v3.14.1) on the six shell files: clean.
  • node --test --test-concurrency=4 on the node test files that name either workflow or plugin-eval/ (including callers.test.mjs, which holds the three legs equal): 3728/3728 pass. test_merge_holds_sync.py: 21 passed. check-artifact-retention.mjs: 152 upload steps match.
  • actionlint (local) reports only cache-mode job keys that are already on main, not in this diff.
  • Left to CI: the full .github suite (ci-status).

Related

Part of #15695 (R2). Follow-on: R2-8 calls the three remaining scripts and install-pinned-ffmpeg.sh from the eval-dispatch pull request path.

🤖 Generated with Claude Code

…ffmpeg

Five scripts hold step bodies the workflows repeat: check-bwrap.sh,
choose-plugins.sh, stage-suites.sh and check-label-sender.sh (each its
eval-dispatch step's body verbatim) and lib/install-pinned-ffmpeg.sh
(the BtbN release, build and SHA-256, with an optional download cache).
The three dispatch-only bwrap checks call check-bwrap.sh from .base,
and the demo-video ffmpeg install calls install-pinned-ffmpeg.sh from
its root checkout. The other scripts get their pull request path
callers in R2-8. scripts/eval-leg-scripts.test.sh runs each script.

Closes #16021

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 13, 2026 20:19
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T20:21:15.792376Z b3ac229 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed b3ac22979c60fb734b4d645ec34320978f298f88: read 8 of 8 changed file(s); 2 finding(s), 0 as inline comments.

Code review: PR #16025, refactor(ci): add scripts for the eval-dispatch leg steps and pinned ffmpeg

I read all 8 changed files in full in .claude-lane/pr.diff. I also checked the scripts against the workflow at head:

  • The scripts match the step bodies. check-label-sender.sh, choose-plugins.sh and stage-suites.sh hold the same bodies as "Stop on an untrusted pull request trigger" (eval-browser-dispatch.yml:330-338), "Choose the plugins" (:375-402) and "Validate and stage the suites" (:414-449), apart from re-indentation. They read the same environment variable names.
  • The bwrap check is unchanged. check-bwrap.sh is the removed 18-line body exactly. The three steps keep their if:, so each runs only on workflow_dispatch, and .base is the dispatched default-branch commit.
  • The ffmpeg install behaves the same. install-pinned-ffmpeg.sh, given a cache directory, does what the removed demo-video body did: it downloads only when the archive is missing, checks the SHA-256 on every run, extracts, checks each tool is executable and checks the version line. test-bash checks out the pull request tree at the workspace root (pr-require-checks.yml:3537-3540), so the relative call resolves. The cache key and the save step's cache-primary-key are unchanged.
  • The pin appears once. A repository grep finds the release, build and SHA-256 only in the script, in the cache key, and in the three eval-dispatch steps that R2-8 will switch. That meets the issue's "appear once" criterion.
  • The new test looks sound, from reading it. It uses scripts/lib/test-harness.sh, a # test-scope: header (which plan-test-lanes.sh reads to pick suites) and an EXIT trap for its mktemp. Each expect looks for the last line its script prints, and that is what the scripts print. I did not run it; the 13/13 pass is the author's claim, unverified.

Findings (summary-only: neither can sit on a changed line)

  1. One acceptance criterion is not met as written. The closing issue Add scripts for the eval-dispatch leg steps and the pinned ffmpeg install #16021 says: "The diff edits only the listed files and the lines of a test that assert on them when the change breaks that assertion." The PR adds a new file, scripts/eval-leg-scripts.test.sh, which is not on the issue's file list. The PR body says so and gives its reasons. The test is worth keeping, since three of the scripts have no other caller until R2-8. So the fix is to update the issue's criterion to allow it, or for the issue owner to confirm the exception. Removing the test is not the fix.

  2. Nothing keeps the three not-yet-called scripts equal to their workflow steps (advisory). The issue says "choose-plugins.sh, stage-suites.sh and check-label-sender.sh each hold their step's body verbatim." That is true at this head. But no test compares choose-plugins.sh, stage-suites.sh or check-label-sender.sh with the step bodies at eval-browser-dispatch.yml:330, :375 and :414. The new test only checks a few refusal and output paths. Until R2-8 lands, an edit to any of those steps in all three legs would pass callers.test.mjs without touching the scripts. R2-8 would then replace the edited body with the old script and drop the edit silently. Either add a check that the scripts match the step bodies until R2-8 lands, or have R2-8 diff each script against its step body before switching.

Other notes

  • No inline comments. .claude-lane/prior-findings.md lists no earlier posts (this is the first review), so this is a full review, not blocking-only.
  • Spend: none. The change moves step bodies into scripts and adds no runs, model calls or turns.
  • Security: the trusted-path workflow files keep their gates. The label-sender and trusted-trigger logic is copied unchanged and has no caller yet. Running .base scripts on dispatch keeps the checkout model described in the PR.

I fanned out no hunter or verifier subagents; each candidate was checked directly against the workflow and repository files at head.

Verifier dropped 0 of 0 candidates.

@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed b3ac22979c60fb734b4d645ec34320978f298f88: read 8 of 8 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #16025 (head b3ac229)

No security issues found. I read the whole diff for all 8 changed files.

critical-findings: 0

What I checked

  • eval-browser-dispatch.yml (trusted path): the three "Check bwrap starts a sandbox" steps now run bash .base/.github/scripts/plugin-eval/check-bwrap.sh.
    • Each step keeps its if: ... && github.event_name == 'workflow_dispatch', so it never runs on a pull request event.
    • On a dispatch, .base is checked out at github.sha (eval-browser-dispatch.yml#L239, and the same at L1081 and L1745). That is the commit the workflow file itself comes from.
    • So the script comes from the same trusted tree as the inline body it replaces, and pull request code gets no new way in.
    • The script's content matches the removed inline body. The other change in this file only edits a comment.
  • pr-require-checks.yml (trusted path): "Install ffmpeg for demo-video" now runs .github/scripts/lib/install-pinned-ffmpeg.sh from the workspace checkout.
    • The workflow runs on pull_request and merge_group events, not pull_request_target.
    • The test-bash job checks out the PR tree with persist-credentials: false (pr-require-checks.yml#L3537-L3540), and it already runs the PR's own test suites. Running one more PR-tree script gives PR code nothing it lacked before.
    • The pin is unchanged: release autobuild-2026-09-30-13-08, build n8.1.3-9-g29e619e767, and the same SHA-256.
    • The SHA-256 check still runs before tar, on both a downloaded and a cached archive.
    • The cache save step is still limited to refs/heads/main and its key is unchanged, so the cache cannot be poisoned in a new way.
    • This step is not one of the ci-status merge-hold steps, and no merge hold is weakened.
  • New scripts that nothing calls yet (check-label-sender.sh, choose-plugins.sh, stage-suites.sh):
    • Each is a verbatim copy of an existing step body, and no workflow calls them in this PR.
    • check-label-sender.sh still fails closed:
      • A PROCEED that is not true is refused.
      • An empty or malformed SENDER_ID makes jq --argjson fail, which takes the refusal branch.
      • Only a listed human passes.
    • choose-plugins.sh keeps the ^plugins/[A-Za-z0-9][A-Za-z0-9._-]*$ check on the dispatch target.
    • Who passes the trusted-trigger check is not widened. When R2-8 wires these scripts in, the callers need checking: they must run the scripts from .base, not .head.
  • scripts/eval-leg-scripts.test.sh: a test-only script. It runs a stub curl inside a mktemp directory and touches nothing outside it.

Trust controls

No trust control is widened:

  • the trusted-trigger check, its actor list, the lane token scope and the kill switch are unchanged;
  • no merge hold changes, in pr-merge or in the ci-status hold steps;
  • no instruction-surface file and no plugin manifest is touched.

Spend: none beyond the existing CI legs. The demo-video leg's work is unchanged, and the new test suite adds a few seconds to a Bash leg.

The PR description held no embedded instructions to the review lane.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 13, 2026
Merged via the queue into main with commit 5aff8ba Nov 13, 2026
113 checks passed
@kyle-sexton
kyle-sexton deleted the refactor/r2-7-eval-leg-scripts branch November 13, 2026 21:25
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 5, survived 2, timeout 0, no coverage 0, invalid 0, not run 0.
Covered-code score 71%; mutation score 71%.

File Killed Survived Timeout No coverage Invalid Not run
.github/scripts/lib/install-pinned-ffmpeg.sh 1 0 0 0 0 0
.github/scripts/plugin-eval/check-bwrap.sh 0 1 0 0 0 0
.github/scripts/plugin-eval/check-label-sender.sh 2 0 0 0 0 0
.github/scripts/plugin-eval/choose-plugins.sh 2 0 0 0 0 0
.github/scripts/plugin-eval/stage-suites.sh 0 1 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
.github/scripts/plugin-eval/stage-suites.sh:24 ROR productive input-gap
.github/scripts/plugin-eval/check-bwrap.sh:17 SBR productive input-gap

The run's summary has the full report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add scripts for the eval-dispatch leg steps and the pinned ffmpeg install

1 participant