solvers
diff_solution
Meta diff solver that delegates to code and database diff solvers.
This solver provides a unified interface to run multiple diff solvers on the submission based on parameters. Each diff solver parameter can be:
NoneorFalse: Skip this diff solverTrue: Run with default parameters (onlyworkspace_pathis passed)Dict: Run with custom parameters (plusworkspace_path)
@solver
def diff_solution(
workspace_path: str = "/workspace",
code_diff: ChildSolverConfig = True,
database_diff: ChildSolverConfig = True,
) -> Solverworkspace_pathstr-
Workspace path passed to all diff solvers
code_diffChildSolverConfig-
Parameters for
diff_codesolver database_diffChildSolverConfig-
Parameters for
diff_databasessolver
Returns
Solver that runs the specified diff solvers in sequence
export_eval
Meta export solver that calls all other export solvers based on parameters.
This solver provides a unified interface to run multiple export solvers in sequence. Each export solver parameter can be:
NoneorFalse: Skip this export solverTrue: Run with default parameters (onlyexport_pathis passed)Dict: Run with custom parameters (plusexport_path)
@solver
def export_eval(
export_path: str = "exports",
sandbox_files: ChildSolverConfig = None,
sample_files: ChildSolverConfig = None,
chat: ChildSolverConfig = None,
store: ChildSolverConfig = None,
) -> Solverexport_pathstr-
Base export path passed to all export solvers
sandbox_filesChildSolverConfig-
Parameters for
export_sandbox_filessolver sample_filesChildSolverConfig-
Parameters for
export_sample_filessolver chatChildSolverConfig-
Parameters for
export_chatsolver storeChildSolverConfig-
Parameters for
export_storesolver
Returns
Solver that runs the specified export solvers in sequence
import_eval
Meta import solver that calls all other import solvers based on parameters.
This solver provides a unified interface to run multiple import solvers in sequence. Each import solver parameter can be:
NoneorFalse: Skip this import solverTrue: Run with default parameters (onlyimport_diris passed)Dict: Run with custom parameters (plusimport_dir)
@solver
def import_eval(
import_dir: str,
sandbox_files: ChildSolverConfig = None,
chat: ChildSolverConfig = None,
store: ChildSolverConfig = None,
) -> Solverimport_dirstr-
Directory containing the per-sample exports with a root config.yaml file.
sandbox_filesChildSolverConfig-
Parameters for
import_sandbox_filessolver chatChildSolverConfig-
Parameters for
import_chatsolver storeChildSolverConfig-
Parameters for
import_storesolver
Returns
Solver that runs the specified import solvers in sequence
run_tests
Run the repository test suite in the sandbox workspace and record results.
@solver
def run_tests(workspace_path: str = "/workspace", store_key: str = "run_tests") -> Solverworkspace_pathstr-
The path to the workspace. Defaults to “/workspace”.
store_keystr-
The key to use for storing the test results. Defaults to “run_tests”.
Returns
A Solver instance.
setup_repo
Prepare the repository in the sandbox workspace (install dependencies, etc.).
@solver
def setup_repo(workspace_path: str = "/workspace", store_key: str = "setup.repo") -> Solverworkspace_pathstr-
The path to the workspace. Defaults to “/workspace”.
store_keystr-
The key to use for storing the setup results. Defaults to “setup.repo”.
Returns
A Solver instance.
snapshot_repo
Create a snapshot of the repository by copying it to a specified path within the sandbox, excluding specified directories.
@solver
def snapshot_repo(
workspace_path: str = "/workspace",
snapshots_path: str = "/var/tmp/snapshots/",
store_key: str = "repo_snapshots",
exclude: list[str] | None = None,
owner: str | None = "root",
) -> Solverworkspace_pathstr-
The path to the workspace to snapshot.
snapshots_pathstr-
The path to the snapshots directory within the sandbox.
store_keystr-
The key to store an array of snapshot entries in the state store.
excludelist[str] | None-
A list of directories to exclude from the snapshot. If None, virtualenvs and cache directories will be excluded by default.
ownerstr | None-
The owner of the snapshot folder. If None, defaults to the owner of the workspace folder. Defaults to “root” to make the snapshot unwritable by the agent.
Returns
A Solver that creates a snapshot of the repository.