So write domain entity as a literal, union of states with a schema and a table of transitions (from, verb, to, guard) then derive everything from that literal- types, db, rpc proca, permissions. So changing any logic will throw type errors for the logic errors upstream