Skip to content

Add an "update available" notice (install-method aware)#79

Merged
alexkroman merged 12 commits into
mainfrom
update-notifier
Jun 11, 2026
Merged

Add an "update available" notice (install-method aware)#79
alexkroman merged 12 commits into
mainfrom
update-notifier

Conversation

@alexkroman

Copy link
Copy Markdown
Collaborator

Summary

Add an unobtrusive "update available" notice in the npm update-notifier / Vercel style. When a newer release exists, the next human, interactive run prints a small bordered box on stderr after the command finishes, with the upgrade command matching how the CLI was installed.

  ╭────────────────────────────────────────────────╮
  │                                                  │
  │   Update available  0.1.0 → 0.2.0                │
  │   Run  brew upgrade assembly  to update          │
  │                                                  │
  ╰────────────────────────────────────────────────╯
  • Never blocks. The notice always renders from a config.toml cache (zero latency). The cache is refreshed by a detached assembly _update-check process (≤ once/day), reusing the exact detached-spawn pattern from telemetry.py.
  • Version source = GitHub Releases API (/releases/latesttag_name) — the PyPI name is squatted, and releases ship as git tags/bottles. releases/latest excludes pre-releases.
  • Install-method aware: detects brew / pipx / uv-tool from the running interpreter's path and shows brew upgrade assembly / pipx upgrade assembly / uv tool upgrade assembly (or a docs hint when unknown).
  • Suppressed under --json, non-TTY (piped/redirected), CI, AAI_NO_UPDATE_CHECK, or when not actually behind — so pipelines and agents stay clean.
  • Best-effort: all network/parse/config failures are swallowed; the notice can never delay or break a command.
  • Declares packaging as a direct dependency (already resolved transitively) for robust version compare.

Also includes scripts/bump_minor.sh (a release helper that bumps the minor version, complementing cut_release.sh).

Test Plan

  • ./scripts/check.shAll checks passed.
  • aai_cli/update_check.py at 100% coverage; diff-cover 100% on changed lines
  • Mutation gate: 26 mutants on changed lines, no survivors (behavioral asserts for the interval value, timeout/follow-redirects passed to the request, empty/missing-tag handling, and every suppression rule; cosmetic Panel styling marked # pragma: no mutate)
  • End-to-end: a real command shows the box on a human/TTY run and is silent under --json
  • Hidden _update-check command runs and is absent from --help

🤖 Generated with Claude Code

alexkroman-assembly and others added 10 commits June 11, 2026 14:53
A best-effort, cached, non-blocking "update available" notice (npm
update-notifier / Vercel style): renders from cache on stderr for human TTY
runs, refreshes via a detached GitHub-releases check, and shows the upgrade
command matching the detected install method (brew/pipx/uv).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Bumps the version (pyproject.toml + aai_cli/__init__.py) by one minor
increment (X.Y.Z -> X.(Y+1).0). Complements cut_release.sh, which tags
whatever version main already holds.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Wire update_check.maybe_notify into run_command's success path; register the
hidden _update-check command with an examples epilog; cover the notice's
render/fetch/gating paths (incl. install-method detection) end to end.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add scripts/bump_minor.sh to check.sh's shellcheck list so the release
helper is covered like cut_release.sh.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@alexkroman
alexkroman enabled auto-merge (squash) June 11, 2026 22:47
@alexkroman
alexkroman merged commit 246348f into main Jun 11, 2026
8 checks passed
@alexkroman
alexkroman deleted the update-notifier branch June 11, 2026 22:54
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.

2 participants