{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://oms.local/schemas/goal-executor-result.schema.json",
  "title": "OMS goal executor result",
  "type": "object",
  "additionalProperties": false,
  "required": ["status", "goal_id", "attempt", "lease_token", "stopping_condition", "summary"],
  "properties": {
    "dispatch_id": { "type": "string", "pattern": "^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$" },
    "status": { "enum": ["complete", "blocked", "paused"] },
    "goal_id": { "type": "string", "pattern": "^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$" },
    "attempt": { "type": "integer", "minimum": 1 },
    "lease_token": { "type": "string", "pattern": "^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$" },
    "worktree_commit": { "type": "string", "pattern": "^[a-f0-9]{40}(?:[a-f0-9]{24})?$" },
    "stopping_condition": { "type": "string", "minLength": 1, "maxLength": 8192 },
    "summary": { "type": "string", "minLength": 1, "maxLength": 8192 }
  }
}
