Overview
The Allternit Self-Improve crate provides scaffolding for an evolutionary self-improvement loop in the agents-as-diffs pattern. A meta-agent rewrites a task-agent’s code, and every generation is stored as a diff from its parent. A protected evaluation surface can never appear in a produced diff, and a staged evaluation gate runs a cheap subset before paying for a full evaluation.Base URL
The crate is consumed as a Rust library. It does not expose HTTP endpoints directly.Components
The pattern
LineageArchive::recordstores each generation as{ id, parent_id, patches, valid, score }.ParentSelectionchooses the next breeding parent:LatestBest(highest score)ScoreProportional(sigmoid-weighted sampling with an over-use penalty)
WorkingCopy::createscratch-copies a target repo, excluding protected paths.WorkingCopy::apply_patchesrunsgit applyover the reconstructed patch chain.WorkingCopy::finalize_diffforce-resets protected paths and filters the resulting diff.StagedGateruns aValidityCheck, then a subsetEvaluator::eval_subset, then the full evaluation if all staged scores are positive.
Safety rules
- Protected paths can never appear in a produced diff. Filtering is verified by re-scanning the diff for the protected path string.
- No network assumptions. The crate only invokes local
git applyandgit diff. - Validity before evaluation. A generation that does not compile or typecheck never reaches an evaluator.
- Staged before full. Full evaluation only runs after every staged score clears the
> 0bar.