Skip to main content

CRADLE Schema Reference

The CRADLE JSON Schema describes the structured JSON representation of scenario metadata, instances, networks, and events, including the rules applied by JSON Schema validators. It is written for JSON Schema Draft 7. This page does not define the human-authored CRADLE block syntax; for that syntax and the properties recognized by the compiler, see CRADLE Language Structure.

The current schema is a preview reference. It is not yet fully aligned with the CRADLE grammar and active compiler output, so it should not be treated as the sole validation authority for a product release.

Schema conventions

ConventionCurrent behavior
Schema versionJSON Schema Draft 7
Root typeobject
Required root propertiesmetadata, instances, networks, events
Declared defaultsNone
Unknown propertiesAllowed unless a nested rule states otherwise
Reference validationCross-references between names are not enforced
Format validationDepends on the selected JSON Schema validator

“Required” in the tables below means required by the current JSON Schema. It does not necessarily mean that the compiler rejects the corresponding CRADLE source when the property is absent.

Document structure

PropertyTypeRequiredDescription
metadataObjectYesIdentifies the scenario and its artifact repository.
instancesObject mapYesMaps instance names to instance definitions.
networksObject mapYesMaps network names to network definitions.
eventsObjectYesGroups events into pre-event, main-event, and post-event phases.

The schema does not declare additionalProperties: false. As a result, standards-compliant validators may accept properties that are not listed on this page.

Metadata schema

Path: metadata

PropertyTypeRequiredAllowed value or formatDescription
nameStringYesAny stringScenario name.
eventTypeStringYessequence or DAGEvent organization model.
repositoryRemoteStringYesURIRemote base location for scenario artifacts.
objectArray of stringsYesObject namesArtifacts declared by the scenario.

The schema does not define minimum lengths for these strings or the object array. It therefore permits empty strings and an empty array unless another validation layer rejects them.

Repository fields should contain locations only. Do not embed usernames, passwords, access tokens, or other credentials in a scenario or schema document.

Instance schema

Path: instances.<instance-name>

Each property under instances acts as the name of one instance.

PropertyTypeRequiredAllowed value or formatDescription
osObjectYesSee operating-system propertiesOperating-system definition.
objectArray of stringsYesObject namesArtifacts associated with the instance.
networkStringNoNetwork nameNetwork associated with the instance.
roleObjectNoSee role propertiesPredefined role associated with the instance.

Operating-system properties

Path: instances.<instance-name>.os

PropertyTypeRequiredDefaultDescription
nameStringYesNoneOperating-system name or platform.
versionStringYesNoneOperating-system version.

Role properties

Path: instances.<instance-name>.role

PropertyTypeRequiredDefaultDescription
nameStringYes, when role is presentNoneRole name.
varsStringNoNoneRole-specific variables represented as a string.

The schema does not validate whether referenced objects, networks, roles, operating systems, or versions are available for a deployment platform.

Network schema

Path: networks.<network-name>

Each property under networks acts as the name of one network.

PropertyTypeRequiredAllowed value or formatDescription
subnetStringYesipv4-cidr formatIPv4 address range for the network.
endpointObjectYesSee endpoint propertiesInstance connected to the network.

Endpoint properties

Path: networks.<network-name>.endpoint

PropertyTypeRequiredDefaultDescription
instanceStringYesNoneName of the connected instance.
configStringNoNoneEndpoint configuration value.

ipv4-cidr is not one of the standard Draft-07 format names. A validator will enforce it only if that validator supplies a compatible custom format checker.

The schema also models endpoint as one object. Current CRADLE examples commonly connect multiple endpoints to a network, which requires reconciliation between the schema and compiler representation.

Events schema

Path: events

PropertyTypeRequiredDescription
preEventObjectNoEvents associated with the preparation phase.
mainEventObjectNoEvents associated with the primary scenario phase.
postEventObjectNoEvents associated with the follow-up phase.

Although events is required at the document root, the schema does not require any individual phase.

Phase schema

Path: events.<phase>

PropertyTypeRequiredDescription
eventArray of objectsNoEvent definitions belonging to the phase.

The schema does not require at least one event and does not enforce unique event names or order values.

Event properties

Path: events.<phase>.event[]

PropertyTypeRequiredAllowed value or formatDescription
instanceStringYesInstance nameInstance associated with the event.
needRootStringYestrue or falseWhether elevated privileges are requested.
subjectStringYesAny stringExecution subject.
runObjectStringYesObject nameArtifact associated with the event.
pauseBeforeRunIntegerNoIntegerDelay before the event, represented in seconds.
pauseAfterRunIntegerNoIntegerDelay after the event, represented in seconds.
waitforStringNotrue or falseWhether the event waits before proceeding.
scheduleExecutionStringNodate-time formatScheduled event time.
descriptionStringNoAny stringHuman-readable purpose of the event.

The schema does not declare defaults for optional event properties. Any defaults described by the compiler are implementation behavior rather than JSON Schema defaults.

What the schema validates

When used with a validator that implements the declared formats, the schema can check:

  • the presence of the four required top-level sections;
  • basic object, array, string, and integer types;
  • required properties within metadata, instances, networks, and events;
  • allowed eventType, needRoot, and waitfor values; and
  • URI and date-time formatting supported by the validator.

What the schema does not validate

The current schema does not establish that:

  • an instance, network, event, object, role, image, or configuration actually exists;
  • a named reference resolves to another part of the scenario;
  • an endpoint address belongs to its declared subnet;
  • an event dependency resolves or is free of cycles;
  • an artifact location is reachable or authorized;
  • a target platform supports every requested capability;
  • arrays contain unique values or a minimum number of entries; or
  • unknown properties are rejected.

These checks require compiler validation, semantic validation, deployment-platform validation, or a future stricter schema.

Known implementation differences

The schema and current reference implementation differ in several material areas:

AreaJSON SchemaCurrent compiler or scenarios
Metadata namesname, repositoryRemote, objectCompiler output uses a different metadata structure for the screenplay name, repositories, and objects.
InstancesObject map keyed by instance nameCompiler output represents instances as a list of named objects.
ObjectsMetadata contains an array of stringsCompiler output includes object identifiers, locations, and optional heuristic data.
NetworksObject map with one endpoint objectCompiler output represents networks and endpoints as lists.
Endpoint fieldsinstance and optional configCompiler output uses endpoint name and IP-related data.
Event phasesPhase object containing an event arrayCompiler output represents each phase directly as an event list.
Event delaysIntegersCRADLE source examples pass quoted values, and the compiler may preserve them as strings.
waitforOnly true or falseExisting scenarios also use event names or order identifiers.
ExtensionsLimited to listed schema propertiesThe compiler recognizes additional properties such as configurations, descriptions, heuristics, I/O definitions, local repositories, and execution-flow settings.

Because of these differences, successfully validating data against the current schema does not guarantee equivalent compiler behavior, and compiler output may not validate against the schema without transformation.

Versioning and distribution

The current schema does not declare a versioned $id, product release, or compatibility range. Before it is distributed as a customer-facing validation contract, maintainers should:

  1. select the canonical structured representation;
  2. align the compiler, schema, examples, and tests;
  3. assign a versioned schema identifier;
  4. decide whether unknown properties should be rejected;
  5. define and test custom formats such as ipv4-cidr;
  6. document compatibility with each CRADLE release; and
  7. confirm whether the raw JSON Schema is included in the proprietary product delivery.

Until that decision is approved, this documentation describes the schema but does not publish a downloadable copy as a supported customer artifact.