Skip to main content

Module optimizer

Module optimizer 

Source
Expand description

The core optimization loop (Phase 3).

High-level optimization flow:

  1. Run the agent on the dataset while collecting rich traces.
  2. Score outputs (mechanical rules + optional LLM-as-Judge).
  3. Diagnose failures using a strong model + policy + traces + code bundle.
  4. Generate N targeted candidate fixes (different focus areas).
  5. Validate candidates safely (cargo check + clippy + smoke tests in worktree).
  6. Evaluate survivors on the full dataset.
  7. Accept only net-positive changes with regression guards + holdout set.

This module is currently a structural skeleton. Real implementations of the individual steps will be filled in as the analysis crate and LLM client mature.

Structs§

Candidate
A proposed improvement generated during an optimization iteration.
ModelProvenance
OptimizationRun
A single optimization experiment / iteration result.
OptimizeConfig
Configuration for a single optimization run.

Enums§

EditStrategy

Functions§

mechanical_score
Very rough mechanical scorer for the example agent. Gives higher score if the output is not the echo fallback.
run_optimization
Placeholder for the full optimization engine. In a real implementation this would orchestrate: