{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://oms.local/schemas/native-goal-snapshot.schema.json",
  "title": "Immutable native get_goal snapshot",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "native_goal_id",
    "objective",
    "stopping_condition",
    "status",
    "terminal",
    "snapshot_version",
    "captured_at"
  ],
  "properties": {
    "schema_version": { "const": 1 },
    "native_goal_id": { "type": "string", "pattern": "^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$" },
    "objective": { "type": "string", "minLength": 1, "maxLength": 32768 },
    "stopping_condition": { "type": "string", "minLength": 1, "maxLength": 32768 },
    "status": { "enum": ["active", "complete", "blocked", "cancelled"] },
    "terminal": { "type": "boolean" },
    "snapshot_version": { "type": "integer", "minimum": 1 },
    "captured_at": { "type": "string", "minLength": 20, "maxLength": 24 }
  }
}
