Skip to content

/evaluate: grade with main's evaluator and keep submission code away from the write token - #254

Merged
yl231 merged 1 commit into
mainfrom
ci/evaluate-with-main-evaluator
Oct 30, 2026
Merged

yl231 merged 1 commit into
mainfrom
ci/evaluate-with-main-evaluator

Conversation

@yl231

@yl231 yl231 commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Problem

/evaluate ran automation/process_pr_submission.py from the base branch, but that script then checked out the PR head and ran the PR branch's validator, evaluator and lockfile. Two consequences:

Change

  • Grade with the base branch's code. The script now creates its worktree from the base branch and copies in only the submission's data, read straight from git objects (symlinks are refused):

    • the router's prediction, robustness and config files;
    • prices for models the PR adds. Models already in model_cost.json keep main's price, and a PR that edits an existing price gets a warning in the log. Only the PR's own edits count, so a branch made from an older main doesn't undo later price changes.
    • names and mappings the PR adds to universal_model_names.py, which is parsed, not imported.

    Other files the PR changes are listed in the log and not used.

  • Keep submission code away from the write token. The workflow is now three jobs:

    • start acknowledges the comment and creates the check;
    • evaluate runs the grading with contents: read and persist-credentials: false. This is the only job that runs submission code, because LiveCodeBench answers are executed;
    • report reads metrics.json from an artifact, accepts only numbers from it, posts the comment and completes the check.
  • Safer inputs. The router name must match [A-Za-z0-9._-]+ and is passed to steps through env instead of being expanded into scripts. The entry-count check runs Python with -I, so a module planted in the PR checkout can't be imported.

  • Evaluator in the comment. The results comment names the evaluator commit.

  • README. The submission section says which files are taken from the branch.

Testing

The re-grade workflow (regrade-all.yml) only grades merged files on main, so it is unchanged.

🤖 Generated with Claude Code

…from the write token

The workflow ran automation/process_pr_submission.py from the base branch, but
the script then checked out the PR head and ran that branch's validator,
evaluator and lockfile. Fixes merged to main didn't apply until a contributor
rebased, and code in a submission branch ran in a job whose token could post
PR comments and update checks.

- The script now creates its worktree from the base branch and copies in only
  the submission's data files from the PR: its prediction, robustness and
  config files, prices for models it adds (models already priced keep main's
  price), and the names it adds to universal_model_names.py, which is parsed,
  not imported. Other files the PR changes are listed in the log.
- The workflow is split into three jobs. Only the evaluate job runs submission
  code (LiveCodeBench answers are executed), with a read-only token and no
  stored credentials; it hands metrics.json to the report job, which accepts
  only numbers from it.
- The router name is checked against [A-Za-z0-9._-] and passed through env
  instead of being expanded into scripts.
- The results comment names the evaluator commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@yl231
yl231 merged commit 9f6ae25 into main Oct 30, 2026
10 checks passed
@yl231
yl231 deleted the ci/evaluate-with-main-evaluator branch October 30, 2026 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant