core: extract the store and sync engine into a shared crate (M12 step 1)
Desktop (Tauri) / Tauri desktop (Linux) (push) Failing after 48s
Desktop (Tauri) / Windows installer (cross-compiled) (push) Successful in 1m50s
Desktop (Tauri) / Update manifest (push) Skipped

Android becomes a native Kotlin client over this same code (Scribe note 2730), so
the local store and sync engine stop being modules of the desktop app and become
`thoughtsync-core`, a crate with no UI framework in it at all.

This is a move, not a rewrite, and the measurement is why: every file in local/
and sync/ already carried ZERO Tauri references — 4,980 of 6,372 lines. The
coupling was 473 lines of command shim, which stays behind in the desktop crate
as src/commands/. Kept as git renames so history follows the files.

The desktop imports them under their old names (`use thoughtsync_core::{local,
sync}`) so every call site reads exactly as before. What moved is where they
live, not what they are.

Two things a workspace changes that are easy to miss, both caught before pushing:

[profile.release] now lives at the workspace ROOT. Cargo silently ignores
profiles declared by a non-root member — leaving it in the desktop crate would
have dropped lto/strip/opt-level from every release build with only a warning.

And a workspace shares ONE target dir, so the bundles moved from
desktop/src-tauri/target to target/. Thirteen references across publish-release,
debundle-graphics, verify.sh, package-prebuilt and the workflow now point there.
Pinning target-dir back would have been the smaller diff, but the Android lane
also produces Rust artifacts and they do not belong under desktop/.

Also retires the Tauri Android lane in the same push rather than leaving a path
that is being replaced: gen/android, android.yml and docs/android-dev.md are
gone, the mobile_entry_point attribute with them, and the lib drops to rlib —
staticlib/cdylib existed for Tauri mobile, and the .so Android loads will be
built from the core crate instead. Rule 22, no parallel path.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-17 23:12:26 -04:00
co-authored by Claude Opus 5
parent c28f2bc00e
commit 0a7480cf9b
75 changed files with 246 additions and 1346 deletions
+57 -53
View File
@@ -1,20 +1,24 @@
//! ThoughtSync desktop (Tauri v2).
//!
//! The window loads the shared Vue 3 frontend (`../../frontend`). The Rust core will
//! own the on-device SQLite store (M10.4) and the opt-in sync engine (M10.7), which
//! the frontend reaches through the `frontend/src/adapters/` seam (M10.3) over Tauri
//! `invoke`. Today it exposes desktop integration (menu-entry install for the Linux
//! AppImage) and boots the UI.
//! The window loads the shared Vue 3 frontend (`../../frontend`), which reaches the
//! store and sync engine through the `frontend/src/adapters/` seam (M10.3) over Tauri
//! `invoke`.
//!
//! This crate is the DESKTOP WRAPPER, not the core. The on-device SQLite store and
//! the sync engine live in `thoughtsync-core`, shared with the Android client; what
//! remains here is the Tauri command surface (`commands`), desktop integration
//! (menu-entry install for the Linux AppImage), the in-app updater, and boot.
mod commands;
mod integration;
mod local;
// `pub` (unlike the modules above) because parts of it have no in-crate caller yet —
// the engine that will consume them is M10.7b/c, and a private module's unreachable
// items read as dead code.
pub mod sync;
mod update;
#[cfg_attr(mobile, tauri::mobile_entry_point)]
// The store and the sync engine live in the shared `thoughtsync-core` crate, which
// the Android client binds through uniffi (Scribe note 2730). Aliased to their old
// names so every call site below reads exactly as it did when they were modules of
// this crate — the extraction changed where they live, not what they are.
use thoughtsync_core::{local, sync};
pub fn run() {
use tauri_plugin_log::{Target, TargetKind};
@@ -93,48 +97,48 @@ pub fn run() {
integration::integration_status,
integration::integrate_desktop,
integration::unintegrate_desktop,
local::commands::config_get,
local::commands::auth_me,
local::commands::notes_list,
local::commands::notes_get,
local::commands::notes_create,
local::commands::notes_create_titled,
local::commands::notes_update,
local::commands::notes_complete_reminder,
local::commands::notes_snooze_reminder,
local::commands::notes_set_labels,
local::commands::notes_add_item,
local::commands::notes_update_item,
local::commands::notes_delete_item,
local::commands::notes_delete_attachment,
local::commands::notes_delete_preview,
local::commands::notes_reorder,
local::commands::notes_trash,
local::commands::notes_restore,
local::commands::notes_delete_forever,
local::commands::notes_revisions,
local::commands::notes_restore_revision,
local::commands::notes_reminders,
local::commands::notes_titles,
local::commands::notes_search,
local::commands::notes_backlinks,
local::commands::notes_link_search,
local::commands::labels_list,
local::commands::labels_create,
local::commands::labels_rename,
local::commands::labels_set_color,
local::commands::labels_remove,
local::commands::labels_merge,
local::commands::saved_filters_list,
local::commands::saved_filters_create,
local::commands::saved_filters_remove,
local::commands::saved_filters_rename,
sync::commands::sync_probe,
sync::commands::sync_link,
sync::commands::sync_unlink,
sync::commands::sync_status,
sync::commands::sync_now,
sync::commands::sync_has_pending,
commands::local::config_get,
commands::local::auth_me,
commands::local::notes_list,
commands::local::notes_get,
commands::local::notes_create,
commands::local::notes_create_titled,
commands::local::notes_update,
commands::local::notes_complete_reminder,
commands::local::notes_snooze_reminder,
commands::local::notes_set_labels,
commands::local::notes_add_item,
commands::local::notes_update_item,
commands::local::notes_delete_item,
commands::local::notes_delete_attachment,
commands::local::notes_delete_preview,
commands::local::notes_reorder,
commands::local::notes_trash,
commands::local::notes_restore,
commands::local::notes_delete_forever,
commands::local::notes_revisions,
commands::local::notes_restore_revision,
commands::local::notes_reminders,
commands::local::notes_titles,
commands::local::notes_search,
commands::local::notes_backlinks,
commands::local::notes_link_search,
commands::local::labels_list,
commands::local::labels_create,
commands::local::labels_rename,
commands::local::labels_set_color,
commands::local::labels_remove,
commands::local::labels_merge,
commands::local::saved_filters_list,
commands::local::saved_filters_create,
commands::local::saved_filters_remove,
commands::local::saved_filters_rename,
commands::sync::sync_probe,
commands::sync::sync_link,
commands::sync::sync_unlink,
commands::sync::sync_status,
commands::sync::sync_now,
commands::sync::sync_has_pending,
update::update_channel_get,
update::update_channel_set,
update::update_check,