Update 74: apps/fluxer and devserver: updater runtime, apply helper, fake feed, parity #436

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

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

Task 74: apps/fluxer and devserver: updater runtime, apply helper, fake feed, parity

Issue: (to be created)
Closes: none.

Touches fluxer-devserver (fake feed first) and apps/fluxer — serialised in that order — plus
the parity docs.

Files:

  • Create: crates/fluxer-devserver/src/updates.rs, crates/fluxer-devserver/fixtures/updates/ (a small fake asset; manifests are generated at run time with the asset's real SHA-256), apps/fluxer/src/update_rt.rs
  • Modify: crates/fluxer-devserver/src/{http.rs,lib.rs,main.rs} (--update-scenario), crates/fluxer-devserver/README.md; apps/fluxer/src/{main.rs,runtime.rs,config.rs,lib.rs}, apps/fluxer/README.md; docs/parity/settings.toml (advanced-automatic-updates → done with its note; new row native-update-channel, tab advanced_settings, owner 6, done), docs/parity/ shell list (tray "Check for updates" note)
  • Test: crates/fluxer-devserver/tests/updates.rs, apps/fluxer/tests/update_runtime.rs

Interfaces:

  • Consumes: Text chat 69–72 (and 73 only for manual verification; the runtime tests do not render).

  • Produces (devserver): GET /_update/feed/{channel}.json and GET /_update/assets/{name} (Accept-Ranges: bytes, 206 + Content-Range, 416 on a bad range, ETag); --update-scenario newer|same|bad-sha|malformed|none (default newer: version 2026.0101.2 against the app's faked 2026.0101.1, stable unpublished → 404).

  • Produces (app): update_rt::UpdateRuntime executing UpdateCommands on the runtime (feed via UpdateHttp, downloads on a task with progress throttled to 4 Hz as UpdateEvent::Progress, CancelDownload), sending UpdateEvent::Started at start with BuildInfo from debug_info::RELEASE + GIT_SHA + PlatformKey::current() and the capability from detect_install, and running sweep_leftovers once; feed base = FEED_BASE, or FLUXER_UPDATE_FEED_BASE (logged once), or the devserver's /_update/feed with --devserver. --devserver fakes the build as 2026.0101.1 nightly and makes Apply a dry run (logs the target path and stays Ready). Apply { relaunch }: the same clean shutdown as closing the window (leave voice, flush persistence), then appimage::apply + relaunch, or windows::prepare + spawn the helper, then exit; failures before exit → UpdateEvent::ApplyFailed. Window close sends UpdateEvent::Quitting first and executes a resulting Apply { relaunch: false } after shutdown. main.rs: --apply-update <journal> (hidden) is handled before anything else (no logging setup, no settings, no window) and calls windows::run_helper with the real ops; on Linux it exits with an error. --debug-info gains an "Updates" section: channel, feed base, install target, capability.

  • Step 1: Write failing tests: devserver — feed_serves_a_manifest_with_the_assets_real_sha256, asset_supports_ranges, bad_range_is_416, scenarios_change_the_feed, stable_feed_is_404; runtime (devserver, no GPU, no network) — devserver_update_flows_from_check_to_ready, dry_run_apply_does_not_touch_the_binary, bad_sha_scenario_fails_verification_and_retries_later, malformed_feed_is_silent, manual_check_reports_up_to_date_with_same_scenario, channel_switch_rechecks, dev_build_without_devserver_never_requests_the_feed, feed_base_override_is_used_and_logged_once, quit_with_ready_applies_without_relaunch (fake installer), apply_failure_reports_apply_failed (fake installer), apply_update_helper_flag_runs_before_logging (spawns the test binary with a journal against a temp dir, #[cfg(windows)] for

🤖 Generated with Claude Code

Plan: `docs/superpowers/plans/2026-11-12-textchat.md`, section "Task 74" (Auto-update, added 2026-11-13 at Charles's request). Design: `docs/superpowers/specs/2026-11-13-fluxer-native-autoupdate-design.md`. ### Task 74: `apps/fluxer` and devserver: updater runtime, apply helper, fake feed, parity **Issue:** (to be created) **Closes:** none. Touches `fluxer-devserver` (fake feed first) and `apps/fluxer` — serialised in that order — plus the parity docs. **Files:** - Create: `crates/fluxer-devserver/src/updates.rs`, `crates/fluxer-devserver/fixtures/updates/` (a small fake asset; manifests are generated at run time with the asset's real SHA-256), `apps/fluxer/src/update_rt.rs` - Modify: `crates/fluxer-devserver/src/{http.rs,lib.rs,main.rs}` (`--update-scenario`), `crates/fluxer-devserver/README.md`; `apps/fluxer/src/{main.rs,runtime.rs,config.rs,lib.rs}`, `apps/fluxer/README.md`; `docs/parity/settings.toml` (`advanced-automatic-updates` → done with its note; new row `native-update-channel`, tab `advanced_settings`, owner 6, done), `docs/parity/` shell list (tray "Check for updates" note) - Test: `crates/fluxer-devserver/tests/updates.rs`, `apps/fluxer/tests/update_runtime.rs` **Interfaces:** - Consumes: Text chat 69–72 (and 73 only for manual verification; the runtime tests do not render). - Produces (devserver): `GET /_update/feed/{channel}.json` and `GET /_update/assets/{name}` (`Accept-Ranges: bytes`, `206` + `Content-Range`, `416` on a bad range, ETag); `--update-scenario newer|same|bad-sha|malformed|none` (default `newer`: version `2026.0101.2` against the app's faked `2026.0101.1`, `stable` unpublished → 404). - Produces (app): `update_rt::UpdateRuntime` executing `UpdateCommand`s on the runtime (feed via `UpdateHttp`, downloads on a task with progress throttled to 4 Hz as `UpdateEvent::Progress`, `CancelDownload`), sending `UpdateEvent::Started` at start with `BuildInfo` from `debug_info::RELEASE` + `GIT_SHA` + `PlatformKey::current()` and the capability from `detect_install`, and running `sweep_leftovers` once; feed base = `FEED_BASE`, or `FLUXER_UPDATE_FEED_BASE` (logged once), or the devserver's `/_update/feed` with `--devserver`. `--devserver` fakes the build as `2026.0101.1` nightly and makes `Apply` a dry run (logs the target path and stays `Ready`). `Apply { relaunch }`: the same clean shutdown as closing the window (leave voice, flush persistence), then `appimage::apply` + `relaunch`, or `windows::prepare` + spawn the helper, then exit; failures before exit → `UpdateEvent::ApplyFailed`. Window close sends `UpdateEvent::Quitting` first and executes a resulting `Apply { relaunch: false }` after shutdown. `main.rs`: `--apply-update <journal>` (hidden) is handled before anything else (no logging setup, no settings, no window) and calls `windows::run_helper` with the real ops; on Linux it exits with an error. `--debug-info` gains an "Updates" section: channel, feed base, install target, capability. - [ ] **Step 1: Write failing tests**: devserver — `feed_serves_a_manifest_with_the_assets_real_sha256`, `asset_supports_ranges`, `bad_range_is_416`, `scenarios_change_the_feed`, `stable_feed_is_404`; runtime (devserver, no GPU, no network) — `devserver_update_flows_from_check_to_ready`, `dry_run_apply_does_not_touch_the_binary`, `bad_sha_scenario_fails_verification_and_retries_later`, `malformed_feed_is_silent`, `manual_check_reports_up_to_date_with_same_scenario`, `channel_switch_rechecks`, `dev_build_without_devserver_never_requests_the_feed`, `feed_base_override_is_used_and_logged_once`, `quit_with_ready_applies_without_relaunch` (fake installer), `apply_failure_reports_apply_failed` (fake installer), `apply_update_helper_flag_runs_before_logging` (spawns the test binary with a journal against a temp dir, `#[cfg(windows)]` for 🤖 Generated with [Claude Code](https://claude.com/claude-code)
charles added this to the Text chat milestone 2026-11-13 07:49:13 +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#436
No description provided.