feat(cli): silent opt-out self-update (#102)#103
Merged
Conversation
Keep the CLI up to date automatically, mirroring the agent-telemetry consent pattern: default-on once with a visible disclosure and an easy opt-out. Reuses the same install.sh the user already trusted at install time, so it adds no new trust surface. CLI: - iris/update/auto.py: auto_update_enabled/initialized flags, enable/ disable, IRIS_NO_AUTO_UPDATE env opt-out, version compare, managed- install guard (pipx / ~/.iris only), daily stamp + log, and a detached best-effort upgrade that never blocks the push that triggers it. - cli.py: first-run init (TTY + managed-install gated so the disclosure is never swallowed by the background hook), trigger after a push, and `iris upgrade --disable-auto|--enable-auto|--auto-status`. Platform: - lib/cli-version.ts: cached GitHub Releases lookup (RocketBus/iris) + version compare, fail-safe. - /api/ingest now returns latest_version + update_available. Tests: 15 Python + 6 vitest. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #102.
What
Silent, opt-out CLI self-update — the CLI keeps itself current without anyone running
iris upgradeby hand. Mirrors the agent-telemetry consent model already in the repo: default-on once, with a visible first-run disclosure and an easy off switch. The update action reuses the sameinstall.shthe user already ran at install time, so it adds no new trust surface — it just repeats that step automatically.How it flows
git commit→ daily background hook →iris --push→ server returnslatest_versionin the ingest response → if enabled + newer + self-manageable install + not yet attempted today → a detachedcurl <server>/install.sh | shruns in its own process group. Interactive commits never trigger anything; the upgrade never blocks the push that spawned it.Safety guards (self-update ≠ read-only telemetry)
~/.iris/venv(the onesinstall.showns). System pip / Homebrew are skipped silently and logged, never clobbered./dev/null). Stays uninitialized until a real interactive run discloses it.~/.iris/auto_update.log, never raised.Opt-out
iris upgrade --disable-auto(and--enable-auto,--auto-status)IRIS_NO_AUTO_UPDATE=1Changes
CLI
iris/update/auto.py(new) — flags, toggles, version compare, managed-install guard, daily stamp/log, detached upgradeiris/cli.py— first-run init + disclosure, trigger after push,upgradetoggle flagsPlatform
lib/cli-version.ts(new) — cached GitHub Releases lookup (RocketBus/iris) + version compare, fail-safe/api/ingest— response now includeslatest_version+update_availableTests
tests/test_auto_update.py— 15 (version compare, toggles, first-run gates, launch gates) ✅platform/tests/cli-version.test.ts— 6 (compare, cache/TTL, failure modes) ✅tsc/eslint/prettiercleanFollow-up (not in this PR)
Version bump at release time per the checklist:
pyproject.toml,iris/cli.py,platform/package.json,CHANGELOG.md.🤖 Generated with Claude Code