Skip to content

fix(pr-policy): make metadata checks advisory, block only on clinical governance#967

Merged
BigSimmo merged 2 commits into
mainfrom
claude/pr-policy-tests-failing-5sejm2
Jul 20, 2026
Merged

fix(pr-policy): make metadata checks advisory, block only on clinical governance#967
BigSimmo merged 2 commits into
mainfrom
claude/pr-policy-tests-failing-5sejm2

Conversation

@BigSimmo

Copy link
Copy Markdown
Owner

Summary

  • Follow-up to fix(pr-policy): stop over-flagging presentation-only UI PRs as clinical-risk #965. The PR Policy check was still hard-failing PRs for metadata nits (missing/empty Summary or Verification, no verify:ui evidence, incomplete Risk and rollout). This makes those advisory warnings instead of blocking failures, so the check stops getting in the way.
  • evaluatePullRequestPolicy() now returns a warnings[] array alongside errors[]:
    • errors[] (blocking): only a genuine clinical-risk PR with a missing or incomplete ## Clinical Governance Preflight fails the check.
    • warnings[] (advisory): title quality, ## Summary, ## Verification, UI verify:ui evidence, and ## Risk and rollout are surfaced as warnings that never fail the check or block a merge.
  • The workflow (.github/workflows/pr-policy.yml) now emits warnings via core.warning and only calls core.setFailed for blocking clinical-governance errors. The run summary reports both counts.

Verification

  • npm run check:pr-policy — self-test (updated to assert the block-vs-warn split) + check-pr-policy-workflow.mjs workflow-contract guard both pass.
  • npx eslint scripts/pr-policy.mjs clean; npx prettier --check clean on both changed files.
  • Self-tests lock the contract: a bare body on non-clinical files → ok: true with warnings; a clinical-risk PR (src/lib/answer-synthesis.ts) with no governance section → ok: false.
  • Verification not run: full verify:pr-local / verify:ui — this is a CI metadata-policy script only, with no app runtime, UI, or provider surface; the targeted self-test + lint above are the relevant gate.

Risk and rollout

  • Risk: low. Deliberately loosens the gate so only clinical-governance gaps block; all other metadata expectations become non-blocking nudges. The clinical-safety block itself (narrowed in fix(pr-policy): stop over-flagging presentation-only UI PRs as clinical-risk #965) is unchanged.
  • Rollback: revert this commit; blocking behavior for the advisory items returns.
  • Provider or production effects: None. pr-policy.yml runs from github.workflow_sha (base/main), so the new behavior applies to open PRs only after this merges to main.

Notes

  • No change to requiredClinicalGovernanceItems (still exported for the dormant sync-pr-policy-body job) or to the workflow's trusted-checkout contract, so scripts/check-pr-policy-workflow.mjs stays green.

🤖 Generated with Claude Code


Generated by Claude Code

Follow-up to the classification narrowing: make the PR Policy check stop
blocking PRs for metadata nits. evaluatePullRequestPolicy now returns a
warnings[] array alongside errors[]:

- errors[] (blocking): only a clinical-risk PR with a missing or incomplete
  Clinical Governance Preflight fails the check.
- warnings[] (advisory): title, Summary, Verification, UI verify:ui, and Risk
  and rollout expectations are surfaced as warnings that never fail the check
  or block a merge.

The workflow emits warnings via core.warning and only calls setFailed on
blocking clinical-governance errors. Self-tests updated to assert the
block-vs-warn split.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014MG846R4YM51NojUf9XthF
@supabase

supabase Bot commented Jul 20, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@BigSimmo, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 29 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 57b2720e-680b-477b-809a-4b53c1ff53c6

📥 Commits

Reviewing files that changed from the base of the PR and between 55aa3df and 8eb8447.

📒 Files selected for processing (2)
  • .github/workflows/pr-policy.yml
  • scripts/pr-policy.mjs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/pr-policy-tests-failing-5sejm2

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

@BigSimmo
BigSimmo marked this pull request as ready for review July 20, 2026 08:11
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@BigSimmo
BigSimmo enabled auto-merge (squash) July 20, 2026 08:11
@BigSimmo
BigSimmo merged commit 7265e9d into main Jul 20, 2026
16 checks passed
@BigSimmo
BigSimmo deleted the claude/pr-policy-tests-failing-5sejm2 branch July 20, 2026 08:13
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.

2 participants