| 29 | } |
| 30 | |
| 31 | function readinessReport({ branch, head, pr, status = 'ready', verification = 'pass', generated = '2026-06-05T12:00:00.000Z' }) { |
| 32 | return [ |
| 33 | `# PR Readiness: ${branch}`, |
| 34 | '', |
| 35 | `Generated: ${generated}`, |
| 36 | `Status: ${status}`, |
| 37 | `PR: ${pr}`, |
| 38 | `Branch: ${branch}`, |
| 39 | `Head: ${head}`, |
| 40 | '', |
| 41 | '## Gates', |
| 42 | '', |
| 43 | '| Gate | Status | Detail |', |
| 44 | '|---|---|---|', |
| 45 | `| Pull request URL | ${pr ? 'pass' : 'fail'} | ${pr || 'missing'} |`, |
| 46 | '| Git worktree | pass | clean |', |
| 47 | '| Dashboard repairs | pass | no queued repairs |', |
| 48 | `| Verification | ${verification} | npm run test exited ${verification === 'pass' ? 0 : 1} |`, |
| 49 | '', |
| 50 | '---HANDOFF---', |
| 51 | `- PR: ${pr}`, |
| 52 | `- Branch: ${branch}`, |
| 53 | `- Readiness: ${status}`, |
| 54 | `- Verification: ${verification}`, |
| 55 | '---', |
| 56 | ].join('\n'); |
| 57 | } |
| 58 | |
| 59 | withTempProject((projectRoot) => { |
| 60 | const reportPath = path.join(projectRoot, '.planning', 'pr-readiness', 'top.md'); |