{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/vestiarion-xyz/json-schema/vestiarion-xyz-get-milestone-evidence-response-schema.json",
  "title": "GetMilestoneEvidenceResponse",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/vestiarion-xyz-openapi.json#/components/schemas/GetMilestoneEvidenceResponse",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "format": {
          "type": "string",
          "const": "vestiarion-evidence/1"
        },
        "exportedAt": {
          "type": "string"
        },
        "workspace": {
          "type": "object",
          "properties": {
            "slug": {
              "type": "string"
            },
            "name": {
              "type": "string"
            }
          },
          "required": [
            "slug",
            "name"
          ],
          "description": "The workspace the document is of."
        },
        "network": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "enum": [
                "arc-testnet",
                "arc-mainnet"
              ]
            },
            "label": {
              "type": "string",
              "description": "The network's name, as the workspace's pages write it."
            }
          },
          "required": [
            "id",
            "label"
          ],
          "description": "The workspace's network."
        },
        "subject": {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "invoice",
                "milestone"
              ]
            },
            "id": {
              "type": "string"
            },
            "title": {
              "type": "string"
            },
            "payee": {
              "type": "string"
            },
            "amount": {
              "type": "number",
              "description": "The bill's or the milestone's amount."
            },
            "paidAmount": {
              "description": "What was paid, when an early-payment discount took part of the bill off; null when the whole amount was paid, and for anything not paid.",
              "type": [
                "number",
                "null"
              ]
            },
            "currency": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "paid": {
              "type": "boolean"
            },
            "closed": {
              "type": "boolean",
              "description": "Rejected by a person, or closed without paying: it will not be paid."
            },
            "simulated": {
              "type": "boolean",
              "description": "Marked paid by a simulated transfer: nothing moved on chain."
            },
            "onChain": {
              "type": "boolean",
              "description": "Paid by a transaction on chain the chain shows."
            }
          },
          "required": [
            "kind",
            "id",
            "title",
            "payee",
            "amount",
            "paidAmount",
            "currency",
            "status",
            "paid",
            "closed",
            "simulated",
            "onChain"
          ],
          "description": "The payable or milestone the evidence is of."
        },
        "labels": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "type": "object",
            "properties": {
              "words": {
                "type": "string"
              },
              "meaning": {
                "type": "string"
              },
              "facts": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "words",
              "meaning",
              "facts"
            ]
          },
          "description": "The seven words a fact is labelled with, what each means, and how many facts each holds."
        },
        "steps": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "enum": [
                  "agreed",
                  "delivered",
                  "bill",
                  "payee",
                  "decision",
                  "people",
                  "payment",
                  "books",
                  "receipt",
                  "signatures"
                ]
              },
              "title": {
                "type": "string"
              },
              "label": {
                "type": "string",
                "description": "The step's label in words."
              },
              "kind": {
                "type": "string",
                "enum": [
                  "checked",
                  "verified",
                  "stated",
                  "inferred",
                  "missing",
                  "unreachable",
                  "contradicted"
                ]
              },
              "caveat": {
                "type": "string"
              },
              "facts": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "label": {
                      "type": "string",
                      "description": "The fact's label in words."
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "checked",
                        "verified",
                        "stated",
                        "inferred",
                        "missing",
                        "unreachable",
                        "contradicted"
                      ]
                    },
                    "text": {
                      "type": "string"
                    },
                    "who": {
                      "description": "Who stated it: a member by user id, \"a former member\", \"a member\" when the members could not be read, \"the payee\", \"@<login> on GitHub\" for a GitHub bounty; null when the ledger names no one.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "at": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "fill": {
                      "description": "For a missing fact: what would fill it.",
                      "type": "string"
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "link": {
                      "type": "object",
                      "properties": {
                        "href": {
                          "type": "string"
                        },
                        "label": {
                          "type": "string"
                        },
                        "state": {
                          "type": "string",
                          "enum": [
                            "checked",
                            "not_opened",
                            "unreachable",
                            "contradicted",
                            "cannot_open"
                          ]
                        },
                        "reason": {
                          "type": "string"
                        },
                        "given": {
                          "description": "A link a person, a payee or GitHub gave, rather than one Vestiarion built.",
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "href",
                        "label",
                        "state"
                      ],
                      "description": "A link a fact points to, and what its check found."
                    },
                    "warn": {
                      "description": "What it says is bad news, however well it is known.",
                      "type": "boolean",
                      "const": true
                    },
                    "entries": {
                      "type": "array",
                      "items": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "description": "The signed entries it rests on, by `seq`."
                    }
                  },
                  "required": [
                    "label",
                    "kind",
                    "text",
                    "who",
                    "at",
                    "entries"
                  ]
                }
              }
            },
            "required": [
              "id",
              "title",
              "label",
              "kind",
              "facts"
            ]
          }
        },
        "signedEntryProves": {
          "type": "string",
          "description": "What a signed entry proves, and what it does not."
        },
        "checkAnEntry": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "How to check one entry alone: its body hash, its signature and its chain hash."
        },
        "keys": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The first 16 hex characters of the SHA-256 of the key's public SPKI: a key counts only under this id."
              },
              "status": {
                "type": "string",
                "enum": [
                  "active",
                  "retired"
                ]
              },
              "publicKeyPem": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "status",
              "publicKeyPem"
            ],
            "description": "One of the workspace's ledger signing keys, its public half only."
          },
          "description": "The workspace's public keys, active and retired, each under its id: what the entries were signed with."
        },
        "entries": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "seq": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "ts": {
                "type": "string"
              },
              "actor": {
                "type": "string"
              },
              "domain": {
                "type": "string"
              },
              "action": {
                "type": "string"
              },
              "summary": {
                "type": "string"
              },
              "detail": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              "body_hash": {
                "type": "string"
              },
              "signature": {
                "type": "string"
              },
              "prev_hash": {
                "type": "string"
              },
              "hash": {
                "type": "string"
              },
              "signing_key_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "check": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "ok": {
                            "type": "boolean",
                            "const": true
                          }
                        },
                        "required": [
                          "ok"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "ok": {
                            "type": "boolean",
                            "const": false
                          },
                          "reason": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "ok",
                          "reason"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "ok": {
                            "type": "null"
                          },
                          "reason": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "ok",
                          "reason"
                        ]
                      }
                    ],
                    "description": "One entry checked alone: `true` it verifies, `false` it does not, `null` it could not be checked here, for example by a key not known here."
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The server's check of this entry alone. A checker re-checks it rather than trust this field."
              }
            },
            "required": [
              "seq",
              "id",
              "ts",
              "actor",
              "domain",
              "action",
              "summary",
              "detail",
              "body_hash",
              "signature",
              "prev_hash",
              "hash",
              "signing_key_id",
              "check"
            ],
            "description": "A ledger entry in full, as the audit export writes it (snake_case), with the server's check."
          },
          "description": "Every entry the document cites, oldest first, in full, each with the server's check."
        }
      },
      "required": [
        "format",
        "exportedAt",
        "workspace",
        "network",
        "subject",
        "labels",
        "steps",
        "signedEntryProves",
        "checkAnEntry",
        "keys",
        "entries"
      ],
      "description": "One payable's or milestone's evidence, `vestiarion-evidence/1`: the chain its evidence page shows, each fact citing the signed entries it rests on, which it carries in full."
    }
  },
  "required": [
    "data"
  ]
}