Commit fce42af
committed
fix: harden installation against 12 failure modes
Comprehensive fix for installation/upgrade reliability across all platforms.
## Fixes (12 issues)
1. **HTML guard on curl install** — altimate.ai/install currently returns HTML.
Now detects HTML response and gives actionable error with npm workaround.
2. **Windows curl guard** — curl/bash upgrade on Windows now fails fast with
PowerShell alternative command.
3. **Fetch timeout (10s)** — all fetch() calls now use AbortController timeout
to prevent hanging on network issues.
4. **.altimate-code/bin path detection** — method() now detects curl installs
in ~/.altimate-code/bin/ (not just ~/.opencode/bin/).
5. **Scoop upgrade command** — changed from `scoop install opencode@version`
to `scoop update opencode` (correct command for upgrades).
6. **Choco error message** — removed hardcoded "not running from elevated shell",
now shows actual stderr from choco process.
7. **Choco empty results guard** — data.d.results[0].Version no longer crashes
when Chocolatey returns empty results array.
8. **Scoop missing version guard** — checks data.version exists before accessing.
9. **GitHub releases null guard** — checks data.tag_name exists before .replace().
10. **Brew JSON parse safety** — JSON.parse wrapped in try/catch for non-JSON output.
11. **Brew core formula 404** — removed fetch to formulae.brew.sh/altimate-code.json
(doesn't exist in homebrew core, only in AltimateAI/tap). Falls through to
GitHub releases instead.
12. **Local channel skip** — npm/bun/pnpm version check returns current VERSION
when CHANNEL is "local" instead of fetching /local from registry (404).
## Registry Status (verified)
| Registry | Package | Exists? |
|----------|---------|---------|
| npm | @altimateai/altimate-code | ✅ v0.4.9 |
| scoop | opencode | ✅ v1.2.27 (upstream) |
| choco | opencode | ✅ v1.2.27 (upstream) |
| brew | AltimateAI/tap/altimate-code | ✅ formula exists, v0.3.1 |
| GitHub | AltimateAI/altimate-code | ✅ v0.4.9 with all platform binaries |
## Infra Issues (not code — documented for team)
- altimate.ai/install returns HTML homepage (needs server config fix)
- Brew tap formula pinned to v0.3.1 (needs tap update)
- No altimate-code packages on scoop/choco (uses upstream opencode)
## Test Evidence
Install matrix (55 combinations): https://github.com/AltimateAI/altimate-qa/actions/runs/232634890021 parent 0612f4e commit fce42af
2 files changed
Lines changed: 117 additions & 39 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
12 | 17 | | |
13 | 18 | | |
14 | 19 | | |
| |||
180 | 185 | | |
181 | 186 | | |
182 | 187 | | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
188 | 194 | | |
189 | 195 | | |
| 196 | + | |
190 | 197 | | |
191 | 198 | | |
192 | 199 | | |
| |||
215 | 222 | | |
216 | 223 | | |
217 | 224 | | |
218 | | - | |
| 225 | + | |
219 | 226 | | |
220 | 227 | | |
221 | 228 | | |
| |||
266 | 273 | | |
267 | 274 | | |
268 | 275 | | |
269 | | - | |
| 276 | + | |
270 | 277 | | |
271 | 278 | | |
272 | 279 | | |
| |||
284 | 291 | | |
285 | 292 | | |
286 | 293 | | |
287 | | - | |
| 294 | + | |
| 295 | + | |
288 | 296 | | |
289 | 297 | | |
290 | 298 | | |
291 | 299 | | |
292 | 300 | | |
293 | 301 | | |
294 | | - | |
| 302 | + | |
295 | 303 | | |
296 | 304 | | |
297 | 305 | | |
298 | 306 | | |
299 | 307 | | |
300 | | - | |
301 | | - | |
| 308 | + | |
| 309 | + | |
302 | 310 | | |
| 311 | + | |
303 | 312 | | |
304 | 313 | | |
305 | 314 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
28 | 42 | | |
29 | 43 | | |
30 | 44 | | |
| |||
34 | 48 | | |
35 | 49 | | |
36 | 50 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
41 | 76 | | |
42 | 77 | | |
43 | 78 | | |
| |||
101 | 136 | | |
102 | 137 | | |
103 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
104 | 142 | | |
105 | 143 | | |
106 | 144 | | |
| |||
225 | 263 | | |
226 | 264 | | |
227 | 265 | | |
228 | | - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
229 | 269 | | |
230 | 270 | | |
231 | 271 | | |
232 | 272 | | |
233 | | - | |
| 273 | + | |
234 | 274 | | |
235 | 275 | | |
236 | | - | |
237 | | - | |
| 276 | + | |
238 | 277 | | |
239 | 278 | | |
240 | 279 | | |
| |||
282 | 321 | | |
283 | 322 | | |
284 | 323 | | |
| 324 | + | |
285 | 325 | | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
290 | 335 | | |
291 | | - | |
292 | | - | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
293 | 339 | | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | 340 | | |
300 | 341 | | |
301 | 342 | | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
302 | 349 | | |
303 | 350 | | |
304 | 351 | | |
305 | 352 | | |
306 | 353 | | |
307 | 354 | | |
308 | 355 | | |
309 | | - | |
| 356 | + | |
310 | 357 | | |
311 | 358 | | |
312 | 359 | | |
| |||
316 | 363 | | |
317 | 364 | | |
318 | 365 | | |
319 | | - | |
| 366 | + | |
320 | 367 | | |
321 | 368 | | |
322 | 369 | | |
323 | 370 | | |
324 | 371 | | |
325 | 372 | | |
326 | 373 | | |
327 | | - | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
328 | 383 | | |
329 | 384 | | |
330 | 385 | | |
331 | | - | |
| 386 | + | |
332 | 387 | | |
333 | 388 | | |
334 | 389 | | |
335 | | - | |
| 390 | + | |
336 | 391 | | |
337 | 392 | | |
338 | | - | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
339 | 401 | | |
340 | 402 | | |
341 | | - | |
| 403 | + | |
| 404 | + | |
342 | 405 | | |
343 | | - | |
| 406 | + | |
344 | 407 | | |
345 | 408 | | |
346 | | - | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
347 | 416 | | |
348 | 417 | | |
0 commit comments