Why guid changes when definition modified

It makes sense from a data perspective, but not from a human perspective. E.g. If you call your child “Marco”, but then they grow up, you still call them by their given name. They’ve changed, but the identifier needs to persist or we won’t know what to call anything.

It’s the Ship of Theseus problem.

Unfortunately because of this, if you want a “human”-style guid than you can expect to persist, you have to generate your own identifiers using e.g.

 rand(0x1000000000000000000000000000000000000000).to_s(36)

and save them to the component with set_attribute.