(payload)
| 42 | } |
| 43 | |
| 44 | function formatStatus(payload) { |
| 45 | if (!payload.active) { |
| 46 | if (payload.contracts && payload.contracts.length > 0) { |
| 47 | const list = payload.contracts.map((c) => ` - ${c.id} [${c.status}] ${c.title}`).join('\n'); |
| 48 | return `${payload.message}\n${list}`; |
| 49 | } |
| 50 | return payload.message; |
| 51 | } |
| 52 | const lines = []; |
| 53 | lines.push(`Contract: ${payload.title} (${payload.active})`); |
| 54 | lines.push(`Status: ${payload.status} — ${payload.summary}`); |
| 55 | lines.push(''); |
| 56 | for (const a of payload.assertions) { |
| 57 | const mark = a.state === STATES.PASSED ? '[PASS]' |
| 58 | : a.state === STATES.FAILED ? '[FAIL]' |
| 59 | : a.state === STATES.SKIPPED ? '[SKIP]' |
| 60 | : '[ ]'; |
| 61 | lines.push(` ${mark} ${a.id} ${a.text}`); |
| 62 | } |
| 63 | if (payload.blockers && payload.blockers.length > 0) { |
| 64 | lines.push(''); |
| 65 | lines.push(`Blockers: ${payload.blockers.map((b) => b.id).join(', ')}`); |
| 66 | } else if (payload.done) { |
| 67 | lines.push(''); |
| 68 | lines.push('All assertions resolved — done-guard will allow final response.'); |
| 69 | } |
| 70 | return lines.join('\n'); |
| 71 | } |
| 72 | |
| 73 | // ─── tool branches ─────────────────────────────────────────────────────────── |
| 74 |
no outgoing calls
no test coverage detected