{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://w3id.org/aow/schemas/result.schema.json",
  "title": "Result",
  "description": "The immediate, atomic effect or output of an Action.",
  "type": "object",
  "properties": {
    "id": {
      "$ref": "#/$defs/ref",
      "description": "Stable identifier of the entity. Serialized as the node's IRI."
    },
    "type": {
      "const": "Result",
      "description": "The AOW class of the entity (for example, \"Intent\")."
    },
    "label": {
      "description": "Short human-readable name.",
      "type": "string"
    },
    "description": {
      "description": "Longer human-readable explanation.",
      "type": "string"
    },
    "version": {
      "description": "Version of this entity definition, ideally a semantic version such as \"1.4.2\".",
      "type": "string"
    },
    "created_at": {
      "description": "When this entity or version was created.",
      "type": "string",
      "format": "date-time"
    },
    "created_by": {
      "description": "The Actor responsible for creating this entity or version.",
      "$ref": "#/$defs/ref"
    },
    "revision_of": {
      "description": "The earlier version this entity revises.",
      "$ref": "#/$defs/ref"
    },
    "status": {
      "description": "Whether the Action achieved what it set out to.",
      "enum": [
        "success",
        "partial",
        "failure"
      ]
    },
    "summary": {
      "description": "What the Result is, in words.",
      "type": "string"
    },
    "artifacts": {
      "description": "Documents, records, or state changes the Result produced.",
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri-reference"
      }
    },
    "approved_by": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ref"
      },
      "description": "People who confirmed the Action, Plan, or Result before it took effect. Required whenever the effective Assurance Level or a Policy calls for human confirmation."
    },
    "generated_by": {
      "$ref": "#/$defs/ref",
      "description": "The Action that produced this Result, Signal, or Observation."
    },
    "affects": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ref"
      },
      "description": "Work Items whose state the Result changed."
    },
    "has_confidence": {
      "$ref": "#/$defs/ref",
      "description": "The Confidence attached to this Result, Observation, Action, or Plan."
    },
    "contributes_to": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ref"
      },
      "description": "Outcomes this Result counts toward."
    }
  },
  "patternProperties": {
    "^[A-Za-z][A-Za-z0-9_-]*:[A-Za-z0-9_-]+$": {
      "description": "Extension property, namespaced with a prefix."
    }
  },
  "additionalProperties": false,
  "required": [
    "id",
    "type",
    "generated_by"
  ],
  "$defs": {
    "ref": {
      "type": "string",
      "minLength": 1,
      "description": "Identifier of an entity: an IRI, a compact IRI such as aow:AL2, or an id relative to the document base."
    }
  }
}
