Recent advances in frontier models have pushed the boundaries of agentic robot control, enabling agents to perform complex robotic tasks through reasoning and interaction. However, repeated calls to these models during execution can substantially increase task completion time. Code as Policies (CaP) offers a route for coding agents to acquire physical skills through experience and retain them in executable programs, allowing the reasoning invested in development to be reused across runs. Developing reliable code policies while limiting the cost of physical experimentation remains a central challenge. We investigate human guidance as a source of priors for feasible actions and simulation as an auxiliary environment for exploring and testing candidate policies. Our findings favor robot demonstrations available on request and simulation used selectively during real-world policy refinement. These findings inform ACE-CaP-0, an agentic recipe that couples policy revision with experience acquisition through Demonstrations on Request and Simulation on Demand. Across eight real-world manipulation tasks spanning alignment, multi-object handling, and bimanual coordination, the resulting frozen programs achieve 92.1\% success (221/240 trials). Mean execution times across tasks range from 0.97 to 2.27 minutes. The programs execute with runtime perception and control, without a human or coding agent in the loop. These results highlight CaP's potential to turn experience into reliable, reusable physical skills.
Full waveform inversion (FWI) reconstructs subsurface velocity models from seismic mea surements but faces the challenges of ill-posedness and nonlinearity, making accurate inversion dependent on suitable initialization and effective prior constraints. Classical methods stabi lize the inversion and improve convergence by designing hand-crafted regularization terms, yet these terms provide limited descriptions of complex geological structures. Recent diffusion based methods learn more detailed structural priors from data and integrate them into inverse problem solvers. We propose Physical-State-Guided Diffusion Sampling (PSG), which decouples diffusion posterior sampling into two mutually interacting processes: regularized FWI optimiza tion and conditional diffusion sampling with linear guidance. PSG shows overall improvements in reconstruction accuracy, preservation of prior structure, and robustness over classical and diffusion-based baselines across diverse OpenFWI inversion scenarios. Through domain decom position, PSG can generalize without retraining to more complex, realistic velocity fields with structural patterns distinct from those represented by the prior learned from training datasets and larger spatial domains than the training models. Overall, PSG offers a flexible framework for integrating learned priors with physical constraints, with potential for extension to other nonlinear inverse problems.