{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://w3id.org/aow/schemas/intent.schema.json",
  "title": "Intent",
  "description": "A structured, actionable goal derived from an Objective and interpretable by agents, orchestrators, and people.",
  "type": "object",
  "properties": {
    "id": {
      "$ref": "#/$defs/ref",
      "description": "Stable identifier of the entity. Serialized as the node's IRI."
    },
    "type": {
      "const": "Intent",
      "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"
    },
    "goal_statement": {
      "description": "What the Intent is meant to achieve, stated as an outcome rather than a procedure.",
      "type": "string"
    },
    "constraints": {
      "description": "Free-text constraints that are not (yet) captured as Policies.",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "priority": {
      "description": "Relative priority.",
      "enum": [
        "low",
        "medium",
        "high",
        "critical"
      ]
    },
    "acceptable_risk_band": {
      "description": "The level of residual risk the requester accepts.",
      "enum": [
        "low",
        "medium",
        "high"
      ]
    },
    "status": {
      "description": "Where the Intent is in its life.",
      "enum": [
        "proposed",
        "active",
        "fulfilled",
        "abandoned"
      ]
    },
    "serves_objective": {
      "$ref": "#/$defs/ref",
      "description": "The Objective an Intent was derived from."
    },
    "shaped_by": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ref"
      },
      "description": "Context that gives the Intent or Task its situational meaning."
    },
    "concerns": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ref"
      },
      "description": "The Work Item the Intent, Task, or Action is about."
    },
    "constrained_by": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ref"
      },
      "description": "Policies that apply."
    },
    "requires_assurance": {
      "$ref": "#/$defs/ref",
      "description": "The highest Assurance Level at which this work may be done. The effective level is the lowest of the Intent's, the Task's, the Skill's, and the performing Agent's autonomy_level."
    }
  },
  "patternProperties": {
    "^[A-Za-z][A-Za-z0-9_-]*:[A-Za-z0-9_-]+$": {
      "description": "Extension property, namespaced with a prefix."
    }
  },
  "additionalProperties": false,
  "required": [
    "id",
    "type",
    "goal_statement",
    "serves_objective",
    "requires_assurance"
  ],
  "$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."
    }
  }
}
