{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://airflow.apache.org/schemas/sdk-executable/airflow-metadata-1.0.schema.json",
  "title": "Airflow Executable SDK Bundle Metadata",
  "description": "Build-time manifest declaring DAG and task identifiers exposed by an Airflow native-executable SDK bundle. See the Executable Bundle Spec documentation in the Airflow Task SDK.",
  "type": "object",
  "required": ["airflow_bundle_metadata_version", "sdk", "dags"],
  "additionalProperties": true,
  "properties": {
    "airflow_bundle_metadata_version": {
      "type": "string",
      "description": "Bundle-spec version this manifest conforms to (currently '1.0').",
      "pattern": "^[0-9]+\\.[0-9]+(\\.[0-9]+)?$"
    },
    "sdk": {
      "type": "object",
      "description": "Identifies the SDK that produced the bundle.",
      "required": ["language", "version", "supervisor_schema_version"],
      "additionalProperties": true,
      "properties": {
        "language": {
          "type": "string",
          "description": "Lower-case source-language identifier (e.g. 'go', 'rust', 'cpp', 'zig').",
          "pattern": "^[a-z][a-z0-9_+.\\-]*$"
        },
        "version": {
          "type": "string",
          "description": "SDK version used at build time.",
          "minLength": 1
        },
        "supervisor_schema_version": {
          "type": "string",
          "description": "Dated supervisor wire-schema version the bundle was compiled against (e.g. '2026-06-16'). The coordinator passes this value to the supervisor so it can downgrade outbound messages / upgrade inbound messages to a shape the bundle understands.",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
        }
      }
    },
    "entrypoint_path": {
      "type": "string",
      "description": "Path of the entrypoint source file (e.g. 'example/bundle/main.go'). It must be one of the sources paths. Shown for a Dag that dag_source_paths does not map.",
      "minLength": 1
    },
    "dag_source_paths": {
      "type": "object",
      "description": "Mapping of dag_id to the path of the file that defines the Dag. Every value must be one of the sources paths.",
      "additionalProperties": {
        "type": "string",
        "minLength": 1
      }
    },
    "sources": {
      "type": "array",
      "description": "The embedded source files, in the order they appear in the source region. A bundle without it embeds no source. Paths must be unique.",
      "items": {
        "$ref": "#/$defs/sourceEntry"
      }
    },
    "dags": {
      "type": "object",
      "description": "Mapping of dag_id to the tasks the bundle runs for a Python Dag with stub TaskHandler. May be empty, for example when the bundle only declares Dag definitions.",
      "additionalProperties": {
        "$ref": "#/$defs/dagEntry"
      }
    }
  },
  "$defs": {
    "sourceEntry": {
      "type": "object",
      "description": "One embedded source file inside the bundle's source region.",
      "required": ["path", "offset", "length", "sha256"],
      "additionalProperties": true,
      "properties": {
        "path": {
          "type": "string",
          "description": "The file's path as the author knows it (e.g. 'example/bundle/main.go').",
          "minLength": 1
        },
        "offset": {
          "type": "integer",
          "description": "The file's start, in bytes from the start of the source region.",
          "minimum": 0
        },
        "length": {
          "type": "integer",
          "description": "The file's length in bytes.",
          "minimum": 0
        },
        "sha256": {
          "type": "string",
          "description": "Lower-case hexadecimal SHA-256 of the file's bytes.",
          "pattern": "^[0-9a-f]{64}$"
        }
      }
    },
    "dagEntry": {
      "type": "object",
      "description": "Static description of a single DAG declared in the bundle.",
      "required": ["tasks"],
      "additionalProperties": true,
      "properties": {
        "tasks": {
          "type": "array",
          "description": "Static list of task_ids declared in the DAG.",
          "items": {
            "type": "string",
            "minLength": 1
          }
        }
      }
    }
  }
}
