Your deleted post suggests you are on the right way – definitely don’t just change the doc for an editor, but go through the transforms. The way to change attributes is with the "ancestor" transform, but it seems I haven’t provided a convenient Transform method for that yet. I’ll push something that fixes that later today, at which point you should be able to say:
pm.tr.setAttributes(path, attributes).apply()
And it’ll update the doc and the display, going through the proper mechanisms to ensure the change is recorded in history, broadcast to collaborating editors, etc.