Skip to content

fix(review): include violation count and ban proximity in moderation escalation comments#7640

Merged
JSONbored merged 1 commit into
mainfrom
fix/mod-warning-violation-context
Jul 21, 2026
Merged

fix(review): include violation count and ban proximity in moderation escalation comments#7640
JSONbored merged 1 commit into
mainfrom
fix/mod-warning-violation-context

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • A mod:warning/mod:banned label alone doesn't tell anyone reading the closure how many violations are on record or how close a contributor is 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.
  • New pure buildModerationEscalationComment helper, directly unit tested for every tier/blacklisted/decay combination.

Test plan

  • npx vitest run test/unit/agent-action-executor.test.ts — 172/172 passing
  • Coverage scoped to the diff: 100% of changed lines and branches covered (verified via lcov DA/BRDA against the diff hunks), including a real D1-write-failure test (vi.spyOn on env.DB.prepare) rather than an ignore annotation
  • npm run test:coverage (full, unsharded) — all green, no regressions
  • npx tsc --noEmit clean
  • npm audit --audit-level=moderate clean

…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.
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@JSONbored JSONbored self-assigned this Jul 21, 2026
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.50%. Comparing base (4d9b9d1) to head (7f17edd).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

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     
Flag Coverage Δ
shard-1 35.71% <0.00%> (-0.01%) ⬇️
shard-2 32.95% <0.00%> (-0.03%) ⬇️
shard-3 28.61% <100.00%> (-0.03%) ⬇️
shard-4 40.52% <35.71%> (-0.11%) ⬇️
shard-5 33.98% <0.00%> (-0.02%) ⬇️
shard-6 35.92% <0.00%> (-0.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/services/agent-action-executor.ts 97.13% <100.00%> (+0.11%) ⬆️

... and 2 files with indirect coverage changes

@JSONbored
JSONbored merged commit be9a7dd into main Jul 21, 2026
16 checks passed
@JSONbored
JSONbored deleted the fix/mod-warning-violation-context branch July 21, 2026 05:57
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant