Skip to content

fix(reviewer): require the full configured check set present + green before merge (guard D) - #282

Merged
ProtocolWarden merged 1 commit into
mainfrom
feat/guard-d-required-checks
Jun 13, 2026
Merged

fix(reviewer): require the full configured check set present + green before merge (guard D)#282
ProtocolWarden merged 1 commit into
mainfrom
feat/guard-d-required-checks

Conversation

@ProtocolWarden

Copy link
Copy Markdown
Owner

The hole #272 + Guard C left open

Those close "merge on red CI", "merge while checks run", and "merge on a head with no checks at all". But a required check in a separate workflow registers slightly after the main CI workflow. In that window it's invisible to both get_failed_checks (no check-run yet) and get_incomplete_checks (not a run yet), so the gate sees the main-workflow checks completed+green and merges before the late check ever runs.

That is exactly how #277/#278 reached main with a red audit job — the very check that surfaces the new OC12/OC13 divergence guards. So without this, a future PR that trips those guards could merge anyway. This is the keystone that makes Guards A/B actually block rather than just report.

Fix

  • New per-repo required_checks config (RepoConfig). A check name satisfies an entry if it contains the entry (case-insensitive), matching ci_ignored_checks semantics.
  • The primary self-review gate and the WO-3 no-progress merge path now require every configured required check to be present and passing on the current head before treating CI as green. failed is already empty at the gate, so a required check is satisfied iff it appears in the completed set; a missing one defers via the existing ci_wait_cycles bound (escalating ci_never_settled if it never shows).

Activation is per-repo via required_checks (e.g. ["audit"]) in the local config; default empty → no behaviour change for unconfigured repos. (I'll set required_checks: [audit] for OperationsCenter in the live local config once this merges.)

Tests

+2: required check absent → defer (no self-review, no merge, wait counter advanced); required check present+green → proceeds through self-review LGTM to merge. Mock repo_cfg factories default required_checks=[]. Full reviewer suite passes (175); ruff clean; audit clean.

🤖 Generated with Claude Code

…before merge (guard D)

#272 and Guard C close "merge on red CI", "merge while checks run", and "merge on
a head with no checks". But a hole remained: a required check that lives in a
SEPARATE GitHub Actions workflow registers slightly later than the main CI
workflow. In that window it is invisible to both get_failed_checks (no conclusion
yet — actually no check-run at all) and get_incomplete_checks (not a check-run
yet), so the gate sees the main-workflow checks completed+green and merges before
the late check ever runs.

That is exactly how #277/#278 reached main with a red `audit` job — the very check
that surfaces the new OC12/OC13 divergence guards. Without this, a future PR that
trips those guards could merge anyway.

Fix:
- New per-repo `required_checks` config (RepoConfig). A check name satisfies an
  entry if it contains the entry (case-insensitive), matching ci_ignored_checks.
- The primary self-review gate and the WO-3 no-progress merge path now require
  every configured required check to be PRESENT and passing on the current head
  before treating CI as green. `failed` is already empty at the gate, so a required
  check is satisfied iff it appears in the completed set; a missing one defers via
  the existing ci_wait_cycles bound (escalates ci_never_settled if it never shows).

Activate per repo by setting required_checks (e.g. ["audit"]) in the local config;
default is empty (no behaviour change for unconfigured repos).

+2 gate tests (required check absent → defer; present+green → proceeds to merge).
Mock repo_cfg factories default required_checks=[].

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ProtocolWarden
ProtocolWarden merged commit 23fc43b into main Jun 13, 2026
17 checks passed
@ProtocolWarden
ProtocolWarden deleted the feat/guard-d-required-checks branch June 13, 2026 22:06
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