php-agentic/Services
Clotho 0e7b617551
Some checks failed
CI / PHP 8.3 (pull_request) Failing after 2s
CI / PHP 8.4 (pull_request) Failing after 1s
feat: add template version management (#35)
Snapshots YAML template content in a new `plan_template_versions` table
whenever a plan is created from a template. Plans reference their version
via `template_version_id` so existing plans are unaffected by future
template file edits.

Key changes:
- Migration 0006: create `plan_template_versions` table (slug, version,
  name, content JSON, content_hash SHA-256); add nullable FK
  `template_version_id` to `agent_plans`
- Model `PlanTemplateVersion`: `findOrCreateFromTemplate()` deduplicates
  identical content by hash; `historyFor()` returns versions newest-first
- `AgentPlan`: add `template_version_id` fillable and `templateVersion()`
  relationship
- `PlanTemplateService::createPlan()`: snapshot raw template before
  variable substitution; store version id and version number in metadata;
  add `getVersionHistory()` and `getVersion()` public methods
- Tests: `TemplateVersionManagementTest` covering model behaviour, plan
  creation snapshotting, deduplication, history ordering, and service
  methods

Closes #35

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 13:25:17 +00:00
..
Concerns fix: resolve 14 test failures across 3 test files 2026-02-23 11:48:29 +00:00
AgentApiKeyService.php perf: cache permitted tools per API key (closes #24) 2026-02-23 10:54:12 +00:00
AgentDetection.php style: fix Pint violations in ProcessContentTask and AgentDetection 2026-02-23 12:08:49 +00:00
AgenticManager.php fix: validate API keys on AgenticManager init (#29) 2026-02-23 11:39:01 +00:00
AgenticProviderInterface.php refactor: rename namespace Core\Agentic to Core\Mod\Agentic 2026-01-27 16:12:58 +00:00
AgenticResponse.php refactor: rename namespace Core\Agentic to Core\Mod\Agentic 2026-01-27 16:12:58 +00:00
AgentSessionService.php chore: fix pint code style and add test config 2026-02-23 03:50:09 +00:00
AgentToolRegistry.php perf: cache permitted tools per API key (closes #24) 2026-02-23 10:54:12 +00:00
ClaudeService.php fix: add error handling to ClaudeService streaming (#26) 2026-02-23 11:04:07 +00:00
ContentService.php style: fix pint issues in ContentService and AgentToolRegistryTest 2026-02-23 11:58:52 +00:00
GeminiService.php chore: fix pint code style and add test config 2026-02-23 03:50:09 +00:00
IpRestrictionService.php refactor: rename namespace Core\Agentic to Core\Mod\Agentic 2026-01-27 16:12:58 +00:00
OpenAIService.php chore: fix pint code style and add test config 2026-02-23 03:50:09 +00:00
PlanTemplateService.php feat: add template version management (#35) 2026-02-24 13:25:17 +00:00