[kimi] Refactor autoresearch.py -> SystemExperiment class (#906) #1244
Reference in New Issue
Block a user
Delete Branch "kimi/issue-906"
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 #906
Summary
Refactored
src/timmy/autoresearch.pyfrom ML-training-only scope to a generalizedSystemExperimentclass that supports arbitrary metrics.Changes
SystemExperiment class enhancements:
run()method: Encapsulates the full experiment loop (hypothesis → edit → tox → evaluate → commit/revert)create_branch()method: Git branch management for experimentsmetric_fnparameter: Support for custom metric extraction callablesrevert_on_failure,hypothesis,results,baselineCLI updates:
timmy learncommand to useSystemExperiment.run()methodTests added:
test_create_branch_success- Git branch creationtest_create_branch_failure- Error handlingtest_run_dry_run_mode- Dry-run functionalitytest_run_with_custom_metric_fn- Custom metric extractiontest_run_single_iteration_success- Single iteration flowtest_run_stores_baseline_on_first_success- Baseline trackingBackward Compatibility
All standalone functions preserved:
prepare_experiment()run_experiment()evaluate_result()get_experiment_history()_extract_metric(),_extract_pass_rate(),_extract_coverage()Testing
All 49 autoresearch tests pass.