Why
`clawloop/learning_layers/harness.py` is 1139 lines and mixes five conceptually distinct things in one file:
- `ToolConfig`
- `PlaybookEntry` / `Playbook` (ACE-style memory)
- `PromptCandidate` / `ParetoFront` (GEPA)
- `Insight` (reflector output validation)
- `Harness` itself (Layer-protocol orchestration)
A reader trying to grok the layering can't see the boundaries.
There's also an architectural smell: `clawloop/core/curator.py:25` imports from `clawloop/learning_layers/harness.py`. Core depending on a layer is the wrong direction; `Playbook`/`Insight` should live in core (they're domain types, not layer mechanics).
What
Acceptance
- `grep -r "from clawloop.learning_layers.harness import" clawloop/core/` returns nothing
- `learning_layers/harness.py` is ≤400 lines
- `pytest tests/ -x -q` green
Effort
~2-3 hours. Mechanical refactor; risk is import cycles.
Source
Code audit and Codex review, 2026-04-18. Both auditors independently flagged this as the top S1 refactor.
Why
`clawloop/learning_layers/harness.py` is 1139 lines and mixes five conceptually distinct things in one file:
A reader trying to grok the layering can't see the boundaries.
There's also an architectural smell: `clawloop/core/curator.py:25` imports from `clawloop/learning_layers/harness.py`. Core depending on a layer is the wrong direction; `Playbook`/`Insight` should live in core (they're domain types, not layer mechanics).
What
Acceptance
Effort
~2-3 hours. Mechanical refactor; risk is import cycles.
Source
Code audit and Codex review, 2026-04-18. Both auditors independently flagged this as the top S1 refactor.