**Problem.** Several TUI / CLI files exceed 1 kLOC, mixing rendering, event handling, and business logic. **Targets.** - [cli/tui/views/results.py](hackagent/cli/tui/views/results.py) — ~2,479 lines - [cli/tui/attack_specs.py](hackagent/cli/tui/attack_specs.py) — ~1,377 lines - [cli/tui/views/attacks.py](hackagent/cli/tui/views/attacks.py) — ~1,318 lines - [cli/commands/attack.py](hackagent/cli/commands/attack.py) — ~884 lines **Actions.** - [ ] For each TUI file: extract widgets to siblings (`screens/`, `widgets/`), keep top-level files as routers. - [ ] For `cli/commands/attack.py`: split into `parse_config()` (pure, testable) and `run_attack()` (uses `HackAgent`). Both reusable from the TUI. - [ ] Add textual snapshot tests for any newly extracted screens. **Acceptance:** no file in `cli/` exceeds 600 lines; `parse_config` is unit-tested; TUI snapshot tests added.
Problem.
Several TUI / CLI files exceed 1 kLOC, mixing rendering, event handling, and business logic.
Targets.
Actions.
screens/,widgets/), keep top-level files as routers.cli/commands/attack.py: split intoparse_config()(pure, testable) andrun_attack()(usesHackAgent). Both reusable from the TUI.Acceptance: no file in
cli/exceeds 600 lines;parse_configis unit-tested; TUI snapshot tests added.