Commit graph

5 commits

Author SHA1 Message Date
darbs-claude
a352f697a9 perf: cache permitted tools per API key (closes #24)
Some checks failed
CI / PHP 8.4 (pull_request) Failing after 1m23s
CI / PHP 8.3 (pull_request) Failing after 1m27s
Cache the list of permitted tool names in `AgentToolRegistry::forApiKey()`
using a 1-hour TTL to avoid O(n) filtering on every request (PERF-002).

- Add `Cache::remember()` in `forApiKey()` storing tool names keyed by API
  key ID (`agent_tool_registry:api_key:{id}`)
- Add `flushCacheForApiKey(int|string $id)` for explicit invalidation
- Add `CACHE_TTL` constant (3600 s) for easy tuning
- Invalidate cache in `AgentApiKeyService::updatePermissions()` and `revoke()`
  so permission changes take effect immediately
- Add `tests/Unit/AgentToolRegistryTest.php` covering cache hit/miss,
  per-key isolation, scope filtering, TTL constant, and flush behaviour

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 10:54:12 +00:00
Claude
3f905583a8
chore: fix pint code style and add test config
Some checks failed
CI / tests (push) Failing after 1m9s
Add phpunit.xml for standalone test execution.
Apply Laravel Pint formatting fixes across all source files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 03:50:09 +00:00
Snider
adcc163775 refactor: update namespaces for L1/L2 package convention
- Core\Mod\Tenant -> Core\Tenant
- Core\Service\Agentic -> Core\Mod\Agentic\Service

Part of namespace restructure to align with L1/L2 module conventions.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 17:34:46 +00:00
Snider
ad83825f93 refactor: rename namespace Core\Agentic to Core\Mod\Agentic
Updates all classes to use the new modular namespace convention.
Adds Service/ layer with Core\Service\Agentic for service definition.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 16:12:58 +00:00
Snider
1350472d11 monorepo sepration 2026-01-27 00:28:29 +00:00