Pure moves: IncidoDrawer, ReleaseNotesDialog, PassphraseDialog
(clipboard: Context.getSystemService -> LocalClipboardManager, the
SAME API both targets ship in Compose 1.7.3 - the section 6.3
LocalClipboard+ClipEntry swap is a Compose 1.8-only API, recorded
for M5+). PassphraseGenerator moves behind an internal expect/
actual secureRandomInt (blockingFirst precedent; identical
SecureRandom actuals - both targets ARE the JVM).
New seams justified: secureRandomInt (java.security is not common);
commonMain gains jetbrains lifecycle viewmodel-compose +
runtime-compose (the SAME coordinates androidMain resolved since
M4.1) and material-icons-extended (moved with the screens).
Verified: ./gradlew assembleDebug :desktopApp:build SUCCESSFUL
+ :composeApp:compileKotlinJvm + :desktopApp:run --self-test
(SELFTEST id=1 -> RENDER notes=1 selected=1) + :core:data-jvm:smoke
(M1a PASS); objectbox-models clean.
M4.3's container seam, proven with the smallest ViewModel:
* commonMain di/AppGraph.kt — the platform-neutral container face
(noteRepository + settingsRepository) plus LocalAppGraph /
requireAppGraph. Scope discipline per §9: only services BOTH platforms
can honestly serve; Keystore/SecurityManager/BackupManager/CarnetImporter
stay on the concrete AppContainer.
* :core:settings + lifecycle-viewmodel enter commonMain (settings as api —
AppGraph exposes it). Lifecycle coordinates are the SAME
org.jetbrains.androidx.lifecycle 2.8.4 aliases androidMain already
resolved since M4.1, so the §6.4 "verify the artifact set" question is
answered GREEN for both targets and the state-holder fallback is NOT
needed: DrawerViewModel moves with its androidx.lifecycle.* imports
UNCHANGED (offline set keeps the androidx FQCNs).
* DrawerViewModel.Factory(APPLICATION_KEY as IncidoApplication) →
factory(graph: AppGraph). AppContainer implements AppGraph; IncidoApp
provides LocalAppGraph at the root (same fallback chain it already used).
Verification (one run):
./gradlew :composeApp:compileKotlinJvm assembleDebug → BUILD SUCCESSFUL
(jvm target = first compile of a commonMain ViewModel on desktop deps)
Phase-0 recommendation #1 ("core:domain is already JVM-clean —
convert it first; zero code changes"), now unlocked by M4.1: common
source sets cannot see plain kotlin("jvm") projects, so the domain
deploy was the gate for making composeApp's commonMain depend on
Note/NoteColor/NoteRepository. Sources move untouched (pure renames);
Flow moves implementation → api (it is in the public repository
interfaces — was already leaking, now stated).
androidTarget() drags in the AGP plugin + a namespace — the module is
now a library-for-Android too, but emits no Android-specific code and
needed no manifest (AGP 8 + namespace). Plain-JVM consumers
(:core:data-jvm, :core:backup, :core:settings, :desktopApp) and AGP
consumers (:core:data, :app) resolve through variant metadata with
ZERO import or build-line changes — verified below.
Then composeApp: api(project(":core:domain")) in commonMain (up from
androidMain), NoteColors.kt moves to commonMain — first real shared
UI-layer file with a domain dependency.
Verified: ./gradlew assembleDebug + :composeApp:compileKotlinJvm +
:core:data-jvm:smoke (M1a PASS) in one run, and
:desktopApp:run --args="--data-dir /tmp/incido-desktop-smoke3
--self-test --exit-after 6" (SELFTEST wrote note id=1).
Plan §6.1 step 1, the conservative shape: build converts, Android code
moves UNMODIFIED (git shows pure renames; behaviour diff = zero), and
commonMain starts with only the files that compile for both targets
today — theme Color/Type, PasswordPolicy, ReleaseNotes, LinkedShare-
Composer — behind two new expect/actual seams (justification per §9):
* platformDynamicColorScheme — Android actual keeps the pre-M4
Build.VERSION + dynamicColorScheme branch verbatim; JVM actual
returns null (desktop hides dynamic color, per M3's posture).
* relativeTimestamp — Android actual is DateUtils verbatim; JVM
actual is a java.time approximation of the same format (English-
only until M4 follow-up; desktop has no locale switch yet).
New friction found paying itself into §3/§2 (all fixed in-tree):
* kotlinMultiplatform must be registered at the ROOT with apply false
like the other Kotlin markers — sibling modules' markers put KGP on
the buildscript classpath and the subproject request then dies with
the kapt-style 'already on classpath with unknown version' (§2.5).
* KMP source-set dependency handlers: platform(libs.x) returns raw
notation, not a Dependency — use project.dependencies.platform(…);
debugImplementation is not on the handler (moved to a project-level
dependencies block); androidTestImplementation dropped (no tests).
* ColorScheme is androidx.compose.material3.ColorScheme, NOT
ui.graphics — desktop ships it inside material3-desktop, no extra
artifact needed.
* AGP 8.7.2 > KGP 2.0.21's tested max 8.5 — warning only, same as
the kapt modules; assembleDebug green.
Deliberate deferrals (documented in the build file): :core:domain is
still kotlin("jvm") so commonMain can't see it — NoteColors moves
when domain converts (M4.2, per the Phase-0 recommendation); screens,
ViewModels and AppContainer move with the container seam (M4.3).
Verified: ./gradlew :composeApp:compileKotlinJvm + assembleDebug +
:core:data-jvm:smoke (M1a PASS) + :desktopApp:run --self-test
(SELFTEST wrote note, clean exit) + git status clean over
core/**/objectbox-models (ID model file unchanged, invariant 2).
Milestone M3 task 1 (DESKTOP_PHASE_PLAN §5): move UserSettings +
SettingsRepository into a plain kotlin("jvm") module so the desktop
build reads/writes the SAME preferences keys and .preferences_pb format
the phone uses. Package name org.incido.compose.data.settings kept, so
the Android diff is file moves + one constructor change.
Seam: SettingsRepository now takes an injected DataStore<Preferences>.
Android supplies the preferencesDataStore(name = "incido_settings")
Context-extension store (new AndroidSettingsStore.kt, moved verbatim);
desktop builds it with PreferenceDataStoreFactory.create(
corruptionHandler = ReplaceFileCorruptionHandler, produceFile) — the
Phase-0 API delta (no Context extension on the multiplatform core
artifact). snapshot() keeps runBlocking for startup-only use.
DesktopContainer grows settingsRepository first, mirroring AppContainer
construction order ahead of M3's cipher install. dynamic_color /
use_biometric / block_screenshots keys ride along but have no desktop
UI — hidden, not faked (M3 exit rule).
Verified: ./gradlew assembleDebug (green; :app needed :core:settings on
its classpath — MainActivity reads userSettingsFlow, same pattern as
:core:domain) + ./gradlew :desktopApp:run --args="--data-dir
/tmp/incido-desktop-smoke --self-test --exit-after 6" (RENDER/SELFTEST
sequence intact) + ./gradlew :core:data-jvm:smoke (green).
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).