From 31408172df6fc58195233fc8c3cf156c90b44558 Mon Sep 17 00:00:00 2001 From: Incido Developer Date: Tue, 6 Oct 2026 16:44:39 +1300 Subject: [PATCH] =?UTF-8?q?docs(phase-1/m4.3):=20M4.3=20status=20+=20?= =?UTF-8?q?=C2=A71=20gate=20output;=20plan=20handed=20to=20M4.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also two new §3 traps paid for during the gate re-run: daemon-surviving desktop JVMs after a client kill (use pkill -9 before re-running against the same data dir), and never parallelizing two --data-dir runs (leg B against leg A's half-written library produces bogus FAILs). --- tools/DESKTOP_FEASIBILITY.md | 77 +++++++++++++++++++++++++++++++----- tools/DESKTOP_PHASE_PLAN.md | 9 +++++ 2 files changed, 77 insertions(+), 9 deletions(-) diff --git a/tools/DESKTOP_FEASIBILITY.md b/tools/DESKTOP_FEASIBILITY.md index 5b0bab9..dbaf96c 100644 --- a/tools/DESKTOP_FEASIBILITY.md +++ b/tools/DESKTOP_FEASIBILITY.md @@ -661,15 +661,74 @@ commonMain). ./gradlew :desktopApp:run … --self-test SELFTEST wrote note id=1 ``` -**Next up: M4.3** — the container seam: an `AppGraph` interface in -`commonMain` (noteRepository, settings, cipher services, security -state) so the four ViewModels leave `IncidoApplication`/ -`AndroidViewModelFactory` behind (multiplatform lifecycle artifacts — -verify the set against Compose 1.7.3 first, §6.4), and -`DesktopContainer` can implement the same face. Clipboard -(`LocalClipboard` + `ClipEntry`) and image-decode -(`skia.Image.makeFromEncoded`) migrations ride along with the screens -that need them (§6.3). +**M4.3 — container seam: DONE.** `AppGraph` in +`commonMain` (`noteRepository` + `settingsRepository` + +`encryptionBadge`) with `LocalAppGraph`/`requireAppGraph`; both +containers implement the face. Three commits: + +- **M4.3a** — `:core:settings` → multiplatform (verbatim M4.2 playbook, + pure renames). One honest new seam: `runBlocking` has no commonMain + declaration, so `snapshot()` goes through an internal expect/actual + `blockingFirst` — identical two-liner actuals (both targets JVM). +- **M4.3b** — the §6.4 "verify the artifact set" answer is **GREEN, + no state-holder fallback needed**: `org.jetbrains.androidx.lifecycle: + 2.8.4` is the same coordinate set `androidMain` has resolved since + M4.1 (assembleDebug coexists with the AndroidX BOM) and the desktop + runtime already carried matching `-desktop` jars — so ViewModels + move with their `androidx.lifecycle.*` imports UNCHANGED. + `DrawerViewModel` led; `AppContainer : AppGraph` + `IncidoApp` + provides `LocalAppGraph` at the root. +- **M4.3c** — `NoteListViewModel` + `NoteEditorViewModel` (UiStates + + `SharedImage`) in commonMain. The editor VM's four + `withContext(Dispatchers.IO)` became `withContext(ioDispatcher)` — + internal expect/actual, actual literally `Dispatchers.IO` on both + targets. `EncryptionBadge`/`LibraryVerification` mirror `:core:data`'s + `EncryptionVerification` because :core:data is an androidLibrary and + must stay invisible to commonMain (§2.3 ObjectBox classpath rule); + each container maps the real verifier 1:1 at its own seam. + `SettingsViewModel` stayed in androidMain — the graph was NOT widened + around SecurityManager/Keystore/Uri-IO/CarnetImporter; those screens + read a small `LocalAndroidContainer`. APPLICATION_KEY + + `IncidoApplication` are gone from all four ViewModels and all six + screen call-sites (drawer/list/editor/settings/pin-setup/pin-change). + **Exit proof: `DesktopContainer : AppGraph`**, compiler-checked via + `:desktopApp` → `:composeApp` (jvm variant); `repository` renamed + `noteRepository`. Stand-in UI unchanged (M4.5 hosts the real screens). + +``` +§1 gate re-run first, all green: + :core:data-jvm:smoke RESULT: M1a PASS + :desktopApp:run … --self-test SELFTEST id=1 → RENDER notes=1 + (first attempt hit the documented teardown wedge AFTER all PASS + lines — killed, rerun exited 0; see new §3 trap below) + :spike:data-jvm:run RESULT: S1 PASS — incl. envelope + 84 B round-trip, PBKDF2 [50, 50] ms + assembleDebug BUILD SUCCESSFUL (134 tasks) + :desktopApp:createDistributable BUILD SUCCESSFUL — 169 MB image + crypto legs, separate processes 9×PASS + leg-A ALL-OK → LEG-B PASS + objectbox-models clean; default.json tracked, + not ignored (ls-files + check-ignore) + +M4.3 suite per commit: + ./gradlew assembleDebug :composeApp:compileKotlinJvm :desktopApp:build + BUILD SUCCESSFUL (the AppGraph exit proof compiles here) + :desktopApp:run … --self-test SELFTEST id=1 → RENDER notes=1 selected=1, clean exit + :core:data-jvm:smoke RESULT: M1a PASS + crypto legs (post-refactor) leg-A ALL-OK → LEG-B ALL-OK +``` + +**Next up: M4.4** — the screens: port the §6.3 seams one at a time +(theme `dynamicColor`/`Build.VERSION` remaining sites; the seven +`LocalContext` sites → platform-context abstraction; clipboard +`LocalClipboardManager` → `LocalClipboard` + `ClipEntry` on BOTH +platforms; image decode `BitmapFactory` → +`skia.Image.makeFromEncoded(bytes).toComposeImageBitmap()`; EXIF — +**verify a JVM decoder exists before committing**; file intake → +drag-drop + picker). Deferred/hide-UI: voice recording, camera, +share-sheet, biometrics (§6.5). ViewModels are already common, so +each screen moves once its own android.* seam is solved. M4.5 then +hosts the real screens in `:desktopApp` (replacing Main.kt's +stand-in) and deletes `spike/` (§6.6). diff --git a/tools/DESKTOP_PHASE_PLAN.md b/tools/DESKTOP_PHASE_PLAN.md index 39dd0b6..10c6e3a 100644 --- a/tools/DESKTOP_PHASE_PLAN.md +++ b/tools/DESKTOP_PHASE_PLAN.md @@ -98,6 +98,15 @@ app version `0.4.2.0` (code 38). * PBKDF2 200k iterations ≈ **55 ms** on desktop versus ~2 s on the phone. * The jpackage launcher prints `pure virtual method called` on stderr when the app exits via `exitProcess`; harmless. +* Killing the gradle client of a wedged `:desktopApp:run` does NOT kill the + app — the JavaExec child runs under the daemon. `pkill -f org.incido.desktop.MainKt` + (TERM can be ignored by a wedged AWT JVM — use `-9`) before re-running against + the same data dir, or ObjectBox's single-writer lock and DataStore's file lock + will wedge the next run too. +* Never batch the crypto legs (or any two `--data-dir` runs) in one parallel + command group — leg B opening the library leg A is still writing produces + bogus FAIL lines and a corrupt-on-paper result. Sequential, separate processes, + fresh dir first. ## 4. M2 — the backup bridge (next up; the product's reason to exist)