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

Modern-Apps.git / library / everysync-core / AGENTS.md

AGENTS.md2.3 KiBRenderedCodeRaw
1# AGENTS.md — library/everysync-core/ (':library:everysync-core')
2
3> Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside `library/everysync-core/` + allowed shared modules. Do not root-scan.
4
5- Gradle: :library:everysync-core / dir: library/everysync-core/
6- Targets: android + jvm (desktop) + iosArm64 + iosSimulatorArm64 (KMP plugin version == Kotlin version)
7- Package: `com.vayunmathur.everysync.core` (commonMain) + platform actuals
8- Entry files: `commonMain/sync/RelayMerge.kt`, `commonMain/data/RemoteModels.kt` (Phase 1A moves)
9- Deps: kotlinx-coroutines-core, kotlinx-serialization-json, kotlinx-datetime (common only)
10- Metadata: none (libraries have none by design)
11- Rust: no (binds the `:library:e2ee-p2p` crate via JNI/JNA/cinterop — no new Rust)
12
13## Overview
14**Purpose:** Shared KMP sync brain for the EverySync E2EE relay protocol — merge, vault policy, DTOs, formats. No Android API in commonMain; platform coupling behind expect/actual (`RelayTransport`, `SecureStore`, `SyncScheduler`, `SyncSink`, `AesGcm`, `SyncDigest`).
15**Invariants (verbatim from the Android impl):** a failed pull returns null = abort, never empty; only explicit tombstones delete; vault keys never user-visible. Relay contract: `https://api.maproj.org/personal` + `wss://api.maproj.org/personal/ws`, `POST /register|/getkey|/append|/pull`.
16**Gotchas:** never depend on `:library:log` / `:library:network` / `:library:room` from commonMain (Android-only, no common variant); FIRST_PARTY pinning DERs are copied by `syncCaResources` into `src/commonMain/resources/ca/` (gitignored build output) and loaded at runtime by the OkHttp actuals.
17
18### Relay server (backend, outside this repo)
19Relay contract host: `https://api.maproj.org/personal` (Cloudflare FIRST_PARTY pins). Server checkout: `../location_share_server` (sibling of this repo root, `C:\Users\Vayun\Documents\code\location_share_server`). Live SSH: `ssh [email protected]`. Full details: root `AGENTS.md` → "Backend server (outside this repo)".
20
21## Verify (this module only)
22```
23./gradlew :library:everysync-core:compileKotlinJvm
24./gradlew :library:everysync-core:lint
25```
26
27## Cross-platform
28Program status: root `CROSS_PLATFORM_STATUS.md`. System-sink interfaces: `src/commonMain/kotlin/com/vayunmathur/everysync/core/sinks/SystemSinks.kt`. Shells: `desktop/` (EDS/Windows), `apple/` (EventKit/CNContactStore).