{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "ace://schemas/artifact-manifest/1.1.0",
  "title": "ACE Artifact Manifest",
  "oneOf": [
    {
      "type": "object",
      "required": [
        "artifact_id",
        "artifact_path",
        "producer_module",
        "spec_version",
        "req_ids",
        "timestamp",
        "checksum",
        "confidence_level",
        "evidence_ref"
      ],
      "additionalProperties": false,
      "properties": {
        "artifact_id": {
          "type": "string",
          "minLength": 4
        },
        "artifact_path": {
          "type": "string",
          "minLength": 1
        },
        "producer_module": {
          "type": "string",
          "pattern": "^(capability|agent)-[a-z0-9-]+$"
        },
        "spec_version": {
          "type": "string",
          "minLength": 1
        },
        "req_ids": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "timestamp": {
          "type": "string",
          "format": "date-time"
        },
        "checksum": {
          "type": "string",
          "pattern": "^sha256:[a-f0-9]{64}$"
        },
        "confidence_level": {
          "type": "string",
          "enum": [
            "low",
            "medium",
            "high",
            "WIP",
            "Draft",
            "Verified"
          ]
        },
        "evidence_ref": {
          "type": "string",
          "minLength": 1
        },
        "dependencies": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "evidence_refs": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string",
            "minLength": 1
          }
        }
      }
    },
    {
      "type": "object",
      "required": [
        "schema_version",
        "updated_at",
        "artifacts"
      ],
      "additionalProperties": false,
      "properties": {
        "schema_version": {
          "type": "string",
          "const": "1.1.0"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        },
        "artifacts": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "artifact_id",
              "artifact_path",
              "producer_module",
              "spec_version",
              "req_ids",
              "timestamp",
              "checksum",
              "confidence_level",
              "evidence_ref"
            ],
            "additionalProperties": false,
            "properties": {
              "artifact_id": {
                "type": "string",
                "minLength": 4
              },
              "artifact_path": {
                "type": "string",
                "minLength": 1
              },
              "producer_module": {
                "type": "string",
                "pattern": "^(capability|agent)-[a-z0-9-]+$"
              },
              "spec_version": {
                "type": "string",
                "minLength": 1
              },
              "req_ids": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "timestamp": {
                "type": "string",
                "format": "date-time"
              },
              "checksum": {
                "type": "string",
                "pattern": "^sha256:[a-f0-9]{64}$"
              },
              "confidence_level": {
                "type": "string",
                "enum": [
                  "low",
                  "medium",
                  "high",
                  "WIP",
                  "Draft",
                  "Verified"
                ]
              },
              "evidence_ref": {
                "type": "string",
                "minLength": 1
              },
              "dependencies": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "evidence_refs": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              }
            }
          }
        }
      }
    }
  ]
}
