Skip to content

ci(pr-pipeline): check the subprocess env scrub once per Claude Code release from release intake - #13234

Merged
kyle-sexton merged 3 commits into
mainfrom
ci/12836-env-scrub-release-probe
Nov 4, 2026
Merged

kyle-sexton merged 3 commits into
mainfrom
ci/12836-env-scrub-release-probe

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Closes #12836

Summary

A Claude Code release can change CLAUDE_CODE_SUBPROCESS_ENV_SCRUB with no changelog line, the CI lanes rely on that scrub, and nothing checked it per release: the two env-scrub behavior probe cases run only on request. They cannot run in CI as written, because a Claude API key may reach only a run-claude-cli step and that action always forces the scrub on, so the scrub-off control cannot run there.

Under the owner's decision on the issue (option (d), 2026-11-04), release intake keeps the credential rule and changes the check: it runs capture-probe.mjs in place of the two cases.

Fix

  • upstream-apply-changelog.yml gets a scrub-probe job. It runs a run-claude-cli leg with cli-version set to the release the gate picked, on ISSUE_LANE_CLAUDE_API_KEY, with one allowed Bash call to capture-probe.mjs and two Read calls its deny rules must refuse. The scrub is on as the lanes run it, and the probe's canary child shows its /proc scan can see an environment.
  • Its conditions are the model job's (proceed, skip-key, run_attempt == '1'). Token: contents: read. Cache: cache-mode: read. The leg runs after the kill switch, the managed settings and runner isolation. Its sealed transcript goes under the existing lane-transcript-* row. No job needs it, so a red probe blocks no publishing.
  • "Check the probe" fails with an ::error naming the release and hit names, never a value or a place, on a failed leg, a CLI other than the release, no result, a missing name, any hit, a missed canary, or a Read that was not refused. A pass writes a ::notice and a job summary line naming the release.
  • capture-probe.mjs takes further credential names from CAPTURE_PROBE_EXTRA_NAMES and lists the names it probed in its result, so a name that never reached the Bash child fails the check. With the variable unset it probes the same names as before, so pr-verify-capture.yml behaves as it did.
  • lane-funding.json lists the job under issue-lane. No new secret, no wider token permission, no change to the credential pins.

Verification

  • node --test: capture-probe.test.mjs, upstream-apply-changelog.test.mjs, the rest of .github/scripts/pr-verify/, callers.test.mjs, live-config.test.mjs, log-api-budget.test.mjs pass. The new check-step test runs the step's own script against hand-built results and leg transcripts.
  • One mutation per new clause (job conditions, permission, cache mode, cli-version, extra names, each check-step branch, transcript, funding row): 28 of 29 runs failed a test. The survivor ran callers.test.mjs against the key in the probe step's own env, which that pin allows since the key stays on the launcher step; the same mutation run against the intake test fails it.
  • zizmor reports nothing. Local actionlint reports only the cache-mode and queue keys it does not know, which this file already used, and nothing else with those two ignored.
  • scripts/check-affected.sh --tests, check-line-citations.py, check-lane-coverage.sh --check, check-test-tmp-cleanup.sh --check and check-changelog-fragments.sh --check pass.

Not verified:

  • The probe has never run live, here or in pr-verify-capture.yml (merge.verify-capture.app is unset), and a workflow run cannot happen before merge.
  • That CAPTURE_PROBE_EXTRA_NAMES survives the scrub into the Bash child; the check fails red if it does not.

Known limits:

  • A release the gate takes again (a failed model run, publish, or range-not-computed) is probed again, at most the lane's per-day cap, since only the done marker ends a release.
  • A release npm does not have yet ends the leg install-failed and turns the job red; the model job may still mark that release done, so it is not probed again without a dispatch.

Related

🤖 Generated with Claude Code

kyle-sexton and others added 2 commits November 4, 2026 08:25
Release intake runs capture-probe.mjs as a Bash child of a run-claude-cli
leg on the release it takes, in place of the two env-scrub cases, which
cannot run under the rule that a Claude API key reaches only that action.
A failure fails the scrub-probe job naming the release and hit names; a
pass records the release. No job needs it, so a red probe blocks no
publishing. No new secret, no wider permission, no credential pin change.

capture-probe.mjs takes further names from CAPTURE_PROBE_EXTRA_NAMES and
lists the names it probed, so a name that never arrived fails the check.

Closes #12836

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

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

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T13:34:38.695474Z aaf25a5 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

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review (incremental, blocking only): no security issues found

critical-findings: 0

Scope. This review covers only what changed since aaf25a55. That is one file, .github/workflows/upstream-apply-changelog.yml, and I read both of its hunks. The file is on a trusted path, so I also read the whole scrub-probe job at head and the log-api-budget action the new step calls. This lane already reviewed an earlier head (blocking only: yes), so only CRITICAL and IMPORTANT findings would be reported.

What changed. The push fixes the settled API-budget coverage thread, which is marked lines changed since resolution: no:

  • "Resolve the model" step (L545-L546): it gains API_BUDGET_TOKEN: github-token. That value is a token label read by the budget logger, not a credential. No secret or token value is added to the step's environment.
  • New final step (L673-L679): an always() step runs log-api-budget with continue-on-error: true and timeout-minutes: 1.
    • The action (action.yml L51-L114) only reads the rate-limit records the job left in $RUNNER_TEMP/api-budget.
    • It writes notices, the step summary and outputs. It checks each token name against ^[a-z][a-z0-9-]{0,39}$ and always exits 0.
    • It makes no call that needs the job token. The job's token scope is unchanged (contents: read, L520-L521).

Can the Claude leg tamper with the logger? The new step runs after the probe leg, so I checked whether the leg could alter the logger's code under .base or its inputs under $RUNNER_TEMP. It cannot:

  • Only one exact Bash command is allowed (L606-L607).
  • Edit, Write, Edit(./.base/**) and Edit(/${{ runner.temp }}/**) are disallowed (L608-L625).
  • In any case the logger only prints counts.

Trust controls. No trust control is widened. The trusted-trigger check, token scope, kill switch, merge holds and the secrets the job reads are all unchanged by this push. No instruction surface or plugin manifest changed.

Spend: none added beyond a one-minute bookkeeping step on the job's existing hosted runner.

The PR context contains no text addressed to this review.

@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 aaf25a55c9d84eec7cba08b498d93ec6ffbc9271; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review: PR #13234, incremental since aaf25a55

Scope. This was an incremental review covering one file, .github/workflows/upstream-apply-changelog.yml. I read all of its change. Because this lane already reviewed an earlier head, this review reports blocking findings only.

Earlier blocking finding is fixed. At aaf25a55, the scrub-probe job was missing API-budget logging. This push fixes it the same way the other jobs in this file do:

  • The "Resolve the model" step now sets API_BUDGET_TOKEN: github-token (L545-L546).
  • The job's last step is now an always() log-api-budget step with continue-on-error and tokens: github-token (L673-L679).

Those are the two things api-budget-coverage.test.mjs checks for. The owner resolved the thread on this head, so it is settled and I did not raise it again.

Not verified. The author says api-budget-coverage and the intake tests pass, 293 of 293. That is their claim; I ran nothing.

No new findings. The push changes nothing else. The closing-issue (#12836) check from the earlier review still holds.

Spend (not a hold): none new in this push. The PR as a whole adds one short run-claude-cli leg (at most 6 turns) on ISSUE_LANE_CLAUDE_API_KEY for each release the gate takes.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 4, 2026
Merged via the queue into main with commit b0a3308 Nov 4, 2026
48 checks passed
@kyle-sexton
kyle-sexton deleted the ci/12836-env-scrub-release-probe branch November 4, 2026 13:54
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.

ci(harness-ops): run the env-scrub probe cases once per Claude Code release from release intake

1 participant