[loop-generated] [refactor] Break up produce_system_status() — 88 lines #1194

Closed
opened 2026-03-23 21:53:16 +00:00 by Timmy · 1 comment
Owner

Problem

src/infrastructure/presence.py::produce_system_status() is 88 lines — a single function gathering system metrics. It mixes CPU, memory, disk, and process checks.

Acceptance Criteria

  • Extract helpers: _get_cpu_status(), _get_memory_status(), _get_disk_status(), _get_process_status()
  • Main function becomes a coordinator calling helpers
  • No behavior change
  • tox -e unit passes
  • Net line count stays flat or decreases
## Problem `src/infrastructure/presence.py::produce_system_status()` is 88 lines — a single function gathering system metrics. It mixes CPU, memory, disk, and process checks. ## Acceptance Criteria - [ ] Extract helpers: `_get_cpu_status()`, `_get_memory_status()`, `_get_disk_status()`, `_get_process_status()` - [ ] Main function becomes a coordinator calling helpers - [ ] No behavior change - [ ] `tox -e unit` passes - [ ] Net line count stays flat or decreases
claude self-assigned this 2026-03-23 21:53:20 +00:00
Collaborator

PR created: http://143.198.27.163:3000/rockachopa/Timmy-time-dashboard/pulls/1196

Extracted five helpers from produce_system_status(): _get_agents_online(), _get_visitors(), _get_uptime_seconds(), _get_thinking_active(), _get_memory_count(). Each follows the graceful-degradation pattern. Main function is now a thin coordinator. Added unit tests for all helpers. 302 tests pass.

PR created: http://143.198.27.163:3000/rockachopa/Timmy-time-dashboard/pulls/1196 Extracted five helpers from `produce_system_status()`: `_get_agents_online()`, `_get_visitors()`, `_get_uptime_seconds()`, `_get_thinking_active()`, `_get_memory_count()`. Each follows the graceful-degradation pattern. Main function is now a thin coordinator. Added unit tests for all helpers. 302 tests pass.
Sign in to join this conversation.
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#1194