strategies - kongusen/loom-agent GitHub Wiki
Learns which tools are reliable from execution feedback.
- Tracks success rate and average score per tool
- Produces
preferred_toolsanddiscouraged_toolslists - Configurable:
success_threshold=0.6,min_examples=1
Turns policy-related feedback into concrete recommendations.
- Detects tools that are frequently blocked or risky
- Recommends
deny,require_approval, orrelaxper tool - Compares against baseline policy
Solidifies failure root causes into permanent constraints (Ψ.constraints).
- Extracts
(tool, root_cause)pairs from failed feedback entries - Adds new constraints to prevent repeat failures
-
Ratchet-risk mitigation: marks constraints as stale after
stale_afterentries with no violations — prevents capability decay from over-constraining
Detects when a task domain causes persistent early_stop events and recommends spawning a specialist sub-agent.
- Tracks
early_stopratio per domain - Triggers recommendation when
task_ratio(domain) > split_threshold(default 0.4) - Requires
min_samples=3before recommending
| Only E2, no E3 | Gets better at tasks, but repeats the same mistakes |
|---|---|
| Only E3, no audit | Gets more cautious until capability atrophies |
| Only E4, no protocol | Single-agent chaos becomes distributed chaos |
All four strategies together keep capability, constraints, and structure evolving in balance.
Code: loom/evolution/strategies.py