iserith
Magic Wordsmith
I don't think there's an official ruling on this, because it's a bit metaphysical. When you undertake a task, your ability check determines how well you perform that task, so it applies to the entirety of that task - but that doesn't dictate when, in in-game terms, the skill check takes place, because the character in game isn't making a skill check - they're simply performing a task.
Right, this is the key thing to remember that resolves a lot of these issues.
A check is not a task. The check does not exist in the game world. It exists only at the table as @Hriston goes on to say. The spell (and the bard's inspiration) and the task do exist in the game world. Therefore to gain the benefit of either, the task must be resolved within the spell or feature's duration. But the check doesn't actually occur at any specific point during the task since it's not a thing in the fiction.