fix(commands): require an open, non-draft PR for chat's pr_author grant - #5094
Conversation
The per-PR chat rate-limit counter (repoFullName#issueNumber#command) never checks PR state and never resets -- a contributor could keep a fresh chat allowance indefinitely by reopening/reusing a closed PR or spamming cheap draft PRs, since each PR number gets its own independent, permanent counter. Requires the PR to be open and not draft, enforced in evaluateCommandAuthorization alongside the existing commandRateLimitPolicy: hold requirement. Scoped only to the pr_author tier; maintainers/collaborators are unaffected regardless of PR state. Closes #5092
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | 2b0780d | Commit Preview URL Branch Preview URL |
Jul 11 2026, 02:39 PM |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5094 +/- ##
=======================================
Coverage 94.20% 94.21%
=======================================
Files 470 470
Lines 39736 39741 +5
Branches 14501 14504 +3
=======================================
+ Hits 37435 37440 +5
Misses 1645 1645
Partials 656 656
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-11 14:45:03 UTC
⏸️ Suggested Action - Manual Review
Review summary Blockers
Nits — 6 non-blocking
Concerns raised — review before merging
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
|
An AI reviewer flagged a likely defect, but its confidence was below this repository's configured close-confidence floor, so this is held for a maintainer to confirm instead of closing automatically. Resolve the flagged defect (see the review notes), or ask a maintainer to override. |
Summary
repoFullName#issueNumber#command) never checks PR state and never resets. Without this fix, a contributor could keep a fresh chat allowance indefinitely by reopening/reusing a closed PR or opening cheap draft PRs -- each PR number gets its own independent, permanent counter.pr_authormatch onchatto authorize, enforced inevaluateCommandAuthorizationalongside the existingcommandRateLimitPolicy: holdrequirement from Allow PR authors to use @gittensory chat when rate limiting is active #5084.pr_authortier -- maintainers/collaborators are completely unaffected regardless of PR state (the check exists to bound a less-trusted population, not to restrict already-trusted roles).packages/gittensory-engine/src/settings/command-authorization.tsto keeptest:engine-paritygreen.Note: this doesn't by itself bound "open N genuinely-open non-draft PRs and burn the allowance on each" -- that's a separate, already-existing lever (
contributorOpenPrCap), not duplicated here.Closes #5092
Test plan
npm run typechecknpm run test:coverage(14395 passed, 0 failed)queue-5.test.ts: a contributor's own closed PR and own draft PR both deny chat even withcommandRateLimitPolicy: hold, with the distinctpr_author_requires_open_praudit reasonnpm run command-reference:check/npm run docs:drift-check