Commit Graph
6 Commits
Author SHA1 Message Date
Incido Developer cf0e74b68d feat(phase-1/m2.2): desktop Import/Export — the phone bridge has a UI
Phase 1 M2 task 2 (tools/DESKTOP_PHASE_PLAN.md §4): :desktopApp can now
speak the phone's backup format through the extracted bridge.

- New BackupActions.kt: top-bar overflow menu (Import from file… /
  Export plain / Export encrypted). Import = AWT FileDialog ->
  BackupBridge.preview -> passphrase dialog on INCDBK1 (wrong passphrase
  stays open for retry) -> BackupPreview confirm dialog -> import.
  Export = save-picker -> exportPlain / passphrase + exportEncrypted.
  All heavy bridge calls run on Dispatchers.IO; results via Snackbar.
- Same package-level BackupBridge calls Android's BackupManager shim
  makes — format shared by construction, not reimplementation. Android's
  PassphraseDialog.kt deliberately NOT ported (M4 moves the real one to
  common code).
- :desktopApp gains implementation(:core:backup).
- Scripted headless path for CI: --backup-import/--backup-export drive
  the identical bridge calls without dialog clicking.

Verification passed: :desktopApp:run --args="--data-dir /tmp/...
--backup-import <real phone export> --backup-export /tmp/m2t4-exp.json
--exit-after 8" (preview 27 / imported 27 / exported 27, clean exit) +
:core:data-jvm:backupSmoke on the DESKTOP-written export (all PASS) +
python cross-check: notes (createdAt,updatedAt,content) and attachment
Base64 identical phone->desktop->phone + assembleDebug +
:core:data-jvm:smoke + :desktopApp:run --self-test — all green.
Output recorded in DESKTOP_FEASIBILITY.md (incl. one unreproduced
first-run exit hang to watch in M5).
2026-10-05 19:23:47 +13:00
Incido Developer 8facbe718b test(m2): backupSmoke — round-trip a real Android export through :core:backup, + import-timestamp fix
Phase 1 M2 verification probe, driven by a real phone export (27 notes,
1 attachment, 14 orphan tags; the file is user data and stays out of the
repo):

- :core:data-jvm:backupSmoke --args="<export.incido.json> [libDir]" —
  preview, import into a fresh JVM library, re-export + field-by-field
  compare, encrypted envelope export (wrong passphrase rejected),
  encrypted import into a 2nd library with attachment-byte equality.

The probe caught a PRE-EXISTING Android bug the phone also has: upsert /
saveNoteWithHashtags stamped createdAt+updatedAt to now on every insert,
so backup import rewrote every note's history — and would defeat the
(createdAt, updatedAt, sha256(content)) dedupe key M2 task 3 depends on.
Justified behavior change (invariant 1: not silent): non-zero caller
timestamps are now honoured, 0 still means now. The Android editor
passes its own stamps (verified at both Note(...) sites), so only the
import path changes. addAttachment gains createdAt: Long = 0L;
importSnapshot passes the phone value through.

Verification passed: :core:data-jvm:backupSmoke (RESULT: M2 round-trip
PASS on the real export) + assembleDebug + :core:data-jvm:smoke (after a
forced codegen regen: "ID model file unchanged") + :desktopApp:run
--self-test + :spike:data-jvm:run — all green; output recorded in
DESKTOP_FEASIBILITY.md.

Known pre-existing gap left open (documented): importSnapshot never
recreates orphaned hashtag rows.
2026-10-05 19:03:31 +13:00
Incido Developer 7cc4eda90d feat(phase-1/m2.1): :core:backup — codecs + stream-based BackupBridge
Phase 1 M2 task 1 (tools/DESKTOP_PHASE_PLAN.md §4): extract the backup
bridge from :composeApp into a plain kotlin("jvm") module so the desktop
build can import/export the phone file format.

- git mv BackupCodec / EncryptedBackupCodec / EncryptedKeyCodec into
  core/backup, keeping the org.incido.compose.data.backup package so the
  Android diff is file moves + one dependency line (no import churn).
- New BackupBridge: the four BackupManager operations over
  InputStream/OutputStream instead of Uri (incl. the v0.3.3.3 preview
  hotfix catches); BackupPreview moves with it, same package.
- BackupManager stays in :composeApp as a thin Uri -> stream SAF shim,
  public API unchanged. Dedupe = task 3, desktop picker UI = task 2.

Verification passed: ./gradlew :core:backup:build :core:data-jvm:smoke
:spike:data-jvm:run + assembleDebug + :desktopApp:run --args="--data-dir
/tmp/incido-desktop-smoke --self-test --exit-after 6" — all green; run
output recorded in tools/DESKTOP_FEASIBILITY.md (Phase 1 status).
2026-10-05 18:51:07 +13:00
Incido Developer b11c02e1b4 docs(phase-1): cold-start handoff plan for the desktop track
Adds tools/DESKTOP_PHASE_PLAN.md: everything a fresh session needs with no
prior context — current module shape, the exact commands that must stay
green, pinned versions, the invariants (tracked ObjectBox model file, the
objectbox-android / objectbox-java classpath rule, kapt and Compose
Desktop plugin quirks), the traps already paid for, and the M2/M3/M4/M5
milestones with exit criteria.

Every claim is checked against the working tree rather than remembered:
the coupling inventory (per-file android.* import counts), the 8
DataStore keys, AesGcmFieldCipher's single getOrCreateKey() call, the
portability of BackupCodec/EncryptedBackupCodec, and the pinned versions
(Kotlin 2.0.21, AGP 8.7.2, Compose Multiplatform 1.7.3, ObjectBox 4.0.3).

Open questions are marked as such rather than guessed — the JVM EXIF
decoder and OS-keyring libraries are unverified, and the AGP/KMP
friction around the composeApp conversion is called out as the least-known
part of M4, with a fallback shape and a time-boxed decision rule.
2026-10-05 18:38:52 +13:00
Incido Developer 5f45b0921b feat(phase-1/m1b): :desktopApp — desktop shell over the real repository
Phase 1 milestone M1b: a Compose Multiplatform window driven by the same
NoteRepositoryImpl the Android app uses, over its own ObjectBox library.

  DesktopContainer  mirrors AppContainer's construction order (store,
                    CipherHolder, repository). Owns its library at
                    $XDG_DATA_HOME/incido — a separate library per machine,
                    since ObjectBox is single-writer; the backup file (M2)
                    is the only bridge to the phone. --data-dir opens
                    another library, e.g. one pulled off a phone.
  Main.kt           two panes, save-as-you-type with a 400ms debounce,
                    favourite toggle. Material 3 defaults on purpose: the
                    app's theme and screens arrive with the M4 composeApp
                    conversion, which deletes this stand-in.

Verified headlessly (--self-test drives the same repository calls the "+"
button and the star make, --exit-after auto-closes), against a library
previously written by :core:data-jvm:smoke — i.e. a different module's
generated MyObjectBox, same schema:

  RENDER notes=0 selected=null    first frame (collectAsState initial value)
  RENDER notes=1 selected=1       ObjectBox flow delivered
  SELFTEST wrote note id=2        write path through the UI's own calls
  RENDER notes=2 selected=2       and it came back through the flow
  reopen -> RENDER notes=2        persisted

Gotcha recorded in the findings doc: the first composition always sees the
empty initial value of collectAsState, so anything asserting on note counts
must watch the flow rather than the first frame.

Still synthetic: theme + screens. Not wired yet: settings, encryption (M3),
backup bridge (M2), packaging (M5). assembleDebug verified green.
2026-10-05 18:28:24 +13:00
Incido Developer 8b66e82acb spike(desktop): Phase 0 feasibility probes + findings
Adds the throwaway Phase-0 spike (Development Plan §6.3) that answers
whether Incido can become a Compose Multiplatform desktop app without
abandoning ObjectBox, its crypto layer, or its UI layer. All six
questions came back PASS; findings live in tools/DESKTOP_FEASIBILITY.md.

  :spike:data-jvm    ObjectBox kapt codegen + native runtime on a plain
                     JVM, DataStore Preferences without a Context, and
                     the app's own EncryptedKeyCodec round-tripping.
  :spike:compose-jvm Compose Desktop rendering the app's real theme
                     layer + core:domain, plus jpackage packaging.

Additive only: nothing outside spike/ depends on these, and the Android
build is untouched (assembleDebug verified green).
2026-10-05 18:20:46 +13:00