{
  "$defs": {
    "AllowedExample": {
      "additionalProperties": false,
      "description": "A public project function that does what a contract report shows from a place its contract\nallows, and the file defining it (the report's help names it).",
      "properties": {
        "fqn": {
          "description": "Dotted fully qualified name (`pkg.store.Store.add`).",
          "type": "string"
        },
        "path": {
          "description": "The file that defines it, as reports print paths.",
          "type": "string"
        }
      },
      "required": [
        "fqn",
        "path"
      ],
      "type": "object"
    },
    "Certainty": {
      "description": "Whether a report can be wrong about the code (ADR-018). A report's claim is a conjunction of\npremises (its rule page lists them under \"What a report states\").",
      "oneOf": [
        {
          "const": "exact",
          "description": "Every premise of the claim was established, under the assumptions R1-R5, and the rule's\nreports were checked on the measurement corpus with none wrong: a wrong one is a bug.",
          "type": "string"
        },
        {
          "const": "heuristic",
          "description": "A premise of the claim may be unknown, which does not stop the report: it can be wrong\nabout the code.",
          "type": "string"
        }
      ]
    },
    "ContractLocation": {
      "additionalProperties": false,
      "description": "Where the configuration defines a contract a report is of, or the entry of it the report\nnames: where a configuration file writes it, or the place the contract's `source` or\n`entry-sources` names instead.",
      "properties": {
        "column": {
          "description": "The 1-based byte column (1 for a place `source` or `entry-sources` names).",
          "format": "uint32",
          "minimum": 0,
          "type": "integer"
        },
        "line": {
          "description": "The 1-based line.",
          "format": "uint32",
          "minimum": 0,
          "type": "integer"
        },
        "message": {
          "description": "What is there: the contract (``write-owners contract `fields` ``), or the entry of it\n(``` `targets` entry `pkg.m.Model.fields` ```), with the group that holds it.",
          "type": "string"
        },
        "path": {
          "description": "The file, as reports print paths.",
          "type": "string"
        }
      },
      "required": [
        "path",
        "line",
        "column",
        "message"
      ],
      "type": "object"
    },
    "Diagnostic": {
      "additionalProperties": false,
      "properties": {
        "allowed_examples": {
          "description": "The public project functions that do what a contract report shows from a place its\ncontract allows, at most three, by fully qualified name: its help names them. Empty for the other\nreports and when there is none; written to JSON only when not empty.",
          "items": {
            "$ref": "#/$defs/AllowedExample"
          },
          "type": "array"
        },
        "blocker": {
          "description": "What keeps the rewrite of an `OPT` report from being safe; none otherwise.",
          "type": [
            "string",
            "null"
          ]
        },
        "certainty": {
          "$ref": "#/$defs/Certainty",
          "description": "The certainty of the report, written by every output format: its rule's, or heuristic\nwhere the report did not establish a premise its rule's exact reports have (an `OPT`\nreport whose rewrite is not proven)."
        },
        "column": {
          "description": "The 1-based byte column of the report.",
          "format": "uint32",
          "minimum": 0,
          "type": "integer"
        },
        "contract_locations": {
          "description": "Where the configuration defines the contracts a contract report is of: each contract,\nthen the entry of it the report names as its target. Written to JSON only when not\nempty; SARIF and the language server add them to the related locations.",
          "items": {
            "$ref": "#/$defs/ContractLocation"
          },
          "type": "array"
        },
        "evidence": {
          "description": "What shows the claim holds, when the rule keeps it.",
          "type": [
            "string",
            "null"
          ]
        },
        "fix": {
          "description": "The edits of the report's fix, as byte spans of `path`; none when the report has no fix.",
          "items": {
            "$ref": "#/$defs/TextEdit"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "help": {
          "description": "What to do about it (`= help:` in the full output); `None` when the rule has no advice\nfor the report.",
          "type": [
            "string",
            "null"
          ]
        },
        "line": {
          "description": "The 1-based line of the report.",
          "format": "uint32",
          "minimum": 0,
          "type": "integer"
        },
        "message": {
          "description": "One sentence saying what happens, without advice.",
          "type": "string"
        },
        "path": {
          "description": "The file, as `heki check` prints paths: relative to the working directory, with forward\nslashes.",
          "type": "string"
        },
        "qualname": {
          "description": "The qualified name of the function the report is in; empty at module level.",
          "type": "string"
        },
        "related": {
          "description": "The other places the report is about: the hops of a call chain, a definition.",
          "items": {
            "$ref": "#/$defs/RelatedLocation"
          },
          "type": "array"
        },
        "rule_code": {
          "description": "The code of the rule that reports (`EFF101`).",
          "type": "string"
        },
        "rule_slug": {
          "description": "The name of the rule (`async-blocking-call`).",
          "type": "string"
        },
        "severity": {
          "$ref": "#/$defs/Severity",
          "description": "The severity of the report, from its rule or the configuration."
        },
        "sites": {
          "description": "Distinct violation sites the diagnostic stands for (at least 1): a contract report at the\ncaller of a private helper covers every write, read, or call inside it, and an effect\nboundary report every forbidden site its scope function reaches. Ratchet baselines count\nsites, so a second violation behind a recorded report is a regression. Written to JSON\nonly when above 1.",
          "format": "uint32",
          "minimum": 0,
          "type": "integer"
        },
        "span": {
          "$ref": "#/$defs/Span",
          "description": "The byte span of the reported code in `path`."
        },
        "target": {
          "description": "What the report is about: the call, name, or module it names.",
          "type": "string"
        },
        "unresolved_sites": {
          "description": "Every site of an effect boundary's `unresolved-calls`, `unresolved-writes`, or\n`unresolved-reads` report (`sites` counts them), ordered by path, line, and column: those\nthe walk from the scope function records, not the code behind them, which heki does not\nfollow. Written to JSON only when not empty; no other output writes them.",
          "items": {
            "$ref": "#/$defs/UnresolvedSite"
          },
          "type": "array"
        }
      },
      "required": [
        "path",
        "line",
        "column",
        "span",
        "qualname",
        "rule_code",
        "rule_slug",
        "target",
        "severity",
        "certainty",
        "message",
        "help",
        "evidence",
        "blocker",
        "related",
        "fix"
      ],
      "type": "object"
    },
    "ReadAccess": {
      "description": "The `access` of an [`UnresolvedRead`].",
      "enum": [
        "read"
      ],
      "type": "string"
    },
    "RelatedLocation": {
      "additionalProperties": false,
      "description": "Related jump location (e.g., each hop in an `EFF101` or `MUT201` call chain for LSP).",
      "properties": {
        "column": {
          "description": "The 1-based byte column.",
          "format": "uint32",
          "minimum": 0,
          "type": "integer"
        },
        "line": {
          "description": "The 1-based line.",
          "format": "uint32",
          "minimum": 0,
          "type": "integer"
        },
        "message": {
          "description": "What the location is: the call of a hop, for instance.",
          "type": "string"
        },
        "path": {
          "description": "The file, as reports print paths.",
          "type": "string"
        },
        "span": {
          "$ref": "#/$defs/Span",
          "description": "Byte span in `path` (the LSP server converts it with the file's own text)."
        }
      },
      "required": [
        "path",
        "line",
        "column",
        "span",
        "message"
      ],
      "type": "object"
    },
    "Severity": {
      "description": "Diagnostic severity override (matches `t-linter` / `ty`).",
      "enum": [
        "error",
        "warning"
      ],
      "type": "string"
    },
    "Span": {
      "additionalProperties": false,
      "description": "Byte-offset span in the original Python source file.",
      "properties": {
        "end": {
          "description": "The offset after the last byte.",
          "format": "uint32",
          "minimum": 0,
          "type": "integer"
        },
        "start": {
          "description": "The offset of the first byte.",
          "format": "uint32",
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "start",
        "end"
      ],
      "type": "object"
    },
    "TextEdit": {
      "additionalProperties": false,
      "description": "Minimal byte-span text edit (preserves formatting and comments).",
      "properties": {
        "replacement": {
          "description": "The text that takes their place.",
          "type": "string"
        },
        "span": {
          "$ref": "#/$defs/Span",
          "description": "The bytes to replace."
        }
      },
      "required": [
        "span",
        "replacement"
      ],
      "type": "object"
    },
    "UnresolvedCall": {
      "additionalProperties": false,
      "description": "A call whose code heki does not follow: a call it resolves to no function, or a call of a\nfunction whose body it does not model or only a stub declares.",
      "properties": {
        "callee": {
          "description": "The method or value called (`get` of `table.get(...)`, `handler` of `handler(...)`),\n`null` for a value computed in place (`make()(...)`); for a body heki does not follow,\nthat function, by fully qualified name.",
          "type": [
            "string",
            "null"
          ]
        },
        "column": {
          "description": "The 1-based byte column of the call.",
          "format": "uint32",
          "minimum": 0,
          "type": "integer"
        },
        "function": {
          "description": "The function holding the call, by fully qualified name; the scope function itself, at\nits definition, when its own body is the one heki does not follow.",
          "type": "string"
        },
        "line": {
          "description": "The 1-based line of the call.",
          "format": "uint32",
          "minimum": 0,
          "type": "integer"
        },
        "parameter": {
          "description": "The parameter the reason is about (`unannotated-parameter`, `unresolved-annotation`).",
          "type": [
            "string",
            "null"
          ]
        },
        "path": {
          "description": "The file, as reports print paths.",
          "type": "string"
        },
        "reason": {
          "description": "Why heki does not follow it: the reasons `heki recommend` gives for a call it resolves\nto no function (`unannotated-parameter`, `callable-value`, `call-result`,\n`unknown-member`, ...), `unmodeled-body` for a body heki does not model (`eval`, a body\ntoo large), or `stub-body` for a function only a stub declares.",
          "type": "string"
        }
      },
      "required": [
        "path",
        "line",
        "column",
        "function",
        "callee",
        "reason",
        "parameter"
      ],
      "type": "object"
    },
    "UnresolvedRead": {
      "additionalProperties": false,
      "description": "A read, on an object of unknown class, of an attribute the boundary names, or a read under a\nname heki cannot read on an object that may have one.",
      "properties": {
        "access": {
          "$ref": "#/$defs/ReadAccess",
          "description": "`read`: what tells a read from a write, which has the other fields too."
        },
        "attribute": {
          "description": "The attribute read; `null` for a name computed at run time (`getattr(obj, name)`,\n`vars(obj).pop(name)`).",
          "type": [
            "string",
            "null"
          ]
        },
        "column": {
          "description": "The 1-based byte column of the read.",
          "format": "uint32",
          "minimum": 0,
          "type": "integer"
        },
        "function": {
          "description": "The function holding the read, by fully qualified name.",
          "type": "string"
        },
        "kind": {
          "description": "How it is read: `direct_attr`, `get_attr` (also `object.__getattribute__`), `has_attr`,\nor `dict_direct` (an item of `__dict__` or `vars(obj)`).",
          "type": "string"
        },
        "line": {
          "description": "The 1-based line of the read.",
          "format": "uint32",
          "minimum": 0,
          "type": "integer"
        },
        "path": {
          "description": "The file, as reports print paths.",
          "type": "string"
        }
      },
      "required": [
        "path",
        "line",
        "column",
        "function",
        "attribute",
        "kind",
        "access"
      ],
      "type": "object"
    },
    "UnresolvedSite": {
      "anyOf": [
        {
          "$ref": "#/$defs/UnresolvedCall"
        },
        {
          "$ref": "#/$defs/UnresolvedRead"
        },
        {
          "$ref": "#/$defs/UnresolvedWrite"
        }
      ],
      "description": "A site an effect boundary with `unresolved = \"report\"` cannot judge, one of those its\n`unresolved-calls`, `unresolved-writes`, or `unresolved-reads` report stands for."
    },
    "UnresolvedWrite": {
      "additionalProperties": false,
      "description": "A write, on an object of unknown class, of an attribute the boundary names.",
      "properties": {
        "attribute": {
          "description": "The attribute written; `null` for a name computed at run time (`setattr(obj, name, v)`).",
          "type": [
            "string",
            "null"
          ]
        },
        "column": {
          "description": "The 1-based byte column of the write.",
          "format": "uint32",
          "minimum": 0,
          "type": "integer"
        },
        "function": {
          "description": "The function holding the write, by fully qualified name.",
          "type": "string"
        },
        "kind": {
          "description": "How it is written, as `heki inspect` names write kinds (`direct_attr`, `set_attr`,\n`container_mut`, ...).",
          "type": "string"
        },
        "line": {
          "description": "The 1-based line of the write.",
          "format": "uint32",
          "minimum": 0,
          "type": "integer"
        },
        "path": {
          "description": "The file, as reports print paths.",
          "type": "string"
        }
      },
      "required": [
        "path",
        "line",
        "column",
        "function",
        "attribute",
        "kind"
      ],
      "type": "object"
    }
  },
  "$id": "https://heki.koxudaxi.dev/schemas/check-1.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "items": {
    "$ref": "#/$defs/Diagnostic"
  },
  "title": "heki check --output-format json",
  "type": "array"
}
