0.1.9 #37

Merged
NiXTheDev merged 21 commits from dev into release 2026-02-15 03:30:26 +03:00
NiXTheDev commented 2026-02-14 21:59:14 +03:00 (Migrated from github.com)

Release v0.1.9 - regexYbot Enhancement Roadmap

This PR implements the complete Epic #26 enhancement roadmap, delivering 6 major feature areas with 166 tests and comprehensive documentation.

Summary

Metric Value
Issues Completed 6 / 6
Tests 166 (was 77)
New Files 8
Lines Added 1,737
Test Coverage 12 test files

Completed Issues

#27 - Health Monitoring System

  • Real-time health tracking with automatic status detection (healthy/degraded/unhealthy)
  • Configurable thresholds for error rates, queue depth, and worker counts
  • Event-driven status change notifications
  • 14 comprehensive tests covering all health scenarios

#28 - Test Suite Expansion

  • +89 tests (77 to 166 total)
  • New test files:
    • config.test.ts - 24 tests for configuration validation
    • logger.test.ts - 11 tests for logging functionality
    • errorHandling.test.ts - 19 tests for error scenarios
    • telegram.test.ts - 12 tests for Telegram integration
  • Full coverage of new features and edge cases

#29 - Per-User Rate Limiting

  • Configurable spam prevention (default: 30 commands/minute)
  • Smart counting: N commands = N points
  • User-friendly error messages with remaining time
  • Skips message edits (corrections, not spam)

#30 - Performance Optimizations

  • LRU Cache for compiled regex patterns with TTL support
    • Default: 1000 patterns, 5-minute TTL
    • Configurable via CACHE_ENABLED, CACHE_MAX_SIZE, CACHE_TTL_MS
  • Database indexes for faster queries
  • Significant performance boost for repeated patterns

#31 - Enhanced Error Handling

  • 6 custom error types with user-friendly messages:
    • BotError (base), RegexError, TelegramAPIError
    • RateLimitError, WorkerError, CircuitBreakerError
  • Circuit Breaker Pattern for resilience
    • States: CLOSED to OPEN to HALF_OPEN
    • Automatic recovery after cooldown

#34 - Code Quality

  • Comprehensive JSDoc documentation
  • Zero lint warnings (fixed all any types in tests)
  • Clean, maintainable codebase

#35 - Documentation

  • Updated README with all 25+ environment variables
  • Complete CHANGELOG section for v0.1.9
  • Documented all new features and configuration options

New Environment Variables

# Worker Pool V2
WORKER_POOL_V2_ENABLED=false
WORKER_POOL_MIN_WORKERS=0
WORKER_POOL_MAX_WORKERS=8
WORKER_POOL_INITIAL_WORKERS=1
WORKER_POOL_IDLE_TIMEOUT_MS=300000
WORKER_POOL_IDLE_CHECK_INTERVAL_MS=60000

# Rate Limiting
RATE_LIMIT_ENABLED=true
RATE_LIMIT_COMMANDS_PER_MINUTE=30

# Caching
CACHE_ENABLED=true
CACHE_MAX_SIZE=1000
CACHE_TTL_MS=300000

Quality Assurance

  • All 166 tests pass
  • Zero lint warnings
  • TypeScript compilation clean
  • No breaking changes
  • Backward compatible

Testing

Run the full test suite:

bun ltf  # lint + typecheck + format + test

All 166 tests pass with zero warnings.


Full Changelog: See CHANGELOG.md for detailed release notes.

## Release v0.1.9 - regexYbot Enhancement Roadmap This PR implements the complete Epic #26 enhancement roadmap, delivering 6 major feature areas with 166 tests and comprehensive documentation. ## Summary | Metric | Value | | -------------------- | ------------- | | **Issues Completed** | 6 / 6 | | **Tests** | 166 (was 77) | | **New Files** | 8 | | **Lines Added** | 1,737 | | **Test Coverage** | 12 test files | ## Completed Issues ### #27 - Health Monitoring System - Real-time health tracking with automatic status detection (healthy/degraded/unhealthy) - Configurable thresholds for error rates, queue depth, and worker counts - Event-driven status change notifications - 14 comprehensive tests covering all health scenarios ### #28 - Test Suite Expansion - **+89 tests** (77 to 166 total) - New test files: - config.test.ts - 24 tests for configuration validation - logger.test.ts - 11 tests for logging functionality - errorHandling.test.ts - 19 tests for error scenarios - telegram.test.ts - 12 tests for Telegram integration - Full coverage of new features and edge cases ### #29 - Per-User Rate Limiting - Configurable spam prevention (default: 30 commands/minute) - Smart counting: N commands = N points - User-friendly error messages with remaining time - Skips message edits (corrections, not spam) ### #30 - Performance Optimizations - **LRU Cache** for compiled regex patterns with TTL support - Default: 1000 patterns, 5-minute TTL - Configurable via CACHE_ENABLED, CACHE_MAX_SIZE, CACHE_TTL_MS - **Database indexes** for faster queries - Significant performance boost for repeated patterns ### #31 - Enhanced Error Handling - **6 custom error types** with user-friendly messages: - BotError (base), RegexError, TelegramAPIError - RateLimitError, WorkerError, CircuitBreakerError - **Circuit Breaker Pattern** for resilience - States: CLOSED to OPEN to HALF_OPEN - Automatic recovery after cooldown ### #34 - Code Quality - Comprehensive JSDoc documentation - Zero lint warnings (fixed all any types in tests) - Clean, maintainable codebase ### #35 - Documentation - Updated README with all 25+ environment variables - Complete CHANGELOG section for v0.1.9 - Documented all new features and configuration options ## New Environment Variables ```bash # Worker Pool V2 WORKER_POOL_V2_ENABLED=false WORKER_POOL_MIN_WORKERS=0 WORKER_POOL_MAX_WORKERS=8 WORKER_POOL_INITIAL_WORKERS=1 WORKER_POOL_IDLE_TIMEOUT_MS=300000 WORKER_POOL_IDLE_CHECK_INTERVAL_MS=60000 # Rate Limiting RATE_LIMIT_ENABLED=true RATE_LIMIT_COMMANDS_PER_MINUTE=30 # Caching CACHE_ENABLED=true CACHE_MAX_SIZE=1000 CACHE_TTL_MS=300000 ``` ## Quality Assurance - All 166 tests pass - Zero lint warnings - TypeScript compilation clean - No breaking changes - Backward compatible ## Testing Run the full test suite: ```bash bun ltf # lint + typecheck + format + test ``` All 166 tests pass with zero warnings. --- **Full Changelog**: See CHANGELOG.md for detailed release notes.
Sign in to join this conversation.
No description provided.