Skip to content

Conversation

@konard
Copy link
Member

@konard konard commented Sep 13, 2025

Summary

This PR implements a voting countdown system to prevent users from responding with "-" to another "-" comment within a specified time period (5 minutes by default), as requested in issue #62.

Key Features

  • Countdown mechanism: Users must wait 5 minutes between "-" votes to prevent spam/harassment
  • Per-user tracking: Each user has their own countdown timer
  • Persistent storage: Uses FileStorage to remember voting timestamps across bot restarts
  • Warning messages: Bot posts informative comments when users violate the countdown rule
  • Non-disruptive: Only affects "-" comments, doesn't interfere with other bot functionality

Implementation Details

New Components:

  • VotingCountdownTrigger: Main logic for detecting and enforcing countdown rules
  • GitHubStorage.GetIssueComments(): Method to retrieve issue comments for analysis
  • Voting timestamp tracking using FileStorage with format: voting_countdown_tracking_{repoId}_{issueNumber}

Integration:

  • Added trigger to IssueTracker in Program.cs alongside existing triggers
  • Configurable countdown period (defaults to 5 minutes)
  • Graceful error handling to prevent bot crashes

How It Works

  1. Detection: Bot monitors all issues for "-" comments
  2. Analysis: When "-" comments are found, checks timing between consecutive votes
  3. Enforcement: If a user votes "-" too quickly after their previous "-" vote, posts a warning
  4. Persistence: Saves user voting timestamps to prevent circumvention via bot restart

Test Plan

  • ✅ Code compiles successfully with no errors
  • ✅ Created experiment script demonstrating countdown logic correctness
  • ✅ Tested scenarios: valid timing, invalid timing, multiple users
  • ✅ Verified integration with existing bot architecture

Example Warning Message:

@username Please wait 5 minutes before responding with "-" to another "-" comment. This helps maintain civil discussion. Your comment was posted too quickly after a previous "-" vote.

Files Changed

  • csharp/Storage/RemoteStorage/GitHubStorage.cs: Added comment retrieval method
  • csharp/Platform.Bot/Triggers/VotingCountdownTrigger.cs: Main countdown logic (new)
  • csharp/Platform.Bot/Program.cs: Integrated new trigger
  • experiments/: Added test scripts to validate implementation

Fixes #62

🤖 Generated with Claude Code

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #62
@konard konard self-assigned this Sep 13, 2025
- Add GetIssueComments method to GitHubStorage for retrieving issue comments
- Create VotingCountdownTrigger to enforce 5-minute cooldown between "-" votes
- Track user voting timestamps using FileStorage for persistence
- Add warning comments for users who violate the countdown rule
- Include trigger in Program.cs issue tracker configuration
- Add experiment script to validate countdown logic

This prevents users from responding with "-" to another "-" comment
within the specified time period, helping maintain civil discussion.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@konard konard changed the title [WIP] Make a countdown for voting - in response to another - Implement voting countdown system for "-" comments Sep 13, 2025
@konard konard marked this pull request as ready for review September 13, 2025 21:19
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.

Make a countdown for voting "-" in response to another "-"

2 participants