The code in the canonicalize_and_validate method of Trigger is doing two things... and is growing a bit lengthy.
Think about ways to refactor this code to make it easier to understand.
Furthermore, canonicalizing is effectively munging - munging should happen in the munge block for the type definition. Similarly, validation should happen then.
As it stands, all of the code runs very late in the process - running inside the provider rather than the type. This should be rectified.