Skip to content

feat(OMN-10347): harden Receipt Gate to FAIL on [skip-*] tokens per Rule #10 - #986

Merged
jonahgabriel merged 2 commits into
mainfrom
jonah/omn-10347-harden-receipt-gate
May 1, 2026
Merged

jonahgabriel merged 2 commits into
mainfrom
jonah/omn-10347-harden-receipt-gate

Conversation

@jonahgabriel

Copy link
Copy Markdown
Contributor

Summary

Closes OMN-10347

  • validate_pr_receipts() now returns passed=False when any [skip-*] token is found without # skip-token-allowed: <receipt-id>
  • Previously [skip-receipt-gate:] returned passed=True, friction_logged=True (exit 0) — this violated Rule Refactor tech debt: Add Protocols and Pydantic models for type safety #10
  • Adds SKIP_TOKEN_PATTERN + ALLOWLIST_PATTERN constants; OVERRIDE_PATTERN becomes an alias for backwards compat
  • 20 new unit tests covering all cases

Problem

OMN-9608 remediation: GHA run 25132166746 accepted [skip-receipt-gate:] with only a warning. The escape hatch (# skip-token-allowed: <id>) continues to work — it must be paired with a non-empty receipt ID from the user.

DoD evidence

pytest (receipt gate tests)

tests/unit/validation/test_receipt_gate_adversarial.py — 18 passed
tests/unit/validation/test_receipt_gate_cli.py — 1 passed
tests/unit/validation/test_receipt_gate_workflow_shape.py — 7 passed
tests/unit/validation/test_receipt_gate_skip_token_hardening.py — 20 passed
Total: 46 passed

Key behavioral verification

  • [skip-receipt-gate: docs only] → passed=False ✓
  • [skip-deploy-gate: reason] → passed=False ✓ (regression)
  • [skip-anything: reason] → passed=False ✓
  • [skip-receipt-gate: ...] + # skip-token-allowed: USER-APPROVAL-2026-04-30-jonah → passed=True, friction_logged=True ✓
  • # skip-token-allowed: (empty id) → passed=False ✓

pre-commit

pre-commit run --all-files — all passed

…ule #10

validate_pr_receipts() previously returned passed=True (friction only)
when [skip-receipt-gate:] was present. Now any [skip-*] token returns
passed=False unless paired with a valid # skip-token-allowed: <id>.

Adds SKIP_TOKEN_PATTERN + ALLOWLIST_PATTERN constants; OVERRIDE_PATTERN
becomes an alias for backwards compat. Unit tests cover all cases:
[skip-receipt-gate:] alone FAILs, [skip-deploy-gate:] alone FAILs,
[skip-anything:] alone FAILs, paired with allowlist receipt PASSes
with friction, empty receipt-id still FAILs.
@coderabbitai

coderabbitai Bot commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@jonahgabriel has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 5 minutes and 1 second before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 706ae348-a2ae-40fd-b8e1-d82160b5c861

📥 Commits

Reviewing files that changed from the base of the PR and between d315c8c and c94ca43.

📒 Files selected for processing (4)
  • scripts/validation/validate_pr_receipts.py
  • src/omnibase_core/validation/receipt_gate.py
  • tests/unit/scripts/validation/test_validate_pr_receipts.py
  • tests/unit/validation/test_receipt_gate_skip_token_hardening.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jonah/omn-10347-harden-receipt-gate

Review rate limit: 0/5 reviews remaining, refill in 5 minutes and 1 second.

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

@jonahgabriel
jonahgabriel enabled auto-merge April 30, 2026 13:08
@jonahgabriel
jonahgabriel added this pull request to the merge queue Apr 30, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Apr 30, 2026
@jonahgabriel
jonahgabriel added this pull request to the merge queue Apr 30, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Apr 30, 2026
@jonahgabriel
jonahgabriel added this pull request to the merge queue Apr 30, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks May 1, 2026
@jonahgabriel
jonahgabriel added this pull request to the merge queue May 1, 2026
Merged via the queue into main with commit b07fa3e May 1, 2026
85 checks passed
@jonahgabriel
jonahgabriel deleted the jonah/omn-10347-harden-receipt-gate branch May 1, 2026 06:52
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