Skip to content

feat(cli): silent opt-out self-update (#102)#103

Merged
trentas merged 1 commit into
mainfrom
feat/cli-auto-update
Jun 12, 2026
Merged

feat(cli): silent opt-out self-update (#102)#103
trentas merged 1 commit into
mainfrom
feat/cli-auto-update

Conversation

@trentas

@trentas trentas commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Closes #102.

What

Silent, opt-out CLI self-update — the CLI keeps itself current without anyone running iris upgrade by 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 same install.sh the 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 returns latest_version in the ingest response → if enabled + newer + self-manageable install + not yet attempted today → a detached curl <server>/install.sh | sh runs 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)

  • Detached, background-only. Fires from the push path in its own session; never foreground, never blocks a commit.
  • Managed installs only. Auto-upgrades pipx / ~/.iris/venv (the ones install.sh owns). System pip / Homebrew are skipped silently and logged, never clobbered.
  • Consent you can see. First-run auto-enable only on a TTY, so the disclosure isn't swallowed by the background hook (whose stderr → /dev/null). Stays uninitialized until a real interactive run discloses it.
  • One attempt/day, stamped before launch so a broken release retries tomorrow, not on every push. Failures logged to ~/.iris/auto_update.log, never raised.

Opt-out

  • Persistent: iris upgrade --disable-auto (and --enable-auto, --auto-status)
  • Transient (CI/runners): IRIS_NO_AUTO_UPDATE=1

Changes

CLI

  • iris/update/auto.py (new) — flags, toggles, version compare, managed-install guard, daily stamp/log, detached upgrade
  • iris/cli.py — first-run init + disclosure, trigger after push, upgrade toggle flags

Platform

  • lib/cli-version.ts (new) — cached GitHub Releases lookup (RocketBus/iris) + version compare, fail-safe
  • /api/ingest — response now includes latest_version + update_available

Tests

  • 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 / prettier clean

Note: the full Python suite has one pre-existing failure (test_agent_settings_hook::test_status_reflects_state) — a test-isolation bug that reads the real ~/.iris spool; unrelated to this branch (confirmed via git stash).

Follow-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

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>
@vercel

vercel Bot commented Jun 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clickbus-iris Ready Ready Preview, Comment Jun 12, 2026 11:26pm

Request Review

@trentas trentas merged commit cf00a0f into main Jun 12, 2026
4 checks passed
@trentas trentas deleted the feat/cli-auto-update branch June 12, 2026 23:31
trentas added a commit that referenced this pull request Jun 13, 2026
Bump version across pyproject.toml, iris/cli.py, platform/package.json and
add the CHANGELOG entry for the silent opt-out CLI self-update (#102, #103).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Auto-update silencioso do CLI (opt-out), espelhando o tracker do Claude Code

1 participant