Add local preference signal scaffolding

This commit is contained in:
Rijad Zuzo
2026-02-22 23:19:49 +01:00
parent 058e2c1787
commit 8c79ba1345
4 changed files with 499 additions and 0 deletions
+45
View File
@@ -7,6 +7,51 @@ Updated: 2026-02-22
- After every sensible code/documentation change set, create a git commit as
the last step so the next agent session can pick up from clean checkpoints.
## Latest Milestone (2026-02-22): Local Preference Signal Scaffolding (Inferred/Confirmed)
Added a local-first data model and repository APIs for chat-derived preference
signals so the app can gradually build profile context from shared messages.
- `lib/features/local/local_models.dart`
- new enums:
- `PreferenceSignalPolarity` (`like`, `dislike`, `neutral`)
- `PreferenceSignalStatus` (`inferred`, `confirmed`, `dismissed`)
- new model:
- `PersonPreferenceSignal`
- key/category/label
- confidence
- status
- first/last seen timestamps
- occurrence count
- evidence message ids/snippets
- source apps
- `LocalDataState` now stores `preferenceSignals`
- added `copyWith`, `toJson`, `fromJson` support (backward-compatible with
existing stored state)
- `lib/features/local/local_repository.dart`
- added local-only repository APIs:
- `upsertInferredPreferenceSignalObservation(...)`
- aggregates repeated observations
- merges evidence and source apps
- updates confidence and occurrence count
- `upsertPreferenceSignal(...)`
- `setPreferenceSignalStatus(...)`
- `confirmPreferenceSignal(...)`
- `dismissPreferenceSignal(...)`
- updated person lifecycle consistency:
- deleting a person removes linked preference signals
- merging profiles rebinds source preference signals to target
- remote person delete application also removes preference signals
- intentionally local-only for now (not yet mapped to backend sync envelopes)
- `test/features/local/local_repository_test.dart`
- added coverage for inferred signal upsert aggregation + status transitions
- Validation
- `flutter analyze` -> pass
- `flutter test` -> pass
## Latest Milestone (2026-02-22): Person Editor Inline Validation + Duplicate Warning
Improved the People add/edit profile experience to make validation explicit and