Forge review launch — a scheduled run hands its pull request to a reviewing bot
A bot that opens pull requests on a schedule (the posture bot of ADR-177, Yellow Card) hands each one to the bot that judges dependency pull requests (Vetty). That reviewer is wired to Renovate's and Dependabot's authors, and the webhook ignores the events the iterion App itself sends. Neither filter is widened. Instead, the run that opened the pull request asks the server, explicitly, to launch the review:
POST /api/v1/forge/launch-review
X-Iterion-Run: <the run's forge_publish_token>
{"run_id": "<run id>", "repo": "owner/name", "pr_number": 12, "head_sha": "<40 hex>", "bot": "dep-update-guard"}Who may ask
The capability review_launch is minted only on a repo-bound schedule's grant, for a bot whose manifest names the bots it may launch:
forge:
review_bots: [dep-update-guard]The launch var forge_review_launch_url names the endpoint. A pull-request, API or board launch never carries the capability. The kill switch forge_publish_mutations (anything but true) strips it, since a launch starts a paid run.
What the server checks, in order
Each refusal is typed and decided before anything is launched:
| check | refusal |
|---|---|
the bot is in the grant's review_bots | review_launch_bot_outside_grant |
| the run was not itself launched by a review launch (no chain) | review_launch_chain |
| the run's own schedule row still binds the grant: it launched the run, still has the same team, integration and bot, and is enabled | review_launch_schedule_row |
the row's max_review_launches (default 5) is a valid cap. It is a reserved name: no manifest defaults it, so only a team admin sets it on the row | review_launch_cap_invalid |
the bot is enabled on the repository's integration, its webhook is live (not disabled, not retired) and launches it, and its rule claims pull-request events. A webhook without bot_rules launches one bot on a pull request, so only that bot is accepted. Its author filters are not consulted: this lane is the authenticated exception to them | review_launch_bot_not_enabled |
the pull request reads, and is open, on the grant's repository (not a fork), opened by the connection's own App identity (<slug>[bot]), on a branch under iterion/<the run's bot>/, and created after the run started | review_launch_pr_unreadable / review_launch_pr_not_eligible |
| it is at the head the request names | review_launch_head_moved |
| this grant has not launched the same (pull request, head, bot), and is under its cap | review_launch_repeat / review_launch_cap_reached |
Only GitHub App connections are served (review_launch_unsupported): the App's identity is what proves who opened the pull request.
What is launched
The bot is launched through the same tail a pull-request webhook takes. It gets the same vars (pr_url, head_sha, source_branch, pr_author, the integration's and the operator's launch vars, gate_context included), the same publish grant, and the same admission. Its idempotency key is the pull-request webhook lane's own (gh|team|webhook|repo|PR|head), so the bot reviews a head once, whichever automatic door fired it: a second door answers review_launch_duplicate with the run already reviewing it, and that call takes no slot of the cap. A claim row that names no run is not a review: the answer is review_launch_in_flight while that launch is under way, and review_launch_stranded once it is older than the launch window (10 min). A human command (/vetty on the pull request) keys on its comment instead: it is a deliberate re-review, and it runs.
The run fetches the pull request's branch, as every trusted pull-request lane does, and its verdict is pinned to the commit it read (audited_sha). If the branch moved after the call, the run reviews the new tip, and the server refuses any verdict whose audited commit is no longer the head. The commit is not pinned at the fetch: a pin on a trusted launch is refused by the single-process run service, which cannot persist it.
The launched run carries review_launched_by=<the asking run> in its inputs: the provenance, and what the chain guard reads.
| answer | meaning |
|---|---|
200 {"launched": true, "run_id": …} | launched |
200 {"code": "review_launch_duplicate", "run_id": …} | that head is already reviewed by the bot, by the run named |
409 review_launch_in_flight | another door's launch of this head is under way and names no run yet: ask again later (a later run of the bot) |
409 review_launch_stranded | an earlier launch of this head names no run and is no longer in flight (it died on the way, or its run is unknown): no automatic door relaunches the head, a person can (/vetty) |
422/502 review_launch_not_started | the tail started no run (an admission denial, a launch error proven to start nothing). The claim is released, so the next call may retry |
503 review_launch_claim_unreleased | the tail started no run, but the claim could not be released: the head answers review_launch_repeat through this grant |
502 review_launch_uncertain | the launch failed after its run may have started (a persisted run, a publish that may have landed). The claim keeps its slot, and the head is not relaunched through this grant |
Every launch is audited (forge.review.launch) with the pull request, the head, the bot, the outcome and the launched run.
What stays as it was
- The webhook still launches nothing on a pull request the App sends:
TestGitHubWebhook_IterionBotPRSkipsReview. - The reviewer's author allowlist is unchanged; only this authenticated call reaches past it, for this bot's own pull requests.
- Revi is not launched by this lane. The reviewer it launches claims the repository's
gate_contextlike any other gating bot.
