Skip to content

feat(#596): per-worker RigForge "new version available" badge - #688

Merged
VijitSingh97 merged 4 commits into
developfrom
claude/596-rigforge-badge
Jul 21, 2026
Merged

feat(#596): per-worker RigForge "new version available" badge#688
VijitSingh97 merged 4 commits into
developfrom
claude/596-rigforge-badge

Conversation

@VijitSingh97

Copy link
Copy Markdown
Collaborator

Closes #596. Stacked on #686 (the #660 bounded-HTTP helper — this adds the next GitHub call site on top of it); retarget to develop after #686 merges.

An operator has no way to see that a rig is running an old RigForge. This adds the notify-only visibility half of the v1.10 worker-upgrade theme (#598): a rig whose reported RigForge version is older than the latest published release gets a clickable badge in the Workers Alive table and in Worker Inspect, linking to the release notes. The one-click upgrade is the separate #597, which gates its button on this badge.

Design

  • One fleet-wide fetch, per-rig verdicts at the render seam. UpdateChecker grows a latest_release_cached(now) accessor (same hourly throttle, same fail-silent keep-last-good contract; maybe_check now rides it); DataService runs a second checker pointed at GITHUB_RIGFORGE_RELEASES_API over the existing Tor SOCKS route and stores the raw {tag, url} as latest_data["rigforge_release"].
  • The Header still shows 'New release v1.9.1 available' + Upgrade button while already running v1.9.1 #664 guard, by construction. Only the input (the release) is stored; each rig's rigforge_update is derived per-serialize by views.rigforge_update_for from its live reported version — derived state never outlives its inputs, so a rig on X can never badge "X available", and a snapshot can't resurrect a stale verdict. The release is written unconditionally in the poll loop (the accessor returns None without dialing when the check is off), so a snapshot-restored release can't outlive a flag flip either.
  • Version formats normalize at the compute seam. The rig reports bare 1.11.2; release tags are v1.11.2compute_update/parse_semver already handle both; a tier-1 test now pins that equality across the formats.
  • One flag covers both checks. dashboard.check_for_updates gates the stack check and this one — off means neither dials GitHub.
  • Honest unknowns. A plain-:8080 rig reports no version → no badge (unknown, not "up to date").

Tests

  • Tier 1: latest_release_cached (throttle one-call-many-reads, disabled → no dial, blip keeps cache); bare-vs-v equality in compute_update.
  • Tier 2 (dashboard): rigforge_update_for matrix (behind / current / newer / unparseable / no-version / no-release); build_workers + build_state + build_worker_detail carry the field; DataService wiring drift-guard (right API, same flag, same Tor proxy).
  • Frontend (Node runner): exactly one rig badged in the table; Inspect callout renders only when the server derived one. state.json fixture regenerated (contract grew).
  • Tier 4: rides One-click remote worker upgrade — orchestration + UI #597's gouda loaner session — the behind-rig badge is that scenario's precondition.
  • make test green; patch coverage 98%; docs voice pass clean.
  • Ponytail over-engineering pass: clean — the one-caller RigUpdateBadge follows the established tiny-component idiom; rigforge_update_for and latest_release_cached each have two consumers.

Docs

docs/workers.md (new "RigForge new-release badge" section), docs/dashboard.md (Workers Alive), docs/configuration.md + docs/privacy.md (the flag now covers both checks; the RigForge check sends no rig versions upstream).

🤖 Generated with Claude Code

VijitSingh97 and others added 2 commits July 19, 2026 16:39
All five external call sites — the GitHub release check (#224), the three
XvB reads (stats, reward estimates, winners), and the CoinGecko price
feed (#651) — read via a shared helper/http.py bounded_get that streams
the body and cuts it at 1 MiB. Over-cap raises a RequestException
subclass, so each client's existing fail-silent contract (None / keep
last good) applies unchanged. Known residual from the #642/#646 security
reviews; the local Telegram/healthchecks/monerod clients keep their own
contracts and stay out of scope.

Closes #660

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
One fleet-wide, hourly, Tor-routed fetch of the latest RigForge release
(UpdateChecker.latest_release_cached, gated on the same
dashboard.check_for_updates flag) cached as raw {tag, url}; each rig's
badge is derived at the render seam from its live reported version
(rigforge_update_for), so derived state never outlives its inputs (#664)
and a rig on X can never badge X available. compute_update normalizes
the rig's bare 1.11.2 against the tag's v1.11.2. Badges render in the
Workers Alive table and Worker Inspect; rigs reporting no version show
no badge (unknown, not up-to-date).

Closes #596

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…cstring + catalog row

- Snapshot restore popped `update` (#664) but not `rigforge_release`, so with
  check_for_updates flipped off a restored snapshot re-seeded stale per-worker
  badges until the first poll cycle. Pop it alongside `update`; the checker
  re-fetches on its own cadence. Extends the #664 restore test (fails without
  the pop).
- update_checker docstring said the check is opt-in (default off) — the config
  default and docs/configuration.md say on by default. Docstring now matches.
- testing-strategy scenario catalog (Section I) gains the #596 badge row:
  tier 1 covered today, live badge owed to the #597 gouda loaner session.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@VijitSingh97
VijitSingh97 deleted the branch develop July 21, 2026 00:03
@VijitSingh97 VijitSingh97 reopened this Jul 21, 2026
@VijitSingh97
VijitSingh97 changed the base branch from claude/660-bounded-http to develop July 21, 2026 00:05
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@VijitSingh97
VijitSingh97 merged commit 0bbb040 into develop Jul 21, 2026
16 checks passed
VijitSingh97 added a commit that referenced this pull request Jul 21, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@VijitSingh97
VijitSingh97 deleted the claude/596-rigforge-badge branch July 21, 2026 23:18
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.

Worker "new version available" badge (RigForge version)

1 participant