[loop-cycle-3] refactor: split app.py into schedulers.py and startup.py (#1363) #1455

Merged
Timmy merged 1 commits from refactor/split-app-py into main 2026-03-24 19:07:19 +00:00
Owner

Summary

Splits src/dashboard/app.py (780 lines) into focused modules:

  • dashboard/schedulers.py (278 lines) — background scheduler coroutines (briefing, thinking, hermes, loop QA, presence watcher, chat integrations)
  • dashboard/startup.py (205 lines) — lifecycle management (startup init, pruning, shutdown cleanup, lifespan context manager)
  • dashboard/app.py (343 lines) — thin entry point: app creation, middleware, router registration, route handlers

Changes

  • app.py: 780 → 343 lines (-56% reduction)
  • Net: -437 lines from app.py, +46 lines module boilerplate
  • All 966 tests pass
  • Backward-compatible re-exports for _SYNTHESIZED_STATE and _presence_watcher

Closes #1363

## Summary Splits `src/dashboard/app.py` (780 lines) into focused modules: - **`dashboard/schedulers.py`** (278 lines) — background scheduler coroutines (briefing, thinking, hermes, loop QA, presence watcher, chat integrations) - **`dashboard/startup.py`** (205 lines) — lifecycle management (startup init, pruning, shutdown cleanup, lifespan context manager) - **`dashboard/app.py`** (343 lines) — thin entry point: app creation, middleware, router registration, route handlers ## Changes - app.py: 780 → 343 lines (-56% reduction) - Net: -437 lines from app.py, +46 lines module boilerplate - All 966 tests pass - Backward-compatible re-exports for `_SYNTHESIZED_STATE` and `_presence_watcher` Closes #1363
Timmy added 1 commit 2026-03-24 19:07:13 +00:00
refactor: split app.py into schedulers.py and startup.py (#1363)
Some checks failed
Tests / lint (pull_request) Failing after 11s
Tests / test (pull_request) Has been skipped
6dda0c9769
Extract background scheduler coroutines into dashboard/schedulers.py (278 lines)
and lifecycle management into dashboard/startup.py (205 lines).

app.py reduced from 780 to 343 lines — thin entry point with app creation,
middleware config, router registration, and route handlers.

Net reduction: -437 lines from app.py, +46 lines overhead from module boilerplate.
Timmy merged commit 46b5bf96cc into main 2026-03-24 19:07:19 +00:00
Timmy deleted branch refactor/split-app-py 2026-03-24 19:07:20 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#1455