{
  "title": "Entity Spec",
  "description": "EntitySpec is the body of a `kind: Entity` manifest.\n\nThere is deliberately no `version` field. One used to exist as a\nrequired-but-unread property — the JSON Schema demanded it, yet\nValidateEntitySpec never looked at it and no runtime path consumed it.\nStorage-shape changes are detected by the migration checksum\n(renderers/jsonb-persist/migrate.go entityChecksum), and the enforced spec\nversion lives in the manifest's `apiVersion`. A field that is always `v1` and\ngates nothing reads as a contract while being decoration, so it was removed\nrather than given a second, weaker meaning.\n",
  "type": "object",
  "properties": {
    "actions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Action"
      }
    },
    "assignments": {
      "description": "Assignments declares that this entity records which principal is assigned",
      "type": "array",
      "items": {
        "$ref": "#/$defs/AssignmentDecl"
      }
    },
    "auth": {
      "$ref": "#/$defs/EntityAuth",
      "nullable": true
    },
    "backdate_policy": {
      "$ref": "#/$defs/BackdatePolicy",
      "nullable": true
    },
    "cache": {
      "$ref": "#/$defs/CacheSpec",
      "description": "Cache opts this entity into the framework read-through cache on",
      "nullable": true
    },
    "characteristic": {
      "$ref": "#/$defs/Characteristic",
      "description": "Characteristic is required: it is the axis the engine branches on"
    },
    "create_scope": {
      "description": "CreateScope pins a dimension field on CREATE from a record the payload",
      "type": "array",
      "items": {
        "$ref": "#/$defs/CreateScopeSpec"
      }
    },
    "deliver": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/DeliveryDecl"
      }
    },
    "display_field": {
      "description": "@schema {example: \"name\"}",
      "type": "string",
      "examples": [
        "name"
      ]
    },
    "events": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EventDecl"
      }
    },
    "expose": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ExposeConfig"
      }
    },
    "extend_storage": {
      "$ref": "#/$defs/ExtendStorage",
      "nullable": true
    },
    "fields": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Field"
      }
    },
    "forward_date_policy": {
      "$ref": "#/$defs/ForwardDatePolicy",
      "nullable": true
    },
    "hooks": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/HookDecl"
      }
    },
    "indexes": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/IndexDecl"
      }
    },
    "input_sets": {
      "description": "InputSets declares named, reusable lists of action inputs. A transition or",
      "type": "array",
      "items": {
        "$ref": "#/$defs/InputSet"
      }
    },
    "invariants": {
      "description": "Invariants declares properties that must hold for a `characteristic:",
      "type": "array",
      "items": {
        "$ref": "#/$defs/InvariantDecl"
      }
    },
    "join_key": {
      "type": "string"
    },
    "lifecycle": {
      "description": "@schema {example: \"plain_crud\", enum: [\"two_step_autosave\", \"two_step_manual\", \"plain_crud\"]}",
      "type": "string",
      "enum": [
        "two_step_autosave",
        "two_step_manual",
        "plain_crud"
      ],
      "examples": [
        "plain_crud"
      ]
    },
    "maintained_by": {
      "description": "MaintainedBy names the script that keeps a `characteristic: summary`",
      "type": "string"
    },
    "persist": {
      "$ref": "#/$defs/PersistSpec",
      "nullable": true
    },
    "plural": {
      "description": "@schema {example: \"invoices\"}",
      "type": "string",
      "examples": [
        "invoices"
      ]
    },
    "rate_limit": {
      "$ref": "#/$defs/RateLimitSpec",
      "description": "1.4.1 resource-level rate limit (02-core-extended.md §17)",
      "nullable": true
    },
    "rebuild": {
      "$ref": "#/$defs/RebuildSpec",
      "nullable": true
    },
    "row_scope": {
      "description": "RowScope declares the row-level filters the server enforces on every read",
      "type": "array",
      "items": {
        "$ref": "#/$defs/FilterSpec"
      }
    },
    "scope": {
      "$ref": "#/$defs/ScopeDecl",
      "description": "Scope declares that this entity's rows are partitioned along a named",
      "nullable": true
    },
    "soft_deactivate": {
      "$ref": "#/$defs/SoftDeactivateDecl",
      "description": "1.4.10",
      "nullable": true
    },
    "sources": {
      "description": "Summary-source contract for Entity characteristic: summary (Core Extended",
      "type": "array",
      "items": {
        "$ref": "#/$defs/SummarySource"
      }
    },
    "state_machine": {
      "$ref": "#/$defs/StateMachine",
      "nullable": true
    }
  },
  "required": [
    "characteristic"
  ],
  "additionalProperties": false
}