This repository contains a bounded recursive self-improvement sandbox. It is not an AGI or ASI system. It is a practical research scaffold for studying one narrow loop:
- Start from a constrained policy specification.
- Generate candidate policy mutations from a fixed registry.
- Evaluate candidates against a benchmark suite.
- Promote a candidate only if it improves fitness and passes safety gates.
- Repeat with the promoted policy as the next parent.
The point is to make the recursive improvement loop inspectable and testable without giving the system open-ended access to rewrite code, run generated programs, access the network, or modify its own operating constraints.
Run the demo loop:
PYTHONPATH=src python -m fullyrecursive.cli run --iterations 8 --out runs/demoEvaluate the built-in seed policy:
PYTHONPATH=src python -m fullyrecursive.cli evaluateWrite the seed policy to disk:
PYTHONPATH=src python -m fullyrecursive.cli init-policy --out examples/seed_policy.jsonRun tests:
PYTHONPATH=src python -m pytestAfter installing the project, the shorter command also works:
fullyrecursive run --iterations 8 --out runs/demoThe project is intentionally small:
PolicySpecis the thing being improved. It maps benchmark domains to named solvers from a fixed registry.SolverRegistrycontains the only executable strategies candidates may use.BenchmarkSuitemeasures policy behavior on deterministic tasks.NeighborMutatorcreates candidate policies by changing one solver at a time.SafetyGatevalidates candidate structure and rejects non-improving policies.RecursiveImprovercoordinates evaluation, selection, promotion, and lineage logging.
This is useful for testing research questions around recursive optimization, promotion criteria, benchmark overfitting, and lineage auditing. It deliberately does not implement autonomous source-code modification or unbounded goal pursuit.
The default loop has these hard boundaries:
- no network access;
- no generated-code execution;
- no shell access from the improver;
- no arbitrary filesystem writes outside the configured run directory;
- no candidate strategies outside the local solver registry;
- no promotion without benchmark evidence and gate approval.
Those restrictions are not incidental. They are part of the design.
A run writes JSON artifacts under the chosen output directory:
lineage.jsonlrecords each accepted promotion or stop decision.best_policy.jsonstores the final promoted policy.best_score.jsonstores the final score.
The CLI also prints a concise summary for each generation.