Skip to content

Restructure into disk/ and unify writer internals - #83

Open
justanotherariel wants to merge 2 commits into
justanotherariel-disk-policyfrom
justanotherariel-disk-unify
Open

Restructure into disk/ and unify writer internals#83
justanotherariel wants to merge 2 commits into
justanotherariel-disk-policyfrom
justanotherariel-disk-unify

Conversation

@justanotherariel

@justanotherariel justanotherariel commented Sep 3, 2026

Copy link
Copy Markdown
Member

Description

Stacked on #82.

  • Commit 1: the progress channel carries FlashProgress directly (percentage derived once in FlashProgress::new), a shared run_with_progress replaces four copies of the forwarding loop, and every platform gets the same write_image → write_and_verify → write_to_device → verify_write skeleton with matching names and order. Windows verify-phase failures are now tagged VerificationFailed like Linux; macOS/Windows gain the post-finish progress drain (final "Write complete"/"Verification complete" updates are no longer lost).
  • Commit 2: devices and disk_writer merge into one disk module (disk/{os}/{device,writer}.rs) plus remaining test dedup — motion only, review with --color-moved.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • CI/CD changes

Related Issues

Stacked on #82 (part of the #14 stack).

Testing

  • Unit tests added/updated (duplicated suites consolidated; platform tests follow their code into disk/{os}/)
  • E2E tests added/updated
  • Manually tested on macOS
  • Manually tested on Windows
  • Manually tested on Linux

cargo test -p hai-core --features mock and cargo test -p hai-desktop pass on Linux, including the Linux writer's write/verify roundtrip tests through the new channel type.

Screenshots

N/A — no UI changes.

Checklist

  • My code follows the project's code style
  • I have run cargo fmt and npm run lint
  • I have added tests for my changes
  • All new and existing tests pass
  • I have updated documentation if needed
  • My commits follow conventional commit format

DO NOT MERGE. After reviewing, merge #14 to merge all directly

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