When a task can not be assigned, the ptask framework can message back a reason (see PersistentTasksCustomMetaData.Assignment) in form of a string.
Callers might need to interpret an assignment failure to e.g. return a HTTP status code. A string is hard to interpret and therefore not suitable.
It would be good if the Assignment could take/store a programmer friendly code/category.
After discussion with @DaveCTurner the solution could be a enum similar to UnassignedInfo#Reason.
Related: #53657, #53658