feat(v0.6.3): release-update notifier (notify-only, SessionStart)

Adds a lightweight "new release available" notice without auto-installing —
because re-running install.sh overwrites ADAM's own /reflect-applied skill
edits, so the user must choose when to take an update.

- install.sh writes ~/.claude/adam/.version (the installed release tag) on
  every install. Derived from $VERSION / piped REF / `git describe --tags`.
- adam-nudge.mjs (SessionStart) compares .version against the latest GitHub
  release at most once/day. Cached in ~/.claude/adam/.update-check.json; the
  cache drives an instant nudge (no network on the hot path) and is refreshed
  best-effort with a 1.5s AbortController cap. fetch unavailable / offline /
  timeout / rate-limit / parse error all degrade to silent no-op. Opt out with
  ADAM_NO_UPDATE_CHECK=1. main() is now async; never blocks SessionStart.
- README: "Staying up to date" section; pin example bumped to v0.6.3.

Tests: 134 -> 138. Notifier verified fully offline (cache-driven): nudges when
a newer release is cached, silent when current, suppressed by the opt-out env,
and no-ops when the .version marker is absent.
This commit is contained in:
2026-05-29 13:13:59 +01:00
parent d929101af4
commit fcddb6bf79
5 changed files with 175 additions and 10 deletions
+14
View File
@@ -143,6 +143,20 @@ copy_file "$SRC/adam/tests/fixtures/seed-corrections.jsonl" "$DEST/adam
# install marker — used by future runs to detect local mtime drift
run "touch \"$DEST/adam/.install-marker\""
# version marker — records the installed release tag for the update notifier
# (adam-nudge.mjs compares it against the latest GitHub release).
ADAM_VERSION=""
if [ -n "$VERSION" ]; then
ADAM_VERSION="$VERSION"
elif [ "$PIPED" = 1 ] && [ -n "${REF:-}" ]; then
ADAM_VERSION="$REF"
else
ADAM_VERSION="$(git -C "$SRC" describe --tags --abbrev=0 2>/dev/null || true)"
fi
[ -z "$ADAM_VERSION" ] && ADAM_VERSION="unknown"
run "printf '%s\\n' \"$ADAM_VERSION\" > \"$DEST/adam/.version\""
log " version marker: $ADAM_VERSION"
# --------------------------------------------------------------------- settings.json
SETTINGS="$DEST/settings.json"
EXAMPLE="$SRC/settings.json.example"