Skip to content

perf(ci): let Check Intent Fallback take check-intent's packed reads - #17028

Merged
kyle-sexton merged 2 commits into
mainfrom
perf/fallback-takes-check-intent-reads
Nov 18, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
perf/fallback-takes-check-intent-reads

Conversation

@kyle-sexton

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

Copy link
Copy Markdown
Member

Refs: #16642

Summary

Check Intent Fallback in pr-verify.yml repeated every pre-judge read Check Intent had already made. Check Intent already packs those reads for later jobs, and the subscription job takes them. This change makes Fallback take the same bundle instead of reading again.

Measured cost before, from a local analysis of two GITHUB_TOKEN brake hours on 2026-11-17: Fallback made about 11.5 REST calls per run, and it ran about 14 times an hour, so about 160 calls an hour. Expected cost after is about 3.9 calls per run, which saves about 105 calls an hour. Fallback runs that often because the subscription leg hands off on limit and credit stops. Fixing those handoffs would remove these runs entirely.

Fix

  • check-intent-fallback now lists check-intent in needs ([check-intent, check-intent-subscription]). The needs context holds direct dependencies only, so without this needs.check-intent.outputs.reads would be empty. The job's if: already starts with !cancelled() and spells out the subscription job's success, so gating does not change.
  • Its "Resolve the pull request" step gets the subscription job's CONTEXT_FILE and CARRIED: ${{ needs.check-intent.outputs.reads }} env lines. resolve-pr.mjs main takes the bundle only when takeReads accepts it.
  • Its "Select the trusted PR text" step skips when steps.pr.outputs.carried == 'true', as the subscription job's does.

Behavior that does not change:

  • takeReads still refuses a bundle from another run attempt, so re-running Fallback alone reads live.
  • The trigger gate still reads live.
  • "Assert the gate and the resolver agree" still requires the gate's PR and head to match the carried ones.

Comment not updated. The repository's comment lint (code-tidying-remote-comment-lint, pre-commit) rejects every edited comment line. So the job comment above check-intent-fallback still says "reads included (it takes none from the subscription job)", and the workflow header still says only the subscription job takes check-intent's reads. Both are now out of date and are left as the brief allows. resolve-pr.mjs's comment naming only the subscription job is also unchanged.

Effect on a moved head. The trigger gate still reads live. It keeps only an open PR whose current head equals the upstream run's head_sha (check-trusted-trigger.mjs lines 711-718), so a PR that has moved past the run's head stops at the gate with no-pr, before the agree step. The agree step then checks that the gate and the carried bundle name the same PR and head. With a bundle, Fallback no longer runs the resolver's other live skips, such as a draft or a head already judged, as of Check Intent's read. The subscription job already works this way. Fallback is exposed for longer, since the subscription judgment can run for hours before it hands off.

Verification

  • New test in workflow.test.mjs: "the subscription and fallback resolvers take check-intent's bundle in its own attempt and refuse it in another". For each later job it parses the env block of the job's own Resolve step and substitutes check-intent's packed bundle for the expression. It then runs resolve-pr.mjs main:
    • In attempt 1, with a client that fails on any read, it expects carried=true, the bundle's head, and the context file written.
    • In attempt 2, it expects exactly one live read of the upstream run and no carried=true.
  • Checked that the tests can fail: with Fallback's CARRIED line removed, this test fails, along with "the fallback job runs only on..." and the pre-judge-reads test. The line was then put back.
  • Updated pins: Fallback's needs: list, its needs. expression lines, and its carry wiring in the pre-judge-reads test. The step-equality test between Fallback and the key job passes unchanged.
  • node --test on .github/scripts/pr-verify/**/*.test.mjs, check-kill-switch.test.mjs, log-api-budget.test.mjs and resolve-config/callers.test.mjs: 892 tests, 892 pass.
  • actionlint .github/workflows/pr-verify.yml: clean.
  • Pre-commit (guardrails content, comment lint), commit-msg and pre-push (check-affected, reference verify, content) hooks: all pass.

Remaining

What is still open on #16642 after this PR:

Related

🤖 Generated with Claude Code

Check Intent Fallback repeated every pre-judge read Check Intent had
already packed for the subscription job. It now takes the same bundle
through CARRIED and CONTEXT_FILE, needs check-intent directly so the
output resolves, and skips the trusted-text read when the bundle held.
takeReads still refuses a bundle from another run attempt, the trigger
gate still reads live, and the agree step still stops a moved head.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

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

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T03:54:16.178654Z 39a5bbc PR opened
ℹ️ 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 18, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: PR #17028 (incremental since 39a5bbc)

No security issues found. Earlier heads have already been reviewed, so this review reports only blocking findings.

What changed since the last review. The only change is in .github/workflows/pr-verify.yml, which is a trusted path. It deletes the 16-line # comment block above the check-intent-fallback job. That comment had gone stale: it said the job takes no reads from the subscription job, which the earlier commit on this PR changed. The job's name:, needs:, if:, permissions:, env wiring and steps are all unchanged. This push changes no executable YAML.

What I checked.

  • Instructions removed. The deleted text is a description of how the workflow behaves. It is not an instruction to the model. The rules it described are enforced by the job's if: condition and by workflow.test.mjs, and this push touches neither. Removing the comment weakens no control.
  • Trust controls. No change to the trusted-trigger check, the lane token's scope, the kill switch or any merge hold.
  • Earlier findings. The previous review found nothing, and nothing from it carries over.

Spend. No new charge.

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

claude-lane: claude-review

Comment thread .github/workflows/pr-verify.yml Resolved
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

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

Incremental review of fc0d7bfc against 39a5bbc1. Blocking findings only, because this lane already reviewed an earlier head.

I read the whole incremental change. It is one file, .github/workflows/pr-verify.yml, and one hunk that removes the 16-line job comment above check-intent-fallback.

The deletion is clean. At head, check-intent-subscription's last step ends at L4024. One blank line follows, then the check-intent-fallback: job key at L4026, with its needs/if unchanged. Only comment lines were removed, so the YAML and the job's behaviour stay as they were.

No test depended on the removed text. I searched the repository for its distinctive phrases ("reads included", "takes none from the subscription job"), and no test pins them. The only similar phrase is a different comment in maintenance-audit-lane-runs.yml L937.

My earlier advisory finding is partly fixed by this push. The job comment that said the fallback job "takes none" of check-intent's reads is gone. Two parts of that finding are still stale but were not touched by this push, and both are advisory, so this review does not repost them:

  • the workflow header that says only the subscription job takes check-intent's reads
  • the workflow.test.mjs comment

No closing issue. The PR refs #16642 but closes none, so there are no acceptance criteria to check.

Spend: none from this push, which only removes a comment. The PR as a whole reduces GITHUB_TOKEN REST reads.

Loosened-check verdict: fail (default; the prompt gave no loosened_check_verdict: line); patterns: 0

Verifier dropped 0 of 0 candidates.

The comment said Fallback repeats check-intent's reads and takes none
from the earlier jobs; it now takes check-intent's packed reads. The
block is removed whole per ADR 0110 rather than corrected.

What it recorded, and where each fact is still enforced:
- Fallback runs only on the subscription job's success with next-leg
  "fallback" (a limit stop, a credit stop, a 401 or 402 handed off
  cleanly, or an empty subscription token, each with the fallback token
  set). Its `if:` says this, and workflow.test.mjs pins it.
- Its steps match check-intent's except for the credential, the carried
  reads and capture, the fallback reason, and the key-only, leg-check
  and next-leg steps. workflow.test.mjs holds the rest equal.
- The outputs of earlier jobs reach it only through `if:` and env, and
  never appear in a `run:` script. workflow.test.mjs pins the `needs.`
  lines.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 18, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 18, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 18, 2026
Merged via the queue into main with commit a483a2c Nov 18, 2026
55 checks passed
@kyle-sexton
kyle-sexton deleted the perf/fallback-takes-check-intent-reads branch November 18, 2026 05:08
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 18, 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