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>
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>
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>
Commands now register through Core framework lifecycle via
cli.WithCommands() instead of side-channel init() functions.
Co-Authored-By: Virgil <virgil@lethean.io>
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>
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>
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>
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>
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>
- Make go-inference a direct dependency (was indirect)
- Rewrite mlBackends() to use inference.List()/Get()/Default()
instead of ml.Service.Backends()/Backend()/DefaultBackend()
- Add documentation comments clarifying generation flow
- mlGenerate/mlScore/mlProbe unchanged (work via go-ml.Service)
Co-Authored-By: Virgil <virgil@lethean.io>
- Delete test-mlx.go (standalone test script, not library code)
- Fix TestSandboxing_Symlinks_Followed to match security behaviour
(renamed to TestSandboxing_Symlinks_Blocked — asserts sandbox
correctly blocks symlinks escaping the workspace root)
- Fix TestNewTCPTransport_Warning by adding missing security warning
to NewTCPTransport when binding to 0.0.0.0 (all interfaces)
- Update CLAUDE.md dependency table (go-mlx, duckdb, parquet, ollama,
qdrant now indirect via go-ml/go-rag)
- Tidy go.mod (direct vs indirect aligned with actual imports)
- Verify go build, go vet, go test all pass
Co-Authored-By: Virgil <virgil@lethean.io>
go-ai is now a meta package: ai/ facade + mcp/ hub that imports
go-ml, go-rag, go-mlx, and go-agentic as separate modules.
Co-Authored-By: Virgil <virgil@lethean.io>
Remove mlx/ directory (now lives at forge.lthn.ai/core/go-mlx).
Update ml/backend_mlx.go imports to reference the new module.
Add replace directive for local development.
Co-Authored-By: Virgil <virgil@lethean.io>
The Decode method strips the SentencePiece leading space from every
token, which loses word boundaries during streaming. DecodeToken
preserves the space (it represents the word boundary) and only the
first token of each generation has its leading space stripped.
Fixes Gemma3 space prefix appearing in chat UI output.
Co-Authored-By: Virgil <virgil@lethean.io>
Add LoRA field to Linear for transparent adapter injection via model's
Forward() path. ApplyLoRA() on Qwen3/Gemma3 wraps target projections.
Deterministic param ordering for adapter save/load consistency.
MaskedCrossEntropyLoss for training on assistant tokens only.
Co-Authored-By: Virgil <virgil@lethean.io>
LoRA: low-rank adaptation with trainable A/B matrices, Kaiming normal
init, safetensors save/load. AdamW: decoupled weight decay optimizer
with positional moment tracking for gradient-replaced params.
14 tests passing including end-to-end LoRA+AdamW training loop.
Co-Authored-By: Virgil <virgil@lethean.io>
Native Go bindings for MLX-C gradient computation on Apple Silicon.
Foundation for LoRA training without Python.
- VJP (reverse-mode autodiff) for backward pass
- JVP (forward-mode autodiff) for directional derivatives
- ValueAndGrad for combined loss + gradient computation
- Checkpoint for memory-efficient gradient recomputation
- CrossEntropyLoss (numerically stable via LogSumExp)
- MSELoss, Log, SumAll, MeanAll, OnesLike helpers
- TakeAlongAxis and LogSumExp ops
- Fix closure callback null vector bug (affects compile.go too)
- Fix Float() returning 0 for float32 arrays
14 tests passing on Metal GPU.
Co-Authored-By: Virgil <virgil@lethean.io>
Remove the manual -tags mlx requirement. MLX is now automatically
compiled on darwin/arm64 via build constraints. Stubs remain for
other platforms. No functional change.
Co-Authored-By: Virgil <virgil@lethean.io>
LEM scoring pipeline, native MLX Metal bindings, Claude SDK wrapper,
RAG with Qdrant/Ollama, unified AI facade, and MCP protocol server.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>