{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://thesoftwarelens.com/saacip/0.1/schemas/statement.schema.json",
  "$comment": "SaaCIP 0.1 (https://thesoftwarelens.com/saacip/). Licensed under the Apache License 2.0.",
  "title": "SaaCIP 0.1 statement",
  "description": "The capability's account of a hire, built from its own receipts (section 7.5).",
  "type": "object",
  "required": [
    "hire_id",
    "kind",
    "track_record"
  ],
  "properties": {
    "hire_id": {
      "type": "string"
    },
    "kind": {
      "$ref": "common.schema.json#/$defs/hireKind"
    },
    "reason": {
      "type": "string",
      "description": "Why the hire ended, when it has."
    },
    "track_record": {
      "type": "object",
      "required": [
        "findings",
        "reported",
        "judged",
        "real",
        "false_alarms",
        "share_real",
        "actions"
      ],
      "properties": {
        "findings": {
          "type": "integer",
          "minimum": 0
        },
        "reported": {
          "type": "integer",
          "minimum": 0
        },
        "judged": {
          "type": "integer",
          "minimum": 0
        },
        "real": {
          "type": "integer",
          "minimum": 0
        },
        "false_alarms": {
          "type": "integer",
          "minimum": 0
        },
        "share_real": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0,
          "maximum": 1,
          "description": "real divided by judged; null until something has been judged."
        },
        "actions": {
          "type": "object",
          "additionalProperties": {
            "type": "integer",
            "minimum": 0
          },
          "description": "Counts of declared actions by result: done, dry_run, failed, rejected, refused, and awaiting for those not yet decided."
        }
      }
    },
    "ext": {
      "$ref": "common.schema.json#/$defs/ext"
    }
  }
}
