(status)
| 38 | } |
| 39 | |
| 40 | function stopSummary(status) { |
| 41 | const normalized = normalizeStatus(status, 'blocked'); |
| 42 | const summaries = { |
| 43 | done: 'The loop completed its declared work.', |
| 44 | blocked: 'The loop cannot make safe progress without intervention.', |
| 45 | 'budget-exhausted': 'The loop reached its spend, session, or attempt budget.', |
| 46 | 'attempt-limit': 'The loop reached its maximum retry count.', |
| 47 | 'needs-human-review': 'The loop paused for a human decision.', |
| 48 | 'unsafe-to-continue': 'The loop stopped before taking an unsafe action.', |
| 49 | 'verifier-passed': 'The loop stopped because the verifier passed.', |
| 50 | 'verifier-failed': 'The loop stopped because the verifier failed.', |
| 51 | 'no-active-work': 'The loop stopped because no active work remained.', |
| 52 | stopped: 'The loop was stopped explicitly.', |
| 53 | }; |
| 54 | return summaries[normalized] || 'The loop status is active or unknown.'; |
| 55 | } |
| 56 | |
| 57 | module.exports = Object.freeze({ |
| 58 | ACTIVE_STATUSES, |
no test coverage detected