# Tuck

A place for everything. Tuck is a free Windows 11 x64 utility for organizing loose files with a clear preview and conditional undo.

## Try the release candidate

Use the installer in `release`, or extract the portable ZIP and open `Tuck.exe`. Installation is per user and does not request administrator access. Microsoft Edge WebView2 Runtime is required; the installer can obtain it if missing. The portable edition expects it to be installed already.

1. Choose Downloads, Desktop, or another local folder.
2. Keep Quick tidy for sensible file-type categories, or select a saved preset.
3. Preview the exact source and destination paths. Uncheck files to leave them alone.
4. Select Tuck away, then confirm the moves.
5. Open History & undo to review results or preview restoration.

Existing subfolders are never scanned recursively or moved. Collisions receive an explicit numbered name in the preview. If a destination becomes occupied afterward, Tuck skips that move. Stop safely cancels remaining work while preserving completed moves for undo.

## Custom sorting

Create named presets with ordered rules. Each rule has one or more conditions: extension (comma separated), filename text, prefix, suffix, minimum/maximum size in MB (1,048,576 bytes), and modification age in days. Conditions in a rule all apply; the first enabled matching rule wins. Actions are move or leave untouched. Destination layouts include category, last-modified year/month in local time, or both. Exclusions match filename text, ignore case, and override rules. Unmatched files remain where they are. Save the preset, then preview it from the start screen.

## Recovery and privacy

Tuck saves full paths and file metadata in local journals before moving anything. It does not read file contents, upload files, collect analytics, or require an account. Settings and journals normally live in `%LOCALAPPDATA%\app.riverandrail.tuck`. Portable and installed copies share that location. See [Privacy](docs/PRIVACY.md).

Undo checks file identity, size, modification time, and the availability of the original path. It never overwrites files. It removes only empty directories that still have the identity recorded when Tuck created them. Undo is conditional recovery, not a backup. Forgetting a session removes its recovery record; it does not alter organized files.

After an unexpected shutdown, launch Tuck and open History & undo. Interrupted entries are reconciled against the filesystem. A completed move whose final record was interrupted can still be recovered. Ambiguous or changed entries are left alone with an explanation.

## Supported limits

Local fixed and removable drives, same-volume moves, and loose files only. No network destinations, cross-drive moves, recursive reorganization, automatic background sorting, or deletion of user files. Junctions, symbolic links, protected/hidden files, unavailable cloud placeholders, partial downloads, and files modified in the last five seconds are skipped. A redirected known folder is resolved using Windows; redirected network or junction-backed locations remain outside this release.

This candidate is unsigned. Independent-machine acceptance and code signing remain prerequisites for a broad release. See [Release audit](docs/release-audit.md) for verified checks and limitations.

## Build and test

Requires Windows x64, Node.js, Rust stable (MSVC), Visual Studio C++ build tools, and WebView2.

```powershell
npm.cmd ci
cargo test --manifest-path src-tauri/Cargo.toml --lib
npm.cmd test
.\scripts\build.ps1
node scripts/native-check.mjs
.\scripts\package-release.ps1
```

`npm run dev` provides an explicitly labeled browser demo with sample data. Desktop runs use the native backend. Browser demo data never accesses the filesystem. `scripts/native-check.mjs` tests the release executable using disposable fixtures and isolated application state, including actual interruption/restart recovery. `TUCK_DATA_DIR` is an optional state-directory override for testing. Runtime journals are versioned through their embedded preset/plan format; keep the app and its journals together when testing recovery.

Source follows the adjacent `Tuck-Software-Design.md`. Architecture: React/TypeScript interface, Rust planner and rule engine, a narrow Tauri command boundary, Windows handle-based non-replacing moves, and synced append-only JSONL recovery journals.
