Terminal agents increasingly operate in scientific and engineering domains, where constructing executable reference solutions and domain-specific verifiers requires substantial engineering effort. We introduce software-in-the-loop reconstruction, a self-supervised learning framework that reuses existing software workflows as reference solutions. For each workflow, we execute multiple input configurations and partition the resulting input-output pairs into public examples and hidden test cases. Given the task instruction and public examples, an agent constructs a candidate program to reproduce the workflow's computational behavior without access to its reference implementation. A hierarchical verifier evaluates the candidate on hidden inputs through execution and schema checks, semantic output comparison, and anti-shortcut checks. Public execution feedback supports iterative refinement. By reusing workflows and comparison rules across input configurations, the framework enables scalable task generation without constructing separate reference solutions for each task. We instantiate Software Workflows Reconstruction (SWR), comprising 3,000 tasks from 500 workflows across 46 software families and six domains, including physical and engineering simulation, life and molecular sciences, and earth and space sciences. Qwen3.8-Max achieves 22.8% Pass@1 and 27.9% Pass@3. We sample verified trajectories to construct 3,000 training trajectories. Supervised fine-tuning of Qwen3.8-27B improves mean Terminal-Bench 2 performance from 47.94% to 53.56% across three seeds and yields higher mean scores than four existing training corpora across all four evaluations under matched token budgets. These results demonstrate the potential of scientific software as a scalable source of verified training trajectories for terminal agents.
翻译:暂无翻译