AgentTwin: Dual-Oracle Synthesis of Executable Abstractions from Production Systems
Abstract
AI-driven systems research depends on fast, faithful executable evaluators, but constructing one for a production service is itself a systems problem. Relevant behavior is distributed across source code, mutable state, external services, configuration, and noisy telemetry. We formulate counterfactual executable abstraction: given a production codebase, operational evidence, target observables, and a class of interventions, synthesize a compact runnable model that preserves the behavior relevant to those interventions while omitting infrastructure. We present AgentTwin and its synthesis method, Dual-Oracle Inductive Synthesis DOIS. Its empirical role grounds synthesis in behavior actually observed in production, although traces contain measurement noise and omit relevant state. Its mechanistic role extracts causal rules from source and tests, but behavior may depend on external systems or hidden runtime state absent from the source, and an LLM can select the wrong branch or map production state incorrectly. A two-by-two agreement calculus tells a coding agent how the roles certify one another and how to retain trace windows and source-grounded tests. In a production case study, we synthesize a workload-management simulator and evaluate out-of-distribution executable abstraction across unseen warehouse sizes and workloads. DOIS reduces held-out composite error by 34\% relative to the strongest of eight agentic baselines and by 49\% relative to a human baseline.