FACET: Preserving Source Intent and Executable State in Terminal Task Synthesis
Organizations: MoE Key Lab of BIPC, University of Science and Technology of China · Shanghai AI Laboratory · Fudan University
Abstract
Training terminal agents requires scalable executable supervision, yet synthesizing high-quality terminal tasks remains challenging. Each task couples an instruction, an initialized environment, a reference solution, and an executable verifier; if these artifacts are generated from inconsistent assumptions, the resulting task may be unsolvable or incorrectly evaluated. Meanwhile, multi-stage synthesis can discard the goals, dependencies, state transitions, and procedural constraints encoded in the original sources. We present FACET (Fine-grained Agentic Construction of Executable Tasks), a framework that addresses both information preservation and cross-artifact consistency. FACET reconstructs related agent skills into coherent, information-rich scenarios, then realizes and repairs the execution environment before generating the final task artifacts. The resulting container state serves as shared grounding for the instruction, solution, and verifier, while execution-based validation and targeted repair correct artifact-specific failures without unnecessarily regenerating valid components. FACET produces complex terminal tasks with dense executable checks, and successful trajectories collected from these tasks provide effective, data-efficient supervision. Fine-tuning models across multiple scales consistently improves performance on Terminal-Bench 2.1, while analyses of alternative generation schemes support the importance of environment-grounded construction for task validity and solution-verifier alignment. These results establish source-intent preservation and shared executable-state grounding as key principles for scalable terminal-task synthesis.
Figures & tables
| Dataset | Trajectory | Task | ||||
| #Traj. | Turns | #Tasks | Tests | P@1 | P@3 | |
| Nemotron-Terminal ( Pi et al., 2026 ) | 5K | 6.12 | 15K | 6.18 | 40.67 | 48.00 |
| Endless-Terminals ( Gandhi et al., 2026 ) | 200 | 4.53 | 2,492 | 5.51 | 83.00 | 87.00 |
| Terminal-Lego ( Yang et al., 2026 ) | 32K | 5.77 | 15K | 16.60 | 47.00 | 49.00 |
| TerminalWorld ( Chu et al., 2026 ) | 200 | 11.94 | 1,530 | 3.98 | 57.00 | 82.00 |
| Tmax ( Ivison et al., 2026 ) | 500 | 11.14 | 15K | 3.29 | 80.00 | 86.00 |
| Model | Size | Agent | Terminal-Bench 2.1 |
| Reported reference models | |||
| GPT-5.5 (xhigh) ( Terminal-Bench, 2026a ) | — | Terminus-2 | 78.00 |
| Claude Opus 4.7 (max) ( Terminal-Bench, 2026a ) | — | Terminus-2 | 66.10 |
| Gemini 3 Pro (high) ( Terminal-Bench, 2026a ) | — | Gemini CLI | 65.80 |
| Intern-S2-Preview-397B ( Bai and others, 2026 ) | 397B | Terminus-2 | 67.42 |
| MiniMax M3 ( MiniMax, 2026 ) | 428B | Terminus-2 | 66.00 |
Appendix figures & tables11 assets
Supplementary material from the paper’s appendix.
Appendix
| Category | Skills | Share |
| AI, agents, and tools | 15,182 | 21.28% |
| Software, systems, and security | 15,059 | 21.11% |
| Data, analysis, and research | 12,409 | 17.39% |
| Documents, productivity, and workflows | 11,267 | 15.79% |
| Multimedia, creation, and publishing | 17,424 | 24.42% |
| Total | 71,341 | 100.00% |
| Parent | Fine-grained category | Count | Global | Within parent |
| AI, agents, and tools | Agent orchestration and automation | 2,782 | 3.90% | 18.32% |
| Prompt and model calls | 3,310 | 4.64% | 21.80% | |
| Skills, plugins, and extensions | 1,637 | 2.29% | 10.78% | |
| MCP and external tools | 2,579 | 3.62% | 16.99% | |
| Memory, RAG, and knowledge bases | 3,439 | 4.82% | 22.65% | |
| Multi-agent collaboration | 1,435 | 2.01% | 9.45% |
| Stage | Count | Stage retention |
| Scenario–skill seeds | 7,852 | — |
| Seeds with first-build logs | 7,841 | 99.86% |
| Initial environment success | 6,630 | 84.56% |
| Environment repair recovery | 874 | — |
| Successful environments | 7,504 | 95.70% |
| Entering task validation | 7,446 | 99.23% |
| View | Statistic | Value |
| Command usage | cat occurrences | 18,168 (46.4%) |
| Top three commands | 27,207 (69.5%) | |
| Top ten commands | 34,598 (88.4%) | |
| Observation commands | 33,140 (84.7%) | |
| Turn dynamics | Observation-only first turn | 1,214 (95.6%) |
| Observation-only observation-only | 4,324 (55.6%) |
| Scheme | Reached validation | Initially valid | Final yield |
| Forward (Ours) | 99 | 46 (46.5%) | 83/100 |
| Reverse | 91 | 22 (24.2%) | 63/100 |
| Joint | 96 | 36 (37.5%) | 65/100 |
| Step | Stage | Operation |
| 1 | Materialize environment | Generate the Dockerfile, fixtures, dependencies, and initialization scripts from the reconstructed task specification. |
| 2 | Build and repair | Build the image with docker build . Build or initialization failures are returned to the environment-repair agent for at most three iterations. |
| 3 | Capture shared state | Start a temporary container, inspect the task workspace, and record the realized initial state . |
| 4 | Generate artifacts | Generate the final instruction, reference solution, and verifier using the same reconstructed specification and shared state . |
| 5 | Baseline validation | Start a clean container, copy and execute the verifier without running the solution, and require reward 0. |
| 6 | Oracle validation | Start another clean container, copy and execute solution/solve.sh , run tests/test.sh , and require reward 1. |
| Setting | Value |
| Supervised fine-tuning | |
| Base models | Qwen3.5-4B, Qwen3.5-9B, Qwen3.5-27B |
| Training data | 1.2K complete successful trajectories |
| Training strategy | Full-parameter SFT with BF16 and ZeRO-3 |
| Epochs / effective batch size | 3 / 64 |
| Learning rate / schedule | / cosine with 0.1 warmup ratio |
| Pipeline | Packages | Validated | Yield | P@1 | P@3 | Avg. Cmds. |
| Baseline | 437 | 78 | 15.6% | 80.8% | 85.9% | 12.8 |
| TW | 449 | 139 | 27.8% | 58.8% | 64.0% | 17.0 |
| FACET (Ours) | 395 | 350 | 70.0% | 25.1% | 33.1% | 21.5 |
Terminal Agents
Terminal agents use command-line interfaces and filesystems to carry out multi-step tasks in software and other digital environments.
See all 31 papers