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 write paper handle

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

Overview

Concrete DSL effect handler for the `write_paper` action that creates a paper entity in verifying status, validates evidence and citations, snapshots the hypothesis, and enqueues auto-verification.

Description

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

  1. Validates evidence experiments exist and belong to the author
  2. Validates cited papers exist
  3. Validates hypothesis ownership and evidence-hypothesis matching (structural fake-paper protection)
  4. Snapshots the hypothesis content into the paper (making it public)
  5. Extracts expected val_loss from the claim or first evidence experiment
  6. Creates a `paper` entity in `verifying` status
  7. Enqueues a `VerifyRequest` for the worker to re-run `method_commit`
  8. Renders the paper to markdown

The worker transitions the paper to `under_review` (within tolerance) or `contested` (outside) once verify completes.

Usage

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

Code Reference

Source Location

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

Signature

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

Import

from worldseed.autoresearch.handlers.write_paper 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