Add architecture package and application skeleton

This commit is contained in:
2026-07-03 21:09:47 +03:00
parent 7d6cc1c83e
commit ce2b263e52
47 changed files with 2377 additions and 53 deletions
+55
View File
@@ -0,0 +1,55 @@
# ADR 005: Policy Evaluation Model
## Status
Accepted
## Context
Ключевой принцип проекта: без hardcoded bans.
Система должна принимать решения через policy engine, а не через встроенные запреты по имени tool или по содержимому команды.
## Decision
Policy engine работает в 4 шага:
1. request/action нормализуется в `ActionDescriptor`;
2. descriptor классифицируется по `resource` и `risk_level`;
3. policy evaluator находит эффективное правило;
4. возвращается `PolicyDecision`.
## Core Types
`resource`:
- `filesystem`
- `shell`
- `sql`
- `mcp`
- `external_models`
- `desktop`
- `browser`
- `network`
- `cost`
- `system`
`risk_level`:
- `safe`
- `write`
- `destructive`
- `system`
- `cost`
`decision`:
- `allow`
- `confirm`
- `manual`
- `disabled_by_config`
## Important Rule
Policy engine не получает “tool name only” как источник истины.
Он должен опираться на action classification и metadata от tool/model/worker adapters.