{
  "$schema": "https://flow.jig.md/schemas/invocation-contract-0.schema.json",
  "id": "https://jig.md/contracts/child-checkpoint",
  "version": "0.1.0",
  "artifactResults": ["checkpoint"],
  "input": {
    "type": "object",
    "properties": {
      "operationId": {
        "type": "string",
        "minLength": 1,
        "maxLength": 128
      }
    },
    "required": ["operationId"],
    "additionalProperties": false
  },
  "result": {
    "type": "object",
    "properties": {
      "outcome": { "const": "done" },
      "output": {
        "type": "object",
        "properties": {
          "checkpoint": {
            "anyOf": [{ "type": "null" }, { "$ref": "#/$defs/Checkpoint" }]
          }
        },
        "required": ["checkpoint"],
        "additionalProperties": false
      }
    },
    "required": ["outcome", "output"],
    "additionalProperties": false
  },
  "$defs": {
    "Checkpoint": {
      "type": "object",
      "properties": {
        "sequence": {
          "type": "integer",
          "minimum": 1,
          "maximum": 16
        },
        "digest": {
          "type": "string",
          "minLength": 71,
          "maxLength": 71
        },
        "evidence": {},
        "files": {
          "type": "object",
          "additionalProperties": {
            "type": "string",
            "maxLength": 1048576
          },
          "maxProperties": 64
        }
      },
      "required": ["sequence", "digest", "evidence", "files"],
      "additionalProperties": false
    }
  }
}
