Implementation:AIScientists Dev WorldSeed pilot run data
| Knowledge Sources | |
|---|---|
| Domains | Frontend, Data_Loading |
| Last Updated | 2026-10-26 18:00 GMT |
Overview
Concrete data loader that fetches autoresearch run state from the API and transforms it into a PilotDataset for presentation, with a snapshot fallback, provided by the WorldSeed frontend.
Description
The pilot-run-data module's `fetchLatestAutoresearchPilotDataset` function fetches the latest run from `/api/runs`, then loads its state (`/api/runs/{id}/state`), stream (`/api/runs/{id}/stream`), and agent texts to build a `PilotDataset`. It transforms raw entities (agents, hypotheses, experiments, papers, corpus) into branches, deliverables, and panel members. If the API is unavailable, it falls back to the bundled `autoresearch-latest-snapshot.json` fixture. The result includes a `source` field indicating whether data came from the API or the snapshot.
Usage
Import `fetchLatestAutoresearchPilotDataset` from `PilotRenderer` or `PilotPage` to load the pilot presentation data. Pass an `AbortSignal` for cancellation.
Code Reference
Source Location
- Repository: WorldSeed
- File: frontend/src/components/pilot/pilot-run-data.ts
Signature
export interface AutoresearchPilotDatasetResult {
dataset: PilotDataset;
source: 'api' | 'snapshot';
}
export async function fetchLatestAutoresearchPilotDataset(
signal?: AbortSignal,
): Promise<AutoresearchPilotDatasetResult | null>;
Import
import { fetchLatestAutoresearchPilotDataset } from './pilot-run-data';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| signal | AbortSignal | No │ Abort signal for cancellation |
Outputs
| Name | Type | Description |
|---|---|---|
| returns | null │ Dataset with source indicator, or null on failure |
Usage Examples
import { fetchLatestAutoresearchPilotDataset } from './pilot-run-data';
const result = await fetchLatestAutoresearchPilotDataset();
if (result) {
console.log(`Data from ${result.source}`);
renderPilot(result.dataset);
}