| 178 | } |
| 179 | |
| 180 | function buildNextAction(status, ordered) { |
| 181 | if (status === 'no-stack') { |
| 182 | return { |
| 183 | label: 'No PR readiness reports found', |
| 184 | command: 'node scripts/pr-ready.js --pr <pull-request-url> --run-verification', |
| 185 | canRunNow: false, |
| 186 | why: 'No stack can be planned until at least one PR readiness report exists.', |
| 187 | }; |
| 188 | } |
| 189 | if (status === 'blocked') { |
| 190 | return { |
| 191 | label: 'Resolve blocked PR readiness report', |
| 192 | command: 'node scripts/pr-ready.js --pr <pull-request-url> --run-verification', |
| 193 | canRunNow: false, |
| 194 | why: 'At least one PR readiness report is blocked or missing a passing gate.', |
| 195 | }; |
| 196 | } |
| 197 | return { |
| 198 | label: 'Approve stack landing order', |
| 199 | command: ordered.map((report) => report.pr || report.branch).join(' -> '), |
| 200 | canRunNow: false, |
| 201 | why: 'Every visible PR readiness report is ready; human approval is required before marking drafts ready or merging.', |
| 202 | }; |
| 203 | } |
| 204 | |
| 205 | function buildPostApprovalRunbook(status, ordered) { |
| 206 | if (status === 'no-stack') { |