Skip to content

Update-check nudge (with what's-new) + SKILL/MCP reconciliation#21

Merged
AusafMo merged 3 commits into
mainfrom
feat/update-check
Jul 26, 2026
Merged

Update-check nudge (with what's-new) + SKILL/MCP reconciliation#21
AusafMo merged 3 commits into
mainfrom
feat/update-check

Conversation

@AusafMo

@AusafMo AusafMo commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Since the team drives cfgit through Claude and nobody remembers to upgrade, cfgit now notices when a newer version is on PyPI and nudges — quietly, never forcing.

What

  • src/cfg/update.py (kept out of cfg.core so the engine stays network-free): checks PyPI, throttled to once/day, snooze-aware (~/.cfgit/update-check.json), CFGIT_NO_UPDATE_CHECK kill switch, best-effort/fail-silent, never auto-upgrades.
  • What's new: when an update is available it fetches the latest GitHub release notes (the highlights we already author at release time) and shows a short excerpt + link — so the user sees what they'd get, not just a version number. Degrades to a plain one-liner if the notes fetch fails.
  • Two surfaces, one engine + snooze state:
    • CLI: cfg check-update [--snooze [DAYS]], plus a deterministic stderr nudge after cheap read commands (status/doctor/whoami/log) — human-TTY only, never on stdout/--json/piped, never on a write path.
    • MCP: cfg_check_update(snooze_days) (engine-less) + a SKILL session-start rule so Claude offers the upgrade or a 30-day snooze.

SKILL + MCP reconciliation (not just this feature)

Brought the agent docs current with everything shipped 0.2→0.4: added cfg_set/cfg_import/cfg_check_update to the SKILL tool list; documented the top-level state/next remedy contract, CFG_OUTPUT/CFG_ENV session defaults, doctor --status + open-mode warning, export size warning, and import cancellation/resume. README: cfg check-update + cfg_check_update.

Bootstrap reality

Only helps 0.4.0-forward — already-installed ≤0.3.0 have no check code; those need one manual pip install -U (comms is out of scope here).

Testing

  • 149 pass / 2 skip, ruff clean. test_update_check.py (13): version compare, throttle, snooze/lapse, kill switch, fail-silent, garbage-state tolerance, what's-new excerpt + degrade.
  • Live: cfg check-update/--snooze/kill-switch verified; what's-new fetched real GitHub notes; nudge gating proven across TTY / piped / --json / write-command — stdout never polluted.

Suggest releasing as 0.4.0 (minor, additive).

AusafMo added 3 commits July 26, 2026 21:30
… engine

New src/cfg/update.py (out of cfg.core to keep the engine network-free): checks PyPI for a newer
cfgit, throttled daily, snooze-aware (~/.cfgit/update-check.json), CFGIT_NO_UPDATE_CHECK kill
switch, best-effort/fail-silent, NEVER auto-upgrades. When an update is available it fetches the
latest GitHub release notes and shows a short 'what's new' excerpt + link, so the user sees what
they'd get — degrades to a plain one-liner if the notes fetch fails.

Two surfaces sharing the engine + snooze state:
- CLI: 'cfg check-update [--snooze [DAYS]]', and a deterministic stderr nudge after cheap READ
  commands (status/doctor/whoami/log) — human-TTY only, never on stdout/--json/piped, never on a
  write path, wrapped so it can't break the command.
- MCP: cfg_check_update(snooze_days) (engine-less, cfg_identity_hash pattern) + a SKILL session-
  start rule so Claude offers the upgrade or a 30-day snooze.

Bootstrap reality: only helps 0.4.0-forward; already-installed <=0.3.0 have no check code.

Tests: test_update_check.py (13) — version compare, throttle, snooze/lapse, kill switch, fail-
silent, garbage-state tolerance, what's-new excerpt + degrade. 149 pass.
…2-0.4)

Bring the agent-facing docs fully current, not just the update-check:
- SKILL MCP list: add cfg_set, cfg_import, cfg_check_update (were missing); envelope note now
  documents top-level state + next remedy contract (branch on state, follow next.commands).
- SKILL Rules: session-start cfg_check_update nudge; CFG_OUTPUT/CFG_ENV/CFG_CONFIG session
  defaults + walk-up; cfg doctor --status where-am-I + open-mode-unaudited warning.
- SKILL Mutate: export size warning (data-plane hint) + import partial/cancelled resume.
- README: cfg check-update command + auto-nudge/snooze/CFGIT_NO_UPDATE_CHECK doc; cfg_check_update
  in the MCP list.
Verified every MCP tool the SKILL names is actually registered.
Parametrized test proving the deterministic nudge fires for interactive-human read commands but
is silent on --json, piped/non-TTY, and write commands — and never touches stdout in any case.
Was verified live; now a permanent test so it can't silently regress. 155 pass.
@AusafMo
AusafMo merged commit 969b483 into main Jul 26, 2026
2 checks passed
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