(answerFile)
| 40 | const PUBLISH_TIMEOUT_MS = 15000; |
| 41 | |
| 42 | function _readAnswer(answerFile) { |
| 43 | const raw = fs.readFileSync(answerFile, 'utf8'); |
| 44 | const trimmed = String(raw || '').trim(); |
| 45 | if (!trimmed) throw new Error('answer file is empty'); |
| 46 | if (trimmed.length > MAX_ANSWER_CHARS) { |
| 47 | return trimmed.slice(0, MAX_ANSWER_CHARS - 40) + '\n...[TRUNCATED]...'; |
| 48 | } |
| 49 | return trimmed; |
| 50 | } |
| 51 | |
| 52 | function _buildGene(capabilities, signals) { |
| 53 | const caps = Array.isArray(capabilities) && capabilities.length > 0 |