spawn/gcore/lib
A 3ef59261e7
refactor: reduce complexity in discovery.sh and gcore/lib/common.sh (#1094)
- Extract watchdog loop logic from run_team_cycle into _run_watchdog_loop helper
- Extract resource cleanup into _cleanup_stale_artifacts helper
- Extract prompt file preparation into _prepare_prompt_file helper
- Extract cycle completion handling into _handle_cycle_completion helper
- Extract claude process killing into _kill_claude_process helper (macOS bash 3.x compatible)
- In gcore/lib/common.sh: Extract resource gathering into _gather_instance_resources
- In gcore/lib/common.sh: Extract instance ID extraction into _extract_instance_id
- All refactoring maintains 100% test coverage (80/80 tests pass)

Agent: complexity-hunter

Co-authored-by: Spawn Refactor Service <refactor@spawn.service>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-14 05:45:35 -05:00
..
common.sh refactor: reduce complexity in discovery.sh and gcore/lib/common.sh (#1094) 2026-02-14 05:45:35 -05:00