(action)
| 40 | } |
| 41 | |
| 42 | function localRepairFor(action) { |
| 43 | const command = String(action?.command || '').trim(); |
| 44 | if (!command) return null; |
| 45 | |
| 46 | if (command === '/learn --doc-sync') { |
| 47 | return { |
| 48 | kind: 'local-repair', |
| 49 | command, |
| 50 | args: [path.join(__dirname, '..', 'hooks_src', 'doc-sync.js'), '--project-root'], |
| 51 | appendProjectRoot: true, |
| 52 | why: 'Drain queued doc-sync items and write the latest local review report.', |
| 53 | }; |
| 54 | } |
| 55 | |
| 56 | const packageMatch = command.match(/^node\s+scripts\/package-delivery\.js\s+(.+)$/); |
| 57 | if (packageMatch) { |
| 58 | return { |
| 59 | kind: 'local-repair', |
| 60 | command, |
| 61 | args: [path.join(__dirname, 'package-delivery.js'), packageMatch[1]], |
| 62 | why: 'Create the deterministic review package for a campaign that is ready to package.', |
| 63 | }; |
| 64 | } |
| 65 | |
| 66 | const completeMatch = command.match(/^node\s+scripts\/campaign\.js\s+complete\s+([^\s]+)\s+--archive$/); |
| 67 | if (completeMatch) { |
| 68 | return { |
| 69 | kind: 'local-repair', |
| 70 | command, |
| 71 | args: [path.join(__dirname, 'campaign.js'), 'complete', completeMatch[1], '--archive'], |
| 72 | why: 'Complete and archive a campaign whose phases are already complete.', |
| 73 | }; |
| 74 | } |
| 75 | |
| 76 | return null; |
| 77 | } |
| 78 | |
| 79 | function runNode(projectRoot, repair) { |
| 80 | const args = [...repair.args]; |
no outgoing calls
no test coverage detected