No, the point here is to be able to have a configurable undo as described by jcsogo. The idea is to let the possibility to undo a rating from lighttable into darkroom. Not used at the moment, but the desing here make this possible.

Not sure either for the darktable global variable. Here the state is abstract (it is an ASM) and not an ADT (so no visible type to manipulate).