Skip to content

fix(verify-live): retry capacity 503s, skip closed PRs, report the summary - #270

Merged
senamakel merged 3 commits into
mainfrom
canary-retry-open
Oct 30, 2026
Merged

senamakel merged 3 commits into
mainfrom
canary-retry-open

Conversation

@senamakel

Copy link
Copy Markdown
Member

What changed

The first production canary run after the #265/#266/#268 deploy turned up three bugs in scripts/verify-live.sh canary:

  1. Closed PRs. Three of the default PRs had merged, so the server declined them in about 1.5s as "Not reviewed". That's a false failure that says nothing about the server. The canary now queues only open, non-draft PRs, prints skip #N: MERGED, and exits 2 if none are left. The default set drops the merged PRs, and the doc table is updated.
  2. Capacity 503s. /admin/reviews admits a manual review only while a review slot is free (with_manual_review_admission → ReviewCapacityFull → 503). 4 of 8 requests in the burst were refused and never ran. Each PR is now dispatched in its own retry loop: it retries every 10s on 503 until the deadline and fails on any other status. Latency is measured from the moment the server accepted each PR.
  3. Summary. The percentile loop ended in [ … ] && echo. A false test as the last command killed the run under set -e/pipefail before the summary and the PASS/FAIL line printed. It now uses if, pct ignores blank input, and dispatchers still retrying at the deadline are stopped.

Behaviour change

None in the server. This is the operator script and its doc only.

Verification

senamakel and others added 3 commits October 30, 2026 16:33
The live canary now filters the PR set down to open, non-draft pull requests before queueing, since merged or draft PRs are declined immediately and would otherwise show up as misleading "Not reviewed" failures. Enqueue requests are retried while the admin route answers 503, with latency measured from the moment the server accepts each request rather than from the end of the burst, and the percentile summary no longer aborts under set -e when a test fails as the loop's last command.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…s at deadline

The percentile helper now skips empty input lines so blank output no longer skews the computed value. The canary run also terminates any dispatcher jobs still retrying at the deadline before collecting logs, so lingering retries don't pollute the results.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The canary tier now filters its PR set down to open pull requests before queueing, since a merged PR is declined instantly and would read as a false failure, and it retries the admin route's 503 so bursts larger than review_concurrency wait their turn instead of aborting. The default PR set drops the merged entries and the queueing log line moved after filtering so it reports the count actually queued.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@tinysweeper

tinysweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

Reviewed head: 3d01d4b87dd7c1f99c5f5e64114358824a923fcb

Verdict: Ready for maintainer review · Priority: none
Coverage: Reviewed 2 of 2 files.
Pull request purpose (title): fix(verify-live): re…

Diagnostics and supporting details

Full summary

Pull request purpose (title): fix(verify-live): retry capacity 503s, skip closed PRs, report the summary. Tiny Sweeper completed its review; deterministic results follow.

Review snapshot

Change surface Files Review signal Count
Production 1 Active findings 0
Tests 0 Noted findings 0
Documentation 1 Resolved findings 0
Configuration 0 Pending checks/questions 0

Completeness: Complete
Test assessment: No supported feature-to-test mapping was available; this does not mean tests are absent or passed.

Features

  • Added — Skip closed and draft PRs before queueing: A merged PR is no longer queued and declined in about a second, so it can no longer be reported as a "Not reviewed" false failure; the run reports each skip and exits 2 rather than silently queueing nothing when the set has no open PRs. (scripts/verify-live.sh run_canary() {, docs/modules/server/verify-live.md newest open PRs. The default set is chosen to cover each failure seen on)
  • Modified — Latency measured from server acceptance: `sent_at` is populated from the per-PR ack file written when the POST returns 2xx, so enqueue-to-verdict latency reflects the moment the server took the review rather than the moment the request was launched, which matters now that individual PRs may wait through several 503 retries. (scripts/verify-live.sh run_canary() {)
  • Added — Stop dispatchers still retrying at the deadline: Background retry loops that never got accepted are killed and waited on before the log and summary are collected, so they cannot outlive the measurement window or interfere with the final tally. (scripts/verify-live.sh run_canary() {)
  • Modified — Percentile collection no longer aborts the run: The settled-timestamp loop uses an `if` block instead of a trailing `[ … ] && echo`, so under `set -e`/`pipefail` an empty result no longer kills the script before the p50/p95 line and the PASS/FAIL assertion are printed. (scripts/verify-live.sh)
  • Modified — `pct` ignores blank input: Blank lines no longer shift the median or high percentile, and empty input still yields `-`, keeping the reported latency figures correct when some PRs never settle. (scripts/verify-live.sh, scripts/verify-live.sh done)
  • Modified — Reduced default canary set and matching doc table: The default set drops the merged PRs and now covers only failures still reproducible, with the doc table and the script comment rewritten to say merged PRs are skipped and `--newest N` supplies fresh traffic. (docs/modules/server/verify-live.md newest open PRs. The default set is chosen to cover each failure seen on, docs/modules/server/verify-live.md Anything that depends on index state (the stale-index gate, cache locks) is, scripts/verify-live.sh)

Tests

No supported feature-to-test mapping was produced. Test execution is not inferred.

Findings

No active actionable findings.

Before merge

None.

Agent review details

critique

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: Reviewed both changed files with no findings; the only caveat raised is that the code index lags this pull request, so retrieved context may be stale.
  • Lane summary: Reviewed 2 files; 0 findings. _The code index is behind this pull request (indexed at `b2539f556ac5`), so retrieved context may be out of date._

security

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The admin token remains on the box, read from `.env` and fed to `curl` via stdin, with no new untrusted input path or permission widening; the change adds only retry, skip and timestamp bookkeeping around the existing admin call.
  • Lane summary: The change is confined to the live-verification helper: it prunes merged/closed pull requests from the canary set, retries the admin endpoint on 503 until a deadline, records acceptance timestamps for per-PR latency, and fixes the pipefail/errexit abort in the percentile calculation. The admin token still stays on the box and is fed to curl via stdin, and no new untrusted input path or permission widening appears; I found nothing that would fail or misbehave for a reachable input. 1 file was not security-reviewed: docs/modules/server/verify-live.md (prose or tabular data). _The code index is behind this pull request (indexed at `b2539f556ac5`), so retrieved context may be out of date._

tests

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: This is a live-verification shell harness plus its doc page: the canary now skips non-open/draft PRs, retries the admin route's 503 until the timeout instead of firing the whole burst at once, measures latency from acceptance rather than launch, and fixes two robustness bugs in `pct`/the p50-p95 collector. I found no behaviour that fails for a reachable input, and nothing in the repository's rules requires an in-crate test for a script that needs a deployed server and real PRs — the new retry and skip paths are exercised only by a live run, which the diff's own usage text describes, so there is nothing for a test in this diff to pin. _The code index is behind this pull request (indexed at `b2539f556ac5`), so retrieved context may be out of date._

commits

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: No sensitive content found in the committed files.
  • Lane summary: No sensitive content in committed files. _The code index is behind this pull request (indexed at `b2539f556ac5`), so retrieved context may be out of date._

description

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The description matches the diff: the skip line and exit-when-empty, the per-PR 503 retry keyed on the ack timestamp, the deadline stop of stragglers, the `pct` blank-line fix and the `if`-based percentile loop are all present and named in the body. The one claim the diff cannot show — the earlier run's 4-of-8 rejections — is history rather than an overstatement of the code.
  • Lane summary: The description matches the diff: the canary now filters to open, non-draft PRs with a `skip #N: STATE` line and `die` when none remain, dispatches each PR in its own 503-retry loop keyed on the `acks/` timestamp file, stops stragglers at the deadline, and the p50/p95 loop no longer ends in a false test — plus the `pct` blank-line fix and the updated default set/doc table, all of which the body names. I found no reachable input where the changed script misbehaves and no repo rule broken; the one unverified claim (the earlier run's 4-of-8 rejections) is history the diff cannot show, and the description does not overstate what the code does. _The code index is behind this pull request (indexed at `b2539f556ac5`), so retrieved context may be out of date._
Evidence and run details
  • Models: ladder/vectors-oai3, deepseek-v4.1-flash, deepseek-v4-flash
  • Spend: $0.000408
  • Completion usage: incomplete; some provider completion costs are unavailable.
  • Tokens: 236250 input · 76135 output · 74959 cached · 294 embedding
  • Updated: 2026-10-30T16:37:05Z
Head State Pass summary
3d01d4b87dd7 ready for maintainer review 0 active finding(s), 0 resolved finding(s) (at 2026-10-30T16:37:05Z)

tinysweeper 0.1.2

@coderabbitai

coderabbitai Bot commented Oct 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 2 billable files and costs up to $0.50.

Or wait 31 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f696b8fb-d56e-4859-a146-3e85bddff4da
Commits

Reviewing files that changed from the base of the PR and between b48b252 and 3d01d4b.

Files selected for processing: 2
  • docs/modules/server/verify-live.md
  • scripts/verify-live.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@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-30T16:36:47.615326Z 3d01d4b 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.

@tinysweeper tinysweeper 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.

tinysweeper found nothing blocking. Approving.

Diagnostics

Total spend: $0.0004

@tinysweeper tinysweeper Bot added the priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect. label Oct 30, 2026
@senamakel
senamakel merged commit b6accad into main Oct 30, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant