Skip to main content
Version: Current

Inspect Output

CradleXC can show a scenario at two different processing stages:

OutputCommandUse it to
Compiled YAMLcxc compileCheck that the compiler preserved the source-level scenario structure.
Deployment IRcxc dump-irInspect the resolved, backend-neutral plan consumed by backend plugins.

Both files are generated output. Continue editing the original .cradle file, then regenerate whichever representation you need.

For backend authors

The JSON from cxc dump-ir is the input a backend translates into target-specific files. Use the complete Hello World Deployment IR walkthrough to understand that contract, then follow Building a Backend to implement and test a translator.

Output workflow​

CRADLE source
↓
Validate
↓
Compiled YAML or Deployment IR
↓
Inspect

Backend-specific file generation happens separately after this inspection.

Inspect compiled YAML​

Compile the scenario to a file:

cxc compile \
-i scenarios/HelloWorld.cradle \
-o HelloWorld.yml

Open the result in an editor, or inspect it from the terminal:

less HelloWorld.yml

Check that it contains the expected:

  • scenario metadata and repositories
  • instances, operating systems, objects and configurations
  • networks, subnets and endpoints
  • pre-event, main-event and post-event phases

See Hello World: Compiled YAML for a complete generated example and an explanation of each section.

Inspect Deployment IR​

Display the resolved Deployment IR:

cxc dump-ir -i scenarios/HelloWorld.cradle

Redirect standard output when you want a reusable fixture:

cxc dump-ir \
-i scenarios/HelloWorld.cradle \
> HelloWorld.ir.json

The IR contains backend-ready values such as:

  • instance platform, architecture, CPU and memory values
  • primary addresses and interface attachments
  • gateways, netmasks and provider-safe network names
  • resolved object sources and destination components
  • normalized event fields and dependency ordering
  • derived instance flags such as is_router and is_windows
  • explicit instance boot order

See Hello World: Deployment IR for the complete generated JSON and a field-by-field walkthrough.

note

cxc dump-ir is mainly useful for troubleshooting, compiler inspection and backend development. It is optional during routine scenario authoring.

Choose the right representation​

QuestionInspect
Did CradleXC preserve the instances, networks and events I authored?Compiled YAML
Which concrete IP address did an endpoint receive?Deployment IR
Which gateway, netmask or target-side network name was calculated?Deployment IR
Was an object attached to the intended instance?Either representation
What exact object source and destination components reach a backend?Deployment IR
In what order should machines and events be handled?Deployment IR

Backend authors should consume Deployment IR rather than reconstructing resolved values from compiled YAML. Follow Building a Backend for a runnable translation example.

Investigate unexpected output​

Start by validating the source:

cxc validate -i scenarios/HelloWorld.cradle

Then compare the two generated representations:

cxc compile \
-i scenarios/HelloWorld.cradle \
-o HelloWorld.yml

cxc dump-ir \
-i scenarios/HelloWorld.cradle \
> HelloWorld.ir.json

This separates source or compilation problems from later backend-specific generation problems. See Troubleshooting for additional diagnostic steps.

Keep generated files separate​

A simple project layout keeps authored and generated files distinct:

.
├── scenarios/
│ └── HelloWorld.cradle
├── build/
│ ├── HelloWorld.yml
│ └── HelloWorld.ir.json
└── output/
└── ... backend-specific files ...

Do not treat the YAML, JSON or backend-specific files as replacements for the source scenario.

Detailed examples​

Next steps​