agent/php/tests/Unit
Snider 060f5abb66 feat(agent/php): ProfileSelector + ShapeClassifier services per Phase 3 (#826)
ShapeClassifier::classify($ticket) returns 'A'|'B'|'C' per policy v1:
- (severity=critical OR priority=urgent) → A
- has tag in ['security','crypto','core'] → A
- (severity=major OR priority=high) → B
- everything else → C

ProfileSelector::pickFor($ticket) walks AgentProfile::active(), matches
capability tags case-insensitively against ticket.tags:
- Class A: cheapest matching profile (cost_class alphabetic order)
- Class B: any active profile with quota_headroom_pct >= 25
- Class C: deterministic round-robin via last_dispatched_at

Pest Unit tests cover Good (matching profile picked), Bad (no match → null),
Ugly (all profiles disabled → null), plus class A/B headroom gating + class C
round-robin determinism.

Codex note: php -l clean; pest skipped — no vendor/ at this repo root
(downstream lab/lthn.ai owns composer install).

Closes tasks.lthn.sh/view.php?id=826

Co-authored-by: Codex <noreply@openai.com>
2026-04-26 00:48:37 +01:00
..
Concerns revert fcb9c189e5 2026-04-23 12:32:57 +01:00
Events feat(core/events): add WebhookRegistering lifecycle event (HIGH) 2026-04-25 19:37:23 +01:00
Pipeline feat(pipeline): add MetaReader contract + Forgejo-backed implementation 2026-04-23 18:09:54 +01:00
.gitkeep revert fcb9c189e5 2026-04-23 12:32:57 +01:00
AgentDetectionTest.php revert fcb9c189e5 2026-04-23 12:32:57 +01:00
AgenticManagerTest.php revert fcb9c189e5 2026-04-23 12:32:57 +01:00
AgentToolRegistryTest.php revert fcb9c189e5 2026-04-23 12:32:57 +01:00
BrainServiceTest.php fix(brain): wire Qdrant api-key header from BRAIN_QDRANT_API_KEY 2026-04-24 05:21:15 +01:00
ClaudeServiceTest.php revert fcb9c189e5 2026-04-23 12:32:57 +01:00
GeminiServiceTest.php revert fcb9c189e5 2026-04-23 12:32:57 +01:00
OpenAIServiceTest.php revert fcb9c189e5 2026-04-23 12:32:57 +01:00
ProcessContentTaskTest.php revert fcb9c189e5 2026-04-23 12:32:57 +01:00
ProfileSelectorTest.php feat(agent/php): ProfileSelector + ShapeClassifier services per Phase 3 (#826) 2026-04-26 00:48:37 +01:00
ShapeClassifierTest.php feat(agent/php): ProfileSelector + ShapeClassifier services per Phase 3 (#826) 2026-04-26 00:48:37 +01:00