1.1 KiB
1.1 KiB
Phase 6: Convergence Check
Purpose: The loop doesn't run forever. It runs until it converges.
TS Module: src/tier2-primitives/loops/convergence-check.ts
What It Does
Detects when to stop the loop:
- Max iterations reached → hard stop
- Diminishing returns → improvement delta below threshold for N iterations
- Quality plateau → quality score flat for N iterations and already acceptable
- Target achieved → quality and success rate both above 0.95
Signals
| Signal | Meaning | Action |
|---|---|---|
continuing |
Loop should keep running | Let it run |
diminishing_returns |
Delta below threshold | Exit — more iterations won't help |
quality_plateau |
Quality flat and acceptable | Exit with current state |
target_achieved |
Quality > 0.95 and success > 0.95 | Exit — goal fully met |
Key Rules
- Set
convergenceThresholdbased on task difficulty (0.05 for standard, 0.02 for precise) - In the rubric engine, convergence is replaced by rubric-guided exit conditions
- A plateau with low quality signals "restart approach" — not "exit successful"