{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://earthsciml.org/schemas/esm-integrator/0.1.0/plan.schema.json",
  "title": "EarthSciIntegrator plan",
  "description": "The planner's output (spec/plan.md). M2 draft: every field is specified there except the checkpoint actions, which arrive at M4. A plan is serialized as RFC 8785 canonical JSON and must be byte-identical between the Julia and Rust planners, so it records nothing implementation-specific.",
  "type": "object",
  "required": ["esm_integrator", "inputs", "time", "operators", "schedule", "step", "derived"],
  "additionalProperties": false,
  "properties": {
    "esm_integrator": {"$ref": "run-config.schema.json#/$defs/semver"},
    "inputs": {
      "type": "object",
      "required": ["model", "run_config"],
      "additionalProperties": false,
      "properties": {
        "model": {"$ref": "#/$defs/fileRef"},
        "run_config": {"$ref": "#/$defs/fileRef"}
      }
    },
    "operators": {
      "type": "object",
      "minProperties": 1,
      "propertyNames": {"$ref": "run-config.schema.json#/$defs/operatorName"},
      "additionalProperties": {
        "description": "A map operator (kind map) or any other; chosen by kind, so a defect is reported against its own kind's schema only.",
        "if": {"required": ["kind"], "properties": {"kind": {"const": "map"}}},
        "then": {"$ref": "#/$defs/mapOperatorPlan"},
        "else": {"$ref": "#/$defs/operatorPlan"}
      }
    },
    "output": {
      "type": "object",
      "additionalProperties": false,
      "required": ["times", "stream_only", "time_units", "sinks"],
      "properties": {
        "times": {"$ref": "#/$defs/outputTimes"},
        "stream_only": {"type": "boolean"},
        "time_units": {"type": "string"},
        "adjoint": {"$ref": "run-config.schema.json#/$defs/adjoint"},
        "sinks": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/outputSink"}}
      }
    },
    "forcing": {
      "description": "The model's used data-fed parameters (read by an operator or an ic equation), by flattened name (spec/plan.md §3, §4.1, D87). Present only when the model has one; a data-fed parameter nothing reads is not listed. The runtime supplies their values; the plan records what feeds each one, not where the data is.",
      "type": "object",
      "minProperties": 1,
      "additionalProperties": {
        "type": "object",
        "required": ["shape", "source", "file_variable", "cadence", "records_per_sample"],
        "additionalProperties": false,
        "properties": {
          "cadence": {"enum": ["const", "discrete"], "description": "discrete when the source declares a time-varying temporal block (spec/plan.md §4.1)."},
          "records_per_sample": {"enum": [1, 2], "description": "The effective value EarthSciAST reports in loader_fields (spec/plan.md §4.1)."},
          "shape": {
            "description": "Index-set names, as the flattened model declares them; [] for a scalar.",
            "type": "array",
            "items": {"$ref": "run-config.schema.json#/$defs/identifier"}
          },
          "source": {"type": "string", "minLength": 1},
          "file_variable": {"type": "string", "minLength": 1}
        }
      }
    },
    "schedule": {
      "description": "The resolved schedule: the run-config grammar with every 'auto' replaced and every leaf's options made explicit (spec/plan.md §3). Every node has an id.",
      "allOf": [{"$ref": "#/$defs/resolvedNode"}, {"$ref": "#/$defs/noAuto"}]
    },
    "time": {
      "description": "The resolved run interval in seconds (spec/run-config.md §1.1, D60). Which source gave it is not recorded, so the same interval always gives the same plan.",
      "type": "object",
      "required": ["start", "end"],
      "additionalProperties": false,
      "properties": {
        "start": {"type": "number"},
        "end": {"type": "number"}
      }
    },
    "step": {
      "allOf": [{"$ref": "run-config.schema.json#/$defs/step"}, {"$ref": "#/$defs/noAuto"}]
    },
    "partition": {"$ref": "#/$defs/partitionPlan"},
    "precision": {
      "description": "Resolved precision roles per leaf, keyed by node id. Every role is present.",
      "type": "object",
      "propertyNames": {"$ref": "run-config.schema.json#/$defs/nodeKey"},
      "additionalProperties": {
        "allOf": [
          {"$ref": "run-config.schema.json#/$defs/precisionRoles"},
          {"required": ["state", "rhs", "jacobian", "factors", "tables"]}
        ]
      }
    },
    "checkpoint_schedule": {"$ref": "#/$defs/checkpointSchedule"},
    "derived": {
      "description": "Every derived document the plan refers to, by path relative to plan.json.",
      "type": "object",
      "propertyNames": {"type": "string", "pattern": "^derived/[A-Za-z0-9_.-]+\\.esm$"},
      "additionalProperties": {
        "type": "object",
        "required": ["kind", "operator", "sha256"],
        "additionalProperties": false,
        "properties": {
          "kind": {"$ref": "#/$defs/derivedKind"},
          "operator": {"description": "The operator; for a limit document, the limit observed's qualified name (spec/plan.md §6.8).", "anyOf": [{"$ref": "run-config.schema.json#/$defs/operatorName"}, {"$ref": "run-config.schema.json#/$defs/qualifiedName"}]},
          "sha256": {"$ref": "#/$defs/sha256"}
        }
      }
    },
    "validation": {
      "description": "Pass 8's checks (spec/plan.md §8). Only outcomes are recorded, never measured errors, which differ between implementations. rhs_sum is one check over the whole model and names no operator; band_model and non_empty name theirs.",
      "type": "array",
      "items": {
        "type": "object",
        "required": ["check", "passed"],
        "additionalProperties": false,
        "properties": {
          "check": {"enum": ["rhs_sum", "band_model", "non_empty"]},
          "operator": {"$ref": "run-config.schema.json#/$defs/operatorName"},
          "passed": {"const": true}
        },
        "if": {"properties": {"check": {"const": "rhs_sum"}}},
        "then": {"not": {"required": ["operator"]}},
        "else": {"required": ["operator"]}
      }
    }
  },

  "$defs": {
    "outputTimes": {
      "type": "array",
      "items": {"type": "number"},
      "uniqueItems": true
    },
    "outputSink": {
      "type": "object",
      "additionalProperties": false,
      "required": ["path", "group", "times", "axes", "variables"],
      "properties": {
        "path": {"type": "string", "minLength": 1},
        "group": {"type": "string"},
        "times": {"$ref": "#/$defs/outputTimes"},
        "axes": {
          "type": "object",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": false,
            "required": ["node", "length"],
            "properties": {
              "node": {"type": "string", "minLength": 1},
              "length": {"type": "integer", "minimum": 1},
              "values": {"type": "array", "items": {"type": "number"}},
              "attrs": {"type": "object", "additionalProperties": {"type": "string"}}
            }
          }
        },
        "variables": {
          "type": "object",
          "minProperties": 1,
          "additionalProperties": {
            "type": "object",
            "additionalProperties": false,
            "required": ["node", "axes"],
            "properties": {
              "node": {"type": "string", "minLength": 1},
              "axes": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
              "units": {"type": "string"}
            }
          }
        }
      }
    },
    "resolvedNode": {
      "description": "A run-config schedule node with an id, whose child nodes are resolved nodes too. A leaf's or coupled node's operators are always a list (spec/plan.md §7.1).",
      "$ref": "run-config.schema.json#/$defs/node",
      "required": ["id"],
      "properties": {
        "leaf": {"type": "array"},
        "coupled": {"type": "array"},
        "sequence": {"items": {"$ref": "#/$defs/resolvedNode"}},
        "strang": {"items": {"$ref": "#/$defs/resolvedNode"}},
        "subcycle": {"$ref": "#/$defs/resolvedNode"},
        "every": {"$ref": "#/$defs/resolvedNode"}
      }
    },
    "noAuto": {
      "description": "No value anywhere inside is the string 'auto' (spec/plan.md §3). Operator names and node ids are never 'auto' (spec/run-config.md §2.1), so this cannot misfire on a name.",
      "not": {"const": "auto"},
      "items": {"$ref": "#/$defs/noAuto"},
      "additionalProperties": {"$ref": "#/$defs/noAuto"}
    },
    "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
    "fileRef": {
      "type": "object",
      "required": ["path", "sha256"],
      "additionalProperties": false,
      "properties": {
        "path": {"type": "string", "minLength": 1},
        "sha256": {"$ref": "#/$defs/sha256"}
      }
    },
    "productIo": {
      "type": "object",
      "required": ["lam", "vjp"],
      "additionalProperties": false,
      "properties": {
        "lam": {"type": "object", "additionalProperties": {"type": "string"}},
        "vjp": {"type": "object", "additionalProperties": {"type": "string"}}
      }
    },
    "derivedKind": {
      "enum": [
        "rhs", "jacobian", "split_jacobian", "time_derivative", "frozen_jacobian", "vjp", "second_order", "param_jacobian", "forcing_jacobian",
        "residual", "frozen_residual", "frozen_vjp", "map", "limit", "condition", "held", "lagged", "averaged", "step_start"
      ]
    },
    "mapOperatorPlan": {
      "description": "A map operator (spec/plan.md §5.1.5, D132): target -> source observed, the sorted targets as writes, and bind_dt when given; its document is derived/<op>.map.esm (§6.8).",
      "type": "object",
      "required": ["kind", "map", "writes"],
      "additionalProperties": false,
      "properties": {
        "kind": {"const": "map"},
        "map": {"type": "object", "minProperties": 1, "propertyNames": {"$ref": "run-config.schema.json#/$defs/qualifiedName"}, "additionalProperties": {"$ref": "run-config.schema.json#/$defs/qualifiedName"}},
        "writes": {"$ref": "#/$defs/sortedNames"},
        "bind_dt": {"$ref": "run-config.schema.json#/$defs/bindDt"}
      }
    },
    "operatorPlan": {
      "type": "object",
      "required": ["kind", "locality", "writes", "reads", "structure"],
      "additionalProperties": false,
      "properties": {
        "kind": {"enum": ["rhs", "algebraic", "condition"]},
        "locality": {
          "type": "object",
          "required": ["class"],
          "additionalProperties": false,
          "properties": {
            "class": {"$ref": "run-config.schema.json#/$defs/locality"},
            "radius": {
              "description": "Stencil reach per horizontal axis: [cells toward lower index, cells toward higher index]. Present only for class 'stencil', with every horizontal axis (spec/plan.md §5.2.4).",
              "type": "object",
              "minProperties": 1,
              "propertyNames": {"$ref": "run-config.schema.json#/$defs/identifier"},
              "additionalProperties": {
                "type": "array", "items": {"type": "integer", "minimum": 0}, "minItems": 2, "maxItems": 2
              }
            }
          },
          "if": {"properties": {"class": {"const": "stencil"}}},
          "then": {"required": ["radius"]},
          "else": {"not": {"required": ["radius"]}}
        },
        "writes": {"$ref": "#/$defs/sortedNames"},
        "reads": {"$ref": "#/$defs/sortedNames"},
        "forcing": {
          "description": "The data-fed parameters among reads (spec/plan.md §5.3, D87). Present only when non-empty.",
          "allOf": [{"$ref": "#/$defs/sortedNames"}, {"minItems": 1}]
        },
        "frozen": {
          "description": "The frozen observeds of the operator's solving node, in order (spec/plan.md §6.5, D124, D125): the frozen residual document's FrozenEval.frozen_m holds the m-th. Present only when non-empty.",
          "type": "array",
          "minItems": 1,
          "items": {"$ref": "run-config.schema.json#/$defs/qualifiedName"}
        },
        "held": {
          "description": "The operator's held observeds in code-point order (spec/plan.md §5.4.1, D165): held at the start of each step of the node that advances it, states with the zero right-hand side in its documents; the held-values document derived/<op>.held.esm's FrozenEval.frozen_k holds the k-th. Present only when non-empty.",
          "type": "array",
          "minItems": 1,
          "items": {"$ref": "run-config.schema.json#/$defs/qualifiedName"}
        },
        "lagged": {
          "description": "The held observeds of a split_explicit node's fast operator that the node's lag names, in code-point order (spec/plan.md §5.4.1, D177): a subset of held, taken at the start of the previous substep of the stage (at the substep's own start in a stage's first), with the operator's other held observeds at their held values; the lagged-values document derived/<op>.lagged.esm's FrozenEval.frozen_k holds the k-th. Present only when non-empty.",
          "type": "array",
          "minItems": 1,
          "items": {"$ref": "run-config.schema.json#/$defs/qualifiedName"}
        },
        "carried": {
          "description": "The held observeds of a split_explicit node's fast operator that the node's carry names, in code-point order (spec/plan.md §5.4.1, D177): a subset of held, taken at the end of the previous substep of the time step (across the step's stages; zero in the step's first substep), with the operator's other held observeds at their held values; the lagged-values document derived/<op>.lagged.esm holds them after the lagged ones. Present only when non-empty.",
          "type": "array",
          "minItems": 1,
          "items": {"$ref": "run-config.schema.json#/$defs/qualifiedName"}
        },
        "averaged": {
          "description": "The held observeds of a split_explicit node's scalar operator that the node's average names, in code-point order (spec/plan.md §5.4.1, D178): taken at their mean over the RK stage's substeps of their value at the end of each substep, while the operator is evaluated once per stage at the stage's predictor, after the substeps. With step_start, every held observed of the operator. Present only when non-empty.",
          "type": "array",
          "minItems": 1,
          "items": {"$ref": "run-config.schema.json#/$defs/qualifiedName"}
        },
        "step_start": {
          "description": "The held observeds of a split_explicit node's scalar or scalar_last operator that the node's step_start names, in code-point order (spec/plan.md §5.4.1, D181): taken at their value at the step's start state, the state every stage restarts from, and held over the step. Present only when non-empty.",
          "type": "array",
          "minItems": 1,
          "items": {"$ref": "run-config.schema.json#/$defs/qualifiedName"}
        },
        "vjp": {"$ref": "#/$defs/productIo", "description": "The inputs and outputs of the operator's vjp document (spec/plan.md §6.6, D127). Present only when the run config has adjoint."},
        "frozen_vjp": {"$ref": "#/$defs/productIo", "description": "The inputs and outputs of the operator's frozen_vjp document (spec/plan.md §6.6, D127). Present only when a bound references a state-free observed and the run config has adjoint."},
        "frozen_bands": {
          "description": "The frozen Jacobian document's band list (spec/plan.md §6.5, D124), as structure.bands is written.",
          "type": "array",
          "items": {"type": "object"}
        },
        "residuals": {
          "description": "An algebraic operator's residuals (spec/plan.md §5.9.7), in flattened equation order, each with the unknown the canonical pairing gives it (D120).",
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "required": ["id", "origin", "unknown"],
            "additionalProperties": false,
            "properties": {
              "id": {"type": "string"},
              "origin": {"type": "string"},
              "unknown": {"$ref": "run-config.schema.json#/$defs/qualifiedName"}
            }
          }
        },
        "bounds": {
          "description": "An algebraic operator's bounded unknowns (spec/plan.md §5.9.7, D95): per unknown its lb and ub, each a number, a parameter name or a state-free observed name (D125).",
          "type": "object",
          "minProperties": 1,
          "additionalProperties": {
            "type": "object",
            "minProperties": 1,
            "additionalProperties": false,
            "properties": {
              "lb": {"oneOf": [{"type": "number"}, {"$ref": "run-config.schema.json#/$defs/qualifiedName"}]},
              "ub": {"oneOf": [{"type": "number"}, {"$ref": "run-config.schema.json#/$defs/qualifiedName"}]}
            }
          }
        },
        "terms": {
          "description": "The operator's terms (spec/plan.md §5.1), in flattened-equation order, then contribution, then summand.",
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "required": ["variable", "contribution", "summand", "provenance", "locality"],
            "additionalProperties": false,
            "properties": {
              "variable": {"$ref": "run-config.schema.json#/$defs/qualifiedName"},
              "contribution": {"type": "integer", "minimum": 0},
              "summand": {"type": "integer", "minimum": 0},
              "provenance": {
                "description": "A component path, coupling:<k>, or several joined by + (D64).",
                "type": "string",
                "pattern": "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*|coupling:[0-9]+)(\\+([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*|coupling:[0-9]+))*$"
              },
              "locality": {"$ref": "run-config.schema.json#/$defs/locality"}
            }
          }
        },
        "structure": {"$ref": "#/$defs/structure"},
        "stiffness": {
          "type": "object",
          "required": ["class", "source"],
          "additionalProperties": false,
          "properties": {
            "class": {"enum": ["stiff", "nonstiff"]},
            "source": {"enum": ["reaction_systems", "solver_hint", "gershgorin", "run_config", "frozen", "split_explicit"]}
          }
        }
      },
      "allOf": [
        {
          "if": {"properties": {"kind": {"const": "algebraic"}}},
          "then": {"required": ["residuals"], "not": {"anyOf": [{"required": ["terms"]}, {"required": ["stiffness"]}]}},
          "else": {"required": ["terms", "stiffness"], "not": {"required": ["residuals"]}}
        },
        {
          "if": {"properties": {"locality": {"properties": {"class": {"const": "stencil"}}}}},
          "then": {"properties": {"structure": {"required": ["stencil"]}}},
          "else": {"properties": {"structure": {"not": {"required": ["stencil"]}}}}
        },
        {
          "if": {"properties": {"locality": {"properties": {"class": {"const": "column"}}}}},
          "then": {"properties": {"structure": {"required": ["column"]}}},
          "else": {"properties": {"structure": {"not": {"required": ["column"]}}}}
        },
        {
          "if": {"not": {"properties": {"locality": {"properties": {"class": {"const": "pointwise"}}}}}},
          "then": {"properties": {"structure": {"not": {"required": ["block"]}}}}
        }
      ]
    },
    "structure": {
      "description": "Pass 4 (spec/plan.md §5.4).",
      "type": "object",
      "required": ["class", "linear_in_u", "depends_on_t", "bands"],
      "additionalProperties": false,
      "properties": {
        "class": {"enum": ["block_diagonal", "cell_block", "banded", "general", "empty"]},
        "linear_in_u": {"type": "boolean"},
        "depends_on_t": {"type": "boolean"},
        "time_bands": {
          "description": "Time band positions in field order: band k is J_k of the time-derivative document (spec/plan.md §6.7; EarthSciASTDiff serialize_band without coef, col \"t\").",
          "type": "array",
          "items": {"type": "object", "required": ["row", "col", "rows", "row_idx", "col_idx"]}
        },
        "bands": {
          "description": "Band positions in field order: band k is J_k of the Jacobian document (EarthSciASTDiff serialize_band without coef).",
          "type": "array",
          "items": {
            "type": "object",
            "required": ["row", "col", "rows", "row_idx", "col_idx"],
            "additionalProperties": false,
            "properties": {
              "row": {"$ref": "run-config.schema.json#/$defs/qualifiedName"},
              "col": {"$ref": "run-config.schema.json#/$defs/qualifiedName"},
              "rows": {
                "type": "array",
                "items": {"type": "array", "items": {"type": "integer"}, "minItems": 2, "maxItems": 2}
              },
              "row_idx": {"type": "array", "items": {"type": ["string", "integer"]}},
              "col_idx": {"type": "array"},
              "contracted": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "type": "array", "minItems": 3, "maxItems": 3,
                  "prefixItems": [{"type": "string"}, {"type": "integer"}, {"type": "integer"}]
                }
              }
            }
          }
        },
        "block": {
          "description": "EarthSciASTDiff's block-diagonal factorization plan, 1-based (esm-jacobian-spec §6, without its type tag).",
          "type": "object",
          "required": ["vars", "ordering", "pattern", "lu_pattern"],
          "additionalProperties": false,
          "properties": {
            "vars": {"type": "array", "items": {"$ref": "run-config.schema.json#/$defs/qualifiedName"}, "minItems": 1},
            "ordering": {"type": "array", "items": {"type": "integer", "minimum": 1}, "minItems": 1},
            "pattern": {"$ref": "#/$defs/pairs"},
            "lu_pattern": {"$ref": "#/$defs/pairs"},
            "cell_axes": {"description": "A cell_block plan's cell axes (D123).", "type": "array", "items": {"type": "string"}, "minItems": 1},
            "elements": {"description": "A cell_block plan's block elements in elimination order: each variable with its indices along the axes inside the cell.", "type": "array", "items": {"type": "array"}}
          }
        },
        "column": {
          "type": "object",
          "required": ["axis", "kl", "ku"],
          "additionalProperties": false,
          "properties": {
            "axis": {"$ref": "run-config.schema.json#/$defs/identifier"},
            "faces": {
              "description": "The face sets of the vertical axis (axes.faces), in code-point order; present only when there are some (spec/plan.md §5.4, D153).",
              "type": "array",
              "minItems": 1,
              "uniqueItems": true,
              "items": {"$ref": "run-config.schema.json#/$defs/identifier"}
            },
            "kl": {"type": "integer", "minimum": 0},
            "ku": {"type": "integer", "minimum": 0}
          }
        },
        "stencil": {
          "type": "object",
          "required": ["footprint"],
          "additionalProperties": false,
          "properties": {
            "footprint": {
              "description": "Distinct reduced horizontal offset vectors, in axes.horizontal order, sorted lexicographically (spec/plan.md §5.4).",
              "type": "array",
              "minItems": 1,
              "items": {"type": "array", "items": {"type": "integer"}, "minItems": 1, "maxItems": 2}
            }
          }
        }
      }
    },
    "pairs": {
      "type": "array",
      "items": {"type": "array", "items": {"type": "integer", "minimum": 1}, "minItems": 2, "maxItems": 2}
    },
    "sortedNames": {
      "description": "Qualified names, sorted by Unicode code point (spec/plan.md §2).",
      "type": "array",
      "items": {"$ref": "run-config.schema.json#/$defs/qualifiedName"},
      "uniqueItems": true
    },
    "partitionPlan": {
      "type": "object",
      "required": ["ranks", "tiles"],
      "additionalProperties": false,
      "properties": {
        "ranks": {"$ref": "run-config.schema.json#/$defs/grid2"},
        "tiles": {"$ref": "run-config.schema.json#/$defs/grid2"},
        "halo": {
          "description": "Halo width per horizontal axis, the maximum radius over the stencil operators (architecture §7.1).",
          "type": "object",
          "propertyNames": {"$ref": "run-config.schema.json#/$defs/identifier"},
          "additionalProperties": {"type": "integer", "minimum": 0}
        },
        "shards": {
          "description": "Shard count per pointwise or column leaf, by node id (spec/plan.md §7.4).",
          "type": "object",
          "propertyNames": {"$ref": "run-config.schema.json#/$defs/nodeKey"},
          "additionalProperties": {"type": "integer", "minimum": 1}
        },
        "lanes": {
          "description": "Lane capacity by node id, for the pointwise or column leaves whose partition gives lanes (spec/partitioning.md §10.2).",
          "type": "object",
          "propertyNames": {"$ref": "run-config.schema.json#/$defs/nodeKey"},
          "additionalProperties": {"type": "integer", "minimum": 1}
        },
        "reshard": {
          "description": "Re-sharding by node id, for every leaf whose resolved dt_scope is shard (spec/partitioning.md §6.2, §10.2).",
          "type": "object",
          "propertyNames": {"$ref": "run-config.schema.json#/$defs/nodeKey"},
          "additionalProperties": {"$ref": "run-config.schema.json#/$defs/leafPartition/properties/reshard"}
        },
        "output_shard": {
          "description": "The output stores' shard length per axis; rank block boundaries fall on its multiples (U12).",
          "type": "object",
          "propertyNames": {"$ref": "run-config.schema.json#/$defs/identifier"},
          "additionalProperties": {"type": "integer", "minimum": 1}
        }
      }
    },
    "checkpointSchedule": {
      "description": "D34: computed once by the planner, executed by both runtimes. Until M4 it is the placeholder {kind: all, macro_steps: 0} (D78); the action vocabulary is provisional until then.",
      "type": "object",
      "required": ["kind", "macro_steps"],
      "additionalProperties": false,
      "properties": {
        "kind": {"enum": ["all", "revolve", "multilevel"]},
        "macro_steps": {"type": "integer", "minimum": 0},
        "snapshots": {"type": "integer", "minimum": 1},
        "actions": {
          "type": "array",
          "items": {
            "type": "object",
            "required": ["op", "step"],
            "additionalProperties": false,
            "properties": {
              "op": {"enum": ["store", "restore", "advance", "reverse", "free"]},
              "step": {"type": "integer", "minimum": 0},
              "to": {"type": "integer", "minimum": 0},
              "slot": {"type": "integer", "minimum": 0},
              "level": {"enum": ["memory", "disk"]}
            }
          }
        }
      }
    }
  }
}
