FACET: Preserving Source Intent and Executable State in Terminal Task Synthesis
Summary (Overview)
- FACET is a framework for synthesizing complex, verifiable terminal tasks from heterogeneous agent skills, addressing two key challenges: information loss during multi-stage generation and cross-artifact inconsistencies (instruction, solution, verifier, environment).
- The pipeline has three stages: (1) skill collection and scenario–skill repository construction, (2) agentic scenario reconstruction with five-dimensional representation, and (3) executable-state-grounded task construction with targeted validation and repair.
- FACET generates 6,078 validated tasks with an average of 22.77 executable tests per task—the highest among compared datasets—and 1.2K training trajectories averaging 11.86 turns.
- Fine-tuning on just 1.2K successful trajectories yields consistent improvements across three model scales: Qwen3.5-4B (+7.12), Qwen3.5-9B (+8.24), and Qwen3.5-27B (+6.75) on Terminal-Bench 2.1.
- Analysis of generation schemes shows that sequential, environment-grounded construction (Forward: I → S → V) achieves the highest task yield (83/100) and significantly improves solution–verifier alignment compared to generating the verifier before the solution.
Introduction and Theoretical Foundation
Background and Motivation
The paper addresses the challenge of training terminal agents—AI systems that interact with command-line environments to complete real-world tasks. While benchmarks like Terminal-Bench provide evaluation platforms, the bottleneck lies in acquiring scalable executable supervision for training.
A terminal task is formally defined as a tightly coupled bundle:
where:
- = user instruction
- = environment specification
- = reference solution
- = executable verifier
- = runtime metadata
Key Theoretical Challenges
The paper identifies two fundamental challenges in multi-stage terminal-task synthesis:
-
Information loss during generation: Rich source materials (skills with capabilities, dependencies, procedural constraints) get progressively compressed into simplified task descriptions, losing critical structure and complexity.
-
Cross-artifact drift: The instruction, solution, verifier, and environment can diverge during generation, leading to tasks that are unsolvable or incorrectly evaluated.
Formal Task Acceptance Criterion
A synthesized task is accepted when:
where:
- = environment builds successfully
- = verifier outcome on state
- = initial environment state
- = final state after executing solution
This requires: a buildable environment, a non-trivial initial state (verifier fails), an executable reference solution, and a verifier-accepted final state.
Key Design Principles
The paper proposes two core principles:
- Source-intent preservation: Reconstruct rich scenarios before generating task artifacts, rather than directly converting skills to tasks.
- Shared executable-state grounding: Use the realized container state as a coordination channel across all artifact generation.
Methodology
Stage 1: Information Source Acquisition
Collection and filtering: Skills are collected from OpenClaw, ClawHub, and GitHub. Unsafe skills, those requiring private access, or depending on non-public resources are removed.
Skill understanding: Each skill is normalized into a structured record containing description, tools, inputs/outputs, procedural steps, and provenance—yielding 71K+ valid skills.
Scenario extraction: An extraction agent identifies possible application contexts, user goals, initial states, and desired final states for each skill.
Scenario–skill repository construction: Similar hypotheses are grouped into candidate pairs , and a judge evaluates relevance, complementarity, non-redundancy, and executability:
Stage 2: Scenario Reconstruction and Reference Building
The pipeline follows:
Five-dimensional scenario representation:
- Goal: user objective and expected deliverables
- Context: application setting and motivation
- Capability: role of each skill and inter-skill relationships
- State: initial, intermediate, and desired final states
- Inputs/Outputs & Tools: files, formats, schemas, paths, services, dependencies
Reference generation:
A consistency-alignment model verifies that both references share the same initial state and target outcome.
Stage 3: Executable-State-Grounded Task Construction
Environment construction and repair:
- Environment agent produces a manifest (directories, files, services, dependencies)
- Materializes assets using network access, shell/Python programs, or procedural generation
- Localizes resources for self-containment
- Allows at most 3 environment-repair iterations
Executable-state sharing: After successful build, the realized state is exposed to all downstream generators. Artifacts are generated sequentially:
- Instruction I from and
- Solution S from I, , and
- Execute S to obtain
- Verifier V from I, , , and
Validation and targeted repair: Each candidate is validated for:
- (i) Environment builds and initializes
- (ii) Verifier does not pass in initial state
- (iii) Reference solution executes from clean state
- (iv) Verifier passes on final state
A constrained router identifies the responsible component from execution traces and invokes only the corresponding repair procedure, with at most 5 task-level iterations.
Empirical Validation / Results
Dataset Comparison
Table 1: Trajectory- and task-level comparison of terminal-agent datasets
| Dataset | #Traj. | Turns | #Tasks | Tests | P@1 | P@3 |
|---|---|---|---|---|---|---|
| Nemotron-Terminal | 5K | 6.12 | 15K | 6.18 | 40.67 | 48.00 |
| Endless-Terminals | 200 | 4.53 | 2,492 | 5.51 | 83.00 | 87.00 |
| Terminal-Lego | 32K | 5.77 | 15K | 16.60 | 47.00 | 49.00 |
| TerminalWorld | 200 | 11.94 | 1,530 | 3.98 | 57.00 | 82.00 |
| Tmax | 500 | 11.14 | 15K | 3.29 | 80.00 | 86.00 |
| FACET (ours) | 1.2K | 11.86 | 6K | 22.77 | 27.00 | 35.00 |
Key observations:
- FACET has the highest average tests per task (22.77), indicating stricter completion criteria
- FACET's trajectories are among the longest (11.86 turns), reflecting complex multi-step workflows
- Lower pass rates (P@1=27.00) are consistent with denser verification requirements
Main Results
Table 2: Results on Terminal-Bench 2.1
| Model | Size | Terminal-Bench 2.1 |
|---|---|---|
| Base models | ||
| Qwen3.5-4B | 4B | 17.60 |
| Qwen3.5-9B | 9B | 27.34 |
| Qwen3.5-27B | 27B | 40.82 |
| Fine-tuned models | ||
| FACET-Terminal-Qwen3.5-4B | 4B | 24.72 (+7.12) |
| FACET-Terminal-Qwen3.5-9B | 9B | 35.58 (+8.24) |
| FACET-Terminal-Qwen3.5-27B | 27B | 47.57 (+6.75) |
| Reference: Qwen3.5-397B-A17B | 397B | 49.06 |
Key findings:
- Consistent improvements across all scales (4B, 9B, 27B)
- Largest absolute gain: 9B model (+8.24)
- Largest relative improvement: 4B model (+40.5%)
- The 27B model (47.57) approaches the 397B model (49.06) despite being ~15× smaller
Task Difficulty Analysis
- Partial progress is common: 89.40% of individual checks are satisfied across teacher rollouts, but only 20.94% achieve full task success
- Failures cluster near the success boundary: 54.00% of unsuccessful rollouts fail only 1–2 verifier checks
- Difficulty emerges from composition: Structured-data tasks are solved more reliably than narrative-document tasks; longer instructions and broader verifier coverage decrease performance
Generation Scheme Comparison
Table: Initial validation outcomes by generation scheme
| Scheme | Order | Tasks to validation | Initially valid | Initial validity rate |
|---|---|---|---|---|
| Forward | I → S → V | 99 | 46 | 46.5% |
| Reverse | I → V → S | 91 | 22 | 24.2% |
| Joint | All together | 96 | 36 | 37.5% |
After repair: Forward reaches 83/100, Reverse 63/100, Joint 65/100.
Paired comparison over 88 shared scenario–skill pairs:
- Forward vs. Reverse: 29 vs. 9 successes (p = 0.0017, two-sided exact sign test)
- Forward vs. Joint: 27 vs. 18 (p = 0.233)
This provides strong evidence that generating the solution before the verifier improves cross-artifact alignment.
Theoretical and Practical Implications
Theoretical Contributions
-
Source-intent preservation principle: Demonstrates that reconstructing rich scenarios before task generation preserves information that would otherwise be lost in direct skill-to-task conversion.
-
Executable-state grounding principle: Shows that using the realized container state as a shared coordination channel prevents cross-artifact inconsistencies.
-
Sequential artifact generation: Provides empirical evidence that the order of artifact generation matters—specifically, generating the verifier after the solution (rather than before) significantly improves task validity.
Practical Implications
-
Data efficiency: 1.2K successful trajectories suffice for meaningful improvements, suggesting that quality-focused synthesis can complement quantity-focused approaches.
-
Scalability across model sizes: The consistent gains across 4B–27B models indicate the supervision transfers across capacity regimes.
-
Dense verification as training signal: The high test-per-task ratio (22.77) provides fine-grained execution feedback that distinguishes near-successful trajectories from failures, enabling more informative supervision.
-
Repair-based pipeline: The targeted repair mechanism (identifying and fixing only the responsible artifact) improves yield while preserving valid components.
Conclusion
Main Takeaways
FACET demonstrates that carefully coordinating scenario reconstruction, executable-state grounding, and artifact-level validation can provide data-efficient supervision for terminal agents without relying solely on large-scale task generation. The framework:
- Preserves source intent through five-dimensional scenario representation
- Ensures cross-artifact consistency through shared executable-state grounding
- Achieves high task yield through targeted validation and repair
- Produces effective training data that improves performance across multiple model scales
Future Directions
The paper outlines three planned extensions:
- Broader knowledge sources: Extending FACET to more diverse sources of procedural knowledge
- More interactive environments: Adapting the framework to broader interactive settings beyond terminals
- Reinforcement learning: Investigating how generated tasks and execution feedback can support RL-based agent improvement
AI Use Statement
The authors disclose that generative AI tools were used for drafting, language editing, and LaTeX preparation, with the authors taking full responsibility for verifying all source attributions, experimental records, numerical claims, and generated text.
Related papers
- Phantom Gains: Auditing Self-Improvement Against a Measured Null
Transition-level auditing of LLM self-improvement requires measured nulls for every statistic; without them, a frozen model falsely appears to expand at 0.280.
- EvoMem: Memory-Augmented Evolution for Code Optimization
EvoMem's persistent memory of successful mutation strategies yields a 6.40% average performance gain and 5.93x speedup in LLM-based evolutionary code search.
- Hardening Agent Benchmarks with Adversarial Hacker-Fixer Loops
The hacker-fixer loop, using verifier access and a shared defense pool, automates hardening of agent benchmarks, eliminating all tested reward-hacking attacks on KernelBench and reducing them on Terminal Bench.