Commit Graph

2 Commits

Author SHA1 Message Date
bb65500082 Complete Phase 2: Auto-reconnection and stability testing
Implement automatic connection recovery and long-duration testing infrastructure
to complete Phase 2 (Network Reliability) of the RSIPI improvement roadmap.

New Features:
- Auto-reconnection manager with configurable retry strategies
  - IMMEDIATE: Reconnect without delay
  - LINEAR_BACKOFF: Incremental retry delays
  - EXPONENTIAL_BACKOFF: Exponential retry delays
- Background watchdog monitoring (checks every 2 seconds)
- Reconnection statistics tracking (attempts, failures, timestamps)
- Optional callbacks for reconnection events (success/failure)
- 24-hour stability test script with comprehensive reporting
  - Configurable test duration and sample intervals
  - Real-time health monitoring and progress logging
  - Detailed JSON reports with timing and network statistics
  - Human-readable summary with health percentage

Modified Files:
- src/RSIPI/rsi_client.py
  - Added auto-reconnect integration with enable_auto_reconnect parameter
  - Start/stop auto-reconnect monitor in lifecycle methods
  - Clear metrics on reconnection to reset statistics

New Files:
- src/RSIPI/auto_reconnect.py (241 lines)
  - AutoReconnectManager class with background monitoring thread
  - ReconnectStrategy enum for retry behavior configuration
  - Watchdog timeout detection and automatic recovery
  - Reconnection verification with health checks

- tests/stability_test.py (365 lines)
  - StabilityTest class for long-duration testing
  - Command-line interface with argparse
  - Automatic log file generation with timestamps
  - Sample collection with configurable intervals
  - Statistical analysis and reporting
  - Graceful interruption handling (KeyboardInterrupt)

Phase 2 Status:  COMPLETE
-  Timing instrumentation (commit 6e8ea2e)
-  Watchdog timer (commit 6e8ea2e)
-  Network quality monitoring (commit 6e8ea2e)
-  DiagnosticsAPI implementation (commit 6e8ea2e)
-  Auto-reconnection with graceful recovery (this commit)
-  24-hour stability test infrastructure (this commit)

Next: Run stability test, then proceed to Phase 3 (KRL Coordination)
2026-01-17 00:12:44 +00:00
7bfe5cccf1 Refactor core architecture and add test coverage
- Fix socket lifecycle: create in child process, add cleanup with try/finally
- Add ClientState enum with validated state transitions to prevent invalid operations
- Decouple CSV logging from network loop using queue-based CSVLogger process
- Fix broken imports: change absolute (src.RSIPI.x) to relative (.x) across 7 files
- Add missing @staticmethod decorator to generate_report()
- Add command queue for inter-process communication (logging control)
- Add 34 unit tests for XMLGenerator, SafetyManager, and trajectory_planner
- Add pytest configuration to pyproject.toml
- Add CLAUDE.md with architecture documentation
2026-01-16 20:09:56 +00:00