Commit graph

6 commits

Author SHA1 Message Date
Snider
27d08bbe43 feat(tests): add AgenticManager tests
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 19:23:20 +00:00
Snider
9e513af049 refactor(tests): convert PlanTemplateServiceTest to Pest functional syntax
Convert PHPUnit class-based tests to Pest functional syntax with:
- 47 test cases organised into 9 describe blocks
- Proper beforeEach/afterEach hooks for test setup/teardown
- Covers: template listing, retrieval, preview, variable substitution,
  plan creation, validation, categories, context generation, edge cases
- Uses expect() assertions and method chaining for clarity

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 18:56:51 +00:00
Snider
489c8136e1 docs(TODO): Update test counts for AgentApiKeyService and IpRestrictionService
- AgentApiKeyServiceTest: 58 tests (Pest functional syntax)
- IpRestrictionServiceTest: 78 tests (Pest functional syntax)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 18:51:53 +00:00
Snider
e70e078bcb refactor(tests): convert AgentApiKey tests to Pest functional syntax
- Convert AgentApiKeyTest from PHPUnit class-based syntax to Pest functional syntax
- Add tests/Pest.php configuration with helper functions (createWorkspace, createApiKey)
- Organise tests using describe() blocks for better structure
- Add additional test coverage for key rotation and security edge cases
- Update TODO.md to reflect Pest syntax usage

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 18:42:56 +00:00
Snider
c432a45ca9 feat(security): switch API key to Argon2id with comprehensive tests
P2 Items Completed (P2-062 to P2-068):
- Switch AgentApiKey from SHA-256 to Argon2id hashing
- Add 200+ tests for models, services, and AI providers
- Create agent_plans migration with phases and workspace states

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 13:36:53 +00:00
Snider
a2a9423ad6 security: fix SQL injection and add workspace scoping to MCP tools
- Replace orderByRaw with parameterised CASE statements
- Add Task::scopeOrderByPriority() and scopeOrderByStatus()
- Add AgentPlan::scopeOrderByStatus()
- Add workspace validation to StateSet, StateGet, StateList tools
- Add workspace validation to PlanGet, PlanList tools
- Add SecurityTest.php with comprehensive isolation tests

Fixes SEC-002, SEC-003 from security audit.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 12:21:01 +00:00