Skip to content

#513 Gate The Approval Check On The Claude Label - #518

Merged
b-at-neu merged 2 commits into
devfrom
513-gate-the-approval-check-on-the-claude-label
Aug 19, 2026
Merged

#513 Gate The Approval Check On The Claude Label#518
b-at-neu merged 2 commits into
devfrom
513-gate-the-approval-check-on-the-claude-label

Conversation

@b-at-neu

@b-at-neu b-at-neu commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Closes #513

Summary

approval-check.yml required the approved pipeline label on every PR into dev, which no Dependabot PR and no manual human PR can ever satisfy — PR #296 has been unmergeable since 14 August for exactly this reason. Author-based detection isn't available (pipeline PRs are opened under an operator's gh token, so agent and human PRs share authors), so the claude label is the only usable signal.

The gate now applies only to PRs carrying claude, via a job-level if:. Everything else gets a skipped check run, which GitHub counts as a satisfied required check, so it merges on its own merits. The trigger is deliberately untouched — a workflow that never runs creates no check run, leaving the required check pending forever, which is the worse failure.

This inverts the failure mode from fail-closed to fail-open, accepted deliberately in the ticket: the gate's job is to stop mid-pipeline PRs merging early, not to enforce review universally. Because CI can't tell an unlabelled pipeline PR from a human one, the mitigations are upstream — impl-agent now passes --label "claude" at PR-creation time, and the cockpit gained an ungated-PR sweep so a dropped label surfaces instead of silently disabling the gate.

Changes

  • .github/workflows/approval-check.ymlif: contains(github.event.pull_request.labels.*.name, 'claude') on run-approval-check; rewritten header comment; new missing-approved error copy. on: (branches: [dev], all five types) and the job ID are unchanged — that ID is the registered required check.
  • .claude/agents/impl-agent.md--label "claude" in the step-6 gh pr create block, plus a line on why it is load-bearing.
  • .claude/docs/PIPELINE.mdclaude row in the PR-labels table; a CI merge gate paragraph in Permission rationale; a recovery-runbook row for a pipeline PR showing Skipped.
  • .claude/skills/pipeline/SKILL.md — ungated-PR sweep query in the tick block, its report line, a gate #N command, and the sweep folded into tick step 4 and status.
  • CLAUDE.mdclaude label added to the PR bullet in Commits, Branches, PRs.

Testing plan

This PR is its own primary test fixture: it carries claude, and pull_request workflows run from the merge ref, so the new condition is live here.

  • run-approval-check runs and fails on the missing approved label, showing the new error copy ("remove the 'claude' label and this check will skip").
  • Remove claude from this PR → the next event's run-approval-check reports Skipped, and GitHub's merge box no longer lists it as failing.
  • Re-add claude → the gate runs and fails again (proves labeled re-evaluation in both directions).
  • The check-run name in the merge box is still run-approval-check, with no "Expected — waiting for status" entry.
  • Add approved with claude present → the job passes with the "merge gate satisfied" line.
  • Add a blocking label (e.g. reviewing) alongside claude + approved → the job still fails, on the blocking label.
  • After merge into dev: comment @dependabot rebase on Bump prettier from 3.8.4 to 3.9.6 #505 (and Bump @prisma/adapter-pg from 7.8.0 to 7.9.1 #506, Bump tailwindcss from 4.3.2 to 4.3.3 #508, Bump prettier-plugin-tailwindcss from 0.8.0 to 0.8.1 #509) so their merge refs pick up the new workflow, then confirm run-approval-check reports Skipped and each PR is mergeable. (Bump prettier from 3.8.4 to 3.9.3 #296 from the ticket is already closed; Bump prettier from 3.8.4 to 3.9.6 #505 is its live successor, prettier 3.8.4 → 3.9.6.)
  • A dev → main release PR is unaffected: branches: [dev] means the workflow never runs there, and no pipeline label is involved.
  • In a cockpit session, status reports a pipeline-labeled PR that lacks claude on the ungated line; with claude present it is not reported.

Automated checks

  • npm run prettier:check — pass
  • npm run eslint:check — pass
  • npm run tsc:check — pass
  • npm run test:unit — 133 passed (5 files). The db project was skipped: no Postgres / DATABASE_URL in this worktree. This change touches no source, schema, or query code.

Notes

The gate exists to stop mid-pipeline PRs merging early, not to enforce
review universally, so PRs outside the pipeline now skip it — which
also unblocks Dependabot with no special case. Skipping at the job
level still reports the required check as `skipped`; filtering the
trigger would leave it pending forever.

Trade-off is fail-open: a pipeline PR missing `claude` loses its gate,
so impl-agent applies the label at `gh pr create` and the cockpit
sweeps for tracked PRs without it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@b-at-neu b-at-neu added the claude Will be worked on by Claude label Aug 19, 2026
@b-at-neu b-at-neu self-assigned this Aug 19, 2026
@vercel

vercel Bot commented Aug 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
aplio Ready Ready Preview Aug 19, 2026 10:28pm

@b-at-neu b-at-neu added claude Will be worked on by Claude ready for review PR ready for review agent reviewing Review agent working (in-flight) and removed claude Will be worked on by Claude ready for review PR ready for review agent labels Aug 19, 2026

@b-at-neu b-at-neu left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review — Cycle 1 · needs revision

1 open — 1 🟡 Low (see inline)

Comment thread .github/workflows/approval-check.yml Outdated
@b-at-neu b-at-neu added needs revision Review found issues that need fixing revising Revise agent working (in-flight) and removed reviewing Review agent working (in-flight) needs revision Review found issues that need fixing labels Aug 19, 2026
ENGINEERING.md §7 caps comments at two lines; PIPELINE.md's new "CI merge
gate" paragraph already carries the full rationale.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@b-at-neu

Copy link
Copy Markdown
Collaborator Author

Revision — Cycle 1

fixed R1-L1 · skipped none · 0cf9275

Header is now 2 new lines; the 3-line main/dev ruleset warning is preserved verbatim as the ticket's acceptance criteria require, leaving the file's header at its original 5 lines.

@b-at-neu b-at-neu added ready for review PR ready for review agent and removed revising Revise agent working (in-flight) labels Aug 19, 2026
@b-at-neu b-at-neu added reviewing Review agent working (in-flight) and removed ready for review PR ready for review agent labels Aug 19, 2026

@b-at-neu b-at-neu left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review — Cycle 2 · approved

0 open — R1-L1 resolved cleanly (header comment trimmed to 2 lines), no regressions introduced

@b-at-neu b-at-neu added approved Review passed, ready to merge and removed reviewing Review agent working (in-flight) labels Aug 19, 2026
@b-at-neu
b-at-neu merged commit 95a5388 into dev Aug 19, 2026
10 of 15 checks passed
@b-at-neu
b-at-neu deleted the 513-gate-the-approval-check-on-the-claude-label branch August 19, 2026 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Review passed, ready to merge claude Will be worked on by Claude

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gate the Approval Check on the claude Label and Skip It Otherwise

1 participant