CustomEnv is the bridge between the CLI and your own code. It
loads a project’s env.json and exposes the standard Gym 5-tuple loop, so you
can run the exact same phase-aware mission with your own policy or VLA and emit
the same fine-tune records the CLI does.
It lives in the CLI package:
Drive a mission
Constructor
| Param | Description |
|---|---|
cfg | An EnvConfig from load_config(...). |
headless | Run without the viewer. |
xml_path | Override the scene XML. |
seed | RNG seed. |
adapter_factory | Supply a custom sim adapter (advanced). |
Methods
| Method | Returns | Description |
|---|---|---|
reset() | (obs, info) | Start the mission at phase 0. |
step(action) | (obs, reward, terminated, truncated, info) | Advance one tick. action may be an ActionCall, a dict, or a command string. |
current_phase() | phase | The active phase object. |
records | list | Accumulated per-step records. |
mission_success() | bool | Whether all phases were completed. |
judge_summary() | dict | LLM-judge verdict for the rollout. |
signal_summary() | dict | Reward/signal breakdown. |
write_finetune(path) | None | Write (prompt, action, reward) rows via the project’s template. |
write_log(path) | None | Write the full tick-by-tick log. |
close() | None | Shut down the sim. |
info dict from reset() / step() carries the current goal_prompt, phase
index, and predicate state: everything your policy needs to act per phase.
Related config types in cadenza_cli.customenv: EnvConfig, Phase,
FineTuneConfig, and EnvConfigError (raised on an invalid env.json).