Commit graph

73 commits

Author SHA1 Message Date
Snider
18992a70d9 fix: align indirect dependency versions via go work sync
Some checks failed
Security Scan / security (push) Successful in 8s
Test / test (push) Failing after 2m1s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-14 13:42:30 +00:00
Snider
94ec6e3e0a fix: update stale import paths and dependency versions from extraction
Some checks are pending
Test / test (push) Waiting to run
Security Scan / security (push) Successful in 9s
Resolve stale forge.lthn.ai/core/cli v0.1.0 references (tag never existed,
earliest is v0.0.1) and regenerate go.sum via workspace-aware go mod tidy.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-14 13:38:59 +00:00
Snider
3f3faf3c9c refactor(api): update import path from go-api to core/api
Some checks failed
Security Scan / security (push) Successful in 11s
Test / test (push) Failing after 2m0s
Part of the polyglot merge — forge.lthn.ai/core/go-api is now
forge.lthn.ai/core/api.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-14 10:10:32 +00:00
Snider
9e06e3e1b1 docs: add CLAUDE.md project instructions
Some checks failed
Security Scan / security (push) Successful in 10s
Test / test (push) Failing after 2m21s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-13 13:38:01 +00:00
Snider
6460301533 docs: add human-friendly documentation
Some checks failed
Security Scan / security (push) Successful in 8s
Test / test (push) Failing after 2m1s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 13:02:39 +00:00
Snider
0202bec84a refactor: extract MCP server to core/mcp
Some checks failed
Security Scan / security (push) Successful in 9s
Test / test (push) Failing after 1m47s
Move mcp/, cmd/mcpcmd/, cmd/brain-seed/ to the new core/mcp repo.
Update daemon import to use forge.lthn.ai/core/mcp/pkg/mcp.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 18:40:50 +00:00
Snider
413c637d26 refactor: use generic cli.AddDaemonCommand, remove duplicated daemon lifecycle
Some checks failed
Security Scan / security (push) Successful in 12s
Test / test (push) Failing after 2m2s
Replace 260+ lines of hand-rolled start/stop/status/run logic with a thin
wrapper delegating to cli.AddDaemonCommand(). The MCP-specific config,
transport constants, and startMCP() function are preserved.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 14:09:02 +00:00
Snider
021e73a3f6 fix: thread-safe metrics, error returns for RAG, TCP bind safety
Some checks failed
Security Scan / security (push) Successful in 8s
Test / test (push) Failing after 2m28s
- Add mutex to metrics.Record() for concurrent safety
- QueryRAGForTask returns (string, error) instead of silent empty string
- Default TCP transport binds to 127.0.0.1 instead of 0.0.0.0

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 08:23:53 +00:00
Snider
e81f673448 chore: add .core/ build and release configs
Some checks failed
Security Scan / security (push) Successful in 8s
Test / test (push) Failing after 2m20s
Add go-devops build system configuration for standardised
build, test, and release workflows across the Go ecosystem.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-06 18:52:36 +00:00
Snider
16f8ffc22c chore: sync go.mod dependencies
Some checks failed
Security Scan / security (push) Successful in 9s
Test / test (push) Failing after 2m28s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-06 15:22:46 +00:00
Snider
53c4f1d645 chore: remove boilerplate Taskfile
Some checks failed
Security Scan / security (push) Successful in 8s
Test / test (push) Failing after 2m20s
All tasks (test, build, lint, fmt, vet, cov) are handled natively
by `core go` commands. Taskfile was redundant wrapper.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-06 14:45:49 +00:00
Snider
f032887827 docs: add angular-testing MCP guide from core/go
Some checks failed
Security Scan / security (push) Successful in 8s
Test / test (push) Failing after 1m32s
MCP tools live in go-ai — this doc belongs here.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-06 14:24:41 +00:00
Snider
991c1f6bf3 refactor: swap pkg/framework imports to pkg/core
Some checks failed
Security Scan / security (push) Successful in 7s
Test / test (push) Failing after 2m25s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-06 14:11:03 +00:00
Snider
badcfe9a78 refactor: swap pkg imports to standalone modules
Some checks failed
Security Scan / security (push) Successful in 11s
Test / test (push) Failing after 1m37s
- pkg/ws → go-ws
- pkg/webview → go-webview
- pkg/lab → lthn/lem/pkg/lab
- pkg/process → go-process (from prior session)

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-06 13:48:09 +00:00
Snider
dfe474a239 refactor: swap pkg/{io,log,i18n} imports to go-io/go-log/go-i18n
Some checks failed
Security Scan / security (push) Successful in 9s
Test / test (push) Failing after 3m8s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-06 12:35:42 +00:00
Snider
b36975097d feat: add brain-seed tool + TLS support for .lan domains
Some checks failed
Test / test (push) Failing after 43s
Security Scan / security (push) Failing after 14m3s
brain-seed imports Claude Code MEMORY.md files into OpenBrain by
embedding via Ollama and storing vectors in Qdrant. Supports dry-run,
plan docs, and configurable endpoints.

Also fixes embed-bench to use a shared HTTP client that trusts
self-signed certs for .lan domains behind Traefik.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-03 10:23:42 +00:00
Snider
ba6272d2aa feat: add embed-bench tool for comparing embedding models
Some checks failed
Security Scan / security (push) Successful in 7s
Test / test (push) Failing after 1m1s
Benchmarks embedding models head-to-head using cosine similarity
on agent memory corpus. Tests cluster separation and query recall
accuracy across 4 topic groups and 8 queries.

Results: EmbeddingGemma has 2x better separation gap (0.197 vs
0.112) than nomic-embed-text, both achieve 100% top-1 recall.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-03 10:10:08 +00:00
Snider
35246ff14e feat(mcp): add brain subsystem for OpenBrain knowledge store
Some checks failed
Security Scan / security (push) Successful in 7s
Test / test (push) Failing after 1m0s
Adds mcp/brain/ package with 4 MCP tools (brain_remember,
brain_recall, brain_forget, brain_list) that proxy to Laravel
php-agentic backend via the shared IDE WebSocket bridge.

13 tests passing (nil-bridge headless mode + struct round-trips).

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-03 09:52:08 +00:00
Snider
458ea3f3fa test: add iterator and registry tag tests for MCP service
All checks were successful
Security Scan / security (push) Successful in 7s
Test / test (push) Successful in 5m23s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-02 17:37:38 +00:00
Snider
a803603916 chore: bump forge.lthn.ai dep versions to latest tags
Some checks failed
Security Scan / security (push) Successful in 22s
Test / test (push) Failing after 8m45s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-26 05:34:22 +00:00
42dabde28f Merge pull request 'chore: Go 1.26 modernization' (#5) from chore/go-1.26-modernization into main
Some checks failed
Security Scan / security (push) Successful in 10s
Test / test (push) Failing after 1m32s
2026-02-24 18:01:43 +00:00
Claude
ee873fcab4
chore: extract repeated sentinel errors to package vars
Some checks failed
Test / test (pull_request) Failing after 1m34s
Security Scan / security (pull_request) Failing after 11m52s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 16:04:11 +00:00
Claude
23d8cb4824
chore: fmt.Errorf(static) → errors.New
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 16:01:43 +00:00
Snider
6dcb39e0ae chore: bump forge.lthn.ai dep versions to latest tags
All checks were successful
Security Scan / security (push) Successful in 14s
Test / test (push) Successful in 7m21s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-23 06:49:37 +00:00
Snider
fdcd791b9b chore: add Go repo norms (badges, contributing, lint, taskfile, editorconfig)
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-23 06:45:31 +00:00
Snider
bd2e2acd49 chore: refresh go.sum after upstream tag updates
Some checks failed
Security Scan / security (push) Successful in 8s
Test / test (push) Failing after 35s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-23 06:35:18 +00:00
Snider
71abac6415 feat: modernise to Go 1.26 iterators and stdlib helpers
Some checks failed
Security Scan / security (push) Successful in 12s
Test / test (push) Failing after 28s
Add ToolsSeq iterator on MCP server, use slices.SortFunc in registry,
slices.ContainsFunc and strings.SplitSeq in security scanner,
range-over-int in metric benchmarks.

Co-Authored-By: Gemini <noreply@google.com>
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-23 05:59:29 +00:00
Claude
445e6ee375
ci: add Forgejo Actions test and security scan workflows
Some checks failed
Security Scan / security (push) Successful in 9s
Test / test (push) Failing after 29s
Uses reusable workflows from core/go-devops for Go testing
(with race detector and coverage) and security scanning
(govulncheck, gitleaks, trivy).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 03:28:02 +00:00
Claude
2537aea96a
chore: refresh go.sum after upstream tag updates
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 23:36:25 +00:00
Snider
8a21d750bb refactor: migrate CLI imports from core/go to core/cli
Update imports from forge.lthn.ai/core/go/pkg/cli to
forge.lthn.ai/core/cli/pkg/cli following CLI package split.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-22 23:29:44 +00:00
Claude
5f120f8e90
chore: sync workspace dependency versions
Run go work sync to align dependency versions across workspace.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 21:42:15 +00:00
Snider
dff5fb23c5 refactor: apply go fix modernizers for Go 1.26
Automated fixes: interface{} → any, range-over-int, t.Context(),
wg.Go(), strings.SplitSeq, strings.Builder, slices.Contains,
maps helpers, min/max builtins.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-22 21:00:16 +00:00
Snider
6d07388407 chore: bump go directive to 1.26.0
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-22 20:33:48 +00:00
Snider
b2b4982e3c chore: pin forge deps to v0.0.1 tags for Go 1.26 compat
Go 1.26 rejects non-semver version strings (like 'main') in go.mod.
Tags v0.0.1 now exist on all forge repos — workspace still overrides
for local development.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-22 20:15:05 +00:00
Snider
ad865ab3b9 chore: use workspace-resolved versions, drop replace directives
Forge module versions now use main branch resolution via ~/Code/go.work
workspace. Removes local replace directives — the central go.work handles
all cross-repo resolution during development.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-22 19:49:36 +00:00
Snider
85e02297cc fix: update ml tool handlers for Result return type
go-ml's Backend.Generate() and Backend.Chat() now return ml.Result{Text, Metrics}
instead of (string, error). Updated mlGenerate and mlProbe handlers to unwrap
result.Text, and updated test mocks to match the new interface.

Added local replace directives for go-inference, go-ml, go-mlx while
these changes propagate through the dependency chain.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-22 19:24:32 +00:00
Snider
6298a84b8b refactor: remove init() + RegisterCommands pattern
Commands now register through Core framework lifecycle via
cli.WithCommands() instead of side-channel init() functions.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-21 22:07:10 +00:00
Snider
63d74568e2 feat: absorb lab command from CLI
LEM Lab launcher for local ML inference.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-21 21:46:59 +00:00
Snider
55e537a55c feat: migrate metrics command from CLI
Move AI metrics tracking command from core/cli cmd/ai into go-ai
where the metrics backend lives.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-21 20:42:17 +00:00
Snider
d962260b81 feat(cmd/rag): re-export go-rag CLI commands through go-ai
CLI should import RAG commands via go-ai (which already depends on
go-rag), not directly. This keeps the CLI's dependency tree clean.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-21 20:23:22 +00:00
Snider
c3de6c4935 feat: migrate daemon, mcpcmd, security commands from CLI
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-21 19:38:04 +00:00
Snider
bc9597c191 chore: resolve forge deps from registry, remove local replaces
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-21 19:22:32 +00:00
Snider
c37e1cf2de fix(mcp): harden REST bridge with body limit, error classification, sanitised messages
- Add 10MB body size limit via io.LimitReader
- Classify JSON parse errors as 400 Bad Request (not 500)
- Sanitise error messages to prevent path leakage
- Document nil CallToolRequest in RESTHandler closure

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-21 01:27:06 +00:00
Snider
d20688d50b feat(mcp): add BridgeToAPI for MCP-to-REST conversion
Bridge converts MCP ToolRecords into go-api ToolBridge entries,
making MCP tools accessible as REST POST endpoints with OpenAPI
metadata. Each tool's RESTHandler closure captures the generic
input type at registration time, enabling type-safe JSON
unmarshalling without runtime reflection.

Co-Authored-By: Virgil <virgil@lethean.io>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 01:06:33 +00:00
Snider
fbf6421046 fix(mcp): add EUPL-1.2 header and fix empty struct schema
- Add missing SPDX license header to mcp.go
- Return empty schema object for zero-field structs instead of nil

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-21 01:01:13 +00:00
Snider
2107edaf79 feat(mcp): add parallel tool registry for REST bridge
Introduce ToolRecord type and addToolRecorded generic helper that
registers tools with the MCP SDK server while simultaneously recording
metadata (name, description, group, input/output JSON schemas) in a
parallel registry. This enables the upcoming REST bridge to enumerate
available tools and their schemas without depending on the SDK server's
unexported internals.

Co-Authored-By: Virgil <virgil@lethean.io>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 00:59:13 +00:00
Snider
2210e0e298 docs: add README with quick start and docs links
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 15:11:19 +00:00
Snider
9016e2ee7d docs: graduate TODO/FINDINGS into production documentation
Replace internal task tracking (TODO.md, FINDINGS.md) with four
structured documentation files covering architecture, tool reference,
development guide, and project history. Trim CLAUDE.md to agent
instructions only — all detailed content now lives in docs/.

- docs/architecture.md: subsystem plugin model, transports, IDE bridge,
  AI facade, full package layout
- docs/tools.md: all 49 MCP tools with parameters and descriptions
- docs/development.md: prerequisites, test patterns, adding tools/subsystems
- docs/history.md: split history, 5 phases with commit hashes, known issues

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 14:54:05 +00:00
Claude
65ff6c6647
fix(go.mod): correct replace path for core/go
Was ../core (wrong), now ../go matching workspace layout.

Co-Authored-By: Charon <charon@lethean.io>
2026-02-20 14:20:33 +00:00
Snider
c5b17f8537 fix(mcp): eliminate data race in TCP transport diagnostic output
Replace bare os.Stderr writes with mutex-protected diagPrintf helper.
Test captures output via setDiagWriter instead of swapping os.Stderr,
preventing races with concurrent ServeTCP goroutines.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 12:30:16 +00:00