{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.timenet.ai/schemas/manifest.schema.json",
  "$defs": {
    "Access": {
      "description": "How a user obtains the source data.",
      "enum": [
        "open",
        "credentialed",
        "restricted"
      ],
      "title": "Access",
      "type": "string"
    },
    "AnnotationDescriptor": {
      "additionalProperties": false,
      "description": "Type-level projection of an annotation key, stored in the schema and manifest.",
      "properties": {
        "key": {
          "title": "Key",
          "type": "string"
        },
        "annotation_type": {
          "$ref": "#/$defs/AnnotationType"
        },
        "value_type": {
          "anyOf": [
            {
              "enum": [
                "bool",
                "int",
                "float",
                "str",
                "list"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Value Type"
        },
        "unit": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Unit"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Description"
        }
      },
      "required": [
        "key",
        "annotation_type"
      ],
      "title": "AnnotationDescriptor",
      "type": "object"
    },
    "AnnotationType": {
      "description": "Name the shape an annotation key takes across the dataset. It is a schema-level projection in the manifest.",
      "enum": [
        "static",
        "point",
        "interval"
      ],
      "title": "AnnotationType",
      "type": "string"
    },
    "BuildEnvironment": {
      "additionalProperties": false,
      "description": "Build-provenance fields recorded in a manifest.",
      "properties": {
        "python": {
          "title": "Python",
          "type": "string"
        },
        "packages": {
          "additionalProperties": {
            "type": "string"
          },
          "title": "Packages",
          "type": "object"
        }
      },
      "title": "BuildEnvironment",
      "type": "object"
    },
    "DatasetMetadata": {
      "additionalProperties": false,
      "description": "Dataset identity, release version, source information, and access requirements.\n\nThe dataset card defines these fields. ``dataset_version`` identifies the TimeNet release.\n``source_revision`` identifies the original source release, tag, or commit.\n``yaml_schema_version`` identifies the card schema. ``dataset_id`` is a case-sensitive\n``org/name`` pair with exactly one slash. Casing-only differences can cause conflicts on\ncase-insensitive filesystems.",
      "properties": {
        "dataset_id": {
          "pattern": "^[A-Za-z0-9_-][A-Za-z0-9._-]*/[A-Za-z0-9_-][A-Za-z0-9._-]*$",
          "title": "Dataset Id",
          "type": "string"
        },
        "dataset_version": {
          "pattern": "^\\d+\\.\\d+\\.\\d+$",
          "type": "string"
        },
        "parents": {
          "additionalProperties": {
            "anyOf": [
              {
                "$ref": "#/$defs/DatasetRef"
              },
              {
                "type": "string"
              }
            ]
          },
          "title": "Parents",
          "type": "object"
        },
        "source_revision": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Source Revision"
        },
        "name": {
          "minLength": 1,
          "title": "Name",
          "type": "string"
        },
        "description": {
          "minLength": 1,
          "title": "Description",
          "type": "string"
        },
        "license": {
          "$ref": "#/$defs/License"
        },
        "domains": {
          "default": [],
          "items": {
            "$ref": "#/$defs/Domain"
          },
          "title": "Domains",
          "type": "array"
        },
        "tags": {
          "default": [],
          "items": {
            "type": "string"
          },
          "title": "Tags",
          "type": "array"
        },
        "source_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Source Url"
        },
        "license_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "License Url"
        },
        "citation": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Citation"
        },
        "access": {
          "$ref": "#/$defs/Access",
          "default": "open"
        },
        "access_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Access Url"
        },
        "yaml_schema_version": {
          "default": 1,
          "maximum": 1,
          "minimum": 1,
          "title": "Yaml Schema Version",
          "type": "integer"
        }
      },
      "required": [
        "dataset_id",
        "dataset_version",
        "name",
        "description",
        "license"
      ],
      "title": "DatasetMetadata",
      "type": "object"
    },
    "DatasetRef": {
      "additionalProperties": false,
      "description": "An exact release, independent of its registry location.",
      "properties": {
        "dataset_id": {
          "pattern": "^[A-Za-z0-9_-][A-Za-z0-9._-]*/[A-Za-z0-9_-][A-Za-z0-9._-]*$",
          "title": "Dataset Id",
          "type": "string"
        },
        "version": {
          "pattern": "^\\d+\\.\\d+\\.\\d+$",
          "type": "string"
        }
      },
      "required": [
        "dataset_id",
        "version"
      ],
      "title": "DatasetRef",
      "type": "object"
    },
    "DatasetSchema": {
      "additionalProperties": false,
      "description": "A dataset's type declaration, derived from its data (never hand-authored).\n\nIt holds flat descriptor instances for specs and annotations. It also holds the real built-in\n:class:`~timenet.types.tasks.Task` subclasses, resolved against the registry instead of reconstructed.",
      "properties": {
        "time_series_specs": {
          "default": [],
          "items": {
            "$ref": "#/$defs/TimeSeriesSpec"
          },
          "title": "Time Series Specs",
          "type": "array"
        },
        "annotations": {
          "default": [],
          "items": {
            "$ref": "#/$defs/AnnotationDescriptor"
          },
          "title": "Annotations",
          "type": "array"
        },
        "tasks": {
          "default": [],
          "items": {
            "additionalProperties": false,
            "properties": {
              "task_type": {
                "enum": [
                  "classification",
                  "answer",
                  "scalar_prediction",
                  "temporal_localization",
                  "forecasting",
                  "ts_editing",
                  "ts_generation",
                  "ts_correspondence"
                ],
                "type": "string"
              }
            },
            "required": [
              "task_type"
            ],
            "type": "object"
          },
          "title": "Tasks",
          "type": "array"
        }
      },
      "title": "DatasetSchema",
      "type": "object"
    },
    "Domain": {
      "description": "Describes what kind of data a dataset contains. A dataset may declare more than one.",
      "enum": [
        "health",
        "cardiology",
        "respiratory",
        "sleep",
        "activity",
        "motion",
        "economics",
        "finance",
        "environment",
        "energy",
        "transport",
        "observability",
        "audio",
        "industrial",
        "general"
      ],
      "title": "Domain",
      "type": "string"
    },
    "FilePart": {
      "additionalProperties": false,
      "description": "One data file of a dataset version. It has a path, a checksum, and a byte size in one record.\n\nThe path, checksum, and size stay together in one record. A reader does not need to join a file\nto its digest across two structures. A consumer can verify integrity and plan a download from\nthe manifest alone.",
      "properties": {
        "path": {
          "minLength": 1,
          "title": "Path",
          "type": "string"
        },
        "checksum": {
          "pattern": "^sha256:[0-9a-f]{64}$",
          "title": "Checksum",
          "type": "string"
        },
        "size": {
          "minimum": 0,
          "title": "Size",
          "type": "integer"
        }
      },
      "required": [
        "path",
        "checksum",
        "size"
      ],
      "title": "FilePart",
      "type": "object"
    },
    "InputModality": {
      "description": "A kind of input supplied to a task.",
      "enum": [
        "text",
        "time_series",
        "image",
        "audio",
        "no_input"
      ],
      "title": "InputModality",
      "type": "string"
    },
    "License": {
      "description": "The legal license of the source data. Values are SPDX-style identifiers.",
      "enum": [
        "MIT",
        "Apache-2.0",
        "BSD-2-Clause",
        "BSD-3-Clause",
        "GPL-3.0",
        "LGPL-3.0",
        "MPL-2.0",
        "CC0-1.0",
        "CC-BY-4.0",
        "CC-BY-SA-4.0",
        "CC-BY-NC-4.0",
        "ODC-By-1.0",
        "ODbL-1.0",
        "OTHER",
        "NONE"
      ],
      "title": "License",
      "type": "string"
    },
    "ManifestCounts": {
      "additionalProperties": false,
      "description": "TimeF entity counts recorded for inspection without opening DuckDB.",
      "properties": {
        "records": {
          "default": 0,
          "minimum": 0,
          "title": "Records",
          "type": "integer"
        },
        "sources": {
          "default": 0,
          "minimum": 0,
          "title": "Sources",
          "type": "integer"
        },
        "signals": {
          "default": 0,
          "minimum": 0,
          "title": "Signals",
          "type": "integer"
        },
        "axes": {
          "default": 0,
          "minimum": 0,
          "title": "Axes",
          "type": "integer"
        },
        "annotation_contents": {
          "default": 0,
          "minimum": 0,
          "title": "Annotation Contents",
          "type": "integer"
        },
        "annotation_occurrences": {
          "default": 0,
          "minimum": 0,
          "title": "Annotation Occurrences",
          "type": "integer"
        },
        "tasks": {
          "additionalProperties": {
            "minimum": 0,
            "type": "integer"
          },
          "title": "Tasks",
          "type": "object"
        },
        "signal_chunks": {
          "default": 0,
          "minimum": 0,
          "title": "Signal Chunks",
          "type": "integer"
        },
        "signals_by_spec": {
          "additionalProperties": {
            "minimum": 0,
            "type": "integer"
          },
          "title": "Signals By Spec",
          "type": "object"
        }
      },
      "title": "ManifestCounts",
      "type": "object"
    },
    "ManifestFiles": {
      "additionalProperties": false,
      "description": "Descriptors for every TimeF artifact. Readers use this data rather than a file glob.",
      "properties": {
        "control": {
          "items": {
            "$ref": "#/$defs/FilePart"
          },
          "maxItems": 1,
          "minItems": 1,
          "title": "Control",
          "type": "array"
        },
        "time_series": {
          "default": [],
          "items": {
            "$ref": "#/$defs/FilePart"
          },
          "title": "Time Series",
          "type": "array"
        },
        "payloads": {
          "default": [],
          "items": {
            "$ref": "#/$defs/FilePart"
          },
          "title": "Payloads",
          "type": "array"
        }
      },
      "required": [
        "control"
      ],
      "title": "ManifestFiles",
      "type": "object"
    },
    "ParentDatasetCard": {
      "additionalProperties": false,
      "description": "A copy of the card for a parent dataset used by a build.\n\nA child manifest stores these cards in ``parent_cards``, indexed by parent alias.\nThe card records the parent's exact release, license, citation, and access requirements.\nReaders can inspect this information without opening the parent dataset.",
      "properties": {
        "metadata": {
          "$ref": "#/$defs/DatasetMetadata"
        }
      },
      "required": [
        "metadata"
      ],
      "title": "ParentDatasetCard",
      "type": "object"
    },
    "PayloadSource": {
      "additionalProperties": false,
      "description": "A release whose payload files this release reads, pinned to the files it reuses.\n\nThe pins copy the source's own manifest records, so checking that the source is still the\nrelease this one was written against needs only the two manifests, no hashing.",
      "properties": {
        "release": {
          "$ref": "#/$defs/DatasetRef"
        },
        "files": {
          "items": {
            "$ref": "#/$defs/FilePart"
          },
          "minItems": 1,
          "title": "Files",
          "type": "array"
        }
      },
      "required": [
        "release",
        "files"
      ],
      "title": "PayloadSource",
      "type": "object"
    },
    "TimeSeriesSpec": {
      "additionalProperties": false,
      "description": "Define the contract for a measurement modality: identity, value unit, dtype, and per-timestep shape.\n\nThe spec carries no unit for time or for a sampling rate. Time offsets are integer microseconds and\na cadence is a Fraction of them, so those units can only be ``second`` and ``hertz``.",
      "properties": {
        "spec_type": {
          "minLength": 1,
          "title": "Spec Type",
          "type": "string"
        },
        "name": {
          "title": "Name",
          "type": "string"
        },
        "unit_value": {
          "anyOf": [
            {
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Unit Value"
        },
        "dtype": {
          "default": "float32",
          "enum": [
            "bool",
            "enum",
            "float32",
            "float64",
            "int8",
            "int16",
            "int32",
            "str",
            "uint8",
            "uint16",
            "uint32"
          ],
          "title": "Dtype",
          "type": "string"
        },
        "categories": {
          "default": [],
          "items": {
            "minLength": 1,
            "type": "string"
          },
          "title": "Categories",
          "type": "array"
        },
        "value_shape": {
          "default": [],
          "items": {
            "exclusiveMinimum": 0,
            "type": "integer"
          },
          "title": "Value Shape",
          "type": "array"
        },
        "dimension_names": {
          "default": [],
          "items": {
            "minLength": 1,
            "type": "string"
          },
          "title": "Dimension Names",
          "type": "array"
        },
        "nullable": {
          "default": false,
          "title": "Nullable",
          "type": "boolean"
        },
        "modality": {
          "$ref": "#/$defs/InputModality",
          "default": "time_series"
        }
      },
      "required": [
        "spec_type",
        "name",
        "unit_value"
      ],
      "title": "TimeSeriesSpec",
      "type": "object"
    },
    "ValuesBackend": {
      "description": "Storage backend for the time-series values plane, recorded as the manifest ``values_backend`` tag.\n\nEach member value is the on-disk tag. This class is a :class:`~enum.StrEnum`, so each member is\nalso a plain ``str``. Each member compares and serializes like its bare tag.",
      "enum": [
        "parquet",
        "zarr"
      ],
      "title": "ValuesBackend",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "description": "The single source of truth a consumer reads to interpret a dataset version.",
  "properties": {
    "dataset_id": {
      "pattern": "^[A-Za-z0-9_-][A-Za-z0-9._-]*/[A-Za-z0-9_-][A-Za-z0-9._-]*$",
      "title": "Dataset Id",
      "type": "string"
    },
    "metadata": {
      "$ref": "#/$defs/DatasetMetadata"
    },
    "files": {
      "$ref": "#/$defs/ManifestFiles"
    },
    "schema": {
      "$ref": "#/$defs/DatasetSchema"
    },
    "counts": {
      "$ref": "#/$defs/ManifestCounts"
    },
    "values_backend": {
      "$ref": "#/$defs/ValuesBackend",
      "default": "parquet"
    },
    "value_encoding": {
      "additionalProperties": {
        "enum": [
          "dictionary",
          "byte_stream_split",
          "plain"
        ],
        "type": "string"
      },
      "title": "Value Encoding",
      "type": "object"
    },
    "parent_cards": {
      "additionalProperties": {
        "$ref": "#/$defs/ParentDatasetCard"
      },
      "title": "Parent Cards",
      "type": "object"
    },
    "lineage": {
      "default": [],
      "items": {
        "$ref": "#/$defs/ParentDatasetCard"
      },
      "title": "Lineage",
      "type": "array"
    },
    "payload_sources": {
      "additionalProperties": {
        "$ref": "#/$defs/PayloadSource"
      },
      "title": "Payload Sources",
      "type": "object"
    },
    "build_env": {
      "$ref": "#/$defs/BuildEnvironment"
    },
    "timef_format_version": {
      "maximum": 1,
      "minimum": 1,
      "title": "Timef Format Version",
      "type": "integer"
    }
  },
  "required": [
    "dataset_id",
    "metadata",
    "files",
    "timef_format_version"
  ],
  "title": "Manifest",
  "type": "object"
}
