{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/shruggietech/insonic/v0.0.0/schemas/v0.0.0/import-manifest.schema.json",
  "title": "insonic import manifest",
  "description": "Batch import input for the CLI and its GUI wrapper. Syntax validation precedes application validation of source access, calendar values, timezone/DST policy and admission. No approval per item is required for already configured routing.",
  "type": "object",
  "properties": {
    "schema_version": {
      "const": "0.0.0",
      "description": "Version of the insonic document contract."
    },
    "kind": {
      "const": "import-manifest",
      "description": "Document discriminator used by the master registry."
    },
    "defaults": {
      "type": "object",
      "description": "Batch defaults, overridden by explicit per-item fields. Date and timestamp are mutually exclusive within this object.",
      "properties": {
        "originated_at": {
          "$ref": "common.schema.json#/$defs/wallTimestamp",
          "description": "Entered recording timestamp, distinct from import, publication and file modification times."
        },
        "originated_on": {
          "$ref": "common.schema.json#/$defs/calendarDate",
          "description": "Entered recording date when the recording time is unknown."
        },
        "timezone": {
          "$ref": "common.schema.json#/$defs/timezone",
          "description": "Timezone for unzoned recording timestamps; local is resolved once for the batch."
        },
        "dst_fold": {
          "type": "string",
          "enum": [
            "earlier",
            "later"
          ],
          "description": "Explicit choice of offset for an ambiguous repeated daylight-saving wall time."
        },
        "dst_gap": {
          "type": "string",
          "const": "shift-forward",
          "description": "Explicit policy to resolve a nonexistent wall time by shifting forward; absent means no silent correction."
        },
        "copy": {
          "type": "boolean",
          "default": true,
          "description": "True admits a managed copy into the selected artifact store; false keeps an explicitly tracked local reference."
        },
        "preset": {
          "type": "string",
          "minLength": 1,
          "description": "Configured processing/import preset name or ID; does not embed provider configuration.",
          "examples": [
            "local"
          ]
        },
        "extensions": {
          "$ref": "common.schema.json#/$defs/extensions",
          "description": "Optional nonsecret input annotations."
        }
      },
      "not": {
        "required": [
          "originated_at",
          "originated_on"
        ],
        "type": "object"
      },
      "additionalProperties": false
    },
    "items": {
      "type": "array",
      "minItems": 1,
      "description": "Inputs in deterministic admission order, with independent partial-result reporting.",
      "items": {
        "type": "object",
        "description": "One ordered source input. Per-item fields override batch defaults. Source and subtitle paths resolve relative to the manifest unless explicitly absolute.",
        "properties": {
          "source": {
            "type": "string",
            "minLength": 1,
            "description": "Local source path or acquisition-adapter source locator. Credentials and temporary signed URLs must be resolved separately.",
            "examples": [
              "audio/session.wav"
            ]
          },
          "subtitle": {
            "type": "string",
            "minLength": 1,
            "description": "Optional supplied subtitle path attached to this item; missing subtitles do not block import.",
            "examples": [
              "video/session.srt"
            ]
          },
          "originated_at": {
            "$ref": "common.schema.json#/$defs/wallTimestamp",
            "description": "Entered recording timestamp, distinct from import, publication and file modification times."
          },
          "originated_on": {
            "$ref": "common.schema.json#/$defs/calendarDate",
            "description": "Entered recording date when the recording time is unknown."
          },
          "timezone": {
            "$ref": "common.schema.json#/$defs/timezone",
            "description": "Timezone for unzoned recording timestamps; local is resolved once for the batch."
          },
          "dst_fold": {
            "type": "string",
            "enum": [
              "earlier",
              "later"
            ],
            "description": "Explicit choice of offset for an ambiguous repeated daylight-saving wall time."
          },
          "dst_gap": {
            "type": "string",
            "const": "shift-forward",
            "description": "Explicit policy to resolve a nonexistent wall time by shifting forward; absent means no silent correction."
          },
          "copy": {
            "type": "boolean",
            "default": true,
            "description": "True admits a managed copy into the selected artifact store; false keeps an explicitly tracked local reference."
          },
          "preset": {
            "type": "string",
            "minLength": 1,
            "description": "Configured processing/import preset name or ID; does not embed provider configuration.",
            "examples": [
              "local"
            ]
          },
          "extensions": {
            "$ref": "common.schema.json#/$defs/extensions",
            "description": "Optional nonsecret input annotations."
          }
        },
        "required": [
          "source"
        ],
        "not": {
          "required": [
            "originated_at",
            "originated_on"
          ],
          "type": "object"
        },
        "additionalProperties": false
      }
    },
    "extensions": {
      "$ref": "common.schema.json#/$defs/extensions",
      "description": "Optional namespaced additions preserved without changing the core contract."
    }
  },
  "required": [
    "schema_version",
    "kind",
    "items"
  ],
  "additionalProperties": false,
  "examples": [
    {
      "schema_version": "0.0.0",
      "kind": "import-manifest",
      "defaults": {
        "copy": true,
        "timezone": "America/New_York",
        "preset": "local"
      },
      "items": [
        {
          "source": "audio/session.wav",
          "originated_at": "2026-10-04T14:30:00"
        },
        {
          "source": "video/session.mp4",
          "originated_on": "2026-10-03",
          "subtitle": "video/session.srt"
        }
      ]
    }
  ]
}
