Skip to content

fix(rescue): automerge respects the risk gate — fail closed (#453)#454

Merged
hadamrd merged 1 commit into
trunkfrom
fix/453-rescue-respects-risk-gate
Jun 11, 2026
Merged

fix(rescue): automerge respects the risk gate — fail closed (#453)#454
hadamrd merged 1 commit into
trunkfrom
fix/453-rescue-respects-risk-gate

Conversation

@hadamrd

@hadamrd hadamrd commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Two live incidents in 12 hours on a live-prod repo: rescue PRs sourced
from risk:high issues auto-merged with zero review (#92 — whose
'has_tests' was a Dockerfile TEXT LINT — and #107). has_tests is a
quality hint, not consent.

A rescue PR still opens (work is preserved) but automerge is skipped
when the source issue carries the configured risk_gate label, with a
typed rescue_automerge_blocked_risk_gate event for operators. FAIL
CLOSED: label-fetch failure or a missing gate config also blocks —
automerge is the dangerous path; an API hiccup must not open it.

TDD: gated-never-automerges, ungated-with-tests still automerges
(behavior preserved), fetch-failure fails closed. Suite green.

Closes #453.

Co-Authored-By: Claude Fable 5 noreply@anthropic.com

Two live incidents in 12 hours on a live-prod repo: rescue PRs sourced
from risk:high issues auto-merged with zero review (#92 — whose
'has_tests' was a Dockerfile TEXT LINT — and #107). has_tests is a
quality hint, not consent.

A rescue PR still opens (work is preserved) but automerge is skipped
when the source issue carries the configured risk_gate label, with a
typed rescue_automerge_blocked_risk_gate event for operators. FAIL
CLOSED: label-fetch failure or a missing gate config also blocks —
automerge is the dangerous path; an API hiccup must not open it.

TDD: gated-never-automerges, ungated-with-tests still automerges
(behavior preserved), fetch-failure fails closed. Suite green.

Closes #453.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@hadamrd hadamrd merged commit 70d8981 into trunk Jun 11, 2026
@hadamrd hadamrd deleted the fix/453-rescue-respects-risk-gate branch June 11, 2026 13:03
hadamrd added a commit that referenced this pull request Jun 11, 2026
…sed (#455)

Live incident (getadaptiq #108, 2026-06-11): an adopted PR from a
risk:high issue auto-merged MID-HUMAN-REVIEW — while the operator was
running its acceptance evals, which then FAILED 2/6 deterministically.
Main carried a broken routing change for ~40 minutes until the review
repair landed.

_enable_automerge_for_adopted_prs documents itself as mirroring
_enable_automerge_for_reviewed_outcomes, but the mirror dropped
risk_gated_issues. Adopted PRs predate the tick's dispatch metadata, so
the gate now checks the ISSUE's labels fresh via the rescue gate's
helper (promoted public; one source of truth, fail-closed on fetch
failure), emitting orphan_pr_skipped reason=risk_gated.

This closes the LAST of the three merge conveyors: dispatch-path gate
(pre-existing), rescue-path gate (#454), adoption-path gate (this).

TDD: gated-adoption never merges, fetch-failure fails closed; all
existing adoption/rescue tests preserved. 44/44.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.

Rescue automerge bypasses the risk:high review gate

1 participant