{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://law.arxo.io/schema/import-report.schema.json",
  "type": "object",
  "properties": {
    "format": {
      "const": "arxo.import.report/0.1"
    },
    "generator": {
      "type": "string"
    },
    "input_hash": {
      "type": "string"
    },
    "mapping_hash": {
      "type": "string"
    },
    "declarations": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "status": {
            "enum": [
              "rule",
              "fact",
              "catalogue",
              "blocked"
            ]
          },
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "target": {
            "type": [
              "string",
              "null"
            ]
          },
          "anchor": {
            "type": "string"
          },
          "journal": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "expression": {
                  "type": "string"
                },
                "action": {
                  "type": "string"
                },
                "target": {
                  "type": "string"
                }
              },
              "required": [
                "expression",
                "action",
                "target"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "status",
          "code",
          "message",
          "target",
          "anchor",
          "journal"
        ],
        "additionalProperties": false
      }
    },
    "files": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    }
  },
  "required": [
    "format",
    "generator",
    "input_hash",
    "mapping_hash",
    "declarations",
    "files"
  ],
  "additionalProperties": false
}
