Commit graph

21 commits

Author SHA1 Message Date
Snider
8b48b33622 merge(mcp): reconcile origin AX-6 sweep + brainclient refactor with homelab migration + features
Parent SHAs:
  origin/dev: 4420670 feat(mcp/brain): OpenBrain T1+T2 — shared client + direct/brain-seed adoption (#175 #176)
  homelab/dev: 95f8ad3 docs(security): document accepted ollama CVEs + operator runbook

Resolution strategy (29 conflicts: 26 UU + 3 AA):
- Took origin's body for every conflicting file (AX-6-clean, uses core.* helpers
  not banned stdlib; preserves the brainclient.New() refactor that landed in
  origin commit 4420670 and lifted inline HTTP code into pkg/mcp/brain/client/).
- Sed-rewrote `dappco.re/go/core/X` → `dappco.re/go/X` import paths inline so
  origin's body uses the migrated paths that homelab's go.mod declares.
- go.mod auto-merged toward homelab's NEW dep paths (dappco.re/go/{ai,api,cli,
  io,log,process,rag,webview,ws} v0.8.0-alpha.1) — correct outcome.
- Homelab's standalone-new files (cmd/openbrain-mcp/, ipc.go, tools_metrics.go,
  tools_ws_client.go, tools_webview_embed.go, etc.) preserved via git's
  non-conflicting auto-merge.

Followups (filed separately):
- Stale `replace dappco.re/go/core/process => ../go-process` directive remains
  in go.mod — pre-existing, doesn't match any current dep, will catch in
  future cleanup pass.
- Local build verification deferred: workspace-level go-proxy half-migration
  + missing go-ws entry in ~/Code/go.work block `go build ./...` from
  succeeding host-side; this merge resolved by per-file inspection.

Co-authored-by: Codex <noreply@openai.com>
2026-04-25 16:08:35 +01:00
Snider
44206708f9 feat(mcp/brain): OpenBrain T1+T2 — shared client + direct/brain-seed adoption (#175 #176)
#175 (T1/5 — shared Go HTTP client):
- pkg/mcp/brain/client/client.go: shared client with retry, circuit breaker, org propagation
- 30s default HTTP client, retry on network/5xx only, no retry on 4xx
- Minimal circuit breaker for repeated failures
- pkg/mcp/brain/client/client_test.go: httptest coverage

#176 (T2/5 — direct subsystem + binaries adopt shared client):
- pkg/mcp/brain/direct.go: refactored to delegate through *client.Client
- pkg/mcp/brain/direct_test.go: tests updated to use brainclient.New
- cmd/brain-seed/main.go: uses /v1/brain/remember via shared client with -org

Verification: go test ./pkg/mcp/brain/client/... passed; go build cmd/brain-seed passed.

Co-authored-by: Codex <noreply@openai.com>
Closes tasks.lthn.sh/view.php?id=175
Closes tasks.lthn.sh/view.php?id=176
2026-04-25 15:42:11 +01:00
Snider
b29b8b5685 fix(mcp): AX-6 sweep on pkg/mcp/authz.go + cmd/brain-seed/main.go
authz.go: removed errors/fmt/strings → coreerr.E + core.Sprintf + core.*
helpers. brain-seed/main.go: removed bytes/fmt/strings → core.NewBuffer +
core.Print/Println + core.* helpers.

Co-authored-by: Codex <noreply@openai.com>
2026-04-25 11:18:36 +01:00
Snider
b2ed228b3f feat(ax-10): bring mcp to v0.8.0-alpha.1 + CLI test scaffold
- Migrate go.mod direct + indirect deps from dappco.re/go/core/X (pre-migration paths) to dappco.re/go/X at v0.8.0-alpha.1
- Update all Go source imports across 49 files: dappco.re/go/core/{ai,api,cli,io,log,process,rag,webview,ws,i18n,inference} -> dappco.re/go/{ai,api,cli,io,log,process,rag,webview,ws,i18n,inference}
- Add tests/cli/mcp/Taskfile.yaml AX-10 scaffold (build / vet / test under default deps), per RFC-CORE-008-AGENT-EXPERIENCE.md §10
- mcp is library + 4 binaries (brain-seed, core-mcp, mcpcmd, openbrain-mcp); the build target validates all of them

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

Co-Authored-By: Athena <athena@lthn.ai>
2026-04-24 23:35:37 +01:00
Snider
f26ae14222 feat(mcp): add cmd/openbrain-mcp stdio wrapper for Claude Code
Thin Go wrapper mounting pkg/mcp/brain tools onto Service.ServeStdio().
Proxies to the PHP BrainService via --brain-url so any Claude Code
session gains OpenBrain recall/remember via `claude mcp add openbrain`.

Closes tasks.lthn.sh/view.php?id=76
Co-authored-by: Codex <noreply@openai.com>

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-23 15:22:13 +01:00
Snider
62c1949458 fix(mcp): rewrite mcpcmd for new core/cli Command API + correct bridge test
The mcpcmd package was using the removed Cobra-style cli.Command API
(Use/Short/Long/RunE/StringFlag/AddCommand). Rewrites it to the current
core.Command{Description, Action, Flags} path-routed pattern so the
core-mcp binary compiles again. Registers both "mcp" and "mcp/serve"
for parity with the existing OnStartup service-mode flow.

Fixes the bridge DescribableGroup test that expected len == svc.Tools()
but ToolBridge.Describe prepends the GET tool-listing entry, so the
correct expectation is len + 1.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-14 18:02:36 +01:00
Snider
91297d733d fix(mcp): rewrite mcpcmd for new core/cli Command API + correct bridge test
The mcpcmd package was using the removed Cobra-style cli.Command API
(Use/Short/Long/RunE/StringFlag/AddCommand). Rewrites it to the current
core.Command{Description, Action, Flags} path-routed pattern so the
core-mcp binary compiles again. Registers both "mcp" and "mcp/serve"
for parity with the existing OnStartup service-mode flow.

Fixes the bridge DescribableGroup test that expected len == svc.Tools()
but ToolBridge.Describe prepends the GET tool-listing entry, so the
correct expectation is len + 1.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-14 18:01:17 +01:00
Snider
20e4a381cf fix: migrate module paths from forge.lthn.ai to dappco.re
Update all import paths and version pins:
- forge.lthn.ai/core/go-* → dappco.re/go/core/*
- forge.lthn.ai/core/api → dappco.re/go/core/api
- forge.lthn.ai/core/cli → dappco.re/go/core/cli
- Updated: api v0.3.0, cli v0.5.2, ai v0.2.2, io v0.4.1, log v0.1.2
- Updated: process v0.5.0, rag v0.1.13, ws v0.4.0, webview v0.2.1
- Updated: i18n v0.2.3, inference v0.3.0, scm v0.6.1

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-07 12:59:22 +01:00
Virgil
c1d3db1ad3 fix(mcp): ensure CLI shutdown cleanup 2026-04-02 18:42:03 +00:00
Virgil
6a5a177bec refactor(mcp): default CLI to sandboxed workspace 2026-04-02 18:16:46 +00:00
Virgil
41f83b52f6 refactor(mcp): align service descriptions with runtime behavior
Update stale MCP service and CLI descriptions so they match the current runtime shape, and log the actual bound TCP address when listening on an ephemeral port.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 13:01:41 +00:00
Virgil
8e77c5e58d feat(mcp): auto-select unix socket transport
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 12:56:30 +00:00
d02853cb6c Merge pull request 'feat: mcp.Register + module path dappco.re/go/mcp' (#15) from feat/core-service-pattern into dev 2026-03-24 22:10:00 +00:00
Snider
3d62d2f531 feat: migrate module path forge.lthn.ai/core/mcp → dappco.re/go/mcp
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-24 21:39:52 +00:00
2e4608e6b5 Merge branch 'dev' into agent/fix-the-following-codex-review-findings 2026-03-24 11:37:34 +00:00
Virgil
d3c7210433 fix(mcp): harden transport auth and workspace prep path validation
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-23 14:33:35 +00:00
Snider
5d749af517 fix(mcp): resolve codex review findings — spelling, imports, tests, assertions
- UK English in transport_e2e_test.go comments and error strings
- Replace fmt.Printf with coreerr.Error/Warn in brain-seed for errors/skips
- Alias stdlib io as goio in transport_tcp, brain/direct, agentic/prep, bridge, brain-seed
- Add var _ Notifier = (*Service)(nil) compile-time assertion
- Add TestRegisterProcessTools_Bad_NilService for nil-service error path
- Add webview handler tests beyond nil-guard (disconnect success, validation paths)
- Guard tools_process_ci_test.go with //go:build ci (pre-existing build failure)
- Document circular-import exception in EXCEPTIONS.md

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 02:14:33 +00:00
Snider
424b5eb91d refactor: replace fmt.Errorf/os.* with go-io/go-log conventions
Replace all fmt.Errorf and errors.New in production code with
coreerr.E("caller.Method", "message", err) from go-log. Replace all
os.ReadFile/os.WriteFile/os.MkdirAll/os.Remove with coreio.Local
equivalents from go-io. Test files are untouched.

24 files across pkg/mcp/agentic/, pkg/mcp/brain/, pkg/mcp/ide/,
pkg/mcp/, and cmd/brain-seed/.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 21:57:12 +00:00
Snider
ebd44bf2f2 feat(agentic): add workspace prep MCP tool
Ports agentic:prep-workspace from CorePHP to Go as an MCP tool.
Assembles: CLAUDE.md, wiki KB, specs, OpenBrain context, consumer
list, recent git log, and Forge issue TODO for target repo.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-15 08:04:59 +00:00
Snider
b0cbd21741 feat(brain): add direct HTTP subsystem for standalone MCP server
DirectSubsystem calls api.lthn.sh REST API directly without the
IDE WebSocket bridge. Reads API key from CORE_BRAIN_KEY env or
~/.claude/brain.key. Wired into core-mcp serve command.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-15 07:13:45 +00:00
Snider
9e2d77ed2a feat: initial core/mcp — Go MCP server + PHP Laravel MCP package
Moved from go-ai/mcp/ and php-mcp. Produces core-mcp binary.
49 MCP tools including brain, RAG, ML, IDE bridge.
2026-03-09 18:34:17 +00:00