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:

  • None or False: Skip this diff solver
  • True: Run with default parameters (only workspace_path is passed)
  • Dict: Run with custom parameters (plus workspace_path)
@solver
def diff_solution(
    workspace_path: str = "/workspace",
    code_diff: ChildSolverConfig = True,
    database_diff: ChildSolverConfig = True,
) -> Solver
workspace_path str

Workspace path passed to all diff solvers

code_diff ChildSolverConfig

Parameters for diff_code solver

database_diff ChildSolverConfig

Parameters for diff_databases solver

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:

  • None or False: Skip this export solver
  • True: Run with default parameters (only export_path is passed)
  • Dict: Run with custom parameters (plus export_path)
@solver
def export_eval(
    export_path: str = "exports",
    sandbox_files: ChildSolverConfig = None,
    sample_files: ChildSolverConfig = None,
    chat: ChildSolverConfig = None,
    store: ChildSolverConfig = None,
) -> Solver
export_path str

Base export path passed to all export solvers

sandbox_files ChildSolverConfig

Parameters for export_sandbox_files solver

sample_files ChildSolverConfig

Parameters for export_sample_files solver

chat ChildSolverConfig

Parameters for export_chat solver

store ChildSolverConfig

Parameters for export_store solver

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:

  • None or False: Skip this import solver
  • True: Run with default parameters (only import_dir is passed)
  • Dict: Run with custom parameters (plus import_dir)
@solver
def import_eval(
    import_dir: str,
    sandbox_files: ChildSolverConfig = None,
    chat: ChildSolverConfig = None,
    store: ChildSolverConfig = None,
) -> Solver
import_dir str

Directory containing the per-sample exports with a root config.yaml file.

sandbox_files ChildSolverConfig

Parameters for import_sandbox_files solver

chat ChildSolverConfig

Parameters for import_chat solver

store ChildSolverConfig

Parameters for import_store solver

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") -> Solver
workspace_path str

The path to the workspace. Defaults to “/workspace”.

store_key str

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") -> Solver
workspace_path str

The path to the workspace. Defaults to “/workspace”.

store_key str

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",
) -> Solver
workspace_path str

The path to the workspace to snapshot.

snapshots_path str

The path to the snapshots directory within the sandbox.

store_key str

The key to store an array of snapshot entries in the state store.

exclude list[str] | None

A list of directories to exclude from the snapshot. If None, virtualenvs and cache directories will be excluded by default.

owner str | 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.