The logic of the rule is this: If a starter is the pitcher of record when his team assumes the lead permanently but doesn't last five innings, then there's no winning pitcher by the "pitcher of record" criterion. So the official scorer picks a reliever at his discretion.

But if the starter's not the pitcher of record when his team assumes the lead permanently, then one of his reliever teammates is. Thus, the official scorer could not exercise discretion without taking a win away from someone who'd got it the regular rule book way. The additional provision about a brief and ineffective appearance is clarified in the official rules as lasting less than an inning and allowing at least two earned runs. This didn't apply to Affledt.

The current official MLB rules are expressly clear on these points, so there is no way Bumgarner could have gotten a win except through the scorer's mistake. Apparently the army of media people sitting near the scorer took an hour to get it straight, and some stories had already hit the wires.

I checked my history sources, and the rule books I have through 1947 don't specify criteria for winning and losing pitchers. The current rule appeared when the rules were re-worded in my 1952 rule book. Back then, relief pitchers were rare, and circumstances were quite different. I think the idea of pitcher wins is becoming less meaningful these days as the game changes.