{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openeik.org/schemas/0.5/weight/answer.schema.json",
  "$comment": "OpenEik 0.5: folded by tools/fold-schemas-0.5.mjs from the proposal weight, which 0.5 makes a rule (open questions, 138). Written by hand, not generated.",
  "title": "The weight line of an answer",
  "description": "What an accepted batch weighs (Part V, 9.1: the records it wrote and removed, by kind; the session's so far, where the caller keeps one; the heavy forms the detectors of weight find in what the batch wrote, each with its compact form; the advisories of section 15.8 it gave, each the structured form of a warning of the answer's warnings; and the advisories it did not give again, each with how many times it came in the session.",
  "type": "object",
  "properties": {
    "written": {
      "description": "The records the batch wrote, by kind: a list's name (elements, types, views, sheets, …), and details for a view's detail items.",
      "$ref": "#/$defs/counts"
    },
    "removed": {
      "description": "The records the batch removed, by kind.",
      "$ref": "#/$defs/counts"
    },
    "session": {
      "description": "The records the session wrote so far, this batch's with them, by kind, where the caller keeps a session.",
      "$ref": "#/$defs/counts"
    },
    "heavy": {
      "description": "The heavy forms the detectors of weight find in what the batch wrote (Part III, 15.7's codes), each with the records it is in, how many, its compact form, what that saves and, for a view's items, the view. Never weight-copies: whether elements written apart are a group is a whole model's check.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "pattern": "^weight-[a-z-]+$"
          },
          "ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "compact": {
            "type": "object",
            "required": [
              "kind"
            ]
          },
          "saves": {
            "$ref": "#/$defs/counts"
          },
          "message": {
            "type": "string"
          },
          "data": {
            "type": "object"
          },
          "view": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "ids",
          "count",
          "compact",
          "saves"
        ]
      }
    },
    "advice": {
      "description": "The advisories the batch gave (Part III, 15.8, rule 3), once each for a code and a record in the session: each its code and rule, the command it was given on, the record or the view it is about, its message, the command or the batch that does the same lighter, ready to run, where there is one, what that saves, and the guide's topic.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "enum": [
              "weight-rebuild",
              "weight-full-replace"
            ]
          },
          "rule": {
            "type": "string"
          },
          "command": {
            "type": "integer",
            "minimum": 0
          },
          "target": {
            "type": "string",
            "minLength": 1
          },
          "message": {
            "type": "string"
          },
          "compact": {
            "description": "A command, or {kind: \"batch\", commands} for several.",
            "type": "object",
            "required": [
              "kind"
            ]
          },
          "saves": {
            "$ref": "#/$defs/counts"
          },
          "guide": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "rule",
          "command",
          "target",
          "message",
          "saves",
          "guide"
        ],
        "x-eik-closed": true
      }
    },
    "repeats": {
      "description": "The advisories that came again and were not given again, each with how many times it came in the session.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "enum": [
              "weight-rebuild",
              "weight-full-replace"
            ]
          },
          "target": {
            "type": "string",
            "minLength": 1
          },
          "count": {
            "type": "integer",
            "minimum": 2
          }
        },
        "required": [
          "code",
          "target",
          "count"
        ],
        "x-eik-closed": true
      }
    }
  },
  "required": [
    "written",
    "heavy"
  ],
  "x-eik-closed": true,
  "$defs": {
    "counts": {
      "type": "object",
      "additionalProperties": {
        "type": "integer",
        "minimum": 0
      }
    }
  }
}
