Skip to content

feat(evals): give eval runs their own credential role - #18818

Merged
kyle-sexton merged 3 commits into
mainfrom
feat/evals-dedicated-credentials
Nov 24, 2026
Merged

kyle-sexton merged 3 commits into
mainfrom
feat/evals-dedicated-credentials

Conversation

@kyle-sexton

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

Copy link
Copy Markdown
Member

Refs: #18828

Delivers the #18818 done-when item of spec #18828: the three eval workflows read only EVALS_*, key first, no fallback, and every stop names the role. The spec's other open item, the owner assigning the EVALS API key through the rotation tool, is not a diff; EVALS_CLAUDE_API_KEY does not exist yet (the token does), and #18828 closes once it does.

Summary

Eval runs get their own funding role, EVALS, and spend its API key before its subscription token. The MAINTENANCE pair stays as it is.

Fix

  • pr-run-plugin-evals.yml, maintenance-measure-skill-edit.yml and maintenance-measure-skill-edit-pass.yml read EVALS_CLAUDE_API_KEY and EVALS_CLAUDE_CODE_OAUTH_TOKEN (role: evals) in place of the MAINTENANCE_* pair. No eval path reads a fallback token or another role's secret.
  • Key first, then subscription: the key leg now ends with a select-model-credential next-leg call (the pattern the other lanes use) and exposes next-leg. The subscription leg needs the key leg and runs only when the key stopped: unassigned, empty, off, or at its credit stop.
  • The credential dispatch input is gone. Its only callers were docs/review/evals.md and the tests (git grep -n credential -- .github docs). The pass workflow's credential input becomes allow-subscription (boolean, default false). The hill climb never sets it, so it stays on the key alone.
  • Compare mode: compare-prepare now always checks the PR author and outputs subscription (a trusted actor who is a listed human). The arms receive the token, and allow-subscription, only when that holds. Any other author's compare runs on the key alone instead of being refused.
  • The existing subscription guards still apply: default branch only, case/cases/tag required for a suite run, the trusted human author for compare, the per-run --max-cost-usd ceiling, the kill switch, and CLAUDE_EVALS_DISABLED.
  • When both halves are out, the run fails with ::error::EVALS credentials not assigned or used up: ... reassign the EVALS role through the account rotation tool. A label-triggered PR run still only warns, since it never moves to the token.
  • .github/lane-funding.json: a new keyed evals role (category evals) holds every eval lane. The maintenance role keeps its entry and secrets with lanes: [], so the rotation tool can still assign it. The schema now allows an empty lanes list and the evals category. The keyed-role test exempts only a role listed as having no lanes.
  • The credit-stop marker and its retention row are renamed to key-credit-stop-EVALS_CLAUDE_API_KEY.
  • docs/review/evals.md now states the new credential rule. The CLAUDE_EVALS_DISABLED wording is unchanged; it was only rewrapped.

Loosened checks

Authorized by spec #18828, which cites owner-decisions.md#L410 (owner, verbatim: "The rest of these, let's go with recommendations."):

  • Item 1 and 2: maintenance becomes the one laneless role (LANELESS_ROLES = ["maintenance"]), since its only lanes were the eval jobs and a job belongs to one role; the keyed-role run-claude-cli assertion skips it.
  • Item 3: compare on a PR whose author is not a trusted human no longer stops; its arms run on the EVALS key alone and never receive the subscription token.
  • Item 4: the dispatch credential input is removed; runs use the EVALS key first, then the EVALS subscription token when the key stops, keeping the subscription leg's default-branch and case-filter guards. Tests asserting the explicit-credential shape now assert the key-first shape.

Verification

  • node --test on .github/scripts/plugin-eval/credential-legs.test.mjs uses truth tables over every key state and launcher outcome. They run through the job if:s, the pinned select-model-credential next-leg call, and the stop scripts under bash. The subscription leg runs exactly when the key stopped and the run may move, and every terminal stop names the role.
  • callers.test.mjs (306), workflow.test.mjs, hill-climb-workflow.test.mjs, maintenance-measure-skill-edit/credential-legs.test.mjs and sync-credential-legs.test.mjs all pass. scripts/sync-credential-legs.mjs --check is clean.
  • scripts/check-affected.sh --tests: 19 static checks passed, 0 failed. Its test stage selected 229 suites, which ran past the local 120 s budget, so they are left to CI. actionlint is clean on the three workflows. zizmor --offline adds only the two new select-model-credential@main steps, the pin form these files already use.

No eval was run, no workflow was dispatched, and no secret or variable was set.

Related

  • melodic-software/architecture#235 (owner decision "Dedicated eval lane credentials").
  • Before the first dispatch, the owner assigns EVALS_CLAUDE_API_KEY and EVALS_CLAUDE_CODE_OAUTH_TOKEN through the account rotation tool. Until then every eval run stops with the role error.

🤖 Generated with Claude Code

The three eval workflows (pr-run-plugin-evals.yml,
maintenance-measure-skill-edit.yml, maintenance-measure-skill-edit-pass.yml)
now read EVALS_CLAUDE_API_KEY and EVALS_CLAUDE_CODE_OAUTH_TOKEN in place of
the MAINTENANCE pair, with no fallback token.

A dispatched suite run spends the evals key first and moves to the evals
subscription token when the key stops (unassigned, empty or at its credit
stop): the key leg names the next leg through select-model-credential and
the subscription leg needs it. The credential dispatch input is gone. A
compare run moves both passes only for a trusted human's pull request;
compare-prepare passes the token to no other. Every subscription guard stays:
default branch, a case filter, the per-run ceiling, the kill switch and
CLAUDE_EVALS_DISABLED. When both halves are out the run fails with an
::error:: naming the EVALS role.

lane-funding.json gains a keyed evals role holding the eval lanes; the
maintenance role keeps its entry and secrets with no lanes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 24, 2026 16:12
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: 🔄 Running

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

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-11-24T16:12:28.769228Z b075192 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.

@kyle-sexton kyle-sexton added the do-not-merge Hard merge gate: do not merge while applied. label Nov 24, 2026
@kyle-sexton

Copy link
Copy Markdown
Member Author

Held (do-not-merge) until the EVALS_CLAUDE_CODE_OAUTH_TOKEN and EVALS_CLAUDE_API_KEY org secrets exist: merging first would stop every eval run until an account is assigned. The owner assigns them through the rotation tool; the label comes off once gh secret list -o melodic-software shows both.

…credentials

# Conflicts:
#	.github/actions/resolve-config/callers.test.mjs
@kyle-sexton kyle-sexton removed the do-not-merge Hard merge gate: do not merge while applied. label Nov 24, 2026
@kyle-sexton

Copy link
Copy Markdown
Member Author

Hold lifted: EVALS_CLAUDE_CODE_OAUTH_TOKEN exists (org, visibility all, 18:08:44Z). EVALS_CLAUDE_API_KEY does not yet; with it unset, a dispatched run goes straight to the EVALS subscription leg (credential-legs.test.mjs:56-67). Until the key exists, the key-only paths stop with the EVALS role error: the label-triggered PR run and the skill-edit hill climb. Queueing once pr-verify passes this head.

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: PR #18818, incremental (40ec3ca → f821833)

No security issues found. This was an incremental review: I read every hunk of all 3 files in scope. Because this lane already reviewed an earlier head, it reported only blocking (CRITICAL or IMPORTANT) findings.

What changed and what I checked

  • .github/workflows/pr-run-plugin-evals.yml, "Stop at the key's stop" step. The step now gets inputs.case, inputs.cases and inputs.tag through env: (CASE, CASES, TAGS), not through ${{ }} inside run:. A dispatch input therefore reaches the shell only as a variable value, so there is no expression injection.
    • read -ra splits those values into arrays. ${CASE//[*?[:space:]]/} strips glob and space characters. All of these are quoted or used only inside test expressions, so no command is built from the input.
    • The new branch can only fail the run (exit 1) when the key leg stops, NEXT=subscription, and no case filter is named. That makes the handoff to the EVALS subscription token narrower than before, not wider.
    • The subscription job's own first step still refuses an unfiltered run, so this is an extra layer on top of the existing gate. The other conditions on the token leg are unchanged: the workflow_dispatch-only event check, the default-branch ref check, needs.run-eval.result == 'success' and the kill switch.
  • scripts/credential-legs/pr-run-plugin-evals.mjs. The generator's template has the same env lines and the same shell block as the workflow, with $ escaped for the template string. The step it generates for the token leg keeps its own REASON/KEY_REASON env and does not get the new case inputs. That matches the workflow change.
  • .github/scripts/plugin-eval/credential-legs.test.mjs. This is a test-only change: it adds the case-filter dimension to the state matrix. It does not affect any credential path.

Trust controls. None of the changed files is a trusted-trigger check, a lane token request, the kill switch, the token broker or a merge hold. The workflow file is a trusted path, and I read its whole change.

Spend (not a finding, not a hold). This change only reduces subscription-token use: an unfiltered suite dispatch whose key leg stops now ends there and never moves to the EVALS subscription token.

critical-findings: 0

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude-review: 1 inline finding(s) on 40ec3ca83721f2429dd048915dd6d1803bd298ec; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review (incremental, blocking only): 40ec3ca → f821833

This push fixes this lane's earlier finding (discussion_r4684710606). Before, a dispatched whole-suite run (no case/cases/tag) whose key stopped logged that the subscription leg "runs the suite" and then failed on the subscription leg's case-filter refusal. It never printed the EVALS role error.

What changed. The key leg's "Stop at the key's stop" step now gets CASE, CASES and TAGS. When NEXT=subscription and no filter is set, it prints ::error::EVALS credentials not assigned or used up: ... and exits 1 (pr-run-plugin-evals.yml#L1046-L1051).

  • The filter test (${CASE//[*?[:space:]]/}, word-split cases/tags) is the same check the subscription leg's refusal makes (L1097-L1102). The two guards therefore agree on what counts as unfiltered, including * and ?.
  • On exit 1, needs.run-eval.result is no longer success, so run-eval-subscription is skipped. The run ends on the role error, as the closing issue's "a stopped pair ends the run naming the role" requires.

Tests. The truth table in credential-legs.test.mjs now varies the filter: none, CASE, CASES, TAGS, and CASE: "*". It expects a move to the token only when a filter is set, and the role error otherwise. This is the gap the earlier finding named. The stopScript helper passes only the env it is given, so an unset filter is empty in bash, the same as an empty dispatch input.

Generator. In scripts/credential-legs/pr-run-plugin-evals.mjs, both strings it replaces now match the new key-leg step:

  • the env block now includes CASE, CASES and TAGS;
  • the script now includes the new if block, with \${...} escaped correctly inside the template literal.

Both are still replaced wholesale with the token leg's env and its stop script. So the derived token stop step does not gain these unused variables or the extra check.

Closing issue #18828: "a stopped pair ends the run naming the role" is now met on the unfiltered-suite path, and the extended truth table covers it. The other criteria are unchanged since the last review.

This review was blocking only (the lane already reviewed an earlier head). Security findings are left to the security lane. No plugin manifest changed. I ran no tests; the PR's Verification results are the author's claims and unverified.

Verifier dropped 0 of 0 candidates.

…to the token

A whole-suite dispatch whose key stopped printed that the subscription leg
runs the suite, then failed on the subscription leg's case-filter guard
without naming the role. The key leg's stop now checks the filter: with
no case, cases or tag it fails there with the EVALS role error, and the
subscription leg never starts. The truth table gains the filter
dimension.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

The pr-verify verifier failed head f821833dbb3b8de28e80d80526c770573a6eae8a. What it wrote, as data:

What it wrote (26 lines)
Summary: Issue #18828 (closes). The code delivers the #18818 done-when item. All three eval
  workflows now read only `EVALS_CLAUDE_API_KEY` and `EVALS_CLAUDE_CODE_OAUTH_TOKEN` with no
  fallback token. Suite runs and compare passes use the key first and move to the subscription token
  through a `select-model-credential` next-leg call. Every terminal stop prints an `::error::` that
  names the EVALS role. The eval lanes move from the `maintenance` role to `evals` in
  `lane-funding.json`, and `LANELESS_ROLES` is `["maintenance"]`, as the spec says to do once the
  eval lanes move. The four loosenings (empty `lanes`, the laneless skip, key-only compares for
  untrusted authors, removal of the `credential` input) are each authorized by the spec. The spec
  carries both the owner-decisions line link and the owner's verbatim quote. The subscription guards
  are kept: default branch only, a case/cases/tag filter (also enforced at the key leg's stop), a
  trusted human author for compare, the cost ceiling and the kill switches. The hill climb staying
  on the key alone is a reasonable reading, because moving it to the subscription token would be a
  loosening the spec does not authorize. CI is green on the judged head: Test Node 0–3 and Test Bash
  0–2 cover the changed `.mjs` suites, including the wrapped `scripts/sync-credential-legs.test.mjs`
  (https://github.com/melodic-software/claude-code-plugins/actions/runs/45461209674). I found no
  correctness or safety defect in the diff. The verdict is `fail` because the pull request closes
  #18828, but one done-when item of that issue is not delivered and nothing excuses it. That item is
  "The owner assigns an account to EVALS through the rotation tool (both halves)". No diff can
  deliver it, and it is not listed in `person_checks`. A trusted comment on the pull request says
  `EVALS_CLAUDE_API_KEY` does not exist yet. Merging this pull request as it stands would close the
  issue with that item still open.
- PR body: change `Closes #18828` to `Refs: #18828` and say this pull request delivers only the
  #18818 done-when item (the eval workflows on `EVALS_*` only, key first, no fallback, stops that
  name the role). The owner still has to assign the `EVALS` API key through the rotation tool, and a
  trusted comment says it does not exist yet. The other way to fix this is for the issue owner to
  mark the item with `Person check:` on #18828.

This pull request leaves the merge queue, and ci-status holds it out while it carries pr-verify-failed. A pr-verify pass removes the label, at a new commit or at this same head: once a trusted person edits the body, and only trusted people have edited it since the fail, this head is judged again, so a fail on the body or the issues it links needs only the body fixed, no new commit.

@github-actions github-actions Bot added the pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it. label Nov 24, 2026
@kyle-sexton kyle-sexton removed the pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it. label Nov 24, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 24, 2026
Merged via the queue into main with commit 424a7b3 Nov 24, 2026
97 checks passed
@kyle-sexton
kyle-sexton deleted the feat/evals-dedicated-credentials branch November 24, 2026 19:04
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 24, 2026
kyle-sexton added a commit that referenced this pull request Nov 24, 2026
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.

1 participant