fix(review): include violation count and ban proximity in moderation escalation comments#7640
Merged
Merged
Conversation
…escalation comments A mod:warning or mod:banned label alone didn't tell anyone reading the closure how many violations were on record or how close a contributor was to an automatic ban. applyModerationEscalationForRule now posts a follow-up comment stating the current violation count, the configured ban threshold, whether a blacklist entry was actually added (vs. auto-blacklist being disabled or a write failure), and the decay window when one is configured.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7640 +/- ##
==========================================
- Coverage 88.51% 88.50% -0.02%
==========================================
Files 724 724
Lines 75992 76004 +12
Branches 22618 22622 +4
==========================================
+ Hits 67263 67264 +1
- Misses 7681 7688 +7
- Partials 1048 1052 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mod:warning/mod:bannedlabel alone doesn't tell anyone reading the closure how many violations are on record or how close a contributor is to an automatic ban.applyModerationEscalationForRulenow posts a follow-up comment stating the current violation count, the configured ban threshold, whether a blacklist entry was actually added (vs. auto-blacklist being disabled or a write failure), and the decay window when one is configured.buildModerationEscalationCommenthelper, directly unit tested for every tier/blacklisted/decay combination.Test plan
npx vitest run test/unit/agent-action-executor.test.ts— 172/172 passingDA/BRDAagainst the diff hunks), including a real D1-write-failure test (vi.spyOnonenv.DB.prepare) rather than an ignore annotationnpm run test:coverage(full, unsharded) — all green, no regressionsnpx tsc --noEmitcleannpm audit --audit-level=moderateclean