feat: sync envs with references (#827)