Update 72: fluxer-platform updater: feed client, resumable verified download, install targets and apply #434

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

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

Task 72: fluxer-platform updater: feed client, resumable verified download, install targets and apply

Issue: (to be created)
Closes: none.

Files:

  • Create: crates/fluxer-platform/src/update/{mod.rs,http.rs,download.rs,target.rs,appimage.rs,windows.rs,zip.rs,sweep.rs}
  • Modify: crates/fluxer-platform/src/{lib.rs,settings.rs} (the [update] table), crates/fluxer-platform/Cargo.toml (zip — workspace dependency added at the version already in Cargo.lock through webrtc-sys-build, 9.x, default-features = false with deflate only — check docs.rs for the feature name; windows crate features Win32_Foundation, Win32_Storage_FileSystem, Win32_System_Threading on Windows only — the crate is already in the graph), workspace Cargo.toml, crates/fluxer-platform/README.md
  • Test: crates/fluxer-platform/tests/{update_feed.rs,update_download.rs,update_apply.rs} (wiremock, tempfile — both already dev-dependencies)

Interfaces:

  • Consumes: Text chat 69 (types, parse_manifest), 71 (UpdateSettings, InstallCapability, ManualReason).
  • Produces (feed): UpdateHttp::new(user_agent: &str) -> UpdateHttp (no auth, no cookies, 15 s connect / 60 s read, redirects only within the origin of the request); UpdateHttp::fetch_manifest(&self, feed_base: &Url, channel: Channel) -> Result<Manifest, FeedError> (<feed_base>/<channel>.json, ≤ 256 KiB, NotPublished on 404, Http(u16), Network, Manifest(ManifestError)); FEED_BASE: &str = "https://git.forked.io/charles/fluxer-native/releases/download/update-feed".
  • Produces (download): Downloader::download(&self, asset: &Asset, dir: &Path, progress: impl Fn(u64, u64) + Send) -> Result<StagedFile, DownloadError> with resume (.part, .part.meta holding ETag/Last-Modified, Range + If-Range), 200-instead-of-206 restart, size cap, streaming SHA-256 after completion, fsync + rename; DownloadError { Network, Http(u16), TooLarge, SizeMismatch, Sha256Mismatch, NoSpace, ReadOnly, Io(String) } (no URL in Display); CancelToken. A verification failure deletes the file. VerifyPolicy { Sha256Only } (the only variant now; update §3.6 adds Signed(PublicKey) later without changing callers) is a Downloader field.
  • Produces (targets): InstallTarget { AppImage { path }, WindowsPortable { exe, dir, layout: WindowsLayout /* LoneExe | Folder */ }, Unsupported }; detect_install(env: &impl EnvSource, current_exe: &Path) -> (InstallTarget, InstallCapability) per update §5.2–5.3 (EnvSource injectable for tests); staging_dir(target, version) -> PathBuf (.{APP_NAME}-update-<version> next to the install; Downloads/cache dir in manual mode); capability_for(target, asset: &Asset, build: &BuildInfo, manifest: &Manifest) -> InstallCapability (kind/layout matrix, minimum_version).
  • Produces (apply): appimage::apply(target_path: &Path, staged: &Path) -> io::Result<()> (chmod, atomic rename, dir fsync) and appimage::relaunch(path, args) -> io::Result<()>; zip::unpack(archive: &Path, into: &Path) -> Result<Vec<PathBuf>, UnpackError> (one top-level folder stripped, zip-slip and symlinks refused, 1 GiB cap); windows::ApplyJournal (serde, version: 1, pid, install_dir, exe_name, files, relaunch, args, done steps), windows::prepare(target, staged, relaunch, args) -> io::Result<(PathBuf /* helper */, PathBuf /* journal */)> (copies current_exe to apply-helper.exe, writes the journal), windows::run_helper(journal: &Path, ops: &dyn FileOps, wait: &dyn ProcessWait) -> Result<ApplyOutcome, ApplyError> (wait ≤ 60 s, rename-old-then-move-new per

🤖 Generated with Claude Code

Plan: `docs/superpowers/plans/2026-11-12-textchat.md`, section "Task 72" (Auto-update, added 2026-11-13 at Charles's request). Design: `docs/superpowers/specs/2026-11-13-fluxer-native-autoupdate-design.md`. ### Task 72: `fluxer-platform` updater: feed client, resumable verified download, install targets and apply **Issue:** (to be created) **Closes:** none. **Files:** - Create: `crates/fluxer-platform/src/update/{mod.rs,http.rs,download.rs,target.rs,appimage.rs,windows.rs,zip.rs,sweep.rs}` - Modify: `crates/fluxer-platform/src/{lib.rs,settings.rs}` (the `[update]` table), `crates/fluxer-platform/Cargo.toml` (`zip` — workspace dependency added at the version already in `Cargo.lock` through `webrtc-sys-build`, 9.x, `default-features = false` with deflate only — check docs.rs for the feature name; `windows` crate features `Win32_Foundation`, `Win32_Storage_FileSystem`, `Win32_System_Threading` on Windows only — the crate is already in the graph), workspace `Cargo.toml`, `crates/fluxer-platform/README.md` - Test: `crates/fluxer-platform/tests/{update_feed.rs,update_download.rs,update_apply.rs}` (wiremock, tempfile — both already dev-dependencies) **Interfaces:** - Consumes: Text chat 69 (types, `parse_manifest`), 71 (`UpdateSettings`, `InstallCapability`, `ManualReason`). - Produces (feed): `UpdateHttp::new(user_agent: &str) -> UpdateHttp` (no auth, no cookies, 15 s connect / 60 s read, redirects only within the origin of the request); `UpdateHttp::fetch_manifest(&self, feed_base: &Url, channel: Channel) -> Result<Manifest, FeedError>` (`<feed_base>/<channel>.json`, ≤ 256 KiB, `NotPublished` on 404, `Http(u16)`, `Network`, `Manifest(ManifestError)`); `FEED_BASE: &str = "https://git.forked.io/charles/fluxer-native/releases/download/update-feed"`. - Produces (download): `Downloader::download(&self, asset: &Asset, dir: &Path, progress: impl Fn(u64, u64) + Send) -> Result<StagedFile, DownloadError>` with resume (`.part`, `.part.meta` holding ETag/Last-Modified, `Range` + `If-Range`), `200`-instead-of-`206` restart, size cap, streaming SHA-256 after completion, `fsync` + rename; `DownloadError { Network, Http(u16), TooLarge, SizeMismatch, Sha256Mismatch, NoSpace, ReadOnly, Io(String) }` (no URL in `Display`); `CancelToken`. A verification failure deletes the file. `VerifyPolicy { Sha256Only }` (the only variant now; update §3.6 adds `Signed(PublicKey)` later without changing callers) is a `Downloader` field. - Produces (targets): `InstallTarget { AppImage { path }, WindowsPortable { exe, dir, layout: WindowsLayout /* LoneExe | Folder */ }, Unsupported }`; `detect_install(env: &impl EnvSource, current_exe: &Path) -> (InstallTarget, InstallCapability)` per update §5.2–5.3 (`EnvSource` injectable for tests); `staging_dir(target, version) -> PathBuf` (`.{APP_NAME}-update-<version>` next to the install; Downloads/cache dir in manual mode); `capability_for(target, asset: &Asset, build: &BuildInfo, manifest: &Manifest) -> InstallCapability` (kind/layout matrix, `minimum_version`). - Produces (apply): `appimage::apply(target_path: &Path, staged: &Path) -> io::Result<()>` (chmod, atomic rename, dir fsync) and `appimage::relaunch(path, args) -> io::Result<()>`; `zip::unpack(archive: &Path, into: &Path) -> Result<Vec<PathBuf>, UnpackError>` (one top-level folder stripped, zip-slip and symlinks refused, 1 GiB cap); `windows::ApplyJournal` (serde, `version: 1`, pid, install_dir, exe_name, files, relaunch, args, done steps), `windows::prepare(target, staged, relaunch, args) -> io::Result<(PathBuf /* helper */, PathBuf /* journal */)>` (copies `current_exe` to `apply-helper.exe`, writes the journal), `windows::run_helper(journal: &Path, ops: &dyn FileOps, wait: &dyn ProcessWait) -> Result<ApplyOutcome, ApplyError>` (wait ≤ 60 s, rename-old-then-move-new per 🤖 Generated with [Claude Code](https://claude.com/claude-code)
charles added this to the Text chat milestone 2026-11-13 07:49:12 +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#434
No description provided.