Skip to content

Guard PR bodies against premature payment-status wording#1168

Open
yanyishuai wants to merge 1 commit into
ramimbo:mainfrom
yanyishuai:bounty-1107-payment-language
Open

Guard PR bodies against premature payment-status wording#1168
yanyishuai wants to merge 1 commit into
ramimbo:mainfrom
yanyishuai:bounty-1107-payment-language

Conversation

@yanyishuai

Copy link
Copy Markdown

Summary

Implements proposed work for #1107.

  • Add scripts/public_payment_language.py helper to flag deprecated Payout boundary wording, legacy withdrawable phrasing, and reserved paid/settled/received/withdrawable claim assertions.
  • Extend scripts/submission_quality_gate.py with a payment_status_language advisory check.
  • Add scripts/check_pr_payment_language.py and wire it into PR CI via .github/workflows/ci.yml.
  • Document the rule in docs/agent-guide.md with focused tests.

Test plan

  • ests/test_public_payment_language.py
  • submission quality gate regression for payout-boundary warning
  • CI fails on PR bodies with reserved payment/status wording

Related to #1107

@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 43 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: ASSERTIVE

Plan: Pro Plus

Run ID: e58a733e-3860-4b3b-aeb2-0b3941a2f47c

📥 Commits

Reviewing files that changed from the base of the PR and between 3bc87d2 and ccd6d1e.

📒 Files selected for processing (5)
  • docs/agent-guide.md
  • scripts/check_pr_payment_language.py
  • scripts/public_payment_language.py
  • scripts/submission_quality_gate.py
  • tests/test_public_payment_language.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@piaigmt piaigmt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I found a current-head blocker before this can merge.

PR #1168 adds scripts/public_payment_language.py, scripts/check_pr_payment_language.py, and wires the advisory into scripts/submission_quality_gate.py, but the branch now imports a helper that is not present in the PR or in main:

from scripts.gh_collection_caps import (
    GITHUB_COLLECTION_CAP_FOOTER,
    describe_github_collection_cap,
)

At head 834584f072206c8b889cab88cf00a43086f49381, scripts/gh_collection_caps.py is absent, so CI fails during test collection before the new payment-language tests can run:

ERROR tests/test_submission_quality_gate.py
scripts/submission_quality_gate.py:24: in <module>
    from scripts.gh_collection_caps import (
E   ModuleNotFoundError: No module named 'scripts.gh_collection_caps'

Validation/evidence:

  • GitHub check Quality, readiness, docs, and image checks is failing on run 28321418553, job 83903905254 with the import error above.
  • Checked out PR #1168 at head 834584f072206c8b889cab88cf00a43086f49381.
  • git diff --name-only origin/main...HEAD lists the expected seven files, but not scripts/gh_collection_caps.py.
  • test -f scripts/gh_collection_caps.py fails locally on the PR branch.

This should be fixable either by adding the missing shared helper file to this PR or by removing/replacing the new import with logic that already exists on main. Until then the PR is not merge-ready because the repository test suite cannot collect.

Refs #1009

@yanyishuai yanyishuai force-pushed the bounty-1107-payment-language branch from 834584f to ccd6d1e Compare June 30, 2026 14:12

@qingfeng312 qingfeng312 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Reviewed current head ccd6d1e79366dbad26481c41ed723c4a48c61ede.

This is not merge-ready. The hosted Quality, readiness, docs, and image checks job is failing on this head, so the new payment-language guard cannot be treated as validated yet.

There is also a scope mismatch in the docs update: docs/agent-guide.md adds account path identifier rules and URL-encoded account rejection text, but this PR is for #1107 payment/status wording. That account-path content belongs with the account identifier hardening work, not this payment-language guard. Please remove that unrelated doc block and keep the docs focused on the new neutral submission-status/payment-language rule.

@piaigmt piaigmt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Follow-up review at updated head ccd6d1e79366dbad26481c41ed723c4a48c61ede.

My earlier review requested changes on head 834584f072206c8b889cab88cf00a43086f49381 because scripts/submission_quality_gate.py imported the missing scripts.gh_collection_caps module and CI failed during pytest collection. That blocker is partially addressed in the new head (the missing import is gone), but the branch is still not merge-ready: the touched scripts/submission_quality_gate.py file now fails ruff import ordering.

Current-head evidence:

$ uv venv --python 3.12 .venv
$ . .venv/bin/activate
$ uv pip install pytest ruff pydantic
$ ruff check scripts/check_pr_payment_language.py scripts/public_payment_language.py scripts/submission_quality_gate.py tests/test_public_payment_language.py
I001 [*] Import block is un-sorted or un-formatted
  --> scripts/submission_quality_gate.py:18:1
18 | / from scripts.api_host_args import public_api_host
19 | | from scripts.bounty_refs import BOUNTY_REF_RE, GITHUB_LINKED_ISSUE_RE, LEADING_BOUNTY_REF_RE
   | |____________________________________________________________________________________________^
help: Organize imports

Found 1 error.

GitHub's current Quality, readiness, docs, and image checks job is also failing on this head (28450943387 / 84312721817), matching the local ruff blocker.

I did not proceed to pytest after the lint failure because this is an auto-fixable merge gate failure on a touched file. Scope remains limited to docs, payment-language scripts, scripts/submission_quality_gate.py, and tests; no wallet, treasury, payout execution, secrets, or mutation path is changed by this review itself. Once the import block is sorted, this should be quick to re-check with the same ruff command plus the targeted payment-language/submission-quality tests.

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.

3 participants