installer: never downgrade, session-aware next steps
Dogfooding fixes from a live onboarding session (context: INS-574, INS-575).
1. Never move an install backwards. The already current? check only matched current == latest stable, so a machine running an auto-updated prerelease (v0.0.23-rc.1, staging channel) was silently downgraded to v0.0.22 by every installer re-run — and then flip-flopped back on the next auto-update. New numeric ver_ge guard keeps any installed version >= latest stable and says so explicitly; INSTA_VERSION remains the escape hatch for intentional downgrades.
2. Session-aware next steps. The closing banner told every machine to insta login --oauth github, including machines with a live session — which reads as "you must re-login" and undercuts the one-liner experience. It now prints ✓ already logged in as <email> — no login needed when insta status shows a session.
3. Removed a competitor name from a shipped comment in agents.sh.
Tested: sh -n on both scripts; ver_ge unit-checked (rc-newer-than-stable kept, older upgraded, equal skipped, minor-bump ordering).
🤖 Generated with Claude Code
https://claude.ai/code/session_01CZZa6p9ySa5wFJYit2UEF8
Summary by cubic
Prevents installer downgrades and makes next steps session-aware to smooth onboarding. Hardens the session check under set -e and adds tests to lock version-compare behavior (INS-574, INS-575).
- Bug Fixes
- Never downgrade: use strict numeric
ver_gtto keep any installed version >= latest stable, let prereleases advance to their matching stable, and keep the installed binary when release lookup fails;INSTA_VERSIONstill forces a tag. Regression tests extract the realver_gtfrominstall.shto lock these behaviors. - Session-aware next steps: show “already logged in as ” when a session exists (falls back to user id); otherwise suggest
--oauth githubor--oauth googleand noteinsta-ossskips login. Guarded the session probe with|| truesoset -ewon’t abort the installer. - Clean up: removed a competitor reference in an
agents.shcomment.
- Never downgrade: use strict numeric