Commit graph

15 commits

Author SHA1 Message Date
Virgil
1d4ad16e7a docs(ai): align facade comments with AX examples
All checks were successful
Security Scan / security (push) Successful in 14s
Test / test (push) Successful in 1m2s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 09:44:16 +00:00
Virgil
b6571771f3 refactor(ai): make metric bucket ordering deterministic
All checks were successful
Security Scan / security (push) Successful in 10s
Test / test (push) Successful in 1m9s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 09:07:26 +00:00
Virgil
d6c360813a refactor(ai): align facade with AX naming
All checks were successful
Security Scan / security (push) Successful in 10s
Test / test (push) Successful in 1m2s
Add usage-example comments and rename short internal helpers to clearer names.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 06:06:38 +00:00
Virgil
f9e2948176 feat(ai): make RAG facade fail soft
All checks were successful
Security Scan / security (push) Successful in 10s
Test / test (push) Successful in 2m27s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 05:58:24 +00:00
Virgil
3c0d9f853c feat(ai): add recent metrics events
All checks were successful
Security Scan / security (push) Successful in 10s
Test / test (push) Successful in 1m16s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 05:35:56 +00:00
Claude
8a68ed5160
chore: migrate to dappco.re vanity import path
Some checks failed
Security Scan / security (push) Successful in 9s
Test / test (push) Failing after 23s
Module path: forge.lthn.ai/core/go-ai -> dappco.re/go/core/ai

Updated all .go imports for migrated sibling packages:
- forge.lthn.ai/core/go-log -> dappco.re/go/core/log
- forge.lthn.ai/core/go-io -> dappco.re/go/core/io
- forge.lthn.ai/core/go-i18n -> dappco.re/go/core/i18n

Added //go:build ignore to cmd/lab/cmd_lab.go (pre-existing broken
import: forge.lthn.ai/lthn/lem/pkg/lab was removed from LEM).

Packages not yet migrated (left as-is): cli, go-rag, go-scm,
go-process, mcp, api, go-crypt, go-inference, go-ml, go-mlx.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 23:52:57 +00:00
Snider
569f553b1a fix(ai): DX audit — update CLAUDE.md, add tests, fix io consistency
Some checks failed
Security Scan / security (pull_request) Successful in 9s
Test / test (pull_request) Failing after 1m33s
- CLAUDE.md: remove deleted daemon/ entry, add embed-bench/ and lab/,
  fix build commands for go workspace (./... → module path),
  update error handling guidance to coreerr.E(), remove stale
  cli.AddDaemonCommand reference
- Replace os.MkdirAll with coreio.Local.EnsureDir in bench/test code
- Add 14 unit tests for metrics (Record, ReadEvents, Summary, sortedMap,
  readMetricsFile edge cases) — ai/ coverage 65.3% → 67.3%
- Add parseDuration tests for cmd/metrics — coverage 0% → 24.6%
- No fmt.Errorf or errors.New violations found
- No os.ReadFile/os.WriteFile violations found

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 08:01:21 +00:00
Snider
251d248026 refactor: replace fmt.Errorf/errors.New with coreerr.E()
Some checks failed
Security Scan / security (push) Successful in 8s
Test / test (push) Failing after 1m15s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 21:59:21 +00:00
Snider
02b04f9bb5 fix(ai): replace os.MkdirAll with coreio.Local.EnsureDir in metrics
Some checks failed
Security Scan / security (push) Successful in 9s
Test / test (push) Failing after 1m12s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 18:31:36 +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
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
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
6f6844a8a5 test: Phase 5 — testing gaps (process/RAG/ML mocks, metrics bench)
Process tools CI tests:
- Full lifecycle tests using real process.Service with echo/sleep/cat/pwd/env
- Handler validation: empty command, empty ID, nonexistent ID, empty input
- Start → list → output → kill → list lifecycle test
- Working directory and environment variable passthrough tests
- stdin/stdout round-trip via cat process

RAG tools mock tests:
- Handler validation: empty question, empty path, nonexistent path
- Default collection and topK application verification
- Graceful error when Qdrant/Ollama unavailable (no panic)
- Expanded struct round-trip tests for all RAG types

ML tools mock tests:
- Mock ml.Backend for Generate/Chat without real inference
- Mock inference.Backend for registry testing
- Handler validation: empty prompt, empty response, missing backend
- Heuristic scoring without live services
- Semantic scoring fails gracefully without judge
- Content suite redirects to ml_probe
- Capability probes run against mock backend (23 probes)
- ml_backends lists mock inference registry entries

Metrics benchmarks:
- BenchmarkMetricsRecord: ~22μs/op single-threaded
- BenchmarkMetricsRecord_Parallel: ~13μs/op with 32 goroutines
- BenchmarkMetricsQuery_10K: ~15ms/op reading 10K JSONL events
- BenchmarkMetricsQuery_50K: ~75ms/op reading 50K JSONL events
- BenchmarkMetricsSummary_10K: ~235μs/op aggregating 10K events
- TestMetricsRecordAndRead_10K_Good: write+read+summarise 10K events

Co-Authored-By: Virgil <virgil@lethean.io>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 06:48:31 +00:00
Snider
2886ffaa4c refactor: extract rag/ to standalone core/go-rag module
Update ai/rag.go and mcp/tools_rag.go imports to reference new module.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-19 18:30:37 +00:00
Claude
e84d6ad3c9
feat: extract AI/ML packages from core/go
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>
2026-02-16 15:25:55 +00:00