Skip to content

background migration context

Douwe de Vries edited this page Jul 2, 2026 · 1 revision

Migration context

Purpose

Several design choices in CSV Align come from moving behavior out of runtime-specific paths and into shared contracts. Understanding these migrations helps avoid reintroducing drift.

Shared backend workflows

Around Apr 18, 2026, app logic consolidated into src/backend/workflow.rs. Axum handlers in src/api/handlers.rs and Tauri commands in src-tauri/src/commands.rs now call the same functions for load, compare, export, pair-order, and snapshots.

Snapshot validation

Snapshot loading is deliberately strict. src/backend/comparison_snapshot.rs checks the version first, then src/backend/persistence/v1/mod.rs validates file metadata, virtual headers, mappings, results, and recomputed summary. This protects read-only loaded results from inconsistent persisted files.

Raw IPC uploads

Desktop file upload uses load_csv_bytes in src-tauri/src/commands.rs, with raw bytes sent from frontend/src/services/tauri.ts. This replaced JSON number-array transport for large files because raw IPC reduces allocation and parse overhead.

Transport parity tests

tests/transport_parity_integration.rs exists because browser tests can pass even when desktop invoke registration drifts. Keep it in mind when adding commands or routes.

Key source files

File Purpose
src/backend/workflow.rs Shared workflow layer.
src/api/handlers.rs HTTP adapter.
src-tauri/src/commands.rs Desktop adapter.
src/backend/persistence/v1/mod.rs Snapshot validation.
tests/transport_parity_integration.rs Cross-runtime contract test.

See transport parity for current rules.

Clone this wiki locally