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 pilot graph model

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

Overview

Concrete pure graph data-model layer that transforms a PilotDataset into a GraphModel with shape-aware compaction (wide/deep/tree/mixed), provided by the WorldSeed frontend.

Description

The model module provides `buildGraphModel` (full, no compaction) and `compactGraphModel` (shape-aware compaction). For `wide` shapes, it switches to `scroll`/`dense-scroll` mode based on branch count thresholds. For `deep` shapes, `compactSequence` keeps first/last plus key items (chosen, parked, diff, final, accepted) up to a limit. For `mixed` shapes, it compacts each lane's versions independently. For `tree` shapes, `compactTree` recursively limits depth and children per node, inserting collapsed placeholder nodes with descendant counts. `isKeySequenceItem`/`keyPriority` rank versions by status and label content.

Usage

Import `buildGraphModel`/`compactGraphModel` from graph layout components to determine which branches and versions to render. The model's `mode` and `hidden` counts drive collapse UI.

Code Reference

Source Location

  • Repository: WorldSeed
  • File: frontend/src/components/pilot/graph/model.ts

Signature

export function buildGraphModel(data: PilotDataset): GraphModel;
export function compactGraphModel(data: PilotDataset): GraphModel;

Import

import { buildGraphModel, compactGraphModel } from './model';

I/O Contract

Inputs

Name Type Required Description
data PilotDataset Yes │ Full pilot dataset with branches and branchMap shape

Outputs

Name Type Description
returns GraphModel │ Compacted model with visibleBranches, visibleVersions, mode, hidden counts

Usage Examples

import { compactGraphModel } from './model';

const model = compactGraphModel(pilotData);
// model.shape = 'tree'
// model.mode = 'collapsed'
// model.hidden.descendants = 12
// model.visibleBranches = [/* compacted nodes + collapsed placeholders */]

Related Pages

Implements Principle

Requires Environment

Page Connections

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