Skip to content

perf(pr-pipeline): hand check-intent's reads to check-intent-subscription - #11329

Merged
kyle-sexton merged 4 commits into
mainfrom
perf/check-intent-subscription-reads
Oct 30, 2026
Merged

kyle-sexton merged 4 commits into
mainfrom
perf/check-intent-subscription-reads

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

No related issue: GitHub Support's GITHUB_TOKEN budget report on pr-verify (hub item; no new issues under the current phase).

Summary

pr-verify's check-intent-subscription job repeated every read check-intent had just made for the same head in the same run: 19 GITHUB_TOKEN calls on each leg of run 41084360375 (graphql=4 each), 314 calls over 18 runs in the 15Z window.

Fix

  • check-intent writes one reads job output (base64 JSON of the resolved PR, spec.json, spec-text.json and context.json) from its base-side step files, before the model runs.
  • The subscription job's resolver takes it through env only (resolve-pr.mjs takeReads), skips select-trusted-text, and still runs the trigger gate, whose head the agree step compares with the carried one.
  • A missing, malformed or oversized bundle, or one from another run attempt, reads everything again. The fallback job is unchanged.

Verification

  • node --test .github/scripts/pr-verify/resolve-pr.test.mjs .github/scripts/pr-verify/workflow.test.mjs cover takeReads acceptance and every fallback (missing, malformed, oversized, other attempt) and the workflow wiring.
  • Calls per run after merge get measured from the job's github-token= notice and reported to GitHub Support.

Related

  • Q-G: one of three conditions for the HITL backlog drain to run 4 workers.

🤖 Generated with Claude Code

kyle-sexton and others added 3 commits October 30, 2026 12:26
…tion

The subscription leg repeated every read check-intent had just made for
the same head in the same run: 19 GITHUB_TOKEN calls on both legs of run
41084360375 (graphql=4 each), 314 calls over 18 runs in the 15Z window.

check-intent now writes one `reads` job output (base64 JSON of the
resolved PR, spec.json, spec-text.json and context.json) from its
base-side step files, before the model runs. The subscription job's
resolver takes it through env only (resolve-pr.mjs takeReads), skips
select-trusted-text, and still runs the trigger gate, whose head the
agree step compares with the carried one. A missing, malformed or
oversized bundle, or one from another run attempt, reads everything
again. The fallback job is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kyle-sexton
kyle-sexton marked this pull request as ready for review October 30, 2026 21:50
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 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-30T21:51:54.527659Z bd6b353 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bd6b353bc1

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 3e273b925281ba95784d742d19ba2d82caaac983: 0 finding(s), 0 as inline comments.

No security findings in the incremental change since bd6b353. I read resolve-pr.mjs, resolve-pr.test.mjs and pr-verify.yml (the last two as pr-verify.yml and the test file), and I did not run any code.

The change carries relink-since-head through the reads bundle from check-intent to the subscription job. takeReads also gets a size cap.

  • Widening: none.
    • takeReads accepts relink_since_head only when it is exactly the string "true" or "false". It is then written to GITHUB_OUTPUT as relink-since-head=${taken.relinkSinceHead}. That value cannot carry a newline or an extra output key. The other values written alongside it are still checked (SHA, HEAD_REF regex, integer PR number).
    • The new RELINK_SINCE_HEAD env in pr-verify.yml comes from steps.pr.outputs.relink-since-head, which is the same output other steps in that workflow already read. It is passed as an env var, not interpolated into a run: script.
    • Where RELINK_SINCE_HEAD is consumed (write-verdict.mjs:309), it only chooses artifact retention-days. It gates no trust, token, merge hold or credential path.
  • Narrowing: the new length check (CARRY_MAX) in takeReads runs before decoding and parsing. This tightens how the receiving job treats a bundle it did not write itself.
  • Fail-closed: a missing or malformed relink-since-head makes packReads produce an invalid bundle. The taker returns null, and the subscription job reads the pull request again. Nothing proceeds on a partial bundle.
  • Workflow comment: the pr-verify.yml comment edit is documentation only.

Spend: nothing in this change adds lane runs, turns or any billed resource.

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

claude-lane: claude-review

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 3e273b925281ba95784d742d19ba2d82caaac983: 0 finding(s), 0 as inline comments.

Incremental review of resolve-pr.mjs, resolve-pr.test.mjs and pr-verify.yml since bd6b353. I found no problems.

  • relink-since-head handoff. check-intent's carry step passes steps.pr.outputs.relink-since-head through RELINK_SINCE_HEAD. packReads stores it and takeReads accepts only the strings "true" and "false". The carried path in main writes it back as an output, so the subscription leg's verdict step (write-verdict.mjs, RELINK_SINCE_HEAD !== "false") sees the same value as the fresh read. Before this change the carried path left that output empty, which only meant a 90-day retention instead of 7. Any other value, an empty one, or a missing one now makes carryMain hand on nothing, so the subscription job reads again.
  • Size cap on the taker. takeReads now rejects input longer than CARRY_MAX before it decodes it, so an oversized bundle is refused whoever wrote it. The check is correct and the test covers it.
  • Tests. They cover the round trip for "true" and "false", the rejected values "", "yes" and undefined, the empty-env case in carryMain, the oversized input, and the new line in main's output. I read them against the code and they agree with it. I did not run them.
  • Workflow. The only change besides the new RELINK_SINCE_HEAD env var on the carry step is a comment fix. It now says the subscription job also receives the pre-judge reads through the reads output.
  • Trusted paths. Two of the three changed files are on the trusted-path list, resolve-pr.mjs and pr-verify.yml. The new field is parsed strictly, travels only through job output and env, and does not widen what the carried bundle can set. The subscription job still runs the trigger gate and the head-agreement check. I found no security concern.
  • Cost. This change only trims GITHUB_TOKEN API calls. It enables no paid plan or billing.

The carried path wrote no relink-since-head, so write-verdict read the
empty value as not "false" and kept a PASS for 90 days instead of 7.
The bundle now carries it, takeReads accepts only "true" or "false" and
caps the bundle's size itself, and the carried path writes it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KeBVgf4HdeJ2D89FQ3H89A
@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit 6a92a3d Oct 30, 2026
55 checks passed
@kyle-sexton
kyle-sexton deleted the perf/check-intent-subscription-reads branch October 30, 2026 22:59
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