Commit graph

5 commits

Author SHA1 Message Date
Snider
5340a975a7 refactor: modernise to Go 1.26 — iterators, slices, maps
Some checks failed
Security Scan / security (push) Successful in 9s
Test / test (push) Failing after 41s
- Add DiscoverCheckpointsIter, FindUnscoredIter (iter.Seq2/iter.Seq)
- Add BackendsIter on Service
- Replace sort.Slice with slices.SortFunc, sort.Strings with slices.Sort
- Replace manual map-key-collect-sort with slices.Sorted(maps.Keys(...))
- Refactor ProbeCategories to use slices.Sorted with inline iterator
- Existing slice-returning methods preserved, backed by new iterators

Co-Authored-By: Gemini <noreply@google.com>
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-23 06:11:55 +00:00
Snider
a6fb45da67 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
12f3a1c79d refactor: extract hardcoded values into package constants
Move magic numbers and strings into named constants in agent_config.go:
- EpochBase (was 1739577600 in 5 locations)
- 5 InfluxDB measurement names (capability_score, probe_score, etc.)
- 2 DuckDB table names (checkpoint_scores, probe_results)
- Probe defaults (temperature, max tokens, response truncation)
- InfluxBufferFile, LogSeparatorWidth, InterCheckpointDelay

Replace hardcoded probe counts ("23", "6") with len(CapabilityProbes),
len(ContentProbes). 7 files modified, no functional changes.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 03:18:19 +00:00
Snider
1c2a6a6902 feat: add RemoteTransport interface for SSH abstraction
Introduce RemoteTransport interface (Run, CopyFrom, CopyTo) with
SSHTransport implementation using ssh/scp binaries. AgentConfig gains
a Transport field with lazy initialization from M3 credentials.

All internal callers (DiscoverCheckpoints, processMLXNative,
processWithConversion) now use cfg.transport() instead of global
SSHCommand/SCPFrom. Old functions preserved as deprecated wrappers.

Enables mock injection for testing agent loop without real SSH.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 03:09:42 +00:00
Snider
eae9ec9b38 refactor: split agent.go (1070 LOC) into 5 focused files
Decompose monolithic agent.go into concern-based files:
- agent_config.go (97 LOC): AgentConfig, Checkpoint, model maps
- agent_execute.go (215 LOC): RunAgentLoop, discovery, scoring dispatch
- agent_eval.go (397 LOC): MLX native + conversion eval, capability/content probes
- agent_influx.go (291 LOC): InfluxDB scoring push, buffer/replay
- agent_ssh.go (102 LOC): SSH/SCP helpers, env utilities

No functional changes. All tests pass.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 03:05:11 +00:00