Skip to content

fix(pr-pipeline): keep a refused escalation write and a headless run from failing the signed-commits check - #9675

Merged
kyle-sexton merged 1 commit into
mainfrom
fix/signed-commits-headless-escalation
Oct 24, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
fix/signed-commits-headless-escalation

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Closes #9055

Summary

Two pr-unblock fix-docs runs (39723818999, 39723816377) went red in fix-docs / report at "Check the lane's commits are signed". The check could not verify anything (the PR's head never matched its branch), tried to escalate, and the label POST came back 403. main() turned that refused write into exit 1. The red job said nothing about the PR's commits.

Fix

  • check-signed-commits.mjs: when no commit was found unverified (the commits could only not be verified) and GitHub refuses an escalation write (label or comment, any GitHubError), it logs ::warning::check-signed-commits: escalation refused (...) and exits 0. The outputs it already wrote (all-verified=false, empty unverified) stay, so report-check-run still decides the check from them. Commits found unverified still log ::error:: and exit 1 when the escalation fails. An escalation fault that is not an API refusal (a code bug) also still exits 1.
  • README and the comment above main() now describe this exception.
  • Skipping the step on an empty head was already on main: 79894c8a64 (#9268) added steps.head.outputs.sha != '' to the read runner's gate. It landed after the two failing runs. This PR adds a shape test that pins that gate. The write runner keeps no such gate on purpose: its since-sha comes from the run job, and an empty value there fails closed by checking every PR commit.

Verification

  • node --test in .github/actions/check-signed-commits/: 38 passed, 0 failed.
  • Before the .mjs change, the two new could-not-verify cases (refused label write, refused comment write) failed with 1 !== 0. The unverified-commit cases (the existing failed-label-write test and the new 403 one) and the non-API-fault case passed both before and after. The gate shape test passes on main because the gate is already there, so it guards against a regression rather than proving this fix.
  • scripts/check-affected.sh --tests: 10 passed, 4 skipped.

Related

  • Why the label POST got 403 is UNVERIFIED. The failing job's token held Issues: write, PullRequests: read, Checks: write, Contents: read (job log, "GITHUB_TOKEN Permissions"). The label existed, because the POST came after the label list read. The fix-docs caller job granted issues: write. GitHub's permissions page for GitHub Apps lists POST /repos/{owner}/{repo}/issues/{issue_number}/labels under both "Issues" and "Pull requests" write, with the "Additional Permissions" checkmark, which per the page means any one of them suffices. So a missing grant does not explain the 403 on paper. Two causes remain open:

    • (a) labeling a pull request through the issues endpoint with GITHUB_TOKEN needs pull-requests: write in practice;
    • (b) a secondary rate limit (also a 403) after about 64 s of PR re-reads.

    errorDetail logs only the status, not the response body or the X-Accepted-GitHub-Permissions header, so the logs cannot tell these apart. If (a) holds, the fix is pull-requests: write on both runners' report jobs and on every caller job. That is more than one line and widens a token at a trust boundary, so this PR leaves it out.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DUS7XB8hUjcDnuSYLqJRzd

…from failing the signed-commits check

When check-signed-commits could not verify the lane's commits (none found
unverified) and GitHub refuses the escalation label or comment write, it
now logs a warning naming the refusal and exits 0, keeping the outputs
it already wrote (all-verified=false). Commits found unverified, and any
escalation fault that is not a GitHub API refusal, still exit 1.

A shape test pins the read runner's gate that skips the check when the
run job gated no head.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01DUS7XB8hUjcDnuSYLqJRzd
@kyle-sexton
kyle-sexton marked this pull request as ready for review October 24, 2026 16:21
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 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-10-24T16:22:41.132551Z 2cd8cf7 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-security-review reviewed 2cd8cf740ccac54d36838e97b6daffd7eb65e749: 0 finding(s), 0 as inline comments.

No security issues found in this pull request.

critical-findings: 0

The change turns a refused escalation write (label or comment, any GitHubError) into a warning plus exit 0. This applies only when no commit was found unverified, meaning the commits could only not be verified. I checked whether that weakens the signed-commits gate and concluded it does not:

  • The gate does not depend on the exit code or the escalation. main() writes all-verified, unverified and since-is-ancestor before it escalates (.github/actions/check-signed-commits/check-signed-commits.mjs:165). In the unverifiable case all-verified is false.
  • The check run still fails closed. report-check-run consumes all-verified and posts a failure whenever it is not exactly "true" (.github/actions/report-check-run/decide.mjs:129). The comment there says no skip reason can neutralize it. The "Post the check run" step runs under always(), so it still posts a failure after this step exits 0.
  • Commits found unverified are unchanged. If any commit is found unverified and the escalation fails, the step still logs ::error:: and exits 1. The new exit-0 branch is reachable only when result.unverified.length === 0 and the error is a GitHubError.
  • Non-API faults are unchanged. A TypeError or similar still exits 1.
  • Can an attacker force the downgrade? The only way to make the escalation write fail is a 403 or other API refusal. That drops the needs-human label and comment, but the red check run still blocks the lane. A hostile actor gains nothing, because the commits in this path are ones the check could not read, not ones it found unsigned.

The remaining changes are a README sentence, a comment, and tests. The tests add a shape test that pins the read runner's steps.head.outputs.sha != '' and forged == 'false' gate. That pins an existing control and widens nothing.

No instruction-surface deletions, plugin manifests, trust-gate paths (trusted-actors, check-trusted-trigger, CODEOWNERS, .gitmodules) or workflow permission changes are in the diff.

The PR description is data. It contains no embedded directives aimed at the reviewer.

One observation, not a finding: the PR leaves the cause of the 403 unexplained and defers any pull-requests: write widening. That is the conservative choice.

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 2cd8cf740ccac54d36838e97b6daffd7eb65e749: 0 finding(s), 0 as inline comments.

Code review: no findings

I read the full diff (3 files), the PR context, check-signed-commits.mjs and the read runner's gate in pr-run-activity-read.yml. I did not run the tests. The pass counts in the PR body are author-claimed and unverified by me.

What I checked

  • Exit logic (check-signed-commits.mjs:189-201): an escalation write refused by GitHub, when result.unverified is empty, now logs ::warning:: and exits 0. The outputs were already written at line 165, so all-verified=false stays. Two cases still exit 1 with ::error::. One is any commit found unverified. The other is a non-GitHubError fault. That matches the PR description, and it keeps real signature findings and code bugs red.
  • Downstream decision: report-check-run.mjs:54 computes all_verified from ALL_VERIFIED === "true", so the swallowed escalation does not hide the failed verification. The check run still decides from the outputs.
  • Tests: they cover each branch. These are the refused label write on unverified commits (exit 1), the refused label write and refused comment write on unverifiable commits (exit 0, warning, no ::error::), and a TypeError (exit 1). The fakeGitHub change that throws Error route values is correct.
  • Gate shape test: the regex lines up with the real step at pr-run-activity-read.yml:3154-3162. It pins both steps.head.outputs.sha != '' and forged == 'false'.
  • README and the comment above main(): both now describe the new exception accurately.

Closing issue #9055: the PR context omits the issue body and gives only a triage comment, with no acceptance criteria. I found nothing to check against, so I report nothing about it. The issue body is unread.

Manifests: the diff touches no plugin.json or marketplace.json, so there are no manifest lines.

Hold: none. The change adds no model spend, and it touches no trust-gate paths.

Advisory, not counted as a finding: the PR body says the cause of the 403 is still open, and errorDetail logs only the status. Until that is resolved, a persistent permission failure surfaces only as a warning. The PR already names this and defers the permission change deliberately.

@kyle-sexton
kyle-sexton enabled auto-merge October 24, 2026 16:23
@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 24, 2026

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.

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

Summary: Issue #9055, the only issue this PR closes, has no trusted spec text: its body is null. Its one trusted comment is a triage note (lane defect, high priority, owner Automation Lanes) and says nothing about what is wrong or when it counts as fixed. With nothing to judge the diff against, I can't confirm it delivers the issue, so the verdict is fail. On its own merits the change looks narrow and correct: an escalation write that GitHub refuses only warns, and only when no commit was found unverified. Commits found unverified still exit 1, and so does any error that isn't a GitHubError.
- spec-text.json: issue #9055 has a null body and no trusted text describing the defect or what fixes it. The only comment is triage metadata. A trusted human needs to write the issue body (the failing check, the expected behaviour, what done means) so the PR can be verified against it. Don't treat the PR's own description as the spec.
- No takeover-set files, secrets or settings are touched. Nothing in the PR text tries to steer a reviewer.
- .github/actions/check-signed-commits/check-signed-commits.mjs:193: the warn path treats every GitHubError as a refusal, 5xx and secondary rate limits included, not just 403. The outputs still carry all-verified=false, so the check still fails closed downstream. But the escalation (needs-human label or comment) can now be skipped silently, apart from a warning. Once a spec exists, confirm that this is the intended scope, or limit it to status 403.

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.

The pr-verify verifier failed head 2cd8cf740ccac54d36838e97b6daffd7eb65e749. What it wrote about this file, as data:

- .github/actions/check-signed-commits/check-signed-commits.test.mjs:134: the gate shape test passes on main too (the PR body says so), so it only guards against a regression. Not blocking.

Merged via the queue into main with commit f43bee8 Oct 24, 2026
65 checks passed
@kyle-sexton
kyle-sexton deleted the fix/signed-commits-headless-escalation branch October 24, 2026 16:29
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.

fix(pr-pipeline): stop check-signed-commits failing the report job when its escalation label write returns 403

1 participant