Add performance agent (N+1 queries, O(n²) loops, I/O in loops, missing indexes) #36

Closed
opened 2026-06-28 07:59:01 +00:00 by coding-agent-marvin8 · 1 comment
coding-agent-marvin8 commented 2026-06-28 07:59:01 +00:00 (Migrated from codeberg.org)

WuMing lacks a reviewer for runtime performance regressions. A performance agent would examine changed source and SQL files for: N+1 ORM loop patterns, nested loops over large collections (O(n²)), file/network/DB I/O executed per iteration, and new query patterns that imply a missing index. This is AI reasoning about the diff — distinct from static analysis tools.

WuMing lacks a reviewer for runtime performance regressions. A performance agent would examine changed source and SQL files for: N+1 ORM loop patterns, nested loops over large collections (O(n²)), file/network/DB I/O executed per iteration, and new query patterns that imply a missing index. This is AI reasoning about the diff — distinct from static analysis tools.
coding-agent-marvin8 commented 2026-06-28 07:59:21 +00:00 (Migrated from codeberg.org)

Findings from codebase exploration:

  • All agents subclass BaseAgent in src/wuming/agents/base.py; only name, file_patterns, and system_prompt class attributes need to be set — review() is inherited
  • fnmatch.fnmatch is used for pattern matching — ** recursive globs do not work; flat wildcards only
  • Migration files are already matched by *.py; only extra pattern needed is *.sql
  • New agent registered in AGENT_REGISTRY dict in router.py
  • Tests go in tests/test_agents.py using the tryke pattern

Plan of attack:

  1. Create branch feat/issue-36-37-performance-tests-agents
  2. Add src/wuming/agents/performance.pyPerformanceAgent subclass with N+1/O(n²)/I-O-in-loops/missing-index prompt
  3. Add src/wuming/agents/tests_agent.pyTestsAgent subclass targeting all source languages; prompt covers assertion quality + coverage gaps
  4. Register both in router.py
  5. Update CLAUDE.md env var docs and README.md agents table
  6. Add tests for both agents in tests/test_agents.py
  7. Mark items done in Improvements.md
Findings from codebase exploration: - All agents subclass `BaseAgent` in `src/wuming/agents/base.py`; only `name`, `file_patterns`, and `system_prompt` class attributes need to be set — `review()` is inherited - `fnmatch.fnmatch` is used for pattern matching — `**` recursive globs do not work; flat wildcards only - Migration files are already matched by `*.py`; only extra pattern needed is `*.sql` - New agent registered in `AGENT_REGISTRY` dict in `router.py` - Tests go in `tests/test_agents.py` using the tryke pattern Plan of attack: 1. Create branch `feat/issue-36-37-performance-tests-agents` 2. Add `src/wuming/agents/performance.py` — `PerformanceAgent` subclass with N+1/O(n²)/I-O-in-loops/missing-index prompt 3. Add `src/wuming/agents/tests_agent.py` — `TestsAgent` subclass targeting all source languages; prompt covers assertion quality + coverage gaps 4. Register both in `router.py` 5. Update `CLAUDE.md` env var docs and `README.md` agents table 6. Add tests for both agents in `tests/test_agents.py` 7. Mark items done in `Improvements.md`
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
marvin8/wuming#36
No description provided.