Skip to content

Rewrite AutoTidy in Rust + Tauri (v2.0.0) - #67

Merged
KhazP merged 1 commit into
mainfrom
v2-rust-tauri-rewrite
Aug 14, 2026
Merged

KhazP merged 1 commit into
mainfrom
v2-rust-tauri-rewrite

Conversation

@KhazP

@KhazP KhazP commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Replaces the Python/PyQt6 implementation with a Rust engine and a Tauri shell. Existing config and history are read in place from %APPDATA%; upgrading requires nothing of the user.

installer 73 MB -> 1.8 MB executable 33.5 MB -> 4.9 MB
add-folder 74 ms -> 21 ms 8,000 files 7.4 s -> 0.6 s

For a Downloads folder with a few dozen files an hour none of that speed is observable. Size, launch behaviour, and two scanning modes the old architecture could not support are the real changes.

Verification

Rewriting software that deletes files cannot rest on a careful read, so the 1.5.0 engine is retained under legacy/ as an executable specification and two harnesses diff the two engines over a purpose-built corpus: run_parity.py compares the decisions each makes, wet_parity.py runs both for real over disposable copies and diffs the resulting trees. The second exists because 1.5.0's collision handling sits inside if not dry_run: and a dry run cannot reach it.

251 Rust tests, 76 legacy tests, dry parity 12/12, wet parity 11/11.

Bugs this found, all present in 1.5.0

  • Glob matching is case-insensitive on Windows (fnmatch normcases both operands). A case-sensitive port would have silently stopped matching files that users' existing rules match.
  • A {FILENAME}-style destination template lost its rename, filing files under the original name. Only reachable on a real run.
  • 77 history records carry no run_id; in Rust they deserialise to "" and would have collapsed into one undoable run that a click would unwind.
  • --add-folder raced the running app for config.json and lost changes.
  • The Explorer context menu required administrator rights, and so was effectively unavailable. Now per-user.
  • Config writes were not atomic.

Also fixed here

  • The CLI and the app both linked to target/release/autotidy.exe on a case-insensitive filesystem, so whichever built last won. The wet harness then "ran the engine", actually launched the GUI, moved nothing, and reported every variant as a divergence. The CLI is now autotidy-cli, and the harness verifies the binary before trusting it.
  • The NSIS installer detects a 1.5.0 install and offers to remove it; Windows treats them as unrelated products and would run both at once.
  • Explorer context-menu invocations short-circuit before the Tauri runtime is built, which had made them 4.5x slower than 1.5.0.

Repository

Python moves to legacy/ and is marked linguist-vendored, so the root reads as the Rust project it now is. README rewritten. Code signing policy and privacy statement added for a pending SignPath Foundation application; no release is signed yet.

Not yet verified: nobody has driven a real file move through the shipped UI end to end. The engine is covered by tests and both harnesses, the commands by unit tests, and the UI against a stubbed IPC bridge.

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Test Configuration:

  • Firmware version:
  • Hardware:
  • Toolchain:
  • SDK:

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Replaces the Python/PyQt6 implementation with a Rust engine and a Tauri
shell. Existing config and history are read in place from %APPDATA%;
upgrading requires nothing of the user.

  installer   73 MB -> 1.8 MB        executable  33.5 MB -> 4.9 MB
  add-folder  74 ms -> 21 ms         8,000 files 7.4 s -> 0.6 s

For a Downloads folder with a few dozen files an hour none of that speed
is observable. Size, launch behaviour, and two scanning modes the old
architecture could not support are the real changes.

Verification
------------
Rewriting software that deletes files cannot rest on a careful read, so
the 1.5.0 engine is retained under legacy/ as an executable specification
and two harnesses diff the two engines over a purpose-built corpus:
run_parity.py compares the decisions each makes, wet_parity.py runs both
for real over disposable copies and diffs the resulting trees. The second
exists because 1.5.0's collision handling sits inside `if not dry_run:`
and a dry run cannot reach it.

251 Rust tests, 76 legacy tests, dry parity 12/12, wet parity 11/11.

Bugs this found, all present in 1.5.0
-------------------------------------
* Glob matching is case-insensitive on Windows (fnmatch normcases both
  operands). A case-sensitive port would have silently stopped matching
  files that users' existing rules match.
* A {FILENAME}-style destination template lost its rename, filing files
  under the original name. Only reachable on a real run.
* 77 history records carry no run_id; in Rust they deserialise to "" and
  would have collapsed into one undoable run that a click would unwind.
* --add-folder raced the running app for config.json and lost changes.
* The Explorer context menu required administrator rights, and so was
  effectively unavailable. Now per-user.
* Config writes were not atomic.

Also fixed here
---------------
* The CLI and the app both linked to target/release/autotidy.exe on a
  case-insensitive filesystem, so whichever built last won. The wet
  harness then "ran the engine", actually launched the GUI, moved
  nothing, and reported every variant as a divergence. The CLI is now
  autotidy-cli, and the harness verifies the binary before trusting it.
* The NSIS installer detects a 1.5.0 install and offers to remove it;
  Windows treats them as unrelated products and would run both at once.
* Explorer context-menu invocations short-circuit before the Tauri
  runtime is built, which had made them 4.5x slower than 1.5.0.

Repository
----------
Python moves to legacy/ and is marked linguist-vendored, so the root
reads as the Rust project it now is. README rewritten. Code signing
policy and privacy statement added for a pending SignPath Foundation
application; no release is signed yet.

Not yet verified: nobody has driven a real file move through the shipped
UI end to end. The engine is covered by tests and both harnesses, the
commands by unit tests, and the UI against a stubbed IPC bridge.
Copilot AI lite review requested due to automatic review settings August 14, 2026 10:22
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@KhazP
KhazP merged commit 1184ac9 into main Aug 14, 2026
2 of 8 checks passed
@KhazP
KhazP deleted the v2-rust-tauri-rewrite branch August 14, 2026 11:16
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.

2 participants