Update 71: fluxer-core updater: settings, status machine, checks, apply rules, selectors #433

Closed
opened 2026-11-13 07:49:10 +00:00 by charles · 0 comments
Owner

Plan: docs/superpowers/plans/2026-11-12-textchat.md, section "Task 71" (Auto-update, added 2026-11-13 at Charles's request). Design: docs/superpowers/specs/2026-11-13-fluxer-native-autoupdate-design.md.

Task 71: fluxer-core updater: settings, status machine, checks, apply rules, selectors

Issue: (to be created)
Closes: none.

Files:

  • Create: crates/fluxer-core/src/update.rs, crates/fluxer-core/src/selectors/update.rs
  • Modify: crates/fluxer-core/src/{lib.rs,app.rs,effect.rs,event.rs,persist.rs,selectors/mod.rs}, crates/fluxer-core/README.md
  • Test: crates/fluxer-core/tests/update.rs

Interfaces:

  • Consumes: Text chat 69.
  • Produces (state): UpdateSettings { channel: Option<Channel>, automatic: bool } (Default: None, true) as LocalSettings.update (boxed like the other tables); BuildInfo { version: Option<ReleaseVersion>, channel: Channel, commit: String, platform: Option<PlatformKey> }; InstallCapability { Restart, Manual(ManualReason) } with ManualReason { ReadOnlyLocation, NotAnAppImage, PackageFormatChanged, BelowMinimumVersion, UnknownKind, Unsupported }; UpdateStatus and DisabledReason { DevBuild, NoPlatform } exactly as update §4.2; OfferedRelease { version, channel, commit, notes_url, asset }; UpdateError { Feed(String), Download(String), Verify, Apply(String) } (plain words, never a URL); App.update: UpdateState { status, settings_view: UpdateSettings, failures_by_version, next_check: Option<TimerId>, confirm_restart: bool, manual_result: Option<ManualDownload { path_display: String }> }.
  • Produces (commands/events): Effect::Update(UpdateCommand) with UpdateCommand { Check { channel: Channel }, Download { release: Box<OfferedRelease>, to: DownloadTo /* Staging | Downloads */ }, CancelDownload, Apply { relaunch: bool }, RevealDownload }; CoreEvent::Update(UpdateEvent) with UpdateEvent { Started { build: BuildInfo, install: InstallCapability, now_ms: u64 }, Checked { channel, result: Result<Option<Manifest>, UpdateError>, now_ms }, Progress { received: u64, total: u64 }, Downloaded(Result<DownloadedFile /* { version, location_display: String } — the runtime keeps the path */, UpdateError>), ApplyFailed(UpdateError), Quitting }; UserAction::Update(UpdateAction { ButtonClicked, CheckNow, SetChannel(Channel), SetAutomatic(bool), ConfirmRestart, CancelRestart, DismissError, OpenNotes }). Quitting returns Apply { relaunch: false } only when Ready and automatic.
  • Produces (rules, update §4.3–4.6): first check 10 s after Started, CHECK_INTERVAL = 2 h, background backoff 15 min doubling to 2 h; manual check never backs off; Disabled(DevBuild) when build.version is None; newer = ReleaseVersion strictly greater and commit not a prefix match of build.commit; minimum_version above the build → Manual(BelowMinimumVersion); Unknown kind → Manual(UnknownKind); background download only when automatic && Restart; three verification failures for one version stop its background downloads; a channel change re-checks at once and cancels a download of the other channel; ButtonClicked on Ready while selectors::voice_status reports a connected call or an own stream → confirm_restart = true, never Apply; persistence through the existing PersistOp when settings change.
  • Produces (selectors): update_button(&App) -> Option<UpdateButtonModel { icon: UpdateIcon /* Download | Spinning | Error */, tooltip: String, enabled: bool, progress: Option<f32> }> with the tooltips of update §6.1; update_settings(&App) -> UpdateSettingsModel { version_line: String, development_build: bool, channel: Channel, stable_published: Option<bool>, automatic: bool, status_line: Option<String>, check_enabled: bool }; `client_info(&App, product: &str, os: &str) ->

🤖 Generated with Claude Code

Plan: `docs/superpowers/plans/2026-11-12-textchat.md`, section "Task 71" (Auto-update, added 2026-11-13 at Charles's request). Design: `docs/superpowers/specs/2026-11-13-fluxer-native-autoupdate-design.md`. ### Task 71: `fluxer-core` updater: settings, status machine, checks, apply rules, selectors **Issue:** (to be created) **Closes:** none. **Files:** - Create: `crates/fluxer-core/src/update.rs`, `crates/fluxer-core/src/selectors/update.rs` - Modify: `crates/fluxer-core/src/{lib.rs,app.rs,effect.rs,event.rs,persist.rs,selectors/mod.rs}`, `crates/fluxer-core/README.md` - Test: `crates/fluxer-core/tests/update.rs` **Interfaces:** - Consumes: Text chat 69. - Produces (state): `UpdateSettings { channel: Option<Channel>, automatic: bool }` (`Default`: `None`, `true`) as `LocalSettings.update` (boxed like the other tables); `BuildInfo { version: Option<ReleaseVersion>, channel: Channel, commit: String, platform: Option<PlatformKey> }`; `InstallCapability { Restart, Manual(ManualReason) }` with `ManualReason { ReadOnlyLocation, NotAnAppImage, PackageFormatChanged, BelowMinimumVersion, UnknownKind, Unsupported }`; `UpdateStatus` and `DisabledReason { DevBuild, NoPlatform }` exactly as update §4.2; `OfferedRelease { version, channel, commit, notes_url, asset }`; `UpdateError { Feed(String), Download(String), Verify, Apply(String) }` (plain words, never a URL); `App.update: UpdateState { status, settings_view: UpdateSettings, failures_by_version, next_check: Option<TimerId>, confirm_restart: bool, manual_result: Option<ManualDownload { path_display: String }> }`. - Produces (commands/events): `Effect::Update(UpdateCommand)` with `UpdateCommand { Check { channel: Channel }, Download { release: Box<OfferedRelease>, to: DownloadTo /* Staging | Downloads */ }, CancelDownload, Apply { relaunch: bool }, RevealDownload }`; `CoreEvent::Update(UpdateEvent)` with `UpdateEvent { Started { build: BuildInfo, install: InstallCapability, now_ms: u64 }, Checked { channel, result: Result<Option<Manifest>, UpdateError>, now_ms }, Progress { received: u64, total: u64 }, Downloaded(Result<DownloadedFile /* { version, location_display: String } — the runtime keeps the path */, UpdateError>), ApplyFailed(UpdateError), Quitting }`; `UserAction::Update(UpdateAction { ButtonClicked, CheckNow, SetChannel(Channel), SetAutomatic(bool), ConfirmRestart, CancelRestart, DismissError, OpenNotes })`. `Quitting` returns `Apply { relaunch: false }` only when `Ready` and `automatic`. - Produces (rules, update §4.3–4.6): first check 10 s after `Started`, `CHECK_INTERVAL = 2 h`, background backoff 15 min doubling to 2 h; manual check never backs off; `Disabled(DevBuild)` when `build.version` is `None`; newer = `ReleaseVersion` strictly greater and commit not a prefix match of `build.commit`; `minimum_version` above the build → `Manual(BelowMinimumVersion)`; `Unknown` kind → `Manual(UnknownKind)`; background download only when `automatic && Restart`; three verification failures for one version stop its background downloads; a channel change re-checks at once and cancels a download of the other channel; `ButtonClicked` on `Ready` while `selectors::voice_status` reports a connected call or an own stream → `confirm_restart = true`, never `Apply`; persistence through the existing `PersistOp` when settings change. - Produces (selectors): `update_button(&App) -> Option<UpdateButtonModel { icon: UpdateIcon /* Download | Spinning | Error */, tooltip: String, enabled: bool, progress: Option<f32> }>` with the tooltips of update §6.1; `update_settings(&App) -> UpdateSettingsModel { version_line: String, development_build: bool, channel: Channel, stable_published: Option<bool>, automatic: bool, status_line: Option<String>, check_enabled: bool }`; `client_info(&App, product: &str, os: &str) -> 🤖 Generated with [Claude Code](https://claude.com/claude-code)
charles added this to the Text chat milestone 2026-11-13 07:49:10 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/fluxer-native#433
No description provided.