{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openeik.org/schemas/0.6/weight/accepted.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 a record keeps on purpose",
  "description": "The heavy forms a record is part of and keeps on purpose (Part III, 15.7, rule 5: for each, the code of the warning of weight it keeps, a reason for people, and who keeps it and when. A check of weight warns of no heavy form one of whose records keeps its code, and of the others as before; a command processor gives no advisory of a code on a record that keeps it. Its by is modelled on a detail item's provenance (Part XIV, 3.2): a person by their id, or an agent, its name and version, and the person it acts for.",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "code": {
        "description": "The code of the warning of weight kept: one of Part III, 15.7's, or an application's own under its registered prefix (Part I, 11.1), as acme:copied-geometry.",
        "anyOf": [
          {
            "type": "string",
            "enum": [
              "weight-hatch-strokes",
              "weight-split-path",
              "weight-duplicate-items",
              "weight-arc-points",
              "weight-precision",
              "weight-copies",
              "weight-same-types",
              "weight-mesh-prism",
              "weight-shared-shape",
              "weight-svg-path",
              "weight-svg-hatch",
              "weight-rebuild",
              "weight-full-replace"
            ]
          },
          {
            "type": "string",
            "maxLength": 80,
            "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*:[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
          }
        ]
      },
      "reason": {
        "description": "Why the form is kept, for people: a survey's points, a drawing kept as it was traced, elements that are to change apart.",
        "type": "string",
        "minLength": 1,
        "maxLength": 200
      },
      "by": {
        "description": "Who keeps it, as a detail item's provenance says who made it (Part XIV, 3.2): a person by their id; or an agent, its name and version, and the person it acts for.",
        "type": "object",
        "properties": {
          "person": {
            "$ref": "../drawings/defs.schema.json#/$defs/person"
          },
          "agent": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "version": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              }
            },
            "required": [
              "name",
              "version"
            ],
            "x-eik-closed": true
          },
          "actingFor": {
            "$ref": "../drawings/defs.schema.json#/$defs/person"
          }
        },
        "oneOf": [
          {
            "required": [
              "person"
            ],
            "not": {
              "anyOf": [
                {
                  "required": [
                    "agent"
                  ]
                },
                {
                  "required": [
                    "actingFor"
                  ]
                }
              ]
            }
          },
          {
            "required": [
              "agent",
              "actingFor"
            ],
            "not": {
              "required": [
                "person"
              ]
            }
          }
        ],
        "x-eik-closed": true
      },
      "at": {
        "description": "When it was said, in UTC.",
        "$ref": "../drawings/defs.schema.json#/$defs/time"
      }
    },
    "required": [
      "code",
      "reason"
    ],
    "x-eik-closed": true
  },
  "minItems": 1,
  "maxItems": 20
}
