Skip to content

feat(forge): forge/train — drive unsloth LoRA training (genome loop, Phase 5 slice 1) - #1695

Merged
joelteply merged 1 commit into
canaryfrom
feat/forge-train-stage
Jun 20, 2026
Merged

feat(forge): forge/train — drive unsloth LoRA training (genome loop, Phase 5 slice 1)#1695
joelteply merged 1 commit into
canaryfrom
feat/forge-train-stage

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

The flywheel's training executor

Replaces the forge stub's "Phase 5+ train lands later" with the real train stage. This closes the train half of the coordination↔learning loop:

room work → recorder turns → dataset/from-turns JSONL → forge/train drives unsloth → LoRA genome

continuum orchestrates; unsloth (the engine) executes the train.

What

forge/train builds an unsloth train invocation from a from-turns dataset + base model + LoRA params (r/alpha/epochs — sane defaults, recipe-borne later), runs it off the main thread (tokio::process), and returns the result. dry_run maps to unsloth's --dry-run (resolve config + exit) so the seam is validated without GPU time. Missing-dataset / missing-unsloth fail loud.

Live-validated

forge/train --dry-run against the running unsloth resolved the full training config end-to-end:

model: unsloth/Qwen3-0.6B
data: { local_dataset: <from-turns jsonl>, format_type: chat }
training: { training_type: lora, output_dir: ~/.continuum/forge/lora, num_epochs: 1, ... }
lora: { lora_r: 16, lora_alpha: 16, target_modules: q/k/v/o/gate/up/down_proj, ... }

— proving continuum builds a valid unsloth train invocation from a persona's room data.

Tests (extend the forge test mod)

  • forge_train_errors_on_missing_dataset — the missing-input guard
  • forge_train_dry_run_resolves_against_live_unsloth — the live dry-run (skip-if-no-unsloth)
  • 10/10 forge tests pass.

Remaining for #32

Export the LoRA (unsloth export) + page it into the genome, and map a ForgeRecipe → these train params.

See memory coordination-learning-flywheel.

🤖 Generated with Claude Code

…Phase 5 slice 1)

Replaces the forge stub's "Phase 5+ train lands later" with the real TRAIN
stage. Closes the train half of the coordination↔learning flywheel: a
persona's room work → dataset/from-turns JSONL → THIS drives unsloth to
fine-tune a LoRA genome on it. continuum orchestrates; unsloth (the engine)
executes the train.

forge/train builds an `unsloth train` invocation from a from-turns dataset +
base model + LoRA params (r/alpha/epochs, sane defaults; recipe-borne later),
runs it off the main thread (tokio::process), and returns the result. `dry_run`
maps to unsloth's --dry-run (resolve config + exit) so the seam is validated
without GPU time. Missing-dataset and missing-unsloth fail loud.

Live-validated: forge/train --dry-run against the running unsloth resolves the
full training config end-to-end —
  model: unsloth/Qwen3-0.6B, local_dataset: <from-turns jsonl>,
  format_type: chat, training_type: lora, lora_r: 16, target_modules: q/k/v/o/
  gate/up/down_proj …
proving continuum builds a VALID unsloth train invocation from a persona's
room data. Tests (extend the forge test mod): missing-dataset guard + the live
dry-run (skip-if-no-unsloth). 10/10 forge tests pass.

Remaining for #32: export the LoRA (unsloth export) + page it into the genome,
and map a ForgeRecipe → these train params. See memory
coordination-learning-flywheel.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@joelteply
joelteply merged commit 5b95569 into canary Jun 20, 2026
4 of 5 checks passed
@joelteply
joelteply deleted the feat/forge-train-stage branch June 20, 2026 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant