Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
cov/c3 ▾

Modern-Apps.git / desktop / passwords / AGENTS.md

AGENTS.md2.8 KiBRenderedCodeRaw
1# AGENTS.md — desktop/passwords/ (':desktop:passwords')
2
3> Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside `desktop/passwords/` + allowed shared modules. Do not root-scan.
4
5<!-- last-reviewed: 2026-10-16 -->
6- Gradle: :desktop:passwords / dir: desktop/passwords/
7- Package roots present: com.vayunmathur.desktop.passwords (plain Kotlin, no Compose)
8- Entry files: Main.kt, PasswordSync.kt, PasswordVault.kt, KdbxCompat.kt
9- Deps: :library:everysync-core, kotlinx-serialization-json, okhttp, jna (all via catalog)
10- Metadata: none (CLI shell, no app metadata)
11- Rust: no (consumes e2ee_pqc host lib via core's JvmPqcCrypto) / screenshotTest: no
12
13## Overview
14**Purpose:** Desktop JVM shell on the shared EverySync core for the passwords vault (Phase 2a). Syncs `RemotePassword` records over `JvmRelayTransport` through the shared `SyncDriver` + `PasswordKind` merge. No Compose UI yet — UI lands after the core proves.
15**Key features:**
16- File-backed `PasswordVault` implementing core `SyncSink<RemotePassword>` with hard-delete semantics
17- One-shot `PasswordSync.drive` via shared `SyncDriver` (null-pull aborts, never merges a failed pull)
18- `KdbxCompat` KeePass-style CSV/JSON interchange using verbatim shared `EntryMapper` key names
19- `Main.kt` CLI: init transport, sync once, print counts
20**Architecture / data-flow:** `Main` (FileSecureStore + JvmRelayTransport.init) → `PasswordSync.syncOnce` (vault key load-or-create → pullRecords since 0 → fold → SyncDriver.drive → append) → `PasswordVault` (rows + `MemoryBaselineStore` snapshots on disk).
21**Entry points + reading order:** `Main.kt` → `PasswordSync.kt` → `PasswordVault.kt` → `KdbxCompat.kt`.
22**Gotchas:**
23- Passwords HARD-delete: `listLocal` never returns deleted rows; `delete()` removes the row and keeps the baseline snapshot so the merge reads "baseline present + row absent" as a local delete. Only explicit `deleted=true` relay envelopes delete (see `PasswordKind`).
24- Relay log is append-only: `syncOnce` folds the FULL log (last envelope per uid wins) before driving; a null pull aborts the cycle.
25- `KdbxCompat` carries field maps only — no new crypto, no KDBX encryption. File protection stays out of scope.
26- JVM-only module: no `Toast`, no `Icon`/`Scaffold`, no Compose, no Room strings.
27
28## Key files
29- com/vayunmathur/desktop/passwords/PasswordVault.kt — file JSON store + SyncSink with hard-delete rule
30- com/vayunmathur/desktop/passwords/PasswordSync.kt — FileSecureStore, RelayStore adapter, syncOnce drive
31- com/vayunmathur/desktop/passwords/KdbxCompat.kt — KeePassXC-compat field-map import/export
32- com/vayunmathur/desktop/passwords/Main.kt — CLI entry (sync once, print counts)
33
34## Verify (this module only)
35```
36./gradlew :desktop:passwords:compileKotlin
37```
38(Orchestrator verifies; do not run Gradle from this task.)