Dataset Viewer
Auto-converted to Parquet Duplicate
version
string
reward
int64
meta_info
dict
tools
list
messages
list
2.0.0
0
{"teacher":"glm-5.2-thinking","query_source":"synthesized","response_generate_time":"2026-08-24 00:0(...TRUNCATED)
[{"type":"function","function":{"name":"bash","description":"Executes a given bash command in a pers(...TRUNCATED)
[{"role":"system","content":"You are opencode, an interactive CLI tool that helps users with softwar(...TRUNCATED)
2.0.0
0
{"teacher":"glm-5.2-thinking","query_source":"synthesized","response_generate_time":"2026-08-24 00:0(...TRUNCATED)
[{"type":"function","function":{"name":"bash","description":"Executes a given bash command in a pers(...TRUNCATED)
[{"role":"system","content":"You are opencode, an interactive CLI tool that helps users with softwar(...TRUNCATED)
2.0.0
0
{"teacher":"glm-5.2-thinking","query_source":"synthesized","response_generate_time":"2026-08-24 00:0(...TRUNCATED)
[{"type":"function","function":{"name":"bash","description":"Executes a given bash command in a pers(...TRUNCATED)
[{"role":"system","content":"You are opencode, an interactive CLI tool that helps users with softwar(...TRUNCATED)
2.0.0
0
{"teacher":"glm-5.2-thinking","query_source":"synthesized","response_generate_time":"2026-08-24 00:0(...TRUNCATED)
[{"type":"function","function":{"name":"bash","description":"Executes a given bash command in a pers(...TRUNCATED)
[{"role":"system","content":"You are opencode, an interactive CLI tool that helps users with softwar(...TRUNCATED)
2.0.0
0
{"teacher":"glm-5.2-thinking","query_source":"synthesized","response_generate_time":"2026-08-24 00:0(...TRUNCATED)
[{"type":"function","function":{"name":"bash","description":"Executes a given bash command in a pers(...TRUNCATED)
[{"role":"system","content":"You are opencode, an interactive CLI tool that helps users with softwar(...TRUNCATED)
2.0.0
0
{"teacher":"glm-5.2-thinking","query_source":"synthesized","response_generate_time":"2026-08-24 00:0(...TRUNCATED)
[{"type":"function","function":{"name":"bash","description":"Executes a given bash command in a pers(...TRUNCATED)
[{"role":"system","content":"You are opencode, an interactive CLI tool that helps users with softwar(...TRUNCATED)
2.0.0
0
{"teacher":"glm-5.2-thinking","query_source":"synthesized","response_generate_time":"2026-08-24 00:0(...TRUNCATED)
[{"type":"function","function":{"name":"bash","description":"Executes a given bash command in a pers(...TRUNCATED)
[{"role":"system","content":"You are opencode, an interactive CLI tool that helps users with softwar(...TRUNCATED)
2.0.0
0
{"teacher":"glm-5.2-thinking","query_source":"synthesized","response_generate_time":"2026-08-24 00:0(...TRUNCATED)
[{"type":"function","function":{"name":"bash","description":"Executes a given bash command in a pers(...TRUNCATED)
[{"role":"system","content":"You are opencode, an interactive CLI tool that helps users with softwar(...TRUNCATED)
2.0.0
0
{"teacher":"glm-5.2-thinking","query_source":"synthesized","response_generate_time":"2026-08-24 00:0(...TRUNCATED)
[{"type":"function","function":{"name":"bash","description":"Executes a given bash command in a pers(...TRUNCATED)
[{"role":"system","content":"You are opencode, an interactive CLI tool that helps users with softwar(...TRUNCATED)
2.0.0
0
{"teacher":"glm-5.2-thinking","query_source":"synthesized","response_generate_time":"2026-08-24 00:0(...TRUNCATED)
[{"type":"function","function":{"name":"bash","description":"Executes a given bash command in a pers(...TRUNCATED)
[{"role":"system","content":"You are opencode, an interactive CLI tool that helps users with softwar(...TRUNCATED)
End of preview. Expand in Data Studio

LegoFlow

LegoFlow-SWE · 5,000 verified Harbor SWE tasks and two GLM-5.2 trajectory releases

GitHub · Docs · Blog · HuggingFace · LegoX

LegoFlow-SWE

5,000 verified Harbor SWE tasks mined by LegoFlow Curator, shipped in original and anti-hack prompt versions, plus two GLM-5.2 trajectory releases under OpenHands SDK and OpenCode, totaling 9,767 trajectories.

Release Count What it is
tasks/ 5,000 Original prompts
tasks-anti-hack/ 5,000 Same task IDs and task files, with anti-hack instructions appended to every prompt
GLM-5.2 · OpenHands SDK 4,753 Rolled out on tasks/ · 1,350 with reward = 1
GLM-5.2 · OpenCode 5,014 Rolled out on tasks/ · 1,430 with reward = 1

The two task directories contain the same 5,000 tasks, with different prompts. The downloadable GLM-5.2 trajectories were generated on tasks/.

Training results

A 1k-sample SFT from this pool reached 70.2 SWE-bench Verified / 48.8 SWE-bench Pro / 57.0 SWE-bench Multilingual, +6.8 / +10.6 / +5.3 over Qwen3.5-35B-A3B-Instruct under the same recipe.

Held fixed across every row: student Qwen3.5-35B-A3B-Base fine-tuned from scratch per source, ~1,000 trajectories per source, identical SFT settings, and evaluation on SWE-bench Verified (500), Pro (731), and Multilingual (300) under OpenHands SDK, no-hack / 200-turn / 256k. LegoFlow-SWE is sampled from this release; swerebenchv2 is the same Tracer / teacher / sampler on a public instance set (SWE-rebench-V2), so the gap between those two rows isolates the instance source.

Benchmark results by trajectory source

Trajectory source Teacher Avg tokens Turns CoT turn % CoT tok / turn Verified Pro Multilingual
LegoFlow-SWE (this dataset) GLM-5.2 130k 104 62 714 70.2 48.8 57.0
swerebenchv2 (LegoFlow on public instances) GLM-5.2 69k 67 62 500 64.4 46.9 56.0
StepFun 3.5 51k 50 100 257 64.0 38.7 51.3
Qwen3.5-35B-A3B-Instruct 63.4 38.2 51.7
DeNovoSWE DeepSeek v4-Pro 94k 70 97 309 59.8 33.7 48.3
Scale-SWE DeepSeek v4-Pro 40k 28 99 181 59.2 36.0 50.0

Changing only the instance source is worth 5.8 points on Verified, 1.9 on Pro, and 1.0 on Multilingual.

Under a second scaffold. The same 1k recipe evaluated under OpenCode reaches 64.0 / 46.8 / 58.0 against an instruct reference of 53.0 / 37.7 / 51.0. Levels are not comparable across scaffolds, and the two runs draw on different Curator snapshots.

Evaluation safeguards

Our no-hack evaluation setting combines three controls:

  • Anti-hack prompt: require independent solutions from the provided environment and prohibit looking up related issues, pull requests, patches, commits, discussions, or ready-made solutions.
  • Git information removal: remove the original repository history and remote information before the agent starts. A fresh local baseline may be created for collecting the agent's patch.
  • Network restrictions: disable general internet access during the agent's solving phase, allowing only the model-service connection needed for inference. These restrictions are enforced by the evaluation environment.

The downloadable tasks-anti-hack/ variant adds prompt instructions only; downloading it does not enable Git cleanup or network isolation. Those controls must be applied by the evaluation runner. The evaluation setting is separate from the settings used to generate the GLM-5.2 training trajectories.

Task statistics

Language rows use the language tags in task.toml; a task with more than one tag is counted in each matching row, so total is the unique-task total. fix.patch lines counts added and deleted lines together.

Language Valid SWE Count Avg fix.patch lines Avg fix.patch hunks Avg fix.patch files Difficulty Score
c 889 1362.82 57.54 21.77 8.94
cpp 370 856.91 34.00 12.61 8.81
go 761 2356.86 117.96 27.18 8.89
java 725 554.10 31.26 13.28 9.01
javascript 372 535.40 29.36 11.23 8.84
python 716 710.72 38.91 12.36 8.90
rust 639 527.59 34.49 11.21 8.94
typescript 504 1530.30 54.55 22.04 8.87
total 5000 1142.67 53.13 17.29 8.91

Task directory structure

Each task is a directory under tasks/ or tasks-anti-hack/, named by source owner, repository, and issue/PR identifier. The two versions differ only in instruction.md. The layout follows the Harbor task format:

tasks/01mf02__jaq-96/
├── instruction.md                 # the task description shown to an agent
├── task.toml                      # Harbor metadata, limits, tags, and difficulty
├── environment/
│   ├── Dockerfile                 # reproducible task image
│   └── bug.patch                  # buggy-state setup patch
├── solution/
│   ├── fix.patch                  # reference repair patch
│   └── solve.sh                   # reference solution command/script
└── tests/
    ├── test.sh                    # Harbor test entrypoint
    └── ...                        # project-specific tests, layout varies by task

task.toml records [metadata] (difficulty, category, tags), [scoring] (difficulty_score, difficulty_label), and resource/time limits under [verifier], [agent], and [environment].

Trajectories

Each JSONL file under trajectories/ is one agent/model/task-version combination. Lines use PangUML v2: version, reward, meta_info, tools, and messages, where messages preserves assistant reasoning and tool interactions and tool-call arguments are JSON strings.

Both successful and failed rollouts are kept. The top-level reward is 0 or 1, mirroring meta_info.unique_info._reward. Missing verifier rewards map to 0, so reward = 0 covers both test failures and unscored runs, and reward = 1 records verifier success rather than an audit of hack-free behavior. Releases are unfiltered; the 1k training pools behind the numbers above were sampled from them.

File Agent Model Task version Trajectories reward = 1 reward = 0
GLM-5.2 OpenHands SDK OpenHands SDK 1.33.0 GLM-5.2 tasks/ 4,753 1,350 3,403
GLM-5.2 OpenCode OpenCode 1.18.7 GLM-5.2 tasks/ 5,014 1,430 3,584

These files were previously named legoflow-selfmade-*.jsonl. Update any pinned hf_hub_download(filename=...) paths accordingly; the load_dataset configuration names are restored to trajectories-openhands-sdk and trajectories-opencode. Replace the former model-qualified allow-hack names in existing calls.

unique_info fields

Field Description
_instance_id Matches a task directory, according to the file's task version
_reward Compatibility copy of top-level reward
_score Rule-based trajectory quality scores, including composite_score
_instance_metadata Task tags such as difficulty, category, and language tags
_agent_type OpenCode only: main or subagent
_gen_params, _usage OpenHands SDK only: generation settings and token usage

Usage

Run tasks with a Harbor-compatible runner by pointing it at a task directory:

from huggingface_hub import snapshot_download

snapshot_download(
    repo_id="Lego-X/LegoFlow-SWE",
    repo_type="dataset",
    allow_patterns=["tasks-anti-hack/01mf02__jaq-96/**"],
)

Load a trajectory release and keep the resolved rollouts:

from datasets import load_dataset

ds = load_dataset(
    "Lego-X/LegoFlow-SWE",
    name="trajectories-openhands-sdk",
    split="train",
    streaming=True,
)
resolved = ds.filter(lambda record: record["reward"] == 1)

Use name="trajectories-opencode" for the OpenCode release.

Citation

@misc{legoflow2026,
  title  = {LegoFlow: Easy and Interactive Code Data Engineering},
  author = {LegoX Team},
  year   = {2026},
  url    = {https://legox.net/blog/legoflow/}
}
Downloads last month
649