Why
Two purple-agent server implementations duplicate substantial scaffolding:
- `clawloop/environments/_car_purple.py` (344 lines)
- `clawloop/environments/_entropic_purple.py` (378 lines)
Both files implement near-identical versions of:
- `_convert_tools_to_openai()`
- `_normalize_assistant_msg()`
- session-state management
- harness-update protocol
A skilled engineer reading both files will spot the copy-paste immediately. It's also a maintenance liability: a fix in one is unlikely to be ported to the other.
What
Acceptance
- Total LOC across the three files reduced by ≥30%
- `grep "_convert_tools_to_openai" clawloop/environments/` returns one definition
- `pytest tests/environments/` green
Effort
~45 min. Bounded, low-risk, well-scoped — solid first-contribution issue.
Source
Code audit, 2026-04-18 (S1 finding).
Why
Two purple-agent server implementations duplicate substantial scaffolding:
Both files implement near-identical versions of:
A skilled engineer reading both files will spot the copy-paste immediately. It's also a maintenance liability: a fix in one is unlikely to be ported to the other.
What
Acceptance
Effort
~45 min. Bounded, low-risk, well-scoped — solid first-contribution issue.
Source
Code audit, 2026-04-18 (S1 finding).