twintidy

module
v0.0.1-preview.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2026 License: MIT

README

TwinTidy

TwinTidy is a local, Windows-native duplicate-file review tool being hardened toward safe cleanup. It proves that files are byte-for-byte identical and lets you review which copies could be kept. Destructive cleanup is intentionally disabled in the current pre-release build because Windows' documented Shell recycle API cannot keep the action bound to the verified file identity.

It is designed around one rule: finding a duplicate is useful, but avoiding data loss is more important.

What it does

TwinTidy uses a staged scan so expensive work is reserved for plausible matches:

  1. Surface-scan eligible user files and record current Windows file identities.
  2. Group candidates by exact byte size.
  3. Compare the first and last 4 KiB with xxHash.
  4. Stream the remaining candidates through SHA-256 for exact-match proof.

The desktop workflow includes:

  • native Windows folder selection and progress reporting
  • PDF, text, Word, Excel, PowerPoint, image, audio, video, archive, and Other focus filters
  • grouped duplicate results with keep-newest and keep-oldest helpers
  • user-initiated, background-streamed CSV or JSON reports with duplicate metadata and reclaimable-space estimates
  • checkbox-only cleanup planning; highlighting a row never means “remove it”
  • Windows Shell thumbnails, local rich previews, and metadata fallback cards
  • fail-closed cleanup capability gating; the current build never changes files
  • local session diagnostics with no telemetry

TwinTidy finds exact duplicates by content, not merely by name or extension. A supported file whose extension is not in a named focus category can still be considered under Other.

Safety model

A scan result is only a point-in-time observation. Before any future recycle action, TwinTidy must reopen the target and a distinct unselected keeper and revalidate their Windows file identities, sizes, timestamps, protection state, and complete SHA-256 content.

The current production adapter stops before any destructive native call. Windows IFileOperation consumes a path-derived Shell item rather than the verified file handle, so another process could replace the path occupant after verification. Cleanup will remain unavailable until an identity-bound, reversible adapter satisfies ADR 0005.

Any future cleanup must fail closed:

  • every selected file must still belong to its scanned duplicate group
  • at least one separately identified, verified keeper must remain
  • changed, replaced, missing, hard-linked, reparse-backed, or alternate-stream files are not recycled
  • native cancellation, ambiguous outcomes, and access failures are reported as failures
  • success is shown only after Windows reports success and the original source object is no longer present at that path
  • there is no automatic permanent-delete fallback

See Security model, Architecture, and ADR 0002 for the full contract.

Privacy

Scanning, hashing, previews, and cleanup planning run locally under the current Windows account. TwinTidy has no account, cloud service, analytics SDK, advertising, or automatic file upload. It does not require administrator privileges for ordinary use.

Diagnostics are stored under:

%LOCALAPPDATA%\TwinTidy\logs

Logs remain on the computer unless the user explicitly shares them. Review diagnostic files before attaching them to a report because local filesystem context can be sensitive.

CSV and JSON duplicate reports are created only through the Export Report action. They contain local folder/file paths, hashes, sizes, timestamps, and categories; CSV data cells that could be interpreted as spreadsheet formulas are neutralized. Export is cancellable and runs off the UI thread, using same-directory staging and atomic publication only after the exact normalized destination has been authorized for overwrite.

TwinTidy does not upload reports. A report saved to a OneDrive-managed, cloud-synced, or network destination may still be transferred by that provider under its own configuration. Review or redact reports before sharing.

Supported platform

Production targets are:

Operating system Architecture Portable Per-user install
Windows x64 / amd64 TwinTidy-<version>-windows-amd64.zip TwinTidy-<version>-windows-amd64.msix
Windows ARM64 TwinTidy-<version>-windows-arm64.zip TwinTidy-<version>-windows-arm64.msix

Windows 386 is not supported. Release binaries use CGO_ENABLED=0; the shipped application does not need Python, GCC, MSYS2, GTK, Electron, a browser server, or a background service.

See Install, update, and uninstall TwinTidy for architecture selection, checksum and signature verification, portable use, and MSIX lifecycle instructions.

The scanner intentionally uses CPU and storage concurrency rather than requiring a GPU. Exact duplicate detection is generally storage-bound; future similarity analysis can add optional acceleration without weakening deterministic CPU fallback.

Build from source

Requirements:

  • the Go patch version declared in go.mod
  • Windows PowerShell 5.1 or PowerShell 7+
  • Windows for native GUI execution

Run the quality gates:

git clone https://github.com/Soyuz-Tec/twintidy.git
Set-Location twintidy
$env:CGO_ENABLED = "0"
go mod verify
go vet ./...
go test ./... -count=1

Run from source:

go run ./cmd/twintidy

Build one architecture:

./scripts/build.ps1 -Architecture amd64 -Version dev

Generate both architecture-specific Windows resource objects:

./scripts/generate-resources.ps1 -Architecture all

Resource generation uses the pinned pure-Go go-winres tool. Generated .syso files contain the Common Controls v6/PerMonitorV2 manifest, TwinTidy icon, and PE version information.

Release verification

Build exact-commit portable packages and run the source, receipt, reproducibility, and resource checks from a clean tree:

./scripts/verify-release.ps1 -Version 0.1.0-beta.1

Direct development builds remain available from a dirty working tree and are labeled with their source digest. Official public artifacts require the signing, native x64/ARM64 smoke, MSIX lifecycle, checksum, receipt, and provenance gates described in Release engineering. An unsigned local build is a development artifact, not an official TwinTidy release.

Development status

TwinTidy is being hardened toward its first reviewed release. The current pre-release build supports scanning, exact-match verification, selection planning, and previews; cleanup is disabled and no stable release may enable it without the identity-safety evidence required by ADR 0005.

Security or possible data-loss reports should be submitted through GitHub private vulnerability reporting, not a public issue.

License

TwinTidy is licensed under the MIT License. Copyright (c) 2026 Kayilan Inc.

Directories

Path Synopsis
cmd
twintidy command
internal
gui
report
Package report serializes verified duplicate-scan results into local CSV and JSON documents.
Package report serializes verified duplicate-scan results into local CSV and JSON documents.
settings
Package settings persists non-authoritative user interface preferences.
Package settings persists non-authoritative user interface preferences.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL