agent/php/tests/Feature/Brain
Snider 1872424cfd feat(agent/brain): lift OpenBrain discovery features (search/discoverTags/listScopes) (#180)
Bounded subset of RFC-OPENBRAIN lifted from lab/lthn.ai shim into the
OSS BrainService at php/Services/BrainService.php:

- search(query, filter, pagination): Elasticsearch path first, falls
  back to MariaDB if ES is unavailable. Operates on active/latest
  memories only.
- discoverTags(filter): tag-cloud / popular-tags discovery scoped to
  authenticated org(s).
- listScopes(filter): org/project distribution counts for the
  authenticated session.

All three:
- Enforce bounded inputs (per #1001 patterns)
- Honour org auth (per #312 patterns)
- Only operate on active/latest memories (active=1, deleted_at IS NULL)

Self-hosters now get the same discovery surface that lab/lthn.ai
exposes — no need to fork the OSS service to access these features.

Pest covers: bounds-violation rejection, fallback behaviour, scoped
discovery returning correct org/project breakdowns.

Lab-only features still out of scope for this lane (would pull in
extra schema/models/events): agentContext, recall feedback,
maintenance lifecycle (reindex/consolidate/clean/prune). Those need
follow-up tickets if/when bounded-lift becomes possible.

Co-authored-by: Codex <noreply@openai.com>
Closes tasks.lthn.sh/view.php?id=180
2026-04-25 20:39:14 +01:00
..
CircuitBreakerTest.php fix(agent/brain): retryableHttp narrows retryable set + 6-attempt budget 2026-04-25 18:14:40 +01:00
OrgScopingTest.php feat(agent/brain): lift OpenBrain discovery features (search/discoverTags/listScopes) (#180) 2026-04-25 20:39:14 +01:00
ReindexFlagsTest.php fix(brain): close openbrain audit gaps — org scoping + index cleanup + reindex flags + MCP schemas + circuit layer 2026-04-24 08:14:06 +01:00
RememberValidationTest.php feat(agent/brain): lift OpenBrain discovery features (search/discoverTags/listScopes) (#180) 2026-04-25 20:39:14 +01:00
SupersedeForgetIndexCleanupTest.php fix(agent/brain): walk supersede chain to current head + cycle guard 2026-04-25 18:42:52 +01:00