Repository navigation
Conversation
ehitimum
added a commit
that referenced
this pull request
Nov 15, 2026
Data loss (each with an engine regression): - An unreadable chapter or a missing documents folder no longer becomes a delete on every device; the last good state is kept with one note. - Engine writes re-check the file under project::files_lock (shared with the save commands) and capture a newer save first, so it merges or conflicts. - Conflict review and resolve scan first, so the latest typing is a version. - Delete + two different edits keeps both edits as a conflict. - Remote deletes and replaced damaged copies go to <project>/sync-trash/. Sign-in and Drive client: - A stray loopback request no longer ends the sign-in. - Retrying Connect keeps a valid grant unless Google rejects it. - Drive sync is off on Linux (no keyring backend) and says why. - Read the newer error shape (SERVICE_DISABLED); shorter text in release. - Expired change cursor detected by status; catalogue date kept current. Smaller: id validation in sync commands, Android device model name, Drive space used in settings, "Back up, then sync", Beta label, stricter live-test cleanup. Docs and test matrix updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
Changes for the review (commit f21be89, rebased from 3311192)Both reviews (at Data-loss findings
Other findings
Follow-up review (
|
Add the local sync core used by every transport: per-entity immutable revisions (project, folder, chapter metadata, chapter text, assets) with content-derived ids, SQLite WAL state outside project folders, disk scan change capture, causal fast-forward, deterministic field merges, preserved text conflicts, edit-beats-delete, staged updates for the open chapter, frozen batches for crash-safe publishing, and portable asset references. Fix backup restore leaving fantasy-map "My Imports" paths pointing at the original project (regression tests in backup/tests.rs). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Desktop sign-in uses the loopback redirect with PKCE (S256) in the writer's browser and only the drive.appdata scope; the refresh token lives in the OS secret store, access tokens in memory. The OAuth client comes from the environment or a git-ignored .env.local at build time. The Drive transport publishes gzip blobs before immutable batch files in appDataFolder, finds new batches through the changes feed with a listing fallback, ignores duplicate uploads and malformed files, and classifies 401/403/429/5xx/quota errors without discarding queued work. A background worker syncs enabled projects after saves (debounced) and on a poll with backoff, refuses silent Google account switches, and exposes status, download, conflict and staged-update commands. Also write imported images atomically so a crash or a sync scan never sees a half-written asset, and stop syncing a project that leaves the library. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lict review Settings gains a Google Drive card (desktop and phone variants) with sign-in, per-project sync toggles, downloads from other devices and sync notes; a quiet status pill appears only for synced projects. The open chapter is reported to the backend so its text is never replaced under the editor: a banner offers to load the newer version (after saving), and parallel edits open a side-by-side review that keeps the other version as its own chapter by default. Remote renames and moves merge into the open chapter without dropping unsaved typing. Regression suites cover the settings flows, banner, review (inert previews) and the App save boundary. Widen the AI suite's streamed-response waits and cap Vitest at half the cores: App-mounting suites timed out on busy desktops. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add the inline google-auth Android plugin (Google Play services AuthorizationClient for drive.appdata, no refresh token stored) with its ACL permission, and silent re-authorization when the short-lived token lapses. Fix two sync bugs found in review: turning a project's sync off and on reset its batch counter so new batches reused published numbers, and re-enabling under another Google account published nothing (both covered by engine regressions). Report needs-auth after signing out while projects stay bound to the account. Mark desktop-only pairing helpers so Android builds are warning-free. Document the design as built, Google Cloud setup and open items in MNEMOSYNC_DRIVE.md and update architecture, devlog, roadmap, testing, threat model, test matrix and the MnemoSync handoff. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Drive test The first live setup showed a raw "403: accessNotConfigured" when the Cloud project lacked the Drive API; it now says what to enable. A retry after such a failure reuses the stored grant instead of repeating the browser consent. Add an ignored live test (cargo test live_drive -- --ignored) that runs two engines against the real appDataFolder under a throwaway project and cleans up. Passed against the writer's own Cloud project. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Data loss (each with an engine regression): - An unreadable chapter or a missing documents folder no longer becomes a delete on every device; the last good state is kept with one note. - Engine writes re-check the file under project::files_lock (shared with the save commands) and capture a newer save first, so it merges or conflicts. - Conflict review and resolve scan first, so the latest typing is a version. - Delete + two different edits keeps both edits as a conflict. - Remote deletes and replaced damaged copies go to <project>/sync-trash/. Sign-in and Drive client: - A stray loopback request no longer ends the sign-in. - Retrying Connect keeps a valid grant unless Google rejects it. - Drive sync is off on Linux (no keyring backend) and says why. - Read the newer error shape (SERVICE_DISABLED); shorter text in release. - Expired change cursor detected by status; catalogue date kept current. Smaller: id validation in sync commands, Android device model name, Drive space used in settings, "Back up, then sync", Beta label, stricter live-test cleanup. Docs and test matrix updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ehitimum
force-pushed
the
codex/mnemosync-backup
branch
from
November 15, 2026 10:48
5096ebb to
3b0c25c
Compare
ehitimum
force-pushed
the
codex/mnemosync-drive
branch
from
November 15, 2026 10:48
3311192 to
f21be89
Compare
This was referenced Nov 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds optional Google Drive sync for MnemoScript projects, built on a new transport-neutral sync engine. Stacked on #3 (
codex/mnemosync-backup); retarget after #2 and #3 merge.Why the engine is here too. A review of #2 and #3 against the MnemoSync plan found them sound, but only Phase 0 is done (strategy, CI/undo fixes, backup/restore). The local-sync parts the Drive design depends on (sync state, revisions, merge, transport interface) did not exist yet, so this PR builds them first. LAN sync can use the same
Transporttrait later.How it works
<data dir>/sync/mnemosync.db), outside project folders. Project JSON files stay the source of truth.appDataFolderis used (drive.appdatascope).mnemo-asset:<file>; the disk format is unchanged.google-authplugin; no refresh token is stored.Design, Google Cloud setup and open items:
docs/MNEMOSYNC_DRIVE.md.Bugs fixed along the way (each with a regression test)
Testing
npm run checkpasses: lint, types, 145 tests, build.npm run test:regression: 56 tests.cargo testpasses: 90 tests (32 sync), 3 existing live-AI tests ignored.cargo clippy -- -D warningsis clean.npx tauri android build --apk --debug --target aarch64builds, including the Kotlin plugin andplay-services-auth. It has not been run on a device.Not verified
app/src-tauri/.env.local); steps are in the doc.Not included
Smart Merge for projects created separately on two devices, LAN sync, web sync, history pruning.
🤖 Generated with Claude Code