agent/pkg/brain
Snider 9628e5d088 feat(agent/brain): non-Laravel callers route through shared OpenBrain client (#121)
Audit + remediation pass on non-Laravel Brain callers per #121.

docs/brain-callers-audit.md (NEW): audit baseline. Lists every PHP +
Go + script call site, current protections (org auth, retry, circuit
breaker), and gaps. Cross-references recent fixes (#312, #998, #1052,
#1055, #1006, #985).

New pkg/agentic/brain_client.go helper: routes Go callers through
the shared OpenBrain client path with org injection (CORE_BRAIN_ORG
fallback) and a shared circuit breaker.

Patched call sites:
- pkg/agentic/prep.go (line ~1200)
- pkg/agentic/session.go (line ~826)
- pkg/agentic/brain_seed_memory.go (line ~153)
- pkg/brain/direct.go (line ~106)

These previously made raw Brain HTTP posts. Now they go through the
hardened client path inheriting #998 (key-perm), #1052 (bearer SSRF
guard), #1055 (jitter), and the circuit breaker.

Remaining non-Laravel gaps (documented in audit doc, not patched here
because they're outside this lane's path-allowlist):
- core/mcp/pkg/mcp/agentic/prep.go
- Hermes Python plugins
- Claude shell hooks
- plugins/core-go api-endpoints SKILL example

Follow-up tickets needed for those (file separately).

Co-authored-by: Codex <noreply@openai.com>
Closes tasks.lthn.sh/view.php?id=121
2026-04-25 20:33:33 +01:00
..
actions.go feat(agent/brain): adopt shared T1 client + propagate org through actions (#177) 2026-04-25 16:22:38 +01:00
actions_example_test.go revert fcb9c189e5 2026-04-23 12:32:57 +01:00
actions_test.go feat(agent/brain): adopt shared T1 client + propagate org through actions (#177) 2026-04-25 16:22:38 +01:00
alias_test.go revert fcb9c189e5 2026-04-23 12:32:57 +01:00
brain.go revert fcb9c189e5 2026-04-23 12:32:57 +01:00
brain_example_test.go revert fcb9c189e5 2026-04-23 12:32:57 +01:00
brain_test.go revert fcb9c189e5 2026-04-23 12:32:57 +01:00
bridge_test.go feat(ax-10): bring agent to v0.8.0-alpha.1 + CLI test scaffold 2026-04-24 23:48:34 +01:00
direct.go feat(agent/brain): non-Laravel callers route through shared OpenBrain client (#121) 2026-04-25 20:33:33 +01:00
direct_example_test.go revert fcb9c189e5 2026-04-23 12:32:57 +01:00
direct_test.go feat(agent/brain): adopt shared T1 client + propagate org through actions (#177) 2026-04-25 16:22:38 +01:00
messaging.go revert fcb9c189e5 2026-04-23 12:32:57 +01:00
messaging_example_test.go revert fcb9c189e5 2026-04-23 12:32:57 +01:00
messaging_test.go revert fcb9c189e5 2026-04-23 12:32:57 +01:00
provider.go feat(ax-10): bring agent to v0.8.0-alpha.1 + CLI test scaffold 2026-04-24 23:48:34 +01:00
provider_example_test.go revert fcb9c189e5 2026-04-23 12:32:57 +01:00
provider_test.go feat(ax-10): bring agent to v0.8.0-alpha.1 + CLI test scaffold 2026-04-24 23:48:34 +01:00
register.go revert fcb9c189e5 2026-04-23 12:32:57 +01:00
register_example_test.go revert fcb9c189e5 2026-04-23 12:32:57 +01:00
register_test.go revert fcb9c189e5 2026-04-23 12:32:57 +01:00
tools.go revert fcb9c189e5 2026-04-23 12:32:57 +01:00
tools_example_test.go revert fcb9c189e5 2026-04-23 12:32:57 +01:00
tools_test.go test(agent): add AX-10 unit tests for dispatch/session/sync/tools/content (#169) 2026-04-25 07:57:30 +01:00