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

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

AGENTS.md2.0 KiBRenderedCodeRaw
1# AGENTS.md — desktop/notes/ (':desktop:notes')
2
3> Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside
4> `desktop/notes/` + `settings.gradle.kts` (append include only) plus
5> read-only access to the shared contracts. Do NOT touch
6> `library/everysync-core`, `todo/`, `notes/`, `desktop/passwords`, or Apple dirs.
7
8- Gradle: :desktop:notes / dir: desktop/notes/
9- Targets: JVM desktop only (applies `common-conventions-jvm`)
10- Package: `com.vayunmathur.desktop.notes`
11- Entry files: `Main.kt` (CLI), `NoteSync.kt` (driver), `NoteVault.kt`, `TodoView.kt`
12- Deps: `:library:everysync-core` (merge, DTOs, `JvmRelayTransport`), kotlinx-serialization
13- Metadata: none (desktop shells have none by design)
14- Rust: no (PQC via core's JVM actual)
15
16## Overview
17**Purpose:** Desktop Notes JVM shell on the shared core: syncs the
18`notes:<vaultId>` + `todos:<vaultId>` relay channels once via `SyncDriver`
19and prints counts. Windows renders todos inside the Notes UI
20(`TodoView.todosAsNotes` projection, writes back via `updateTodoFromNote`).
21
22**Key files**
23- `NoteVault.kt` — `SyncSink<RemoteNote>` + `RelayStore<RemoteNote>` with
24 SOFT-delete (tombstones persist; `listLocal` includes deleted).
25- `TodoView.kt` — `SyncSink<RemoteTodo>` + `RelayStore<RemoteTodo>`, same
26 tombstone semantics, plus the Windows todos-view projection.
27- `NoteSync.kt` — drives both channels via `SyncDriver` + `JvmRelayTransport`;
28 blob images by `fileName` via `BlobStore` (`notes-blobs:<vaultId>` LWW).
29- `MarkdownBridge.kt` — `NoteBody` → markdown export (no Android deps).
30- `Main.kt` — CLI: sync once, print counts.
31
32**Invariants (from the shared core, preserved here):** failed pull = abort,
33never empty; tombstone-only delete; reorder is not an edit
34(`position` stripped from merge hashes); `notes`/`createdAt` persist verbatim
35on todos.
36
37## Verify (this module only)
38Do NOT run Gradle (per task scope). When enabled:
39```
40./gradlew :desktop:notes:compileKotlin
41```
42Files <350 lines, no Android imports.