Generate verified environments with Beam, then collect Beam’s own solutions as golden traces
Beam writes software-engineering environments through TMax, Ai2’s open-source task generator. Only environments a hidden test can verify survive. Beam then solves them, the test grades every attempt, and the passing trajectories become training data for a small model.
How it works
TMax samples a task from independent axes: domain, skill, persona, difficulty, verifier kind.
Beam writes four artifacts for it: the task with a hidden ground truth, a test that pins down the starting state, a hidden test that decides whether the task was solved, and a container definition.
The only quality gate is executable: the image builds and passes its initial-state test. Build errors go back to Beam for up to three repair rounds. No second model judges the first, which is why this scales.
Beam then solves what it made, in a shell with a single bash tool, inside Harbor. The hidden test grades the attempt.
What counts as a golden trace
A passing trajectory is kept only if it:
ended with the submit command, in at most 250 commands, under 128k estimated tokens
never repeated the same command five times in a row
never read the hidden test. A student trained on that trace learns to look for the answer key.
A no-op control run first drops environments that pass with no work at all (the setup script already produced the answer). When both attempts pass, the shortest is trace_0.
What to expect
From our 30,000-task run: about 810 working environments and 440 solved ones per 1,000 sampled, with a median of 25 commands and about 30,000 characters of reasoning per trace.
Nine domains: software engineering, debugging, data science, system administration, security, file operations and more. “SWE environment” here means anything an engineer solves at a terminal.
The companion recipe, Distil a SWE agent into Gemma 4 E4B (recipes/customization/sft/distil-swe-agent/), trains on these traces (TRACES="beam=output/traces/beam" bash train.sh) and evaluates on Harbor task folders from output/harbor/. Set aside environments whose traces you do not train on; they are the held-out set.
Before you start
A Reflection API key for reflection/Beam-1.0-501B-A23B. Copy the cookbook’s .env.example (at the root of this cookbook) to .env in this folder and fill in REFLECTION_API_KEY. Use a key made for this run and rotate it afterwards: the agent runs inside each task’s container, so the key is visible to generated task code. (litellm has no reflection provider yet, so the two scripts hand it the API through its generic OpenAI-compatible provider; that is the only place the mapping lives.)
A Linux machine with Docker; budget about 1 GB of disk per built task.
TMax at commit 6d3d606c, installed as its README says, with Apptainer for its builds; set TMAX_DIR to the checkout.
Harbor0.22.0 with its Docker environment. It installs mini-swe-agent 2.4.6 into each task container for you.
This recipe runs both tools unmodified. Everything it adds is in config/ and a few scripts.
run_all.sh runs four stages into output/ and skips what an earlier run finished, so you can stop and restart it or run the stages by hand.1. Generate. TMax’s own launcher with the values in config/generate.env (model, concurrency, corpus kind, build workers). Survivors land in output/tasks/<task>/. From the reference run:
The repair rounds are worth it: 53 definitions built on the first try, 79 after three rounds. Stage 4 is where the hours go, so give DEF_BUILD_WORKERS as many cores as you can spare.2. Convert. TMax’s convert_to_harbor.py turns every new task into a Harbor task folder under output/harbor/. These folders are the dataset, and later the held-out evaluation tasks for a trained model.3. Control and solve.solve.sh runs Harbor twice, with the limits from config/task_overrides.toml written into each staged task.toml (Harbor’s defaults are too short for these tasks):
the no-op agent on every environment; one that passes untouched is dropped
Beam through mini-swe-agent, two attempts per environment, with config/agent.json (250 steps, 300 s per command, 16,384 output tokens, temperature 1.0). state.py reads Harbor’s results to decide what still needs a run.
From the reference run, 79 environments through the control in 11 minutes, one dropped:
Expect about 43 solved environments and 70 traces from the 78, at the full run’s 55 to 57 % pass rate.4. Export.export.py applies the acceptance checks and writes output/traces/beam/<task>/trace_<n>.json, at most two per task, plus a manifest.tsv. Each file holds the task name and the messages exactly as mini-swe-agent recorded them (system, user, assistant turns with reasoning_content and tool_calls, tool outputs), which is what the SFT recipes read. Look at a few with harbor view output/jobs before training.Smoke test.python3 smoke_test.py builds a synthetic Harbor job (one task, two passing attempts, two that read the hidden test), exports it and checks the layout, in a second without Docker or the API:
Resume: rerun bash run_all.sh; every stage skips what is done and the export rebuilds traces/ from scratch.
Scale: raise NUM_TASKS, MAX_CONCURRENCY, DEF_BUILD_WORKERS and TRIALS. The API allows 600 requests and 30M tokens a minute per key.
Mix: CORPUS_KIND=legacy for exact-text verifiers and text-only tasks; rl_v2 (default) for every verifier and fixture kind.
Harder data: solve each task with the student too (solve.sh takes MODEL and API_BASE) and keep only what the student fails.
Fixes we patched on TMax locally
Our corpus came from TMax at 6d3d606c plus eight small changes in a patched copy; the recipe runs stock TMax. TMAX_FIXES.md lists each change with the file it touches, and config/prompt_rules.md holds the prompt text; the prompt rules and the re-sampling matter most for yield. Problems you may hit while running are in TROUBLESHOOTING.md.
Last modified on October 20, 2026
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Reflection Developer Docs","colors":{"primary":"#1e3207","light":"#bdc8b5","dark":"#1e3207"},"logo":{"light":"https://mintcdn.com/reflection-ai/QTuxzl6PxhZZjLhq/logo/light.svg?fit=max\u0026auto=format\u0026n=QTuxzl6PxhZZjLhq\u0026q=85\u0026s=58c942f905cb3bd4c0a14b113a3aee89","dark":"https://mintcdn.com/reflection-ai/QTuxzl6PxhZZjLhq/logo/dark.svg?fit=max\u0026auto=format\u0026n=QTuxzl6PxhZZjLhq\u0026q=85\u0026s=72f108f3de1233371ba966d2f4ff3754"},"favicon":{"light":"https://mintcdn.com/reflection-ai/JsnqP0KHndVcbl2Y/favicon-light.svg?fit=max\u0026auto=format\u0026n=JsnqP0KHndVcbl2Y\u0026q=85\u0026s=d06a05d3592404faa659b9776f0c897e","dark":"https://mintcdn.com/reflection-ai/JsnqP0KHndVcbl2Y/favicon-dark.svg?fit=max\u0026auto=format\u0026n=JsnqP0KHndVcbl2Y\u0026q=85\u0026s=890ef9e453a694b505f70db674199964"},"api":{"playground":{"display":"interactive"},"examples":{"languages":["curl","python","javascript"]}},"background":{"color":{"light":"#f8f6f0","dark":"#1a1b1a"}},"navbar":{"links":[{"href":"https://platform.reflection.ai","label":"Platform"},{"href":"https://status.reflection.ai","label":"Status"}],"primary":{"type":"button","label":"Get an API key","href":"https://platform.reflection.ai/api-keys"}},"footer":{"socials":{"github":"https://github.com/reflection-oss","discord":"https://discord.gg/GyNwCVQf6U"}},"fonts":{"heading":{"family":"NaN Serf Sans","weight":600,"source":"fonts/nan-serf-sans-600.woff2","format":"woff2"},"body":{"family":"Reflection Inter","source":"fonts/inter-400.woff2","format":"woff2"}},"styling":{"eyebrows":"breadcrumbs","codeblocks":{"theme":{"light":"vitesse-light","dark":"vitesse-dark"}},"latex":false},"banner":{"content":"Beam 1.0 is out, with open weights, the Reflection API, and Mirror CLI (beta). [Read the announcement](https://reflection.ai/blog/beam-is-available)","dismissible":true},"errors":{"404":{"redirect":false,"title":"Page not found","description":"This page may have moved. Search the docs, or start from the [home page](/introduction), the [API quickstart](/quickstart), or the [Mirror quickstart](/coding-agents-quickstart)."}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"thumbnails":{"preset":"headline","surface":"brand","fonts":{"family":"NaN Serf Sans","source":"fonts/nan-serf-sans-600.woff","format":"woff"},"eyebrow":{"source":"tab","style":"bar","color":"#1e3207"}},"metadata":{"timestamp":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"reflection-ai","hasAudioNarration":false,"actualSubdomain":"reflection-ai","customDomains":["developers.reflection.ai"],"gitSource":{"type":"github","owner":"reflectionai","repo":"developer-docs-web","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"","_id":"6b10fff79ffae5051c41d71e"},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"REMOVE_BRANDING":{"status":"ENABLED"},"CONTEXTUAL_FEEDBACK":{"status":"ENABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6b0d8b281ad4e02b275395f9","clientVersion":"0.0.4458","searchFilterCounts":[{"language":"default","tag":"API","count":17},{"language":"default","tag":"Customization","count":17},{"language":"default","tag":"Safety","count":16},{"language":"default","tag":"Deployment","count":14},{"language":"default","tag":"Self-hosting","count":11},{"language":"default","tag":"Guides","count":10},{"language":"default","tag":"Get started","count":9},{"language":"default","tag":"Supervised fine-tuning","count":9},{"language":"default","tag":"Integration stacks","count":9},{"language":"default","tag":"Mirror","count":8}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[{"filePath":"fonts.css","content":"@font-face{font-family:\"Reflection Inter\";font-style:normal;font-weight:500;font-display:swap;src:url(\"/fonts/inter-500.woff2\") format(\"woff2\")}@font-face{font-family:\"Reflection Inter\";font-style:normal;font-weight:600;font-display:swap;src:url(\"/fonts/inter-600.woff2\") format(\"woff2\")}@font-face{font-family:\"NaN Serf Sans\";font-style:normal;font-weight:500;font-display:swap;src:url(\"/fonts/nan-serf-sans-500.woff2\") format(\"woff2\")}"},{"filePath":"callout-tables.css","content":"#content-area [data-component-part=\"callout-content\"]>[data-component-part=\"scroll-area\"]:first-child{margin-top:0!important;padding-top:0!important}#content-area [data-component-part=\"callout-content\"]>[data-component-part=\"scroll-area\"]:last-child{margin-bottom:0!important;padding-bottom:0!important}#content-area thead:not(:has(th:not(:empty))){display:none}"},{"filePath":"code-links.css","content":"#content-area a.link:has(>code){border-bottom-width:0!important}#content-area a.link>code{text-decoration-line:underline!important;text-decoration-thickness:1px!important;text-decoration-color:rgb(var(--primary))!important;text-underline-offset:3px!important}.dark #content-area a.link>code{text-decoration-color:rgb(var(--primary-light))!important}#content-area [data-component-part=\"callout-content\"] a.link>code{text-decoration-color:currentcolor!important}"}]}
{"page":{"pagePath":"terminal-agent-traces","slug":"/terminal-agent-traces","pageMetadata":{"title":"Synthetic SWE environments with Beam","sidebarTitle":"Synthetic SWE environments","description":"Generate verified environments with Beam, then collect Beam's own solutions as golden traces","href":"/terminal-agent-traces"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Generate verified environments with Beam, then collect Beam’s own solutions as golden traces\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];const ViewOnGitHub=({href,label=`View on GitHub`,note})=>{const _components={a:`a`,..._provideComponents()};return _jsxs(`div`,{className:`vgh not-prose`,children:[_jsx(`style`,{children:`\n .vgh { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 20px; }\n .vgh-btn { flex: none; }\n .vgh-note { flex: 1 1 220px; min-width: 0; font-size: 13px; font-style: italic; line-height: 1.4; color: #5c6255; }\n .dark .vgh-note { color: #a8ad9f; }\n .vgh-btn { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: 999px; border: 1px solid rgba(27, 29, 23, 0.24); color: #1b1d17; font-size: 14px; font-weight: 500; line-height: 1.2; text-decoration: none; transition: border-color 0.15s, background-color 0.15s; }\n .vgh-btn:hover { border-color: #1e3207; background-color: rgba(30, 50, 7, 0.04); }\n .dark .vgh-btn { border-color: rgba(236, 235, 228, 0.24); color: #ecebe4; }\n .dark .vgh-btn:hover { border-color: #bdc8b5; background-color: rgba(189, 200, 181, 0.06); }\n .vgh-btn svg { width: 16px; height: 16px; fill: currentColor; flex: none; }\n `}),_jsxs(_components.a,{className:`vgh-btn`,href,target:`_blank`,rel:`noopener noreferrer`,children:[href.startsWith(`https://github.com/`)?_jsx(`svg`,{viewBox:`0 0 16 16`,\"aria-hidden\":`true`,children:_jsx(`path`,{d:`M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z`})}):_jsx(`svg`,{viewBox:`0 0 16 16`,\"aria-hidden\":`true`,children:_jsx(`path`,{d:`M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z`})}),label]}),note?_jsx(`span`,{className:`vgh-note`,children:note}):null]})};function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,OptimizedImage,Table,_MdxComponentBoundary}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Table)_missingMdxReference(`Table`,true);if(!_MdxComponentBoundary)_missingMdxReference(`_MdxComponentBoundary`,true);return _jsxs(_Fragment,{children:[_jsx(_MdxComponentBoundary,{name:`ViewOnGitHub`,children:_jsx(ViewOnGitHub,{href:`https://github.com/reflection-oss/cookbook/tree/main/recipes/customization/data-synthesis/synthetic-environment-gen`})}),`\n`,_jsxs(_components.p,{children:[`Beam writes software-engineering environments through `,_jsx(_components.a,{href:`https://github.com/hamishivi/tmax`,children:`TMax`}),`, Ai2’s open-source task generator. Only environments a hidden test can verify survive. Beam then solves them, the test grades every attempt, and the passing trajectories become training data for a small model.`]}),`\n`,_jsx(OptimizedImage,{src:`https://mintcdn.com/reflection-ai/ngEEhG9LrYJzE2WI/images/customization/terminal-agent-traces/pipeline-cycle.svg?fit=max\u0026auto=format\u0026n=ngEEhG9LrYJzE2WI\u0026q=85\u0026s=15360a16a7dd77eabd2d8e16a7396da9`,alt:`From sampled axes to golden traces: TMax samples a task, Beam writes it with its tests and container, the container is built and smoke-tested, Harbor runs a no-op control and Beam's attempts, and the verifier picks the golden traces.`,\"data-og-width\":`1000`,width:`1000`,\"data-og-height\":`300`,height:`300`,\"data-path\":`images/customization/terminal-agent-traces/pipeline-cycle.svg`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/reflection-ai/ngEEhG9LrYJzE2WI/images/customization/terminal-agent-traces/pipeline-cycle.svg?w=280\u0026fit=max\u0026auto=format\u0026n=ngEEhG9LrYJzE2WI\u0026q=85\u0026s=c3c85997003278f6d731addb27cd9bc5 280w, https://mintcdn.com/reflection-ai/ngEEhG9LrYJzE2WI/images/customization/terminal-agent-traces/pipeline-cycle.svg?w=560\u0026fit=max\u0026auto=format\u0026n=ngEEhG9LrYJzE2WI\u0026q=85\u0026s=737c54a4dafbea692447fb430a2aa182 560w, https://mintcdn.com/reflection-ai/ngEEhG9LrYJzE2WI/images/customization/terminal-agent-traces/pipeline-cycle.svg?w=840\u0026fit=max\u0026auto=format\u0026n=ngEEhG9LrYJzE2WI\u0026q=85\u0026s=f58aea8cc16953671f433a4d9ee860a8 840w, https://mintcdn.com/reflection-ai/ngEEhG9LrYJzE2WI/images/customization/terminal-agent-traces/pipeline-cycle.svg?w=1100\u0026fit=max\u0026auto=format\u0026n=ngEEhG9LrYJzE2WI\u0026q=85\u0026s=37e8eb3b99388ee6a22dfb51e06a51e2 1100w, https://mintcdn.com/reflection-ai/ngEEhG9LrYJzE2WI/images/customization/terminal-agent-traces/pipeline-cycle.svg?w=1650\u0026fit=max\u0026auto=format\u0026n=ngEEhG9LrYJzE2WI\u0026q=85\u0026s=e7a6ad0203dc6cbb6ec4353b033a5fa0 1650w, https://mintcdn.com/reflection-ai/ngEEhG9LrYJzE2WI/images/customization/terminal-agent-traces/pipeline-cycle.svg?w=2500\u0026fit=max\u0026auto=format\u0026n=ngEEhG9LrYJzE2WI\u0026q=85\u0026s=a061739d24aeedab4417b5b885ac04e4 2500w`}),`\n`,_jsx(Heading,{level:`2`,id:`how-it-works`,children:`How it works`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`TMax samples a task`}),` from independent axes: domain, skill, persona, difficulty, verifier kind.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Beam writes four artifacts`}),` for it: the task with a hidden ground truth, a test that pins down the starting state, a hidden test that decides whether the task was solved, and a container definition.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`The only quality gate is executable`}),`: the image builds and passes its initial-state test. Build errors go back to Beam for up to three repair rounds. No second model judges the first, which is why this scales.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Beam then solves what it made`}),`, in a shell with a single bash tool, inside `,_jsx(_components.a,{href:`https://github.com/laude-institute/harbor`,children:`Harbor`}),`. The hidden test grades the attempt.`]}),`\n`]}),`\n`,_jsx(OptimizedImage,{src:`https://mintcdn.com/reflection-ai/ngEEhG9LrYJzE2WI/images/customization/terminal-agent-traces/beam-two-roles.svg?fit=max\u0026auto=format\u0026n=ngEEhG9LrYJzE2WI\u0026q=85\u0026s=fc38fb4005ab5039c9133643cf8f984c`,alt:`Beam as the generator writes the task, both tests and the container; Beam as the teacher solves the task with a bash tool and the verifier grades it.`,\"data-og-width\":`1000`,width:`1000`,\"data-og-height\":`470`,height:`470`,\"data-path\":`images/customization/terminal-agent-traces/beam-two-roles.svg`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/reflection-ai/ngEEhG9LrYJzE2WI/images/customization/terminal-agent-traces/beam-two-roles.svg?w=280\u0026fit=max\u0026auto=format\u0026n=ngEEhG9LrYJzE2WI\u0026q=85\u0026s=01fdb92769ef27a70d086fb66f913bb9 280w, https://mintcdn.com/reflection-ai/ngEEhG9LrYJzE2WI/images/customization/terminal-agent-traces/beam-two-roles.svg?w=560\u0026fit=max\u0026auto=format\u0026n=ngEEhG9LrYJzE2WI\u0026q=85\u0026s=f7dcbc9fb488130f36eec5af456bb6eb 560w, https://mintcdn.com/reflection-ai/ngEEhG9LrYJzE2WI/images/customization/terminal-agent-traces/beam-two-roles.svg?w=840\u0026fit=max\u0026auto=format\u0026n=ngEEhG9LrYJzE2WI\u0026q=85\u0026s=60def0d8671f4d243c5bb3ca0ada0dcb 840w, https://mintcdn.com/reflection-ai/ngEEhG9LrYJzE2WI/images/customization/terminal-agent-traces/beam-two-roles.svg?w=1100\u0026fit=max\u0026auto=format\u0026n=ngEEhG9LrYJzE2WI\u0026q=85\u0026s=e0195d101d07b8004e5ee7539dd16207 1100w, https://mintcdn.com/reflection-ai/ngEEhG9LrYJzE2WI/images/customization/terminal-agent-traces/beam-two-roles.svg?w=1650\u0026fit=max\u0026auto=format\u0026n=ngEEhG9LrYJzE2WI\u0026q=85\u0026s=d9df913cd81b97e1bbdaa23a87fd07ab 1650w, https://mintcdn.com/reflection-ai/ngEEhG9LrYJzE2WI/images/customization/terminal-agent-traces/beam-two-roles.svg?w=2500\u0026fit=max\u0026auto=format\u0026n=ngEEhG9LrYJzE2WI\u0026q=85\u0026s=464a39e6f8e15ea4f6633f5010538cb2 2500w`}),`\n`,_jsx(Heading,{level:`2`,id:`what-counts-as-a-golden-trace`,children:`What counts as a golden trace`}),`\n`,_jsx(_components.p,{children:`A passing trajectory is kept only if it:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`ended with the submit command, in at most 250 commands, under 128k estimated tokens`}),`\n`,_jsx(_components.li,{children:`never repeated the same command five times in a row`}),`\n`,_jsx(_components.li,{children:`never read the hidden test. A student trained on that trace learns to look for the answer key.`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`A no-op control run first drops environments that pass with no work at all (the setup script already produced the answer). When both attempts pass, the shortest is `,_jsx(_components.code,{children:`trace_0`}),`.`]}),`\n`,_jsx(OptimizedImage,{src:`https://mintcdn.com/reflection-ai/ngEEhG9LrYJzE2WI/images/customization/terminal-agent-traces/golden-trace.svg?fit=max\u0026auto=format\u0026n=ngEEhG9LrYJzE2WI\u0026q=85\u0026s=a47baca601b6fa097fe9fc36c8b4b27a`,alt:`A golden trace is the system prompt, the task, repeated reasoning-plus-bash turns with their outputs, and the submit command, kept only if it passed five acceptance checks.`,\"data-og-width\":`1000`,width:`1000`,\"data-og-height\":`330`,height:`330`,\"data-path\":`images/customization/terminal-agent-traces/golden-trace.svg`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/reflection-ai/ngEEhG9LrYJzE2WI/images/customization/terminal-agent-traces/golden-trace.svg?w=280\u0026fit=max\u0026auto=format\u0026n=ngEEhG9LrYJzE2WI\u0026q=85\u0026s=9ef1ebb83125d2e844affd19cb785707 280w, https://mintcdn.com/reflection-ai/ngEEhG9LrYJzE2WI/images/customization/terminal-agent-traces/golden-trace.svg?w=560\u0026fit=max\u0026auto=format\u0026n=ngEEhG9LrYJzE2WI\u0026q=85\u0026s=2eb7705b01a18989da630e7d53a83723 560w, https://mintcdn.com/reflection-ai/ngEEhG9LrYJzE2WI/images/customization/terminal-agent-traces/golden-trace.svg?w=840\u0026fit=max\u0026auto=format\u0026n=ngEEhG9LrYJzE2WI\u0026q=85\u0026s=c0702daf0c9f0ae5b893bb8a13892043 840w, https://mintcdn.com/reflection-ai/ngEEhG9LrYJzE2WI/images/customization/terminal-agent-traces/golden-trace.svg?w=1100\u0026fit=max\u0026auto=format\u0026n=ngEEhG9LrYJzE2WI\u0026q=85\u0026s=fa87c8f4039c66937d71dcb2f4b4b1df 1100w, https://mintcdn.com/reflection-ai/ngEEhG9LrYJzE2WI/images/customization/terminal-agent-traces/golden-trace.svg?w=1650\u0026fit=max\u0026auto=format\u0026n=ngEEhG9LrYJzE2WI\u0026q=85\u0026s=3fda1c3fe37d6212186ac750e81bc5aa 1650w, https://mintcdn.com/reflection-ai/ngEEhG9LrYJzE2WI/images/customization/terminal-agent-traces/golden-trace.svg?w=2500\u0026fit=max\u0026auto=format\u0026n=ngEEhG9LrYJzE2WI\u0026q=85\u0026s=338ab8cf711f3aa2c207c9f1ca2d324e 2500w`}),`\n`,_jsx(Heading,{level:`2`,id:`what-to-expect`,children:`What to expect`}),`\n`,_jsx(OptimizedImage,{src:`https://mintcdn.com/reflection-ai/ngEEhG9LrYJzE2WI/images/customization/terminal-agent-traces/yield-funnel.svg?fit=max\u0026auto=format\u0026n=ngEEhG9LrYJzE2WI\u0026q=85\u0026s=a8d59962026d598b10b4983a41866603`,alt:`Per 1,000 sampled tasks: 940 parse, 810 build, 800 pass the no-op control, 440 are solved, giving about 700 golden traces.`,\"data-og-width\":`1000`,width:`1000`,\"data-og-height\":`420`,height:`420`,\"data-path\":`images/customization/terminal-agent-traces/yield-funnel.svg`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/reflection-ai/ngEEhG9LrYJzE2WI/images/customization/terminal-agent-traces/yield-funnel.svg?w=280\u0026fit=max\u0026auto=format\u0026n=ngEEhG9LrYJzE2WI\u0026q=85\u0026s=498acca12e5c89811295cb14a761fc5b 280w, https://mintcdn.com/reflection-ai/ngEEhG9LrYJzE2WI/images/customization/terminal-agent-traces/yield-funnel.svg?w=560\u0026fit=max\u0026auto=format\u0026n=ngEEhG9LrYJzE2WI\u0026q=85\u0026s=38b1a9e0529e657f567a2dd0e66271d9 560w, https://mintcdn.com/reflection-ai/ngEEhG9LrYJzE2WI/images/customization/terminal-agent-traces/yield-funnel.svg?w=840\u0026fit=max\u0026auto=format\u0026n=ngEEhG9LrYJzE2WI\u0026q=85\u0026s=dbb061600c805b2a2795a05d8d9c161d 840w, https://mintcdn.com/reflection-ai/ngEEhG9LrYJzE2WI/images/customization/terminal-agent-traces/yield-funnel.svg?w=1100\u0026fit=max\u0026auto=format\u0026n=ngEEhG9LrYJzE2WI\u0026q=85\u0026s=4e4e345ba3a45c4f7f0d2034500fb2e8 1100w, https://mintcdn.com/reflection-ai/ngEEhG9LrYJzE2WI/images/customization/terminal-agent-traces/yield-funnel.svg?w=1650\u0026fit=max\u0026auto=format\u0026n=ngEEhG9LrYJzE2WI\u0026q=85\u0026s=67a723e4a716aefa0f5ab1e909c02215 1650w, https://mintcdn.com/reflection-ai/ngEEhG9LrYJzE2WI/images/customization/terminal-agent-traces/yield-funnel.svg?w=2500\u0026fit=max\u0026auto=format\u0026n=ngEEhG9LrYJzE2WI\u0026q=85\u0026s=db23693e92fe8d62fdf438f6edd5ab62 2500w`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`From our 30,000-task run: about 810 working environments and 440 solved ones per 1,000 sampled, with a median of 25 commands and about 30,000 characters of reasoning per trace.`}),`\n`,_jsx(_components.li,{children:`Nine domains: software engineering, debugging, data science, system administration, security, file operations and more. “SWE environment” here means anything an engineer solves at a terminal.`}),`\n`,_jsxs(_components.li,{children:[`The companion recipe, Distil a SWE agent into Gemma 4 E4B (`,_jsx(_components.code,{children:`recipes/customization/sft/distil-swe-agent/`}),`), trains on these traces (`,_jsx(_components.code,{children:`TRACES=\"beam=output/traces/beam\" bash train.sh`}),`) and evaluates on Harbor task folders from `,_jsx(_components.code,{children:`output/harbor/`}),`. Set aside environments whose traces you do not train on; they are the held-out set.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`before-you-start`,children:`Before you start`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`A Reflection API key for `,_jsx(_components.code,{children:`reflection/Beam-1.0-501B-A23B`}),`. Copy the cookbook’s `,_jsx(_components.code,{children:`.env.example`}),` (at the root of this cookbook) to `,_jsx(_components.code,{children:`.env`}),` in this folder and fill in `,_jsx(_components.code,{children:`REFLECTION_API_KEY`}),`. Use a key made for this run and rotate it afterwards: the agent runs inside each task’s container, so the key is visible to generated task code. (litellm has no `,_jsx(_components.code,{children:`reflection`}),` provider yet, so the two scripts hand it the API through its generic OpenAI-compatible provider; that is the only place the mapping lives.)`]}),`\n`,_jsx(_components.li,{children:`A Linux machine with Docker; budget about 1 GB of disk per built task.`}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`https://github.com/hamishivi/tmax`,children:`TMax`}),` at commit `,_jsx(_components.code,{children:`6d3d606c`}),`, installed as its README says, with `,_jsx(_components.a,{href:`https://apptainer.org/`,children:`Apptainer`}),` for its builds; set `,_jsx(_components.code,{children:`TMAX_DIR`}),` to the checkout.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`https://github.com/laude-institute/harbor`,children:`Harbor`}),` `,_jsx(_components.code,{children:`0.22.0`}),` with its Docker environment. It installs mini-swe-agent `,_jsx(_components.code,{children:`2.4.6`}),` into each task container for you.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`This recipe runs both tools unmodified. Everything it adds is in `,_jsx(_components.code,{children:`config/`}),` and a few scripts.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Run`}),_jsx(_components.th,{children:`Machine`}),_jsx(_components.th,{children:`What it took`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Reference run, 100 tasks`}),_jsxs(_components.td,{children:[`GCE `,_jsx(_components.code,{children:`c4-standard-96`}),`, Docker 29.8, recipe defaults (16 API streams, 4 build workers, 8 parallel trials)`]}),_jsx(_components.td,{children:`10 min of API calls, 47 min of builds, 11 min of control runs`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Full run, 30,000 tasks`}),_jsx(_components.td,{children:`Same machine, 30 API streams, 6 build workers, 64 parallel trials`}),_jsx(_components.td,{children:`About 5 h of API calls and 25 h of builds per 1,000 tasks`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`run-it`,children:`Run it`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes vitesse-light vitesse-dark`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#121212`,color:`#393a34`,\"--shiki-dark\":`#dbd7caee`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#59873A`,\"--shiki-dark\":`#80A665`},children:`pip`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#C98A7D`},children:` install`}),_jsx(_components.span,{style:{color:`#A65E2B`,\"--shiki-dark\":`#C99076`},children:` -r`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#C98A7D`},children:` requirements.txt`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#AB5959`,\"--shiki-dark\":`#CB7676`},children:`export`}),_jsx(_components.span,{style:{color:`#B07D48`,\"--shiki-dark\":`#BD976A`},children:` TMAX_DIR`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#666666`},children:`=`}),_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#DBD7CAEE`},children:`/`}),_jsx(_components.span,{style:{color:`#B07D48`,\"--shiki-dark\":`#BD976A`},children:`path`}),_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#DBD7CAEE`},children:`/`}),_jsx(_components.span,{style:{color:`#B07D48`,\"--shiki-dark\":`#BD976A`},children:`to`}),_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#DBD7CAEE`},children:`/`}),_jsx(_components.span,{style:{color:`#B07D48`,\"--shiki-dark\":`#BD976A`},children:`tmax`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#59873A`,\"--shiki-dark\":`#80A665`},children:`bash`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#C98A7D`},children:` run_all.sh`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`run_all.sh`}),` runs four stages into `,_jsx(_components.code,{children:`output/`}),` and skips what an earlier run finished, so you can stop and restart it or run the stages by hand.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`1. Generate.`}),` TMax’s own launcher with the values in `,_jsx(_components.code,{children:`config/generate.env`}),` (model, concurrency, corpus kind, build workers). Survivors land in `,_jsx(_components.code,{children:`output/tasks/\u003ctask>/`}),`. From the reference run:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`10`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes vitesse-light vitesse-dark`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#121212`,color:`#393a34`,\"--shiki-dark\":`#dbd7caee`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`10`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Generating 100 task templates with 16 concurrency (corpus_kind=rl_v2)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Stages 1-3 complete: 89 intermediates (saved to output/tasks/_intermediates.jsonl)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Stage 4: 89 defs to process (89 total, 0 already done)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` Round 0/3 done: 53 succeeded, 36 failed (cumulative: 53/89)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` Round 1/3 done: 21 succeeded, 15 failed (cumulative: 74/89)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` Round 2/3 done: 2 succeeded, 13 failed (cumulative: 76/89)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` Round 3/3 done: 3 succeeded, 10 failed (cumulative: 79/89)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` Overall rate: 79.0%`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` Total time: 46.8 min`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`The repair rounds are worth it: 53 definitions built on the first try, 79 after three rounds. Stage 4 is where the hours go, so give `,_jsx(_components.code,{children:`DEF_BUILD_WORKERS`}),` as many cores as you can spare.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`2. Convert.`}),` TMax’s `,_jsx(_components.code,{children:`convert_to_harbor.py`}),` turns every new task into a Harbor task folder under `,_jsx(_components.code,{children:`output/harbor/`}),`. These folders are the dataset, and later the held-out evaluation tasks for a trained model.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`3. Control and solve.`}),` `,_jsx(_components.code,{children:`solve.sh`}),` runs Harbor twice, with the limits from `,_jsx(_components.code,{children:`config/task_overrides.toml`}),` written into each staged `,_jsx(_components.code,{children:`task.toml`}),` (Harbor’s defaults are too short for these tasks):`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`the no-op agent on every environment; one that passes untouched is dropped`}),`\n`,_jsxs(_components.li,{children:[`Beam through mini-swe-agent, two attempts per environment, with `,_jsx(_components.code,{children:`config/agent.json`}),` (250 steps, 300 s per command, 16,384 output tokens, temperature 1.0). `,_jsx(_components.code,{children:`state.py`}),` reads Harbor’s results to decide what still needs a run.`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`From the reference run, 79 environments through the control in 11 minutes, one dropped:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`8`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes vitesse-light vitesse-dark`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#121212`,color:`#393a34`,\"--shiki-dark\":`#dbd7caee`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`┏━━━━━━━━┳━━━━━━━┓`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`┃ Reward ┃ Count ┃`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`┡━━━━━━━━╇━━━━━━━┩`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ 0.0 │ 78 │`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ 1.0 │ 1 │`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`└────────┴───────┘`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`need_control 0 | control_running 0 | control_failed 1 | verifier_broken 0 | env_broken 0 | need_solve 78 | solve_running 0 | solved 0 | failed 0`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`Expect about 43 solved environments and 70 traces from the 78, at the full run’s 55 to 57 % pass rate.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`4. Export.`}),` `,_jsx(_components.code,{children:`export.py`}),` applies the acceptance checks and writes `,_jsx(_components.code,{children:`output/traces/beam/\u003ctask>/trace_\u003cn>.json`}),`, at most two per task, plus a `,_jsx(_components.code,{children:`manifest.tsv`}),`. Each file holds the task name and the messages exactly as mini-swe-agent recorded them (system, user, assistant turns with `,_jsx(_components.code,{children:`reasoning_content`}),` and `,_jsx(_components.code,{children:`tool_calls`}),`, tool outputs), which is what the SFT recipes read. Look at a few with `,_jsx(_components.code,{children:`harbor view output/jobs`}),` before training.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Smoke test.`}),` `,_jsx(_components.code,{children:`python3 smoke_test.py`}),` builds a synthetic Harbor job (one task, two passing attempts, two that read the hidden test), exports it and checks the layout, in a second without Docker or the API:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes vitesse-light vitesse-dark`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#121212`,color:`#393a34`,\"--shiki-dark\":`#dbd7caee`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`ok: 1 task, 2 traces | export: 1 tasks, 2 traces -> /tmp/tmpx/traces/beam/ | {'accepted': 2, 'rejected: reads the hidden test': 2}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`resume-and-scale`,children:`Resume and scale`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Resume`}),`: rerun `,_jsx(_components.code,{children:`bash run_all.sh`}),`; every stage skips what is done and the export rebuilds `,_jsx(_components.code,{children:`traces/`}),` from scratch.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Scale`}),`: raise `,_jsx(_components.code,{children:`NUM_TASKS`}),`, `,_jsx(_components.code,{children:`MAX_CONCURRENCY`}),`, `,_jsx(_components.code,{children:`DEF_BUILD_WORKERS`}),` and `,_jsx(_components.code,{children:`TRIALS`}),`. The API allows 600 requests and 30M tokens a minute per key.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Mix`}),`: `,_jsx(_components.code,{children:`CORPUS_KIND=legacy`}),` for exact-text verifiers and text-only tasks; `,_jsx(_components.code,{children:`rl_v2`}),` (default) for every verifier and fixture kind.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Harder data`}),`: solve each task with the student too (`,_jsx(_components.code,{children:`solve.sh`}),` takes `,_jsx(_components.code,{children:`MODEL`}),` and `,_jsx(_components.code,{children:`API_BASE`}),`) and keep only what the student fails.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`fixes-we-patched-on-tmax-locally`,children:`Fixes we patched on TMax locally`}),`\n`,_jsxs(_components.p,{children:[`Our corpus came from TMax at `,_jsx(_components.code,{children:`6d3d606c`}),` plus eight small changes in a patched copy; the recipe runs stock TMax. `,_jsx(_components.a,{href:`https://github.com/reflection-oss/cookbook/blob/main/recipes/customization/data-synthesis/synthetic-environment-gen/TMAX_FIXES.md`,children:`TMAX_FIXES.md`}),` lists each change with the file it touches, and `,_jsx(_components.a,{href:`https://github.com/reflection-oss/cookbook/blob/main/recipes/customization/data-synthesis/synthetic-environment-gen/config/prompt_rules.md`,children:`config/prompt_rules.md`}),` holds the prompt text; the prompt rules and the re-sampling matter most for yield. Problems you may hit while running are in `,_jsx(_components.a,{href:`https://github.com/reflection-oss/cookbook/blob/main/recipes/customization/data-synthesis/synthetic-environment-gen/TROUBLESHOOTING.md`,children:`TROUBLESHOOTING.md`}),`.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{ViewOnGitHub,default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":{"theme":{"light":"vitesse-light","dark":"vitesse-dark"}},"config":{},"pageMetadata":{"title":"Synthetic SWE environments with Beam","sidebarTitle":"Synthetic SWE environments","description":"Generate verified environments with Beam, then collect Beam's own solutions as golden traces","href":"/terminal-agent-traces"}}},"mdxSourceWithNoJs":null,"noJsSplices":[[148,2631,")=>null;function _cr"]]},"mdxExtracts":{"tableOfContents":[{"title":"How it works","slug":"how-it-works","depth":2,"children":[]},{"title":"What counts as a golden trace","slug":"what-counts-as-a-golden-trace","depth":2,"children":[]},{"title":"What to expect","slug":"what-to-expect","depth":2,"children":[]},{"title":"Before you start","slug":"before-you-start","depth":2,"children":[]},{"title":"Run it","slug":"run-it","depth":2,"children":[]},{"title":"Resume and scale","slug":"resume-and-scale","depth":2,"children":[]},{"title":"Fixes we patched on TMax locally","slug":"fixes-we-patched-on-tmax-locally","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"reflection-ai","siteName":"Reflection Developer Docs","title":"Synthetic SWE environments with Beam - Reflection Developer Docs","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-16T22:58:51.093Z","gitLastModified":"2026-10-20T19:37:54.000Z","originalFileLocation":"terminal-agent-traces.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Generate verified environments with Beam, then collect Beam\u0026#x27;s own solutions as golden traces\">\u003cmeta data-mint-head name=\"application-name\" content=\"Reflection Developer Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/reflection-ai/jwXyL2gkH91EW3EL/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/reflection-ai/jwXyL2gkH91EW3EL/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/reflection-ai/jwXyL2gkH91EW3EL/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/reflection-ai/jwXyL2gkH91EW3EL/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/reflection-ai/jwXyL2gkH91EW3EL/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/reflection-ai/jwXyL2gkH91EW3EL/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/reflection-ai/jwXyL2gkH91EW3EL/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/reflection-ai/jwXyL2gkH91EW3EL/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/reflection-ai/jwXyL2gkH91EW3EL/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Synthetic SWE environments with Beam - Reflection Developer Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Generate verified environments with Beam, then collect Beam\u0026#x27;s own solutions as golden traces\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Reflection Developer Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://developers.reflection.ai/terminal-agent-traces\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://reflection-ai.mintlify.site/_mintlify/api/og/v2?division=Customization\u0026amp;title=Synthetic+SWE+environments+with+Beam\u0026amp;description=Generate+verified+environments+with+Beam%2C+then+collect+Beam%27s+own+solutions+as+golden+traces\u0026amp;theme=042e12ebdcff97fefb737062\u0026amp;signature=8f66299100ef6c7fb8ae4c84e10926360592e065815069511c20da080f56f267\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Synthetic SWE environments with Beam - Reflection Developer Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Generate verified environments with Beam, then collect Beam\u0026#x27;s own solutions as golden traces\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://reflection-ai.mintlify.site/_mintlify/api/og/v2?division=Customization\u0026amp;title=Synthetic+SWE+environments+with+Beam\u0026amp;description=Generate+verified+environments+with+Beam%2C+then+collect+Beam%27s+own+solutions+as+golden+traces\u0026amp;theme=042e12ebdcff97fefb737062\u0026amp;signature=8f66299100ef6c7fb8ae4c84e10926360592e065815069511c20da080f56f267\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/reflection-ai/jwXyL2gkH91EW3EL/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Reflection Developer Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#1e3207\">\u003clink data-mint-head rel=\"canonical\" href=\"https://developers.reflection.ai/terminal-agent-traces\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/terminal-agent-traces.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://developers.reflection.ai/#organization\",\"name\":\"Reflection Developer Docs\",\"url\":\"https://developers.reflection.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/reflection-ai/QTuxzl6PxhZZjLhq/logo/light.svg?fit=max\u0026auto=format\u0026n=QTuxzl6PxhZZjLhq\u0026q=85\u0026s=58c942f905cb3bd4c0a14b113a3aee89\"}},{\"@type\":\"WebSite\",\"@id\":\"https://developers.reflection.ai#website\",\"name\":\"Reflection Developer Docs\",\"url\":\"https://developers.reflection.ai\",\"publisher\":{\"@id\":\"https://developers.reflection.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://developers.reflection.ai/terminal-agent-traces#webpage\",\"url\":\"https://developers.reflection.ai/terminal-agent-traces\",\"name\":\"Synthetic SWE environments with Beam\",\"description\":\"Generate verified environments with Beam, then collect Beam's own solutions as golden traces\",\"dateModified\":\"2026-10-20T19:37:54.000Z\",\"isPartOf\":{\"@id\":\"https://developers.reflection.ai#website\"},\"breadcrumb\":{\"@id\":\"https://developers.reflection.ai/terminal-agent-traces#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://developers.reflection.ai/terminal-agent-traces#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Data synthesis\",\"item\":\"https://developers.reflection.ai/tool-calling-reasoning-data\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Use cases\",\"item\":\"https://developers.reflection.ai/data-synthesis-use-cases\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Synthetic SWE environments with Beam\",\"item\":\"https://developers.reflection.ai/terminal-agent-traces\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://developers.reflection.ai/terminal-agent-traces#article\",\"headline\":\"Synthetic SWE environments with Beam\",\"name\":\"Synthetic SWE environments with Beam\",\"description\":\"Generate verified environments with Beam, then collect Beam's own solutions as golden traces\",\"url\":\"https://developers.reflection.ai/terminal-agent-traces\",\"mainEntityOfPage\":{\"@id\":\"https://developers.reflection.ai/terminal-agent-traces#webpage\"},\"dateModified\":\"2026-10-20T19:37:54.000Z\",\"publisher\":{\"@id\":\"https://developers.reflection.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://developers.reflection.ai#website\"}}]}\u003c/script>","agentPointerHref":"/terminal-agent-traces.md","siteName":"Reflection Developer Docs","nav":{"global":null,"tabs":[{"tab":"Home","icon":"house","pages":[{"title":"Home","href":"/introduction"}]},{"tab":"API","icon":"code","pages":[{"title":"API","href":"/api-overview"}]},{"tab":"Mirror","icon":"terminal","pages":[{"title":"Mirror","href":"/mirror-overview"}]},{"tab":"Deployment","icon":"server","pages":[{"title":"Deployment","href":"/deployment-overview"}]},{"tab":"Customization","icon":"sliders","groups":[{"group":"Get started","pages":[{"title":"Customize Beam","sidebarTitle":"Overview","href":"/customization-overview"}]},{"group":"Data synthesis","pages":[{"group":"Use cases","root":{"title":"Data synthesis use cases","sidebarTitle":"Use cases","href":"/data-synthesis-use-cases"},"pages":[{"title":"Tool-calling reasoning data with Beam","sidebarTitle":"Tool-calling reasoning data","description":"Have Beam rewrite entire tool-calling conversations in one shot, adding token-efficient reasoning before every assistant turn, and turn the result into training data that makes a small model think briefly before it calls a tool.","href":"/tool-calling-reasoning-data"},{"title":"Synthetic SWE environments with Beam","sidebarTitle":"Synthetic SWE environments","href":"/terminal-agent-traces"}]}]},{"group":"Supervised fine-tuning","pages":[{"group":"Integration stacks","root":{"title":"Supervised fine-tuning integration stacks","sidebarTitle":"Integration stacks","description":null,"href":"/sft-integration-stacks"},"pages":[{"title":"NeMo AutoModel","sidebarTitle":"NeMo AutoModel","href":"/automodel-lora"},{"title":"NeMo Megatron Bridge","sidebarTitle":"NeMo Megatron Bridge","href":"/megatron-bridge-sft"},{"title":"Axolotl","sidebarTitle":"Axolotl","href":"/axolotl-sft"},{"title":"TRL","sidebarTitle":"TRL","href":"/trl-sft"}]},{"group":"Use cases","root":{"title":"Supervised fine-tuning use cases","sidebarTitle":"Use cases","href":"/sft-use-cases"},"pages":[{"title":"Token-efficient tool calling with Beam as the teacher","sidebarTitle":"Token-efficient tool calling","href":"/trl-tool-reasoning"},{"title":"Doubling synthetic env tasks solve rate using Beam","sidebarTitle":"Distil a SWE agent","href":"/distil-swe-agent"},{"title":"Teaching Beam to write better GPU kernels in Triton","sidebarTitle":"Triton GPU kernels","href":"/self-distil-triton"}]}]},{"group":"Reinforcement learning","pages":[{"group":"Integration stacks","root":{"title":"Reinforcement learning integration stacks","sidebarTitle":"Integration stacks","href":"/rl-integration-stacks"},"pages":[{"title":"Miles","sidebarTitle":"Miles","href":"/miles-rl-math"},{"title":"NeMo RL","sidebarTitle":"NeMo RL","href":"/nemo-rl-math"},{"title":"SkyRL","sidebarTitle":"SkyRL","href":"/skyrl-math"}]}]}]},{"tab":"Safety","icon":"shield-check","pages":[{"title":"Safety","href":"/safety-overview"}]},{"tab":"Gallery","icon":"images","pages":[{"title":"Gallery","href":"/gallery"}]}]},"basePath":"","title":"Synthetic SWE environments with Beam - Reflection Developer Docs","deploymentId":"dpl_HZVV42MMRSo9WnNHfTGZvby5jph9","buildId":"dpl_HZVV42MMRSo9WnNHfTGZvby5jph9","dynamics":["10e4515597","a74be98ba7"],"chunks":["BannerMarkdown-CrFSwoa1.js","dist-MIf_HGLZ.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js","zoom-image-lightbox-B9SB_e-W.js","lightbox-handle-r17bVUz3.js"]}