Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:AIScientists Dev WorldSeed run experiment handle

From Leeroopedia
Knowledge Sources
Domains Research_Automation, Distributed_Computing
Last Updated 2026-10-26 18:00 GMT

Overview

Concrete DSL effect handler for the `run_experiment` action that validates agent-submitted code patches, resolves base source from baseline or parent papers, enforces rate limits, and enqueues training requests for the async worker.

Description

The handle function in `handlers/run_experiment.py` processes the `run_experiment` action. It:

  1. Validates `description` is provided
  2. Checks pending reviews — rejects if agent has unreviewed papers
  3. Accepts exactly one of `patches` (list of `{find, replace}`) or `new_train_py` (full file)
  4. Validates `hypothesis_id` — must be one of the agent's own hypotheses
  5. Resolves the base source: if hypothesis builds_on an accepted paper, start from that paper's `method_commit`; otherwise from baseline
  6. Applies patches (each `find` must match exactly once) or uses full source
  7. Rate-limits: rejects if agent has outstanding experiments
  8. Enqueues an `ExperimentRequest` for the async worker

Usage

This is a DSL effect handler, invoked by the engine when an agent calls the `run_experiment` action. Not called directly.

Code Reference

Source Location

  • Repository: WorldSeed
  • File: src/worldseed/autoresearch/handlers/run_experiment.py

Signature

def handle(
    store: StateStore,
    event_log: EventLog,
    ctx: dict[str, Any],
    tick: int,
) -> None:
    """Handle the run_experiment action."""

Import

from worldseed.autoresearch.handlers.run_experiment import handle

Related Pages

Implements Principle

Requires Environment

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment