Git branch model
Each experiment runs in its own git branch, inheriting code from its parent experiment. This enables:- Isolation: Each experiment starts from a clean parent state
- Inheritance: Child experiments build on parent solutions
- Versioning: All code changes are tracked
Experiment session
TheExperimentSession manages a single experiment:
Default implementation flow
One session does the whole build.run_implementation renders the implementation prompt — the problem, the chosen solution, the knowledge context and the repo memory — and hands it to the coding agent with the budget’s deadline:
<code_changes_summary>, <evaluation_script_path>, <evaluation_output>, <score>, <technical_difficulties>). Errors are not retried inside the iteration; they become feedback for the next one.
Cost-enabled implementation flow
Whensearch_strategy.params.cost.enabled is true, the coding session builds
the candidate and prepares evaluation without running either. After the branch
is finalized and evaluator integrity is checked, the orchestrator estimates
the materialized candidate’s platform cost. Kapso runs evaluation only if the
estimate passes the candidate cap and remaining campaign budget. The feedback
generator judges every finalized candidate: on the run’s captured output when
a run happened, on the session’s output for a build that errored. Only a
completed run can validate a score.
A refused candidate is recorded with score = None, an invalid evaluation,
and cost feedback for the next idea. It skips both internal evaluation and the
optional external iteration evaluator. Exceeding the remaining campaign
budget stops with cost_budget_exhausted. See
Cost-aware selection for the contract,
accounting rules, and the limits of the build-only instruction.
Result structure
Each experiment is recorded as aSearchNode — solution, branch, evaluation tags, judged feedback and score. The full field list is on the search strategies page.
Session finalization
After an experiment completes:- Commit changes to the experiment branch
- Push to origin (available for child experiments)
- Record cost from coding agent
- Cleanup session folder
close_session() raises SessionPushError, keeps the folder, and its message names the exact git push command that recovers the branch. Run that command before resuming: a resumed run rebuilds the node under the same branch name and replaces both the folder and the branch, so the recovered branch is for inspection or cherry-picking. A commit that fails for any reason other than an empty index (for example a pre-commit hook) also raises instead of being skipped.
Related
Execution flow
The loop around one experiment
Coding agents
Who writes the code
pip install leeroo-kapso · Every page as plain text: llms.txt.