feat: add local-first private AI digest workflow

Migrate app code into canonical feature slices, add phone-only AI digest scheduling and review, wire local notification/background task support, and cover the flow with tests.
This commit is contained in:
Rijad Zuzo
2026-05-17 00:17:20 +02:00
parent dab50abf0e
commit f655adfbea
212 changed files with 24178 additions and 15895 deletions
+32
View File
@@ -75,6 +75,38 @@ Behavior notes:
permission prompts
- tapping a reminder notification opens reminder management UI in-app
## Phone-Only Private AI Digest
The app can run without a production backend by keeping `USE_FAKE_BACKEND=true`
and using the LLM integration only for a private weekly digest.
Digest behavior:
- relationship data remains local-first in the Hive/shared-preferences store
- scheduled digest payloads use pseudonymous tokens such as `person_001`
- names, aliases, sender names, source URLs, raw shared text, and sensitive
notes are not sent in the scheduled digest prompt
- LLM results are saved as pending AI review drafts first
- accepting a draft creates a local idea, task, or reminder
- dismissing a draft leaves existing local data unchanged
Scheduling:
- default cadence is weekly
- default run window is Sunday 21:00
- default policy is Wi-Fi + charging
- iOS background execution is best-effort because the OS controls exact timing
- Settings includes `Run Private Digest Now` for physical-phone debug builds
iOS setup now includes:
- `UIBackgroundModes`: `fetch`, `processing`
- `BGTaskSchedulerPermittedIdentifiers`: `com.relationshipsaver.llm.digest`
- Workmanager registration in `AppDelegate.swift`
Local notifications are used for the digest-ready alert. No APNs/FCM remote
push payload is required.
## WhatsApp Share Intake (MVP)
Inbound WhatsApp share-intake is now wired behind a listener in the authenticated