Fix the `assertions` tool goal-expansion hook and add related unit tests