@seanyao/roll 2.602.4 → 2.602.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## v2.602.5
4
+
5
+ ### 稳定性
6
+
7
+ - **升级后彻底不再反向提示"升级"回旧版本(FIX-170)** — 续 FIX-166:上次清缓存只在「新版本自己跑升级」时生效,可升级其实是旧版本执行的,所以换版本后偶尔还会被叫去装回旧号(这回升到 2.602.4 又冒出来提示装回 2.602.2)。现在版本检查缓存绑定了写它的版本号,版本一变缓存立即失效,不管 roll update / npm / brew / 手动哪种升级方式都不会再反向提示
8
+
3
9
  ## v2.602.4
4
10
 
5
11
  ### 可见性
package/bin/roll CHANGED
@@ -4,7 +4,7 @@ set -euo pipefail
4
4
  # Roll — AI Agent Convention Manager
5
5
  # Single source of truth for how all AI coding agents behave.
6
6
 
7
- VERSION="2.602.4"
7
+ VERSION="2.602.5"
8
8
  ROLL_HOME="${ROLL_HOME:-${HOME}/.roll}"
9
9
  ROLL_CONFIG="${ROLL_HOME}/config.yaml"
10
10
  ROLL_GLOBAL="${ROLL_HOME}/conventions/global"
@@ -15576,19 +15576,30 @@ _invalidate_update_cache() {
15576
15576
  rm -f "${ROLL_HOME}/.update-check"
15577
15577
  }
15578
15578
 
15579
+ # FIX-170: the cache file is `<ts> <latest> <writer-version>` — the 3rd field
15580
+ # binds it to the binary version that wrote it. FIX-166's explicit invalidation
15581
+ # only covers `roll update` run by a NEW binary; an upgrade executed by an old
15582
+ # binary (the 2.602.2→2.602.4 transition) or out-of-band (npm -g / brew / git)
15583
+ # left a stale cache that reverse-nagged for up to 24h. A writer-version
15584
+ # mismatch now means "stale" regardless of TTL: refetch, and stay silent until
15585
+ # the refetch lands. Legacy 2-field caches have no writer → auto-invalidated.
15579
15586
  _check_update_async() {
15580
15587
  local cache="${ROLL_HOME}/.update-check"
15581
15588
  local now; now=$(date +%s)
15582
- local last=0
15583
- [[ -f "$cache" ]] && last=$(awk '{print $1}' "$cache" 2>/dev/null || echo 0)
15584
- (( now - last < 86400 )) && return
15589
+ local last=0 writer=""
15590
+ if [[ -f "$cache" ]]; then
15591
+ last=$(awk '{print $1}' "$cache" 2>/dev/null || echo 0)
15592
+ writer=$(awk '{print $3}' "$cache" 2>/dev/null || true)
15593
+ fi
15594
+ [[ "$writer" == "$VERSION" ]] && (( now - ${last:-0} < 86400 )) && return
15585
15595
 
15586
15596
  {
15587
15597
  local latest
15588
15598
  latest=$(curl -sf --max-time 5 \
15589
15599
  "https://api.github.com/repos/seanyao/roll/releases/latest" \
15590
15600
  | grep '"tag_name"' | sed 's/.*"v\([^"]*\)".*/\1/' 2>/dev/null || true)
15591
- echo "$now ${latest:-}" > "$cache"
15601
+ # `-` placeholder keeps the field positions stable when the fetch fails.
15602
+ echo "$now ${latest:--} $VERSION" > "$cache"
15592
15603
  } &
15593
15604
  disown
15594
15605
  }
@@ -15596,8 +15607,13 @@ _check_update_async() {
15596
15607
  _notify_update() {
15597
15608
  local cache="${ROLL_HOME}/.update-check"
15598
15609
  [[ -f "$cache" ]] || return 0
15599
- local latest; latest=$(awk '{print $2}' "$cache" 2>/dev/null || true)
15600
- [[ -z "$latest" || "$latest" == "$VERSION" ]] && return
15610
+ local latest writer
15611
+ latest=$(awk '{print $2}' "$cache" 2>/dev/null || true)
15612
+ writer=$(awk '{print $3}' "$cache" 2>/dev/null || true)
15613
+ # FIX-170: cache written by a different binary version is stale — stay
15614
+ # silent; _check_update_async has already kicked off the refetch.
15615
+ [[ "$writer" != "$VERSION" ]] && return
15616
+ [[ -z "$latest" || "$latest" == "-" || "$latest" == "$VERSION" ]] && return
15601
15617
  # FIX-163: the cached `latest` is GitHub's releases/latest — the newest
15602
15618
  # release by created_at, NOT by semver. Under the MAJOR.MMDD scheme a plain
15603
15619
  # `sort -V` mis-ranks versions across the year-based→MAJOR.MMDD transition
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seanyao/roll",
3
- "version": "2.602.4",
3
+ "version": "2.602.5",
4
4
  "description": "Roll — Roll out features with AI agents",
5
5
  "scripts": {
6
6
  "test": "bash tests/run.sh"