690519:1631 224 to 226 AI #01
CI / CD Pipeline / build (push) Failing after 3m57s
CI / CD Pipeline / deploy (push) Has been skipped

This commit is contained in:
2026-05-19 16:31:50 +07:00
parent 3e25097470
commit ea5499123e
127 changed files with 12387 additions and 42 deletions
@@ -0,0 +1,13 @@
# Research Notes: AI Tool Layer Architecture
- **ADR-025 Analysis**: Focus on Server-Side Dispatch. Instead of giving LLM direct tool calling capabilities, we map a `ServerIntent` to a function call securely on our server. This ensures CASL enforcement prior to executing logic, rather than relying on the LLM runtime to provide constraints.
- **Data Shape**: Tools will return `ToolCallResult<T>` which is defined as:
```typescript
type ToolCallReason = 'FORBIDDEN' | 'NOT_FOUND' | 'INVALID_PARAMS' | 'SERVICE_ERROR';
type ToolCallResult<T> =
| { ok: true; data: T }
| { ok: false; reason: ToolCallReason; message: string };
```
- **Error Types**: Follows ADR-007 layered classification.
- **Identifiers**: Adheres to ADR-019 (Hybrid Identifier). No internal integer `id` exposed. All references utilize `publicId`.
- **Security Check**: Enforce `CaslAbilityGuard` behavior directly inside the Tool Service methods, utilizing `CaslAbilityFactory` instantiated with the `RequestUser`.