AGENTS.md — desktop/passwords/ (':desktop:passwords')
Scoped supplement. Global rules in root AGENTS.md apply. Stay inside desktop/passwords/ + allowed shared modules. Do not root-scan.
<!-- last-reviewed: 2026-10-16 -->
- Gradle: :desktop:passwords / dir: desktop/passwords/
- Package roots present: com.vayunmathur.desktop.passwords (plain Kotlin, no Compose)
- Entry files: Main.kt, PasswordSync.kt, PasswordVault.kt, KdbxCompat.kt
- Deps: :library:everysync-core, kotlinx-serialization-json, okhttp, jna (all via catalog)
- Metadata: none (CLI shell, no app metadata)
- Rust: no (consumes e2ee_pqc host lib via core's JvmPqcCrypto) / screenshotTest: no
Overview
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. Key features:
- File-backed
PasswordVaultimplementing coreSyncSink<RemotePassword>with hard-delete semantics - One-shot
PasswordSync.drivevia sharedSyncDriver(null-pull aborts, never merges a failed pull) KdbxCompatKeePass-style CSV/JSON interchange using verbatim sharedEntryMapperkey namesMain.ktCLI: init transport, sync once, print counts
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). Entry points + reading order: Main.kt → PasswordSync.kt → PasswordVault.kt → KdbxCompat.kt. Gotchas:
- Passwords HARD-delete:
listLocalnever 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 explicitdeleted=truerelay envelopes delete (seePasswordKind). - Relay log is append-only:
syncOncefolds the FULL log (last envelope per uid wins) before driving; a null pull aborts the cycle. KdbxCompatcarries field maps only — no new crypto, no KDBX encryption. File protection stays out of scope.- JVM-only module: no
Toast, noIcon/Scaffold, no Compose, no Room strings.
Key files
- com/vayunmathur/desktop/passwords/PasswordVault.kt — file JSON store + SyncSink with hard-delete rule
- com/vayunmathur/desktop/passwords/PasswordSync.kt — FileSecureStore, RelayStore adapter, syncOnce drive
- com/vayunmathur/desktop/passwords/KdbxCompat.kt — KeePassXC-compat field-map import/export
- com/vayunmathur/desktop/passwords/Main.kt — CLI entry (sync once, print counts)
Verify (this module only)
./gradlew :desktop:passwords:compileKotlin(Orchestrator verifies; do not run Gradle from this task.)