{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://thesoftwarelens.com/saacip/0.2/schemas/statement.schema.json",
  "$comment": "SaaCIP 0.2 (https://thesoftwarelens.com/saacip/). Licensed under the Apache License 2.0.",
  "title": "SaaCIP 0.2 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,
          "description": "Outcomes that count as accepted (under the Resident profile, real). Required in 0.2 for 0.1 readers; replaced by accepted in 1.0."
        },
        "false_alarms": {
          "type": "integer",
          "minimum": 0,
          "description": "Outcomes that count as rejected (under the Resident profile, false_alarm). Required in 0.2 for 0.1 readers; replaced by rejected in 1.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."
        },
        "accepted": {
          "type": "integer",
          "minimum": 0,
          "description": "Outcomes that count as the core value accepted (section 7.4). Added in 0.2; required from 1.0."
        },
        "rejected": {
          "type": "integer",
          "minimum": 0,
          "description": "Outcomes that count as the core value rejected (section 7.4). Added in 0.2; required from 1.0."
        },
        "handed_off": {
          "type": "integer",
          "minimum": 0,
          "description": "Work items handed to another hire through the hub (section 6.5). Added in 0.2."
        },
        "received": {
          "type": "integer",
          "minimum": 0,
          "description": "Work items taken up from a hand-off (section 6.5). Added in 0.2."
        }
      }
    },
    "ext": {
      "$ref": "common.schema.json#/$defs/ext"
    }
  }
}
