Refine Rust architecture boundaries
This commit is contained in:
@@ -39,6 +39,28 @@ MCP client
|
||||
Input mapping переводит MCP arguments в REST request. Output mapping переводит
|
||||
REST response в MCP tool result.
|
||||
|
||||
## Rust boundaries
|
||||
|
||||
В Community-коде закреплены следующие границы:
|
||||
|
||||
- `crank-core::domain` — доменные типы: operations, agents, users, secrets, observability, ids.
|
||||
- `crank-core::ports` — интерфейсы внешних зависимостей: policy, audit, identity, protocol adapters, cache stores, metering.
|
||||
- `crank-registry::records` — read/write records, которые возвращает storage layer.
|
||||
- `crank-registry::requests` — request-структуры для persistence операций.
|
||||
- `crank-registry::infrastructure` — PostgreSQL registry facade, pool config и extension migrations.
|
||||
- `apps/admin-api/src/dto.rs` — HTTP payloads и view models. Service layer не должен владеть DTO-типами.
|
||||
- `apps/admin-api/src/service/*` — application use-cases. Эти модули не импортируют `axum`.
|
||||
- `crates/crank-community-mcp/src/transport.rs` — MCP Streamable HTTP transport: headers, accept negotiation, session id, JSON/SSE responses.
|
||||
- `RuntimeExecutionRequest` — единая точка расширения runtime execution parameters. Новые auth/context/cache/metring параметры добавляются туда, а не через новые `execute_with_*` методы.
|
||||
|
||||
Границы проверяются скриптами:
|
||||
|
||||
```text
|
||||
scripts/check-rust-boundaries.sh
|
||||
scripts/check-rust-module-boundaries.sh
|
||||
scripts/check-rust-code-health.sh
|
||||
```
|
||||
|
||||
## Хранилище
|
||||
|
||||
PostgreSQL хранит:
|
||||
|
||||
Reference in New Issue
Block a user