refactor: 重构聊天数据层至core并简化首页UI
This commit is contained in:
+10
-1
@@ -62,7 +62,7 @@ This file governs `apps/**` (Flutter). Keep rules strict, short, and reusable.
|
||||
|
||||
- Agent chat must follow AG-UI over SSE.
|
||||
- Lifecycle events are mandatory: `RUN_STARTED` and exactly one of `RUN_FINISHED` or `RUN_ERROR`.
|
||||
- Text streaming flow must be `TEXT_MESSAGE_START -> TEXT_MESSAGE_CONTENT -> TEXT_MESSAGE_END`.
|
||||
- Current default text delivery is finalized `TEXT_MESSAGE_END` payloads; do not require token-level `TEXT_MESSAGE_CONTENT` unless backend protocol explicitly enables it.
|
||||
|
||||
## HTTP Error Parse Contract (Must)
|
||||
|
||||
@@ -92,9 +92,18 @@ This file governs `apps/**` (Flutter). Keep rules strict, short, and reusable.
|
||||
- Shared cache infrastructure (`apps/lib/data/cache/`) must remain domain-agnostic: do not import `features/**` or business model DTOs there.
|
||||
- Domain object serialization/deserialization belongs to repository/feature layer via local mappers/codecs; do not centralize feature-specific codecs in shared cache layer.
|
||||
- Shared cache layer may only encode/decode primitives, collections, and cache metadata wrappers.
|
||||
- Cache strategy default is `SWR + TTL + invalidation/reload`.
|
||||
- Local partial cache patching is allowed only for simple single-entity updates with clear rollback paths; complex cross-list/cross-feature states must invalidate and refetch.
|
||||
- Feature TTL policy must be defined in each feature repository; do not add centralized feature TTL registries in shared cache infra.
|
||||
- Runtime cache is hybrid (`memory + local persistent`) managed by DI singletons; do not create per-screen/per-widget cache store instances.
|
||||
- Cross-feature data access must go through app-level facade/usecase boundaries; do not import another feature's data implementation directly from UI/Bloc.
|
||||
- Repository instances should be resolved from DI singletons to reuse cache and avoid per-feature re-creation.
|
||||
|
||||
### Reminder / Notification Rewrite Boundary
|
||||
|
||||
- Reminder/notification data-interaction logic is under rewrite. Do not reintroduce local-notification scheduling/callback execution paths in `apps/lib/data/services/`.
|
||||
- During rewrite, keep protocol/orchestration in `core/notification/**` and reusable rendering in `shared/widgets/notification/**`.
|
||||
|
||||
## Testing Policy
|
||||
|
||||
- Prioritize tests for model parsing, service logic, and high-regression interaction flows.
|
||||
|
||||
Reference in New Issue
Block a user