0.161.0
Added
- MCP: гранулярные гранты — per-agent/user/context allow/deny на отдельные tools (ADR
docs/adr/2026-07-02-mcp-full-coverage.md, Фаза 3, ). Разным принципалам (агентам/пользователям/контекстам) можно разрешить или запретить конкретные инструменты MCP-сервера. Правило разрешения: deny > allow > default-allow. Wildcard-паттерны (mcp_server_*). Кэшsync.Mapс инвалидацией по серверу. Fail-closed при ошибке БД. - Миграция 102 (SQLite + PG): таблицы
mcp_grants(CHECK principal_type IN agent/user/context, UNIQUE server+principal, tool_allow/tool_deny JSONB, enabled bool, config_overrides JSONB) иmcp_access_requests(workflow pending/approved/rejected). - Store: типы
MCPGrant/MCPAccessRequest+ CRUD (Upsert/Get/List/Delete) в SQLite/PG/DualStore. - GrantChecker (
internal/mcp/grants.go):IsAllowed(ctx, serverID, principalType, principalKey, toolName)→(bool, reason). Кэшsync.Map(grantCacheKey), InvalidateServer/Invalidate. deny>allow>default-allow, wildcard через trailing*. Empty allow = all tools. Disabled grant = default-allow. Fail-closed при DB error. Self-healing (notFound кэшируется, DB error — нет). - API (4 endpoints,
RequireGlobalAdmin):GET/POST /mcp-servers/{id}/grants,GET/DELETE .../grants/{principalType}/{principalKey}. - Проверки:
go test ./internal/...— зелёные; 7 новых тестов:TestContainsTool,TestGrantChecker_{DefaultAllow,DenyWins,EmptyAllowMeansAll,DisabledGrantMeansDefaultAllow,WildcardPattern,InvalidateServer}(deny-wins, wildcard, cache invalidation, disabled=allow);go vet+golangci-lint— 0 issues;make build-cross— проходит;ocr review— в процессе.