[claude] Implement AutoLoRA continuous improvement loop (#1105) #1118
Reference in New Issue
Block a user
Delete Branch "claude/issue-1105"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #1105
What this does
Implements the AutoLoRA sovereignty retrain cycle — the weekly pipeline that lets Timmy improve himself without cloud AI in the decision path.
Components
trajectory_exporter.py— reads session JSONL logs, segments by time gap and turn boundaries into discreteTrajectoryobjectsquality_filter.py— scores trajectories (multi-step tasks, successful tool calls, decision points, confidence); keeps HIGH/MEDIUM quality onlytraining_dataset.py— appends filtered trajectories to a chat-format JSONL training file with idempotent deduplicationlora_trainer.py— runsmlx_lm.lorafine-tune and registers the adapter in Ollama; degrades gracefully when mlx-lm unavailabletraining_log.py— records per-cycle metrics (iteration, train loss, skill accuracy) to.loop/retrain/training_log.jsonl+.mdretrain.py— orchestrator; CLI with--dry-run,--weeks-ago,--jsonflagsAutomation
Registered in
automations.jsonas:retrainweekly_sundayhermes4-14bTests
49 new unit tests covering all components. All pass. Pre-existing failures in
test_calm.py/test_round4_fixes.pyare unrelated (unhashable dict key bug in calm routes).Done when