Skip to content

Refactor: finish trimming app.py into a stable composition layer #81

@techmore

Description

@techmore

Summary

This issue is still valid, but it is now a composition-layer cleanup issue rather than an "everything lives in app.py" problem.

The codex/runtime-contract-fixes branch moved a large amount of runtime logic out of app.py. The file is now roughly 786 lines and mostly acts as runtime composition plus a smaller set of app-owned adapters.

What Changed

The refactor branch moved major responsibilities into shared modules, including:

  • bootstrap/runtime startup policy
  • auth-hardened Socket.IO registration
  • client state handling
  • runtime-info handlers
  • core routes
  • scan job handlers
  • connection replay handling
  • scanning helpers
  • auto-scan execution
  • reporting helpers
  • workflow context builders
  • validation and networking helpers

Remaining Work

What remains is narrower architectural work:

  • keep trimming app-specific wiring where module boundaries are already stable
  • decide whether more runtime composition should move into factories/builders
  • preserve clarity so startup/runtime behavior is still easy to trace
  • avoid reintroducing helper wrappers or duplicate orchestration paths

Recommendation

Keep this issue open as a low-to-medium priority cleanup item behind the higher-value runtime, reporting, and CI tickets tracked in #108.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions