| 326 | if ((selected === '/archon' || selected.startsWith('/fleet')) && words(input).length < 20) { |
| 327 | return { |
| 328 | selected: '/marshal', |
| 329 | reason: 'proportionality downgraded campaign-level routing because the input is brief.', |
| 330 | }; |
| 331 | } |
| 332 | return { selected, reason: null }; |
| 333 | } |
| 334 | |
| 335 | function alternativesFor(_input, matches) { |
| 336 | const alternatives = []; |
| 337 | for (const item of matches.slice(0, 4)) { |
| 338 | alternatives.push({ |
| 339 | route: item.route, |
| 340 | why: `matched ${item.matches.join(', ')}`, |
| 341 | }); |
| 342 | } |
| 343 | |
| 344 | if (!alternatives.some((item) => item.route === '/marshal')) { |
| 345 | alternatives.push({ route: '/marshal', why: 'safe fallback for unclear multi-step work' }); |
| 346 | } |
| 347 | if (!alternatives.some((item) => item.route === '/archon')) { |
| 348 | alternatives.push({ route: '/archon', why: 'use only when persistence or phases are needed' }); |
| 349 | } |
| 350 | if (!alternatives.some((item) => item.route === '/fleet --quick')) { |