Update-check nudge (with what's-new) + SKILL/MCP reconciliation#21
Merged
Conversation
… 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.
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.
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 ofcfg.coreso the engine stays network-free): checks PyPI, throttled to once/day, snooze-aware (~/.cfgit/update-check.json),CFGIT_NO_UPDATE_CHECKkill switch, best-effort/fail-silent, never auto-upgrades.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.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_updateto the SKILL tool list; documented the top-levelstate/nextremedy contract,CFG_OUTPUT/CFG_ENVsession 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
test_update_check.py(13): version compare, throttle, snooze/lapse, kill switch, fail-silent, garbage-state tolerance, what's-new excerpt + degrade.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).