Skip to content

fix(pr-pipeline): plan merge-group verify read floor to header limit - #17401

Merged
melodic-automation-lanes[bot] merged 2 commits into
mainfrom
fix/merge-group-verify-header-limit
Nov 19, 2026
Merged

melodic-automation-lanes[bot] merged 2 commits into
mainfrom
fix/merge-group-verify-header-limit

Conversation

@kyle-sexton

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

Copy link
Copy Markdown
Member

Closes #17428

Summary

ci-status's merge-group verdict reader now sets its read floor from GITHUB_TOKEN's live x-ratelimit-limit (5,000) instead of github-token's 1,000-call planning cap (limit-cap in .github/actions/log-api-budget/rate-limits.json). The 10% read-floor stays. Run 44463304120 refused #17252 with 2,766 of 5,000 requests left (verify:unreadable: ... not sent: the github-token pool is below its read-floor share), and 21 merge-group runs were ejected.

Fix

  • babysit_gh.py _below: when BABYSIT_READ_FLOOR_HEADER_LIMIT=1 is set, the read floor is a share of the header's limit and the limit-cap clamp is skipped. Unset, nothing changes.
  • pr-require-checks.yml, lanes-hold step: the merge-group block exports the flag. That block holds the reader whose verify:unreadable ejects the entry. Its cold-read gate now reserves read-floor × header limit (500), so it no longer admits a cold read that the reader would floor about 400 requests later.
  • Scope: the owner-PR reader in the same step runs before that block and keeps limit-cap; a refusal there other than a FAIL holds nothing. pr-merge's readers and the shell guard (API_BUDGET_LIMIT_CAP) keep limit-cap too.
  • Built on main, not on #17382 (D417's read-floor wait). This PR sets the flag with its own export line and leaves fix(source-control): wait out the read floor's reset in the merge-queue verify read #17382's reader invocation line, its babysit_gh.py hunks and its tests alone, so either PR can merge first.

Verification

  • test_babysit_gh_rate_guard.py: new cases built from the run's numbers. With the flag, 2,766/5,000 sends the read; without it, the same reading is floored. With the flag, 500/5,000 is not low and 499/5,000 is. 57 tests pass.
  • scripts/ci-lanes-pr-hold.test.sh: the merge-group reader runs with the flag and the owner-PR reader runs without it. The cold-gate needs were recomputed by hand with a floor of 500 (for example 1,739 + 500 = 2,239).
  • test_babysit_verify_evidence.py, plus node --test on rate-guard.test.mjs and log-api-budget.test.mjs (248 pass).

Related

  • #17382: D417, the verify reader waits for the reset after a read-floor refusal.

🤖 Generated with Claude Code

Owner decision D418 (Q227): ci-status's merge-group verdict reader plans
its read floor to GITHUB_TOKEN's live x-ratelimit-limit instead of
github-token's 1,000-call limit-cap, keeping the 10% read-floor. Run
44463304120 refused with 2,766 of 5,000 left and ejected 21 merge-group
runs.

babysit_gh's _below drops the limit-cap clamp for read-floor when
BABYSIT_READ_FLOOR_HEADER_LIMIT=1; the merge-group block of the lanes-hold
step exports it, and its cold-read gate reserves the same floor of the
header limit. The owner-PR reader and every other reader keep limit-cap.

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

chatgpt-codex-connector Bot commented Nov 19, 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-19T06:46:43.795528Z 768aa91 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.

…schema

The github-token description says a higher header limit is never a
target; ci-status's merge-group verdict reader, run with
BABYSIT_READ_FLOOR_HEADER_LIMIT=1, now plans its read floor to it (owner
decision D418).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review (incremental, blocking only): no findings

Since 768aa91e, the only change is one hunk in docs/conventions/pr-pipeline/pr-pipeline.schema.json. It extends the github-token pool's description with one sentence: ci-status's merge-group verdict reader is the exception to planning against limit-cap. That reader runs with BABYSIT_READ_FLOOR_HEADER_LIMIT=1, so its read floor is a share of the live header limit (owner decision D418).

The new sentence matches what the PR does, as I checked in the earlier review of this PR:

  • The flag is exported only inside the merge_group block of pr-require-checks.yml.
  • The owner-PR reader and the shell guard keep limit-cap.

The edit touches only a description string. It changes no schema structure, $ref or validation keyword, so no validation behaviour changes.

This lane already reviewed an earlier head, so this review reports blocking findings only. There is no closing issue (the PR cites D418), so there are no acceptance criteria to check. No plugin manifest changes in this increment.

Loosened-check verdict: fail (default; the prompt has no loosened_check_verdict or loosened_check_patterns lines); patterns: 0. The prompt has no decision-record line either, so I did not check the citation requirement. A documentation-only description edit loosens no check.

Verifier dropped 0 of 0 candidates.

@github-actions

Copy link
Copy Markdown
Contributor

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

Security review: PR #17401, read floor planned to the header limit

No security issues found.

What changed

The merge-group verdict reader in pr-require-checks.yml now exports BABYSIT_READ_FLOOR_HEADER_LIMIT=1 (L6838). When that flag is set, babysit_gh._below uses the header's own limit for the read-floor share and skips the limit-cap clamp (babysit_gh.py L1108–L1127). The cold-read gate's awk now reserves floor × limit instead of floor × min(limit, cap) (L6868–L6869).

What I checked

  • Merge-hold path (trusted: pr-require-checks.yml ci-status hold step, babysit_gh.py). The change only sets how much API budget must be left before the reader stops. It does not change how the verdict is judged.
    • A reader that runs out of budget still fails closed. BABYSIT_READ_FLOOR_STOP=1 is unchanged (L6880). An unreadable or refused result is still judged by merge-holds.mjs, or exits 1 (L6880–L6913).
    • The cold gate still exits 1 when the rate limit or the floor value does not read. The floor !~ /^[0-9.]+$/ check is kept (L6869). A cold read with too little headroom still holds (L6873–L6876).
    • The PR narrows nothing about which FAIL or pass artifacts count. The pass filter is unchanged (path, event, head_branch == main, same-repository head; L6928–L6935).
    • So no untrusted PR author gets a merge they could not get before. At most, the reader spends more GITHUB_TOKEN reads before it fails closed.
  • Flag scope. The export sits inside the merge-group block, after the owner-PR reader, so it applies only to the rest of this run: step. It does not carry over to other steps, and it does not affect the shell guard's API_BUDGET_LIMIT_CAP or pr-merge's readers. Unset, _below behaves as before: the flag must equal exactly "1".
  • Trust controls. No token scope, trusted-actor list, kill switch, broker signer or untrusted-text path is touched. No plugin manifest is changed.
  • Instruction surfaces. None are deleted or softened. The schema and README edits are descriptive only.
  • PR context. It holds no embedded directives aimed at the lane.

Spend

The merge-group reader can use more GITHUB_TOKEN REST requests per hour: it keeps going down to 10% of the live limit (500 of 5,000) instead of 100. That is API quota, not a billed resource, so it is not a hold and not a finding.

critical-findings: 0

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The pr-verify verifier failed head 6a3d1f4d8c9d1cd7aeb8b03423681b4fb24dcd0d. What it wrote, as data:

What it wrote (25 lines)
Summary: PR #17401 links no issue, so the spec is its own trusted title and body (spec_kind
  pull-request). It cites owner decision D418. The diff does what the body describes. The new
  BABYSIT_READ_FLOOR_HEADER_LIMIT=1 flag makes babysit_gh's read floor 10% of the live header limit
  instead of github-token's 1,000-call limit-cap. ci-status's merge-group block exports the flag.
  The cold-read gate there now reserves floor × header limit, which is stricter (500 instead of
  100). Tests were updated, and every Test Bash/Test Python job passed on the judged head (e.g.
  https://github.com/melodic-software/claude-code-plugins/actions/runs/44474694541/job/135401137662).
  No capture was recorded. The change still blocks because it loosens a rate guard. At 5,000 header
  limit, the merge-group reader used to stop below about 4,100 requests left (the limit-cap clamp).
  It now stops only below 500. That weakens github-token's limit-cap rate cap, which the owner
  keeps. A spec can ask for a weakened check only through a closes/refs issue that names it, links
  the owner-decisions record line and quotes the owner after `verbatim:`. This PR has no such entry:
  it only says "owner decision D418 (Q227)". No other correctness or takeover-set problems were
  found.
- plugins/source-control/skills/babysit-prs/scripts/babysit_gh.py:1074: the new `capped` switch
  drops the github-token limit-cap clamp from the read floor. At a 5,000 header limit, the floor
  falls from about 4,100 requests left to 500, which loosens an owner-kept rate cap with no valid
  authorization. Keep the clamp, or get the authorization described in the PR body note.
- .github/workflows/pr-require-checks.yml:6838: `export BABYSIT_READ_FLOOR_HEADER_LIMIT=1` applies
  the loosened read floor to ci-status's merge-group verdict reader. Remove it unless the
  authorization described in the PR body note is added.
- PR body: 'owner decision D418 (Q227)' alone does not authorize a weakened check. Link an issue
  with `Closes #n` or `Refs: #n`. Its trusted body must name this read-floor/limit-cap loosening,
  hold a line link to D418 in melodic-software/architecture docs/owner-decisions.md (#L<line>), and
  quote the owner's words after `verbatim:` in double quotes.

This pull request leaves the merge queue, and ci-status holds it out while it carries pr-verify-failed. A pr-verify pass removes the label, at a new commit or at this same head: once a trusted person edits the body, and only trusted people have edited it since the fail, this head is judged again, so a fail on the body or the issues it links needs only the body fixed, no new commit.

@github-actions github-actions Bot added the pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it. label Nov 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 19, 2026
@github-actions github-actions Bot removed the pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it. label Nov 19, 2026
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

The unattended merge path enqueued this pull request at head 6a3d1f4d8c9d1cd7aeb8b03423681b4fb24dcd0d.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit 040b01a Nov 19, 2026
118 of 119 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the fix/merge-group-verify-header-limit branch November 19, 2026 12:35
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

The post-merge check verified merge commit 040b01a7dfe0943ea2e56de81d3cc31eee57c475; later checks count it verified from this comment.

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): merge-group verify reader floors reads at github-token's 1,000-call cap and ejects queue entries

1 participant