docs(agents): define Rust backend architecture boundaries

Document which layer owns Rust capabilities, fallible inputs, background work, and crate validation.
This commit is contained in:
Tunglies
2026-11-30 18:13:47 +08:00
parent 1fa03291f3
commit 7b43bac198
3 changed files with 54 additions and 12 deletions
+10 -3
View File
@@ -1,10 +1,17 @@
# Backend Architecture Guardrails
Use [Workspace Crate Architecture](../crates/AGENTS.md) when extracting backend
capabilities or changing background task ownership.
Follow [Workspace Crate Architecture](../crates/AGENTS.md) when changing
backend capability boundaries, reusable orchestration, or background task
ownership.
- **Tauri adapter.** Commands validate transport input, delegate to application
use cases, and map results and errors to IPC. Tauri wires dependencies and
owns desktop lifecycle, window and tray integration, and event delivery.
Keep domain validation and reusable orchestration independent of command
handlers and framework state.
- **Configuration and effects.** `config` owns source configuration, drafts, and
persistence. The effects layer classifies every Verge patch field, including
persistence coordination. Persistence adapters perform storage and recovery.
The effects layer classifies every Verge patch field, including
fields without effects and platform-specific fields, and reconciles requested
state in dependency order. Publish rollbackable state after persistence and
commit. On failure, preserve already applied runtime effects, independently