{
  "$defs": {
    "FileEntry": {
      "description": "One file of an artifact: its store-relative name, size, and content hash.",
      "properties": {
        "name": {
          "description": "Artifact-relative posix path.",
          "title": "Name",
          "type": "string"
        },
        "size": {
          "description": "Bytes.",
          "title": "Size",
          "type": "integer"
        },
        "sha256": {
          "description": "Hex SHA-256 of the content.",
          "title": "Sha256",
          "type": "string"
        }
      },
      "required": [
        "name",
        "size",
        "sha256"
      ],
      "title": "FileEntry",
      "type": "object"
    },
    "ToolVersions": {
      "description": "Provenance of the tools that produced an artifact; never part of its key.",
      "properties": {
        "femforge": {
          "default": "0.1.0",
          "description": "The femforge release that produced it.",
          "title": "Femforge",
          "type": "string"
        },
        "code_sha": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The producing checkout's commit (``-dirty`` when uncommitted changes were present).",
          "title": "Code Sha"
        },
        "gmsh": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "gmsh version, when meshing was involved.",
          "title": "Gmsh"
        },
        "elmer": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "ElmerSolver version, when a solve was involved.",
          "title": "Elmer"
        }
      },
      "title": "ToolVersions",
      "type": "object"
    }
  },
  "description": "The commit marker plus provenance of one stored artifact.",
  "properties": {
    "kind": {
      "description": "The artifact kind name.",
      "title": "Kind",
      "type": "string"
    },
    "key": {
      "description": "The content key the artifact is stored under.",
      "title": "Key",
      "type": "string"
    },
    "name": {
      "default": "",
      "description": "The ``<adjective>-<noun>-<hash8>`` store directory name; always derived from ``key``, never read from input.",
      "title": "Name",
      "type": "string"
    },
    "producer_version": {
      "description": "The kind's producer version at publish time.",
      "title": "Producer Version",
      "type": "integer"
    },
    "spec_type": {
      "description": "``module:QualName`` of the spec model, for humans reading the store.",
      "title": "Spec Type",
      "type": "string"
    },
    "spec": {
      "additionalProperties": true,
      "description": "The exact payload that was hashed into ``key``.",
      "title": "Spec",
      "type": "object"
    },
    "files": {
      "description": "Every file the artifact consists of.",
      "items": {
        "$ref": "#/$defs/FileEntry"
      },
      "title": "Files",
      "type": "array"
    },
    "created_at": {
      "description": "When it was published (UTC).",
      "format": "date-time",
      "title": "Created At",
      "type": "string"
    },
    "producer_host": {
      "description": "Hostname of the machine that produced it.",
      "title": "Producer Host",
      "type": "string"
    },
    "producer_pid": {
      "description": "Process id of the producer, for correlating logs.",
      "title": "Producer Pid",
      "type": "integer"
    },
    "tools": {
      "$ref": "#/$defs/ToolVersions",
      "description": "Tool versions involved."
    }
  },
  "required": [
    "kind",
    "key",
    "producer_version",
    "spec_type",
    "spec",
    "created_at",
    "producer_host",
    "producer_pid"
  ],
  "title": "ArtifactRecord",
  "type": "object"
}
