Skip to content

feat(update): add standalone updater - #377

Merged
fcoury-oai merged 2 commits into
mainfrom
fcoury/red-update
Oct 12, 2026
Merged

fcoury-oai merged 2 commits into
mainfrom
fcoury/red-update

Conversation

@fcoury-oai

Copy link
Copy Markdown
Collaborator

Standalone Red installations currently have no supported in-place update path, so users must manually rerun an installer and the editor cannot surface new stable releases.

This adds a managed updater for official standalone installs. red update --check reports newer stable releases, while red update downloads the exact platform archive, verifies its published SHA-256 checksum, validates the staged binary, and replaces the installation under an exclusive lock. The editor exposes the same flow through :update and Update Red, with a daily notification-only check that can be disabled through [updates] mode = "off". The shell and PowerShell installers now prevalidate binaries and write the receipt and stable lock file that establish updater ownership; Homebrew and source builds continue to receive actionable guidance for their own update path.

How to Test

  1. Run cargo test update::tests. Expect the managed-install success path, checksum-preservation path, lock exclusion, archive validation, and editor worker tests to pass.
  2. Run sh tests/installers/install-sh.sh. Expect the installer fixture to validate the candidate, write .red-install.toml and .red-update.lock, and preserve the lock inode on reinstall.
  3. Build with cargo build --bin red, then run target/debug/red update --check. Expect either an available stable version or an up-to-date message without modifying the executable.
  4. Run target/debug/red update from the development build. Expect an actionable unmanaged-install message and no executable replacement.
  5. Launch target/debug/red, enter :update, and continue editing. Expect the update progress notification to resolve to the same actionable unmanaged-install message while the buffer remains responsive.

Validation

  • cargo test --all-targets --all-features
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo fmt --all --check
  • PowerShell installer AST parse
  • Native Windows replacement against a verified local release fixture, including exact hash change and recovery-copy cleanup
  • Forced Windows sharing violation, confirming the installed bytes remain unchanged and the matching recovery copy is retained

@fcoury-oai
fcoury-oai merged commit 67d4808 into main Oct 12, 2026
22 checks passed
@fcoury-oai
fcoury-oai deleted the fcoury/red-update branch October 12, 2026 23:36
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