Skip to content

fix(update): verify the installed binary after a swap (item 627) - #794

Closed
getappz wants to merge 1 commit into
masterfrom
task/627-agentflare-update-never-verifies-the-swa
Closed

getappz wants to merge 1 commit into
masterfrom
task/627-agentflare-update-never-verifies-the-swa

Conversation

@getappz

@getappz getappz commented Sep 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • Item 624 gave dev-install a byte-level verify_installed check after swap::replace_binary, so a swap that reports success but doesn't actually land the right bytes gets caught. agentflare update — the ordinary user-facing self-upgrade path — called the same replace_binary/SwapOutcome handling but never verified the result, so the same class of "installed successfully" lie item 624 was filed for was still possible via update.
  • Moved verify_installed/digest out of dev_install/mod.rs into the shared update::swap module (both dev_install::run and update::run already depend on update::swap for replace_binary), and made update::run call swap::verify_installed on Ok(SwapOutcome::Installed), exactly like dev_install::run does.
  • Left the two SwapOutcome match blocks in dev_install::run/update::run as-is: their surrounding error messages differ enough (dev-install's includes describe_holders()) that unifying them wasn't worth the risk for this fix — noted here per the task's own framing of that as a nice-to-have, not the actual bug.

Test plan

  • cargo fmt --check
  • cargo clippy --locked --workspace --all-targets --all-features -- -D warnings -A unsafe_code -A clippy::pedantic
  • cargo test --bin agentflare update:: (18 passed, incl. the moved verify_installed_accepts_identical_and_rejects_any_difference and the new update_swap_path_rejects_an_installed_file_that_ends_up_different_from_the_build)
  • cargo test --bin agentflare dev_install:: (6 passed)

Related: item 624 (dev-install's own fix for this bug class, PR 791 / commit c5c965f).

🤖 Generated with Claude Code

…nstall (item 627)

verify_installed/digest moved from dev_install::run into the shared
update::swap module so agentflare update's self-upgrade path calls the
same byte-level check dev-install already runs after replace_binary
(item 624) instead of trusting SwapOutcome::Installed on its own.

Agentflare-Agent: claude-code
Agentflare-Branch: task/627-agentflare-update-never-verifies-the-swa
Agentflare-Item: 627
Agentflare-Session: f0fc45e8-94ad-4f09-b663-89b425da180d
@getappz

getappz commented Sep 22, 2026

Copy link
Copy Markdown
Owner Author

Tracking this PR for automated review (flared:51bb8de6c33b).

@coderabbitai

coderabbitai Bot commented Sep 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 39 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 60 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: getappz/agentflare/.coderabbit.yaml

Review profile: CHILL

Plan: Essentials

Run ID: a1c714a9-8669-46df-8ed5-bb6c107d74a1

📥 Commits

Reviewing files that changed from the base of the PR and between c5c965f and 6a9e457.

📒 Files selected for processing (3)
  • src/dev_install/mod.rs
  • src/update/mod.rs
  • src/update/swap.rs

Comment @coderabbitai help to get the list of available commands.

@getappz

getappz commented Sep 22, 2026

Copy link
Copy Markdown
Owner Author

Duplicate of #792, which already implements this fix (and additionally collapses the two SwapOutcome match blocks). Closing in favor of #792; pushing a fix there for CodeRabbit's outstanding finding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant