22 Commits
Author SHA1 Message Date
Incido Developer 7e0b4b0380 docs(phase-1/m5.5): tag-run decision — merge to main, fire at next real release (throwaway tags would also fire release.yml)
dev / Build debug APK (push) Successful in 2m18s
2026-10-07 00:19:16 +13:00
Incido Developer 765191ac8e docs(phase-1/m5.5): HiDPI correction — Xft.dpi is the real scaling mechanism
Controlled re-runs kill the M5.3 sun.java2d.uiScale verdict: the jpackage
launcher JVM picks the property up yet renders 1:1, in-process setProperty is
also inert, and 1.7.3 Window/rememberWindowState expose no scale arg (javap).
Xft.dpi IS the lever: xrdb 192 + plain bin/incido -> 1920x1016 (1090.dp
clamped), pixel RMSE 0.071 for the 2x-upscaled scale-1 crop (0.000 identical /
0.250 unscaled controls) -> glyphs render proportionally; HiDPI check CLOSED.
Also recorded: uinput virtual keyboard dropped by the compositor like XTEST
(keypress check is physical-keys-only), branch pushed to origin, and the tag
run held for user decision since v*.*.* also fires release.yml.

Verify: bin/incido under Xft.dpi=192 geometry 1920x1016, under 96 -> 1090x730
restored; magick compare RMSE 0.0707 (b6 vs 2x-a), controls 0 and 0.2497;
Main.kt --ui-scale experiment reverted (git checkout, tree was clean).
2026-10-06 23:52:45 +13:00
Incido Developer 9f6124a501 feat(phase-1/m5.5): perf pass legs --perf-smoke/--perf-verify; M5 closed
Seeds 3000 notes against the real streaming UI (279 ms total, ~0.09 ms/note),
fresh observeAll 70 ms, favorite toggle 1 ms, reopen first non-empty emission
89 ms; only 4 RENDER lines during the seed (size-keyed emission coalesces).
The multi-thousand-note unknown from the Phase-0 recommendation closes:
desktop perf is a non-event at 3000 notes. §7 marked DONE + handoff
"first actions" rewritten for post-M5 sessions (four pending-MANUAL checks
listed).

Verify: :desktopApp:run --args="--data-dir /tmp/incido-perf --perf-smoke
--exit-after 150" (PERF seed 3000/279ms, rc 0) then --perf-verify same dir
(reopen 89 ms, rc 0); :desktopApp:createDistributable + image --self-test
rc=0; --keys-smoke KEYS ALL-OK; :core:data-jvm:smoke M1a PASS;
assembleDebug SUCCESSFUL.
2026-10-06 23:18:27 +13:00
Incido Developer 6f16e87ec0 feat(phase-1/m5.4): desktop-release Gitea workflow — Linux packaging job
Tag (v*.*.*) + workflow_dispatch (same retry rationale as release.yml). Linux
runner only: jpackage cannot cross-compile and macOS/Windows GA is Phase 2
(§8) — commented job stubs record the matrix shape. createDistributable ->
image smoke under xvfb (SKIPPED-with-message if absent, never faked) ->
packageDeb only when dpkg exists (failure degrades to recorded skip) ->
tar.gz bundling packaging/incido.desktop + icon.png -> attach to the release
with release.yml's retry-and-verify upload pattern. .gitignore: root
libobjectbox-jni-linux-x64.so is ObjectBox CWD self-extraction noise.

Verify: python yaml parse (job + 6 steps); packageDeb/createDistributable/
printPackageVersion exist in :desktopApp:tasks; their local runs green per
M5.3 log. First real tag run remains the live check (recorded).
2026-10-06 23:10:11 +13:00
Incido Developer c894321fdf feat(phase-1/m5.3): packaging wired — derived version, icon/.desktop, image smoke, HiDPI+Wayland verdicts
packageVersion derived from app versionName (0.4.2.0 -> 0.4.2; printPackageVersion
task). packaging/icon.png + packaging/incido.desktop template ship the icon (1.7.3
DSL exposes no iconFile — recorded). Image smoke caught a REAL bug: jlink runtime
lacked jdk.unsupported, DataStore protobuf died on sun/misc.Unsafe only inside the
image; fixed via modules.add. createDistributable re-verified: 171 MB image,
bin/incido --self-test inside it rc=0. HiDPI: sun.java2d.uiScale=2 doubles requested
geometry (screen-clamp proves it). Native Wayland: AWT probe on JDK17 AND 27 both
resolve X11 XToolkit — stays XWayland; JBR bundling is Phase 2. New §3 traps +
M5.3 run log recorded.

Verify: :desktopApp:createDistributable (SUCCESSFUL, 171 MB); image bin/incido
--data-dir /tmp/incido-img-smoke --self-test --exit-after 6 (SELFTEST id=1, RENDER
notes=1, rc=0); :desktopApp:run --keys-smoke KEYS ALL-OK; :core:data-jvm:smoke
M1a PASS; assembleDebug SUCCESSFUL.
2026-10-06 23:05:54 +13:00
Incido Developer 0cad7729aa feat(phase-1/m5.2): tray + single-instance lock + first-run onboarding
SingleInstanceLock (OS FileLock on <dataDir>/incido.lock) claims the library
before the container starts; a second launch prints INSTANCE and exits 0 —
which also converts the wedged-child trap into a clean message. Tray
(ApplicationScope extension; Item/Separator menu) attaches only for
non-scripted, non-headless, SystemTray-capable sessions; close=quit kept.
First-run dialog explains the per-machine library + backup bridge, gated on
onboarded_v1 in the window store. Two new §3 traps recorded (Window
iconBitmap overload ambiguity; Tray receiver/params) + new harness legs in §1.

Verify: second launch same dir (INSTANCE ... exits, 0); interactive run
(TRAY attached, live KDE SNI); :desktopApp:run --args="--data-dir
/tmp/incido-m52-ob --onboarding-smoke --exit-after 8" (shown=true,
flag-persisted=true PASS) then --onboarding-verify (shown=false gate
respected); --keys-smoke KEYS ALL-OK; --self-test id=1;
:core:data-jvm:smoke M1a PASS; assembleDebug SUCCESSFUL.
2026-10-06 22:54:48 +13:00
Incido Developer 639f39d187 feat(phase-1/m5.1): desktop Esc back stack + Ctrl+N/Ctrl+comma shortcuts
JVM PlatformBackHandler made real (PlatformBackStack + LocalPlatformBackStack);
window drains it on Esc via Window(onPreviewKeyEvent) — the editor rides the
shared seam unchanged (draft flush + discard prompt). Shell registers
drawer/settings Esc; preview-phase shortcuts. New --keys-smoke leg drives the
exact dispatch headlessly. Keypress capture pending-manual (KWin/Wayland drops
xdotool XTEST events to the XWayland window).

Verify: ./gradlew assembleDebug :composeApp:compileKotlinJvm :desktopApp:build
(SUCCESSFUL); :desktopApp:run --args="--data-dir /tmp/incido-keys --keys-smoke
--exit-after 12" (KEYS ALL-OK); --self-test/--settings-smoke/--editor-smoke
green; :core:data-jvm:smoke M1a PASS.
2026-10-06 22:37:37 +13:00
Incido Developer faab0cde98 chore(phase-1/m4.5c): delete spike modules; record M4.4/M4.5 findings
6.6 executed: :spike:data-jvm and :spike:compose-jvm leave the build
now that :desktopApp hosts the real screens (M4.5b) — everything they
proved has a permanent home in :core:data-jvm, :composeApp (jvm) and
:desktopApp; their findings already live in the feasibility log.

tools/DESKTOP_FEASIBILITY.md gains the M4.4a-e + M4.5a-c entries:
seam inventory (image decode, editor intake, voice slot, platform
back, shared settings sections, JVM EXIF), the hide-not-fake §6.5
rulings applied, the harness note about cold-build run timeouts,
the M4.4/M4.5 verification suite, and the M5 next-up.

Verified post-deletion: assembleDebug :desktopApp:build SUCCESSFUL
+ run --self-test --settings-smoke --editor-smoke (SELFTEST id=1,
SETTINGS shown, EDITOR shown, ST_EXIT=0) + :core:data-jvm:smoke
(M1a PASS) + orientationSmoke (M4.4e PASS).
2026-10-06 19:55:26 +13:00
Incido Developer 31408172df docs(phase-1/m4.3): M4.3 status + §1 gate output; plan handed to M4.4
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).
2026-10-06 16:44:39 +13:00
Incido Developer b774a1feb6 docs(phase-1/m4.2): M4.2 status; plan handed to M4.3 (container seam) 2026-10-06 12:23:00 +13:00
Incido Developer bce8e9a0dc docs(phase-1/m4.1): M4.1 status + §1 gate re-run output; plan carried to M4.2 2026-10-06 12:17:51 +13:00
Incido Developer 6b8db18cdf docs(phase-1/m3.4): M3 status + scripted key-envelope legs; plan handed to M4
Closes milestone M3 (DESKTOP_PHASE_PLAN §5).

Code (one addition): --key-export / --key-import CLI legs in Main.kt —
the SecurityActions menu's exact codec calls, headless. This makes the
pending physical-phone leg a one-liner once a Waydroid container is
live (recipe recorded in the feasibility doc).

Docs: DESKTOP_FEASIBILITY.md gains the M3.1–M3.4 status section with
the actual run output (leg A/B, KEYENV logs, 0600 ls lines); plan §1
lists the two crypto legs among the must-stay-green commands; §5 marked
DONE; first-actions now point a fresh session at M4 task 1.

Exit criteria, per the plan's wording:
- encrypted desktop library passes EncryptionVerifier's trial-decrypt
  sweep: MET (leg A verified=1 failed=0, wrong key -> AEAD failure
  count, leg B relaunch all-ok).
- phone-exported recovery key decrypts on desktop: MET at format level
  (shared codec source, 84B INCKEY1 envelope, AEADBadTagException on
  wrong passphrase, byte-identical key into a fresh 0600 file); the
  physical phone export is FLAGGED pending (Waydroid container FROZEN,
  start is sudo-gated) with the exact re-run recipe — not assumed done.

Verified: ./gradlew assembleDebug, :core:data-jvm:smoke,
:spike:data-jvm:run, :desktopApp:run --self-test, and both crypto legs
— all green in one final pass (one self-test teardown hang under the
compositor, rc=124, clean on immediate rerun — recorded, environmental).
2026-10-06 07:39:54 +13:00
Incido Developer 561d16eb0c fix(phase-1/m2.4b): encrypted imports were a silent no-op on-device
Manual Waydroid pass (phone exports encrypted -> re-imports the same
file through the real UI) caught it: the confirm dialog closed but no
import ran and no snackbar appeared. PassphraseDialog.onConfirm's
shared preamble nulls all URI slots before routing on mode, and the
IMPORT branch never re-armed pendingImportUri -- so the preview
confirm dialog's Import button read null and skipped viewModel.import
entirely. Plain-JSON imports bypass the passphrase dialog, which is
why every scripted desktop leg (M2.1-2.5) stayed green.

Fix: re-arm pendingImportUri in the IMPORT branch before preview;
wrong-pw/dismiss paths still null it and zero the retained chars.

Verified on-device after rebuild + `waydroid app install`: export
snackbar, magic-sniffed "Decrypt backup" sheet, 4-note preview, and
the dedupe snackbar "Imported 0 note(s), skipped 4 already imported."

Also lands the Waydroid test rig used for the pass (tools/WAYDROID_
TESTING.md + tools/inject2.c: uinput tap/move/key/text/swipe injector)
and the full M2.4b write-up in DESKTOP_FEASIBILITY.md. M2 exit
criteria met: bidirectional lossless round-trip plain+encrypted.
2026-10-06 05:40:44 +13:00
Incido Developer 9cb7fdbf58 perf(phase-1/m2.5): export memory measured on synthesized worst-case libraries
Phase 1 M2 task 5 (tools/DESKTOP_PHASE_PLAN.md §4): measure & record,
no redesign. New :core:data-jvm:backupMemory probe (2g heap) samples
heap-used at 1 ms during BackupBridge.exportPlain — the phone's own
export path — across four fresh libraries:

  24 MB data (3 att)  → peak 230 MB   |  2 MB text x2000 notes → 140 MB
  80 MB data (10 att) → peak 777 MB   | 320 MB data (40 att)  → OOM at -Xmx2g

Attachments drive memory (~9–10x allocation pressure: store load →
base64 String → UTF-8 bytes → JsonElement tree); note count alone is
trivial. The plan's 250 MB gate trips at ~25–30 MB of attachments, and
the phone (no largeHeap) shares the ceiling — a pre-existing Android
limitation, unchanged by the bridge extraction. The real library
exports at 366 KB ≈ 1000x headroom. Bonus: a ~1.6 GB library dies in
objectbox-java's DbFullException before the bridge ever sees it.

Verdict: record, don't redesign. Streaming formatVersion=2 stays parked
for Phase 2, required only if attachment libraries approach ~25 MB.
2026-10-05 19:48:02 +13:00
Incido Developer 52ccceb732 feat(phase-1/m2.4a): scripted encrypted backup legs — the app round-trips ICDBKP1 envelopes
Phase 1 M2 task 4, desktop half (tools/DESKTOP_PHASE_PLAN.md §4). New
--backup-export-enc <path> + --backup-passphrase <pw> flags drive the
exact calls the RequirePassphrase/Passphrase dialogs make, headlessly.

Verified across two launches on fresh libraries:
  run A: import plain(27) → reimport skipped=27 → exported-enc=27 magic ok
  run B: preview encrypted=true → imported=27 → wrong-pw preview rejected
         → reimport imported=0 skipped=27

Gotcha found (and honoured): EncryptedBackupCodec zeroes the passphrase
CharArray in BOTH encrypt and decrypt — the array is single-use fuel.
The dialogs already comply (fresh toCharArray() per call); the scripted
block re-derives it via newPw() for the same reason.

Device half (4b: phone re-imports a desktop-made envelope + sees the
dedupe snackbar) follows on Waydroid with the M2 wrap-up.
2026-10-05 19:43:42 +13:00
Incido Developer 031d8570b4 feat(phase-1/m2.3): import dedupe — importing the same file twice adds nothing
Phase 1 M2 task 3 (tools/DESKTOP_PHASE_PLAN.md §4). Logic lives in
BackupBridge so both platforms get it through the one bridge:

- BackupBridge.import gains skipExisting (default true) and returns
  ImportSummary(imported, skipped). A note is skipped when the library
  already holds the key (createdAt, updatedAt, sha256(content)) — the
  triple the export preserves verbatim, trustworthy only since the M2
  import-timestamp fix. Keys are snapshotted BEFORE importing, so two
  genuinely identical notes inside one file still both import into a
  fresh library; only a second import of the same file is a no-op.
  Snapshotted keys include trashed notes. skipExisting=false restores
  the old additive behaviour (the documented override).
- Android: BackupManager.import passes the flag and returns the summary
  (signature-identical call for SettingsViewModel); its snackbar now
  reports the skip count. Screen layouts untouched — exit criterion
  "Android backup screens unchanged" holds.
- Desktop: the import confirm dialog swaps its "duplicates persist"
  warning for a working "Skip notes that are already here" checkbox
  (default ON); scripted path prints the re-import outcome.
- Format unchanged: formatVersion stays 1 (streaming/dedupe-at-format
  level stays a Phase-2 formatVersion=2 idea).

Verification passed: :core:data-jvm:backupSmoke (new step — re-import
skipped=27, override added 27, store=54; RESULT M2 round-trip PASS on
the real export) + :desktopApp:run --args="--data-dir /tmp/incido-m2t3
--backup-import <export> --backup-export … --exit-after 8" (imported=27
skipped=0 → exported=27 → reimport imported=0 skipped=27, clean exit) +
assembleDebug + :core:data-jvm:smoke + :desktopApp:run --self-test —
all green; output recorded in DESKTOP_FEASIBILITY.md.

Known limitation (by design): attachments are not in the key.
2026-10-05 19:33:07 +13:00
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