Papers · 2026 · Reading: 24 min, plus 6 in closed details.
Paper · Preprint · arXiv 2609.04148

Terminal-Universe: Turning Agent Trajectories into Scalable Terminal Environments

Jie Wu, Zhenru Zhang (project leader), Beichen Zhang, Xuwu Wang, Yuhui Su, Mouxiang Chen, Peng Wang, Zhihai Wang, Que Shen, Hao Zhou, An Yang, Fei Huang, Yujiu Yang, Dayiheng Liu (corresponding authors Yujiu Yang and Dayiheng Liu)
Qwen Team, Alibaba Group, and Tsinghua University (Jie Wu worked on it as a Qwen intern) · 3 September 2026 (arXiv v1, the only version so far)

In one line: Agent trajectories can be turned back into environments: replay the file operations a trace recorded to rebuild a partial workspace, let a teacher model (Qwen3.7-Max) complete it, and keep the 37,273 workspaces an LLM judge rates task-sufficient (judged on context, not shown to build or run); then grow tasks by breadth (cross-workspace queries) and depth (multi-round with feedback), each checked by teacher-written tests. SFT of Qwen3.5-27B on about 32k verified teacher solutions gives +11.9 on Terminal-Bench 2.1 (46.2 to 58.1) and +13.8 on EvoCode-Bench v2 MT@4; re-solving clearly beats imitating the source traces, but most component ablations sit within run-to-run noise and the gain is partly distillation from the teacher. The agents-to-trajectories-to-environments-to-agents flywheel is the motivation, not something the paper ran. Scoped on 25 October 2026 from the earlier database Takeaway, which called them "37,300 runnable environments" and said the work "closes" the flywheel; 1,464 of the 37,273 are SWE repositories outside the main corpus, and the sources are mostly one model's rollouts on generated tasks.

46.2 → 58.1 % on TB2.1
Qwen3.5-27B before and after SFT on the Full Mixture (+11.9)
mean of 6 runs, Terminus2-XML; EvoCode-Bench v2 MT@4 6.3 → 20.1 · Table 3
52.1 vs 36.7 % on TB2.1
re-solving recovered tasks against imitating the 35.8k source trajectories
average of two scaffolds; imitation scores below the untrained base (47.0) · Table 4
2.9 → 22.4 files
mean workspace size after replay, then after the completion agent
terminal pool; 37,273 of 359,593 source trajectories end as task-sufficient environments · Table 13

How far to trust it: Believe the core move: re-solving rebuilt environments with a strong teacher clearly beats imitating the original traces (52.1 against 36.7, far outside the noise), and the headline gains over the base model are real. Treat the rest as provisional: most component ablations differ by 0.4 to 2.8 points, within about two standard errors of run-to-run noise; the gains are distillation from Qwen3.7-Max as much as a property of the environments; the comparison table mixes base models, scaffolds and reported numbers; and an "environment" here is a mostly model-written workspace that an LLM judged sufficient, not one checked to run. The evidence, judged.

The idea in one sentence: a recorded agent run shows enough of the workspace it ran in to rebuild that workspace, so public trajectories can be turned back into environments, where a strong teacher solves new tasks under its own tests; fine-tuning a 27B model on those solutions lifts Terminal-Bench 2.1 from 46.2 to 58.1, and re-solving beats imitating the original traces by 15 points.

You need: what an RL or evaluation environment for a coding agent contains, container, task and verifier, and how SWE-Gym-style environments are built (Harnesses for training and evaluation); and what Terminal-Bench measures (Agentic benchmarks). New terms: replay (rebuilding the initial workspace Ê0 from the files a trace read and changed); completion agent (fills the workspace so the task is "solvable, but NOT solved"); task-sufficient (an LLM judge's verdict on context, not a build); Intent Recovery, Single-WS, Cross-WS, Multi-Round (the four ways to pose tasks on a workspace); Full Mixture (the 31,977-record SFT set); MT@4 (EvoCode-Bench's fail-stop multi-turn score).

Run the arrow backwards: trajectory to workspace, then new tasks solved by a teacher
Rebuild: from a recorded run back to a workspaceTrajectories359,593 publictracesReplayÊ₀: 2.9 files(mean)Completion agent22.4 files (mean),87% written by itLLM judge37,273 kept astask-sufficientEnvironmentjudged, not runRe-query: new tasks, teacher solutions and testsRe-querySingle-WS 25,386 · Cross-WS 3,512Multi-Round 3,079 recordsTeacher solves, tests filterQwen3.7-Max writes task,tests and solutionSFT Qwen3.5-27BTerminal-Bench 2.1: 46.2 → 58.1(31,977 records, 6 runs)flywheel: the motivation, not runThe same 35.8k tasks on Terminal-Bench 2.1 (Table 4, mean of two scaffolds)imitate the original traces36.7untrained base47.0re-solve in rebuilt workspaces52.1imitation lands below the untrained model; re-solving beats it by 15.4 points
Notice where the workspace comes from: replay recovers about 3 files, the completion agent writes most of the rest, and an LLM judges sufficiency without running anything. The blue boxes are the paper's contribution; the bars are the comparison the verdict rests on. Redrawn for this page from Figure 1, Figure 7 and Tables 3, 4, 13 and 19 (the paper is under arXiv's non-exclusive licence, so its own figures are not reproduced); swipe sideways on a phone.

Problem: plenty of trajectories, few environments

§1 Introduction

A trajectory is the record of one agent run: the user's request, the agent's commands and file edits, and what the terminal printed back. An environment is the place the run happened: a container with the project's files and dependencies installed, in which commands really succeed or fail. Terminal-based code agents now produce trajectories in bulk, but runnable environments are still scarce and mostly built by hand (§1; what an environment contains in general: Harnesses for training and evaluation).

The two are not equally useful for post-training (abstract and §1):

  • A trajectory is one frozen demonstration. Its quality is capped by the model that produced it, and nobody can check whether the changes it made were correct.
  • An environment can be re-queried: the same workspace can be given to a stronger model, the result checked by tests of our own, and harder tasks posed on it.

Expert benchmarks show what a good environment looks like: Terminal-Bench pairs every task with a custom container, an instruction and an executable verifier (Merrill et al., 2026). (How Terminal-Bench is run and scored is on Agentic benchmarks.) That reliability is bought with manual effort, which also caps how many such tasks exist. The paper's goal is realistic, verifiable environments at training scale.

Existing pipelines build environments from repository history, from injected bugs, or by generating task and environment together; all of them either start from an existing environment or generate one alongside a new task.

The three existing routes and what each costs (§1, §2)
  • Repository history (SWE-Gym, R2E-Gym): roll a repository back to just before a past fix; the bug report is the task, the fix's tests the check.
  • Perturbation (SWE-smith, CLI-Gym): inject a bug into a working repository. Many tasks from few repositories, but every task is a repair.
  • Task-conditioned synthesis (Endless Terminals, TMax, CLI-Universe, SkillSynth; SETA for RL): generate task and environment together. Coverage is controllable, but the workspace is tied to no real project and tends to be "small and tidy".

Trajectories, as observations of the environments they ran in, are the resource nobody used. Table 1 sets the paper against eight recent pipelines; it is the only one with multi-round and cross-workspace tasks (rebuilt in the tables tab).

Idea: run the arrow backwards

Figure 1

A trajectory and an environment are "two views of the same episode". Prior work rolls an environment forward into a trajectory; Terminal-Universe inverts the mapping and recovers the environment from the trajectory (Figure 1). The tool calls inside a trace already reveal the workspace: a Read shows a file's contents, a Write or Edit shows how the workspace changed (§1). That is enough to rebuild a copy of the original workspace, then use it the way an environment is used: pose a task, let a strong model solve it, check the result.

The stage runs one real trajectory from the paper's largest source corpus through both uses. Imitate is what training on trajectories normally means: keep the trace as it is. Rebuild and re-solve is the paper's pipeline. The command tiles and the replayed file boxes are this trace's own (one box per file); the completion step uses the paper's terminal-pool medians, since the completed workspace of this trace is not published.

Trace: a real LFM2-Terminal row; results from Table 4.
  1. One recorded trajectory. A real row of LFM2-Terminal: 16 commands typed by DeepSeek-V3.2 in the Terminus-2 harness on a generated task (consolidating a week of sales CSV files into a JSON report). Each tile is one command, coloured by what replay makes of it.
  2. Replay to the earliest version. Deterministic replay keeps the files the trace shows before the agent changed them: here 1 file with content (monday.csv, 6 lines), 6 more known only by name from a listing (dashed), and 3 held back on the side as the agent's own work (two scripts it wrote and the report one of them produced). The paper's terminal pool has a median of 2 replayed files.
  3. Complete the workspace. A completion agent creates the missing project around that evidence, solvable but not solved. In the terminal pool the median workspace grows from 2 to 13 files (mean 2.9 to 22.4, Table 13); the blue boxes show those medians, illustrative for this trace.
  4. Judge: is it sufficient? A read-only judge, the glass plate, asks whether the workspace gives a capable agent enough context for the recovered task. After completion, 93.5% of terminal workspaces pass (Table 2). Nothing is built or run.
  5. Re-query. Pose tasks on it: the recovered original intent, new single-workspace tasks, cross-workspace tasks with a related project, or a multi-round session. The comparison in Table 4 uses Intent Recovery, without verifier filtering.
  6. A stronger teacher re-solves. Qwen3.7-Max (74.5 on TB2.1 itself) solves the task inside the rebuilt container in the Claude Code scaffold. Its trajectory, not the original one, becomes the training record.
  7. Train on 35.8k re-solved tasks. Same volume, same template: 52.1 on average over two scaffolds, against 36.7 for imitation and 47.0 for the base (Table 4). The gap mixes two changes, the rebuilt environment and the stronger demonstrator; the paper does not separate them.

Imitation and re-solving were compared at the same volume, 35.8k records each, on Terminal-Bench 2.1 (Table 4). The re-solved arm used Intent Recovery tasks with no verifier filter, so that the comparison isolates re-solving. The stage plays by itself once in view; any control stops it, and it stays still if your system asks for reduced motion. Step through this trace command by command in Replay a real trajectory.

Step 1: rebuild the workspace

§3.1, Appendix B

From a trajectory τ the pipeline recovers a workspace Ê that approximates the environment E the trace ran in. The recovery is lossy by nature: files the agent never opened, implicit system dependencies and network resources leave no trace. So it runs in three stages (§3.1):

  1. Deterministic replay. Process the trace's reads, writes and edits in order and keep, for every path, the earliest and latest contents it shows. The initial workspace Ê0 holds each pre-existing file at its earliest version, before the agent's first change. Files the agent created are left out, and the agent's changes are stored separately for later checking. Because the trace only shows the paths the agent touched, and sometimes only part of a file or a truncated terminal, Ê0 is partial (Appendix B.1).
  2. Agentic completion. A completion agent gets the recovered task, the partial workspace and its file list, and must make the task "solvable, but NOT solved": create missing files, complete partial ones, configure dependencies, without implementing the requested change, adding tests for it or hinting where the fix goes. Network access and installs are allowed only to restore the existing project's dependencies (the completion prompt).
  3. Environment filtering. An agentic judge with read-only shell and file tools labels each completed workspace sufficient or insufficient for its recovered task: do its source, configuration, data and structure give a capable agent enough context to work? It judges available context, not whether anything builds; dependencies, caches and generated outputs may be missing (Appendix B.2).

Everything runs in a standard ubuntu:24.04 container with network access, cheaper than repository-specific images at "a modest reduction in resolve rate reported by prior work" (§3.1). Projects go under /app; files accessed elsewhere are stored separately.

What replay looks like on a real trace
The paper's replay framework is not released. The Replay a real trajectory tab re-implements the stated rule for the paper's largest source, and runs it in your browser on five real trajectories: which command revealed which file, why the agent's own outputs are held back, and how little a command-line trace exposes. On 640 sampled trajectories, our replay recovers a median of one pre-existing file per trace, two among those that pass the paper's seed filter (Table 13 also reports two).

How much completion adds. Replay alone gives tiny workspaces, because the solution files the original run produced are withheld. Completion grows them several times over (Table 13, Figure 4):

Means, with medians in the labels, from Table 13. The multipliers are Figure 4's printed labels and reproduce from the table's means (recompute.py). For the terminal pool, 87% of the completed workspace's files, and 98% of its text lines on average, were written by the completion agent rather than recovered from the trace (derived: 1 − 2.9/22.4 and 1 − 90/5,761).

Is the completion honest, and how much does it keep?

Is the completion honest? Of 30 random terminal completions the authors inspected, 22 added only task-relevant support files, eight added substantial unneeded code, and none contained a solution (Appendix B.1).

How much it keeps. Before completion, the judge finds 40.2% of terminal workspaces and 20.1% of SWE repositories sufficient; after completion, 93.5% and 77.1% (Table 2). Sufficiency reflects how much project context a trace exposed: completion can add common project files around observed evidence "but cannot recover unseen project-specific content". Insufficient workspaces lack source files, task scripts, input data or configuration (Appendix B.3); per-source rates range from 95.2% (LFM2-Terminal) to 40.0% (SWE-Gym, 2 of 5) (Table 14, rebuilt).

The whole funnel, from the pipeline figure's printed counts (Figure 7) and Tables 2, 12, 14; every step sums (recompute.py). Bars are to scale. The last bar counts SFT records, not environments: one Single-WS task per terminal environment plus the Cross-WS and Multi-Round records.

Step 2: re-query the environment

§3.2, Appendix C

"While reconstruction yields executable environments, re-querying dictates how effectively their latent capability space is exploited." Four mechanisms, each with an observable goal and the implementation left to the agent (§3.2, Appendix C):

Intent Recovery

Rebuild the source task as one self-contained request. A single-round trace's sole substantive request is the task; in a multi-round trace the first substantive request sets the topic and later ones count only if they clarify, constrain or extend it. Agent actions and file evidence help interpret the requests, but only requirements the user stated are kept, and vague wording is not replaced by values inferred from the agent's actions. Output: a 2 to 4 sentence core_objective plus metadata (Appendix C.1).

Single-WS (new tasks in one workspace)

A read-only generator explores the workspace (no network, no edits) and proposes five tasks in the "ideal zone: clear goal + verifiable standard + unexplored implementation", internally drafting ten and keeping five with different focuses; one valid candidate per environment is rolled out (Appendix C.2). MirrorBrain's five: shell-event normalisation, URL classification, client error handling, response-schema alignment and cache-source reconciliation (Appendix E.1).

Cross-WS (breadth)

Profile every workspace (domain, language, capabilities); retrieve neighbours by TF-IDF within a language group; an LLM labels each pair similar, complementary, dependency or unrelated. A dependency pair, where a target lacks a capability a reference has, gets exactly one task. The reference is mounted read-only; the task must rely on at least three facts found only in it, may name only its mount root, must name target files and executable checks, and must be solvable offline. No workspace appears in two pairs (§3.2, Appendix C.3).

Multi-Round (depth)

After the agent answers an initial query, a user agent continues the session in the same workspace, keeping a requirement tracker of active, satisfied and updated requirements. Each round a verifier writes acceptance tests first; the user agent reads the private results and turns any failure into a natural complaint, never mentioning tests or tracebacks. Up to six follow-ups, or until it emits a stop (§3.2, Appendix C.4).

A cross-workspace example: two RSA toolkits (Appendix E.2)

(Appendix E.2) Two C toolkits for RSA; the target has key generation, encryption and signing but no decryption, the reference has the round trip. The task asks for rsa_decrypt.c in the target whose output is byte-for-byte the original plaintext, naming only the reference's mount root; the private-key loader, decrypt call, padding mode and input paths must be found there. The verifier checks compilation, round trips and OpenSSL calls, and that the reference is unchanged.

A multi-round session, round by round

A multi-round example (Table 18, Figure 8). Step through the user agent's requests in a sensor-ingestion session: one workspace, one floor per round. The style of each request follows from the last round's private verdict: extension after a pass, revision after a failure, conflict only when the requirement-change policy permits it. The coding agent sees only the requests; the verifier's tests and results stay private.

  1. Initial request. Make sensor_processor.py take its input and output paths as two positional arguments instead of hard-coding them. The coding agent solves it; the private verifier passes.
  2. Round 1: extension. "The path override work is solid, thanks": now a resumable, incremental ingestion mode with a small persisted state store, so a growing sensor_data.csv is not re-crunched. The agent adds incremental aggregation, but an unseeded random scaling makes the values unstable: the verifier fails the round.
  3. Round 2: revision. Same requirements, no tests mentioned: the user agent describes the symptom ("the actual aggregate values are wrong and unstable", averages, minima and maxima about half the real readings and changing between reruns). The agent removes the random scaling and passes.
  4. Round 3: extension. After that pass, a new grounded requirement compatible with the active ones: a threshold rules engine in a new rules.py, driven by a JSON rules config, for alerting. The example does not print this round's verdict.
  5. Round 4: conflict. A permitted requirement change, stated as a product decision rather than a defect: alerts.json becomes an append-only history of transition events (exit code 2 for a new firing, 0 for a lone resolution, first-observed timestamp and severity kept with every event). The new history requirement replaces the old one and governs the remaining rounds.
  6. Round 5: extension. A reporting command that turns the alert trail into an operational summary. An extension follows only a pass, so round 4 passed.
  7. Round 6: extension. Let reconcile repair the drift between state.json and the alert history, not just report it (so round 5 passed). This is the sixth follow-up, the maximum a session allows; its verdict is not printed.
The seven requests, abridged as printed in Table 18

Across retained records the styles split 62.7% extension, 29.3% revision and 8.0% conflict, with no target ratio imposed (Table 17).

The authors report that the 3,079 retained records average 4.51 rounds and that 69.6% contain a failure the session later repairs (§3.2). Figure 3 shows how 4,563 generated sessions break down: the kept shapes add to 76.4%, about 3,486 sessions, against the 3,079 records the text reports, so 407 sessions are unaccounted for (perhaps Appendix F's length filtering; the paper does not say). With only 23.7% of sessions in the two "recovered" shapes, the 69.6% figure requires most trailing-failure sessions to contain an earlier repair too; the figure cannot confirm that.

Shares printed on Figure 3, matched to its legend by colour (decode_figs.py). Only the kept shapes survive the round rule; the grey share is trimmed.

Step 3: verify, solve, select

§3.3, Appendix D
  • Verifier. For every Single-WS and Cross-WS task, a verifier agent inside the container writes one self-contained pytest file before any solution exists, seeing the task and the initial workspace only. Rules (Appendix D): public interfaces only, absolute paths, no network, no writes under /app, no skips or xfails, at most 18 tests (1 to 3 per requirement), expected values for new behaviour computed independently and never by running the incomplete code. It must run the suite on the untouched workspace: at least one test for the missing capability must fail, preservation tests must pass, and there must be no collection errors; otherwise it rejects the task.
  • Solution rollout. Every model-driven component, completion, judging, generation, verifiers and solving, uses one teacher, Qwen3.7-Max at "xhigh" effort, in the Claude Code scaffold (settings below).
Rollout settings: sampling, context, turn and time limits (§3.3)

Solutions are rolled out in the Claude Code scaffold inside the task container: temperature 1.0, top-p 0.95, interleaved thinking, 256k context, turns capped at 65,536 tokens, summarisation at 176k tokens, at most 500 turns and four hours (§3.3).

  • Selection. Single-WS and Cross-WS trajectories are kept only if all tests pass on the final workspace. Multi-Round is selected per round: trailing failed rounds are trimmed and a session is kept only with at least two verified passing rounds; failures followed by recovery stay in, as supervision for diagnosis and repair. Intent Recovery is not verifier-filtered, to stay comparable with training on the source trajectories (§3.3, Appendix D).

The data, at scale

§4, Appendices A and F
Seed rules, deduplication and per-type record sizes (§4, Appendices A and F)

Seeds. Raw trajectories come from terminal and software-engineering corpora. A trace is a viable seed if the workspace visible at its end has at least 5 files and 100 lines; all Terminal-Bench-derived sources are excluded, as are sources dominated by view-only operations or unsupported action formats (§4.1, Appendix A). Multi-file editing traces reveal enough to rebuild; "command-heavy CLI traces often expose few file contents". SWE corpora are deduplicated by repository, base commit and problem statement (keeping the trace whose replay exposes most), and SWE-bench Verified repositories are removed.

Median records: Single-WS 14 turns, 20 tool calls, 30.4k tokens; Cross-WS 23, 38, 46.5k; Multi-Round 92, 102, 126.1k; Intent Recovery 12, 17, 36.1k (Table 19).

Sources (Table 12): four SWE corpora (SWE-rebench, SWE-smith, CoderForge, SWE-Gym) and two terminal ones (LFM2-Terminal, LiteCoder-Terminal), 359,593 trajectories, 68,263 reconstructed environments. After contamination filtering and repository-level deduplication, 38,294 terminal and 1,900 SWE workspaces reach the judge (one representative reconstruction per SWE repository), and 37,273 are task-sufficient (§4.2).

Composition of the terminal pool (Figure 5): Python is the primary language of 84.7% of workspaces (C++ 7.1%, C 3.1%, Shell 2.0%); data processing (47.4%), DevOps (18.9%) and security (14.6%) together make 80.9% of domains.

The SFT corpus (§4.3, Table 19): verifier-filtered Single-WS (25,386), Cross-WS (3,512) and Multi-Round (3,079) trajectories make the 31,977-record Full Mixture, about 1.42B training tokens. Intent Recovery (35,809 records) is used only in ablations.

Results

§5, Table 3, Appendix G

Qwen3.5-27B is fine-tuned on the Full Mixture and scored on Terminal-Bench 2.0 and 2.1 (mean of six runs, two scaffolds) and on EvoCode-Bench v2, whose MT@4 is fail-stop: a run earns only the rounds it passes before its first failure, and a task-round counts if any of four runs reaches it.

Training and evaluation setup (§5.1)

Training. Qwen3.5-27B, supervised fine-tuning for two epochs, constant learning rate 7×10−6, global batch 256, 256k-token sequences. Before training, a 13-gram contamination check against Terminal-Bench tasks, and Terminal-Bench-derived sources are excluded from all four variants (§5.1).

Evaluation. Terminal-Bench 2.0 and 2.1 (2.1's changes) with two scaffolds, Terminus2 (XML parser) and Claude Code 2.1.126 (web and plan tools off); 12 CPU cores and 32 GiB per container; mean pass rates over six runs. EvoCode-Bench v2 has 26 tasks and 227 rounds (5 to 15 requests per task) in persistent workspaces with cumulative verifiers; each task is run four times with a 10-hour limit. MT@4 is fail-stop: a run earns only the rounds it passes before its first failure, and a task-round counts if any of the four runs reaches it; the Case score averages verifier-case pass rates, measuring partial progress (§5.1).

The Full Mixture model reaches 52.8% on TB2.0 and 58.1% on TB2.1, +11.2 and +11.9 over the base, under Terminus2-XML; under Claude Code, 58.2% on TB2.1 (+10.4). On EvoCode-Bench v2 MT@4 rises from 6.3 to 20.1 and the Case score from 67.8 to 76.1 (§5.2, Table 3). The teacher, Qwen3.7-Max, scores 74.5 and 39.8: the student closes about 42% of the TB2.1 gap to its teacher (derived: 11.9 / 28.3).

Table 3. Filled dots were measured by the authors on released models (the asterisks); hollow ones are copied from each method's own report, with its own scaffold. Only three rows share the base model (Qwen3.5-27B): RST-27B (TB2.0 49.4) and FACET-Terminal-27B (TB2.1 47.6), both from their reports. The reproduced baselines were run with their own, mostly shorter, settings: 32k to 131k context and 8,192-token turns against 256k and 65,536 here (Table 20). Their 0.0 MT@4 scores come from settings this model was never held to.

Ablations: what each piece buys

§6, Tables 4 to 11

All ablations below are on Terminal-Bench 2.1 (six runs) or EvoCode-Bench v2 (four runs). The small numbers after a score are the paper's printed run-to-run spread. To judge a difference, compare it with its standard error, √(sa² + sb²)/√runs; for six runs and spreads of 2 to 4 points that is about 1.4 to 2.2 points. 89 tasks means one task is 1.1 points. (Why and when this unpaired error is the right one: Eval statistics.)

Before re-solving anything: what does plain SFT on the 35.8k source trajectories do to Qwen3.5-27B on TB2.1?

Re-solving beats imitating (§6.1, Table 4). Same volume (35.8k), same chat template and tool-call schema. Training on the source trajectories averages 36.7 across the two scaffolds; Intent Recovery, the same tasks re-solved by the teacher in reconstructed workspaces, averages 52.1; the untrained base is 47.0. The paper reads this as "regenerating demonstrations under a consistent teacher policy provides more effective supervision". It does not discuss that imitation lands below the base, by 5.9 points under Terminus2-XML and 14.8 under Claude Code. The comparison changes two things at once: the environment and the demonstrator (source agents such as DeepSeek-V3.2 against Qwen3.7-Max). It shows the teacher re-solving is worth it; it does not separate how much is the environment.

Completion helps (§6.2, Table 5). Training on Intent Recovery in replay-only workspaces gives 48.7 ± 3.5; in completed workspaces 52.9 ± 1.4 (+4.2, about 2.7 standard errors). Even replay-only beats the base (+2.5, within noise): faced with an incomplete workspace, the teacher often repairs missing files or setup first, so part of the supervision teaches repairing the workspace rather than the task.

The verifier matters for hard tasks (§6.3, Table 6). Single-WS: all 35.1k teacher trajectories 56.0, the 25.4k that passed 56.4 (+0.4, noise). Cross-WS: all 7.1k 53.2, the 3.5k that passed 55.4 (+2.2, about 1.6 standard errors) with half the data.

Breadth (§6.4, Tables 7 and 8). Cross-WS alone (3.5k records) reaches 55.4; adding it to Single-WS lifts 56.4 to 58.4 (+2.0, about 1.5 standard errors). Cross-WS trajectories are longer (median 23 turns, 38 tool calls, 46.5k tokens, against 14, 20 and 30.4k) and harder: the teacher passes 49.2% against 72.3%.

Cross-WS by Terminal-Bench category (Figure 6)

By category (Figure 6), software engineering, the largest (26 tasks), rises from 46.9 to 49.1; model training +15.0 and debugging +10.0 on 4 and 5 tasks; three categories fall 2.1 to 2.5, "within run-to-run variation for categories of at most eight tasks".

On EvoCode-Bench v2 the base scores 6.3 MT@4. How much of the climb to about 21 comes without any Multi-Round data, from Single-WS alone?

Depth (§6.5, Table 9). Adding Multi-Round data to Single-WS raises MT@4 from 18.4 to 21.0 and the Case score from 71.9 to 76.9 (+5.0, about 2.7 standard errors over four runs). Removing the round-level verifier from generation costs 2.2 MT@4 and 3.7 Case points: without "a grounded signal of what remains incorrect", continuations become "longer yet lower-quality". But Single-WS alone already accounts for 82% of the MT@4 climb (derived: 12.1 of 14.7 points), and the Full Mixture (20.1) scores below Single-WS + Multi-Round (21.0).

Double a 17.6k-record Single-WS corpus. Which doubling helps TB2.1 most: twice the environments, two queries per environment, or two teacher solutions per query?

Where to spend a fixed budget (§6.6, Table 10). From 17,558 environments with one query and one solution each (53.2), doubling environments gives 56.0, doubling queries 53.8, doubling solutions 53.9: "each new environment contributes a distinct executable context". The direction is the paper's motivation, but the margin is about 1.2 standard errors: suggestive, not shown.

Transfer from SWE (§6.7, Table 11). Intent Recovery on the 1,464 sufficient SWE repositories (about 10.3k trajectories, since one repository can give several tasks) lifts TB2.1 from 47.0 to 50.0 on average: Claude Code 47.8 to 50.6, Terminus2-XML 46.2 to 49.4. The reverse direction is left to future work.

How much of this to believe

What holds up.

  • The headline over the base model. +11.9 on TB2.1 is about 5 standard errors even if the trained model is as noisy as the base (spread 3.9 over six runs; the Full Mixture's own spread is not printed), and both scaffolds move by similar amounts (+11.9 and +10.4). EvoCode MT@4 triples, though from a tiny base (6.3) on 26 tasks.
  • Re-solving beats imitating by 12.6 points under Terminus2-XML, about 12 standard errors (Table 4). Whatever its cause, it is not noise.
  • The bookkeeping is clean. Every count in the funnel sums, the sufficiency rates reproduce from the per-source table, the corpus adds up to 31,977, and Figure 4's multipliers and Table 8's ratios reproduce from the printed tables (61 checks in the tables tab).
  • The authors state real limits (§7): generic Ubuntu containers instead of per-repository images, so projects that need special system dependencies or builds lose fidelity; coverage bounded by the source trajectories; one teacher writes tasks, solutions and tests, so its mistakes in a solution can be missed by its own tests. Those count in the paper's favour.

What to discount.

  • Most component effects are within noise. Each ablation is one training run evaluated six (or four) times; no training seed is repeated. Of the paper's component claims, completion (+4.2, z ≈ 2.7) and the Multi-Round Case score (+5.0, z ≈ 2.7) are the clearest; the verifier on Single-WS (+0.4), Cross-WS (+2.0), the verifier on Cross-WS (+2.2), environment against query expansion (+2.2) and SWE transfer under Terminus2-XML (+3.2) are all at or under 2 standard errors. The noise table computes each.
  • The parts do not add up. The Full Mixture is no better than its parts: 58.1 on TB2.1 against 58.4 for Single-WS + Cross-WS, and 20.1 MT@4 against 21.0 for Single-WS + Multi-Round (Tables 3, 7, 9). So each axis helps its own benchmark at best, and the headline is mostly Single-WS re-solving.
  • Distillation is doing much of the work (sequence-level distillation in general: Distillation and Small Language Models). Every task, workspace completion, verifier and solution comes from Qwen3.7-Max, which itself scores 74.5. The paper never trains on teacher re-solves in environments built some other way, so the share of the gain owed to trajectory-reconstructed environments, as opposed to a strong teacher solving many verified tasks, is not measured.
  • Table 3 is not like for like. Base models differ (Qwen2.5-Coder-32B to Qwen3-235B), scaffolds differ (Terminus2, BashAgent, OpenHands, Vanillux2Agent, CalibForge-Eval), and most TB2.0 numbers are copied from other reports. The authors' own reproductions ran the baselines with 32k to 131k context and 8,192-token turns, against 256k and 65,536 here (Table 20). The two same-base rows (RST-27B, FACET-27B) are each on a different TB version and from their own reports.
  • "Environment" means judged sufficient, not shown runnable. The judge "evaluates available project context rather than build success" (Appendix B.2), and on average 87% of a terminal workspace's files were written by the completion agent. Only 30 completions were inspected by hand.
  • The sources are narrower than "agent trajectories" suggests. 96.3% of the sufficient terminal environments come from one corpus, LFM2-Terminal (Table 14). Every one of 640 rows we sampled from it is a Terminus-2 rollout by DeepSeek-V3.2 on a generated task family (data processing, file operations, scientific computing and the like), not a record of real development work. The replay tab shows them.
Small inconsistencies: Figure 3 against the text, scores that are not whole trials, decontamination scope

Figure 3's kept shapes imply about 3,486 retained Multi-Round sessions against 3,079 in the text; three of 19 printed TB2.1 scores (46.2, 52.9, 53.8) are not a whole number of trials out of 534 (89 tasks × 6 runs), and most of Figure 6's per-category changes are not whole task-runs, so some trials are evidently dropped or weighted in a way the paper does not describe. Decontamination is described against Terminal-Bench only, not EvoCode-Bench.

Verdict. The idea is sound and the main comparison is decisive: rebuild environments from traces and let a strong teacher re-solve tasks in them, and a 27B model gains about 12 points on TB2.1. Which of the paper's many design choices matter is mostly not established at this sample size, and the gain should be read as "teacher distillation over trajectory-derived, model-completed workspaces", not as proof that trajectories alone supply realistic environments.

What it takes to use this

Nothing is released, but the appendices print every agent's prompt; replay is cheap, the teacher (one strong model doing every step, up to four hours per rollout) is the cost, and it pays only with file-rich traces and a teacher clearly stronger than your student.

Code and licences, cost, training budget, when it pays
  • Nothing is released: no code, environments, SFT data or model (checked 3 October 2026). The source corpora are public with permissive licences as listed in Table 12 (CC-BY-4.0, MIT, Apache-2.0; LFM2-Terminal's Hugging Face card itself states no licence). The prompts for every agent are printed in Appendices B to D, which is enough to rebuild the pipeline.
  • Replay is the cheap part. For keystroke-style traces, the stated rule fits in about 150 lines (this page's replay.py, run live in the replay tab). Traces that use explicit Read, Write and Edit tools, as Claude Code-style agents do, expose far more files.
  • The expensive part is the teacher. One strong model at maximum effort does completion, judging, task generation, pair mining, verifier writing and every rollout (up to 500 turns or four hours each, in a container with network). The paper gives no compute or cost figures.
  • Training: 1.42B tokens, two epochs of SFT on a 27B model at 256k sequence length. Only SFT was tested; using the verified environments for RL is the obvious next step but is not in the paper.
  • When it pays. When you hold many trajectories with rich file evidence (multi-file editing, long tool chains; the authors report richer sources give richer environments) and a teacher clearly stronger than your student. It buys little from command-heavy CLI traces (two thirds of LFM2-Terminal's 139,841 traces yielded no environment), and the environment count, not queries or solutions per environment, is what the paper's own scaling ablation favours.

Why it matters (beyond the paper)

This is environment scarcity solved by recycling rather than by construction. If it works on real usage logs, the supply of environments grows with deployed agent usage instead of human authoring effort. It also names a loop: agents produce trajectories, trajectories produce environments, environments train better agents, a data flywheel for agentic post-training of the kind pretraining had with web crawl. The authors add two ways it scales: richer source trajectories expose more workspace, and several sessions on the same workspace can be replayed together into one larger reconstruction (§7).

The open risk is distributional: environments rebuilt from trajectories inherit whatever the recorded agents were doing, so the flywheel can narrow rather than broaden if the pool is dominated by a few harnesses and task types. The paper itself names this limit (coverage "fundamentally bounded by the coverage of the collected source trajectories", §7), and its own data shows it: 84.7% Python, 47.4% data processing (Figure 5), and one agent, one model and generated tasks behind 96% of the terminal environments. The stronger version of this paper would run the pipeline on real, diverse developer sessions.

Since the paper (dated: checked 3 October 2026)

The practitioner view points the same way: the Mercor and SkyRL 397B RL training guide (filed in this knowledge base on 7 September 2026) argues that environment robustness and harness design decide an RL run as much as the algorithm does, which is exactly the input this paper industrialises. And the scores are on Terminal-Bench 2.1, while the Terminal-Bench leaderboard now reports Terminal-Bench 4.0 (checked 3 October 2026), so these numbers are not comparable with model cards that report the current version.

Connections

  • EnvHarness: the complement. EnvHarness wraps existing frozen environments with composable Stage, Contract and Chain components and auto-customises them against a policy's diagnosed weaknesses; Terminal-Universe manufactures new environments from artifacts nobody treated as environments. Use both and the pipeline covers supply and adaptation.
  • Repo-To-Skill: the same week, the same move, applied to skills instead of environments, both mining artifacts that already exist.
  • HarnessDev: a harness-building model needs somewhere to practise; this is that somewhere.
  • Topic: benchmarks: the gains are against Terminal-Bench 2.1, not the current version (see the dated block above).
  • Topic: agentic-harnesses (harness-scaling section) and Topic: rl for the post-training use; the Mercor and SkyRL guide above is the practitioner-side counterpart.
  • More in Further reading: StateM, Demystifying Agent Skills, Schrödinger's Code Repository, Qwen3, ReAct.

Sources: the paper (arXiv 2609.04148v1), its LaTeX source and vector figures, and 640 rows of LFM2-Terminal-SFT-Processed, all read on 3 October 2026. Derived numbers are computed in src/recompute.py and src/replay.py. This page replaces the written summary that was here; its corrections are listed in the tables tab.