Strategic Improvement
sw-loop.sh at 2654 lines is the largest script and most critical component (build loop = heart of system). Decompose into focused modules: lib/loop-orchestrator.sh, lib/loop-context.sh, lib/loop-iteration.sh, lib/loop-restart.sh. Improves testability, enables optimization, demonstrates platform can improve its own architecture.
Acceptance Criteria
- sw-loop.sh reduced to <500 lines (orchestration + CLI interface only)
- Core logic moved to 4 focused lib modules, each <600 lines
- All existing tests pass without modification (same CLI interface)
- Each module gets dedicated test suite with improved coverage
- Session restart, context management, iteration logic independently testable
- Documentation update showing new architecture and module responsibilities
Context
- Priority: P6
- Complexity: full
- Generated by: Strategic Intelligence Agent
- Strategy alignment: P6: Platform Self-Improvement (AGI-Level Readiness)
Strategic Improvement
sw-loop.sh at 2654 lines is the largest script and most critical component (build loop = heart of system). Decompose into focused modules: lib/loop-orchestrator.sh, lib/loop-context.sh, lib/loop-iteration.sh, lib/loop-restart.sh. Improves testability, enables optimization, demonstrates platform can improve its own architecture.
Acceptance Criteria
Context