#  Copyright (c) 2026 Cisco Systems, Inc. and its affiliates
#  SPDX-License-Identifier: Apache-2.0
$schema: "https://json-schema.org/draft-07/schema#"
$id: "infra/v1#runtime-engine-spec"
title: RuntimeEngineSpec
description: >
  Shared kernel and LLM engine tuning for a deployment — queue depth, cache
  policy, streaming, parallel tool calls. Resolved like infra via workspace
  runtime_refs, env MAS_RUNTIME_REFS, or CLI --runtime-ref (not agent/MAS YAML).
type: object
additionalProperties: false
properties:
  engine:
    type: object
    additionalProperties: false
    properties:
      queue_depth:
        type: integer
        minimum: 1
        default: 32
      max_auto_steps:
        type: ["integer", "null"]
        minimum: 1
        default: null
        description: >
          Dispatch-loop cap. Null / omitted means no cap. Production
          overlays (with-hardened) and RuntimeEngine manifests set an
          integer when a runaway loop must stop.
      timeout:
        type: ["number", "null"]
        minimum: 0
  cache:
    type: object
    additionalProperties: false
    properties:
      enabled:
        type: boolean
      read:
        type: boolean
      write:
        type: boolean
  stream:
    type: boolean
  parallel:
    type: boolean
    description: >
      When set, overrides design-pattern parallel_tool_calls for agents using
      parallel_tool_calls for agents on this deployment profile.
