Skip to content

fix(updater): follow the release protocol and only replace installs we own - #1099

Merged
thdxr merged 1 commit into
devfrom
updater-audit
Nov 25, 2026
Merged

thdxr merged 1 commit into
devfrom
updater-audit

Conversation

@thdxr

@thdxr thdxr commented Nov 25, 2026

Copy link
Copy Markdown
Member

audited the updater against the release guide's auto-updating rules (dev channel only, opencode/desktop-rune/dev.json)

already fine

  • checks 10 s after launch, then every 10 min, failures included (never past an hour), and keeps checking while an update is staged so a newer one replaces it
  • no query string or install id, only https://anoma.ly/release, never dev.anoma.ly
  • versions only tested for equality, rollout_percent and required honored, wrong app/artifact/channel rejected
  • size + sha-256 checked while downloading, before anything is unpacked
  • windows: every exe/dll must be signed by Anomaly Innovations, Inc https://anoma.ly/
  • source/local/pr builds never check (mac .dev bundle id, windows unsigned/local, linux local)

changed

  • user-agent is now opencode/dev/<version> (was opencode-rune/<v> (<target>; channel=…)), downloads too
  • manifest is revalidated with If-None-Match + last ETag (304 reuses the cached body), capped at 256 KiB
  • required: false no longer rejects the manifest (vector "required must be a boolean")
  • a release with the running version's text but a different sha-256 now installs, the machine was dropping it (vector "a different file with the same version is another build")
  • mac: update must pass codesign -R with anomaly's developer id requirement for team 5NZ4Q7NXJ4 + notarized (same as hex), and it always expects that team instead of whatever team signed the running app
  • mac: a translocated or non-writable bundle (parent or the .app itself) keeps checking but links to the dmg instead of trying to swap
  • windows: the setup now writes install.json (app, artifact, channel, method: "direct", root) into the install root, and the updater carries it into each swapped-in version. installs from older setups get it written when an apps & features entry names their folder. any other copy (zip run in place, unwritable folder) keeps checking but links to the setup
  • DisableUpdates: mac defaults key in anomaly.opencode-rune (user, /Library/Preferences and managed prefs), windows HKLM/HKCU SOFTWARE\Policies\Anomaly\OpenCode. either turns the updater off
  • dev only: dropped the stable feed mapping, OPENCODE_RUNE_UPDATE_CHANNEL, and the mac .stable/.beta bundle ids
  • no rune-desktop left in the updater code

follow-ups

  • linux never self-installs (only opens the appimage/deb/rpm link), so nothing extracts or runs a download and no ed25519 check is needed today. if linux ever self-updates it needs a release signing key + <target>-sig first
  • no focus checks exist, so the 1/min cap doesn't apply. could add dev focus checks like hex
  • the release registry (anomalyco/release registry/opencode.json) still authorizes publishes from anomalyco/rune-desktop; github's oidc repository claim follows the rename, so that needs updating (and docs/releasing.md with it)
  • the browser engine index fetch (crates/browser-pane/src/source.rs, opencode-rune/browser-engine/stable.json) sends ureq's default user-agent, left alone here
  • the windows policy key name (Anomaly\OpenCode) is my pick, change it if we want one per app

checked with cargo check of the updater (linux, windows via xwin, macos on a mac, wasm) and opencode-desktop, clippy --no-deps -D warnings on the updater/win-install/setup for linux, windows and macos, and scripts/guardrails.sh. not run live

…e own

user-agent opencode/dev/<version>, etag revalidation, required:false, same-version builds by sha, mac codesign -R requirement with notarization, windows install.json receipt, DisableUpdates policy, dev channel only
@github-actions

Copy link
Copy Markdown

Test build ready — Download OpenCode-Rune-PR-1099-macos-arm64.dmg

  • App: OpenCode (Rune) · updater-audit.app (badged #1099, bundle ID anomaly.opencode-rune.pr.1099)
  • Commit: 120e49a29 (0.0.0-pr-1099-2372, sha256 172555fb7e06…)
  • Side-by-side: installs alongside OpenCode (Rune).app without replacing your dev build; retired automatically when this PR closes.
  • Signing: Ad-hoc signed preview (PR code is never signed with release credentials) — after dragging to /Applications, run xattr -cr "/Applications/OpenCode (Rune) · updater-audit.app" once before first open.
  • Windows: x64 arm64 — unsigned setup (OpenCode (Rune) · updater-audit, installs side by side). SmartScreen asks once: More info, then Run anyway.

@thdxr
thdxr merged commit 0cfe81b into dev Nov 25, 2026
7 checks passed
@thdxr
thdxr deleted the updater-audit branch November 25, 2026 02:51
Hona added a commit that referenced this pull request Nov 25, 2026
)

#1099 added a dependency to crates/win-install and features/updater. cargo derives a crate's symbol hash from its dependencies' hashes, so those two crates and the crates that depend on them (the app crate among them) got new symbol names, and the committed profiles no longer named their functions. Counts moved onto the new names from an instrumented build of dev (#1113): Windows 15,411 of 15,457 functions kept (3,736 renamed; 37 dropped: their code changed; 9 gone); Apple silicon 15,445 of 15,499 (4,452 renamed; 41 dropped; 13 gone). No code changes.
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