Skip to content

Widen the stop-starting hook's queue read past 100 open PRs - #2191

Merged
remigiusz-antczak merged 1 commit into
mainfrom
land/fawin-wide-read
Nov 1, 2026
Merged

remigiusz-antczak merged 1 commit into
mainfrom
land/fawin-wide-read

Conversation

@remigiusz-antczak

Copy link
Copy Markdown
Collaborator

The stop-starting hook now counts ready PRs past the newest 100 (up to 500), so a gated gh pr create no longer passes when older ready PRs put the queue at the cap.

What changes

  • A first read of 100 PRs under the cap is followed by one --limit 500 read within the hook's remaining 15 s budget.
  • With PERUN_STOP_STARTING_LANES set, that read also lists files and the per-lane recount reuses it, so slow queues no longer starve the recount.
  • A failed or slow second read keeps the first verdict and prints one stderr line.
  • flow_alarm.py symptom counts on a 500-PR read and exits 2 if it fails.
  • The per-lane compare sets its timeout after its base lookup and is skipped under 2 s left.

Known limits

  • Past 500 open PRs, the newest 500 are counted.
  • Local git calls are unbudgeted and can start up to 15 s into the 20 s hook timeout.

Verification

Tests: run-ci-tests.sh --affected 6/6 (test_flow_alarm.py 99/99 among them); fake-gh latency probe on fictional repos, 6 cases, all as expected; size-ratchet ok; privacy gate clean.

🤖 Generated with Claude Code

The stop-starting hook counted ready PRs on the newest 100 open ones only, so with a longer queue the older ready PRs fell outside the count and a gated `gh pr create` could pass while the real queue was at or over the cap. When the first read holds 100 PRs and its count is under the cap, the hook now reads again with `--limit 500` within what is left of its 15 s budget. With PERUN_STOP_STARTING_LANES set, that read also lists each PR's files and the per-lane recount uses it instead of listing a third time, so a slow queue no longer spends the budget before the lane is counted. A failed or slow second read keeps the first read's verdict and prints one stderr line saying so. `flow_alarm.py symptom` counts on a 500-PR read, and the per-lane compare takes its timeout after its base lookup and is skipped when under 2 s are left.

Tests: run-ci-tests.sh --affected 6/6 (test_flow_alarm.py 99/99 among them); a latency probe on fictional repos with a fake gh (6 cases: lanes set and unset, per-call delays, a first read already at the cap, a wide read sleeping past the budget) gave the expected exit codes, gh call lists and stderr line; size-ratchet ok; privacy gate clean

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@remigiusz-antczak
remigiusz-antczak merged commit 1c29993 into main Nov 1, 2026
11 checks passed
@remigiusz-antczak
remigiusz-antczak deleted the land/fawin-wide-read branch November 1, 2026 12:33
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