LegoFlow

BlockstracerSFT Data

Scaffolds

The scaffold describes the harness that produced a trajectory. Because each harness logs a different shape, Raw → IM conversion is scaffold-specific. Tracer's pinned swe_data_process checkout provides four converters.

Supported scaffolds

Scaffold--scaffold keyConverter
Claude Codeclaude_codeconvert_cc_to_im.py
OpenCodeopen_codeconvert_oc_to_im.py
OpenHands SDKopenhands_sdkconvert_openhands_sdk_to_im.py
Terminus-2terminus2convert_terminus2_to_im.py

Automatic detection

With --scaffold auto, scripts/convert_trajectories.sh derives the key from the current runtime_info.input.agent.name, for example custom-claude-code → claude_code.

The long-running dashboard sync first tries to derive the scaffold from the target job directory name and passes that value explicitly. If the name has no known scaffold marker, the converter falls back to the current config's agent.name.

You can always override detection by passing --scaffold <key> explicitly.

Pick the scaffold that matches the run

Converting a trajectory with the wrong scaffold key produces malformed IM rows. Because a historical job may have been created with a different agent than the current config, pass --scaffold explicitly in that case.

What a converter does

Each converter normalizes its scaffold's raw log into the shared IM schema:

  • Extracts user/assistant/tool messages and normalizes tool calls into OpenAI tool_calls.
  • Splits reasoning from actions where the scaffold separates them (for example Terminus-2's analysis/plan/command structure).
  • Deduplicates repeated trajectory prefixes so a single clean sequence remains.

The result is a PangUML v2 IM record with normalized messages, tools, instance metadata, and score metadata. Downstream scoring and LF conversion can then be shared across scaffolds.

On this page