Skip to content

feat(selfupdate): X8 — throttled, fail-silent update notifier (spec 14) - #25

Merged
gustavobertoi merged 1 commit into
mainfrom
nightly/X8
Jun 29, 2026
Merged

feat(selfupdate): X8 — throttled, fail-silent update notifier (spec 14)#25
gustavobertoi merged 1 commit into
mainfrom
nightly/X8

Conversation

@gustavobertoi

Copy link
Copy Markdown
Contributor

Chunk X8 (M6)

selfupdate.Notifier prints a one-line "new release available" notice after a command (CLI root PersistentPostRun, stderr):

  • throttled — GitHub at most once per 24h, caching {checkedAt,latest} under the XDG cache dir; within the TTL it reads the cache (no network).
  • fail-silent — any error (offline, rate limit, bad cache) → no notice, never affects exit.
  • quiet where it should be — skipped for --json/--quiet, dev/dirty builds (no clean semver), and DEVSTACK_NO_UPDATE_NOTIFIER.
  • bounded — refresh runs under a 2s context timeout.

Tests

Injected clock + check fn + temp cache: notice-when-newer, silent-when-current, cache throttle (1 call within TTL, refresh after), fail-silent, dev-build skip, env opt-out.

Gate

make ci + make smoke green (dev/stamped builds stay silent).

🤖 Generated with Claude Code

selfupdate.Notifier prints a one-line "new release available" notice after a
command, wired into the CLI root's PersistentPostRun (stderr). It is:

- throttled — hits GitHub at most once per 24h, caching {checkedAt,latest} under
  the XDG cache dir; within the TTL it reads the cache (no network).
- fail-silent — any error (offline, rate limit, bad cache) yields no notice and
  never affects the command's exit.
- quiet by default where it should be — skipped for --json/--quiet output, for
  dev/dirty builds (no clean semver to compare), and when
  DEVSTACK_NO_UPDATE_NOTIFIER is set.
- bounded — the refresh check runs under a 2s context timeout.

Unit-tested with an injected clock + check fn + temp cache: notice-when-newer,
silent-when-current, cache throttle (1 network call within TTL, refresh after),
fail-silent on error, dev-build skip, env opt-out.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gustavobertoi
gustavobertoi merged commit 28c4a78 into main Jun 29, 2026
2 checks passed
@gustavobertoi
gustavobertoi deleted the nightly/X8 branch June 29, 2026 15:21
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.

1 participant