Yes, we are quite thankful to the Lord that nothing bad happened! Stovepipes can be fixed, and money is replaceable. The inspector checked it out this morning and flagged everything that's been mentioned here, plus he said that the cap is wrong for a wood stove, being the style intended for a gas furnace. (The slots are too small for wood, and will plug up.) Between parts and labor, he estimates it will be about $2K to fix the situation. Ironically, he thinks the installer's misuse of insulation is probably what saved the roof opening from leaking this spring.
Small silver lining: The inspector (who will also be doing the repair) thinks we are safe to bend the 10-3-2 rule in this particular case, because the chimney is on the west side of the roof and the prevailing wind here is from that direction. He thinks it would be a problem if it were on the east slope, but since it is where it is and has a history of drawing just fine, we're safe to leave it the same height.
I have reached out to the installer, who is at this point unrepentant. Even in the face of photo evidence, he insists that the B-vent is actually Class A chimney, and he also persists in the belief that fire-rated spray foam is acceptable to be in contact with the pipe. (This also despite pics of the scorched and melted foam.) He has requested a copy of the inspector's formal report, which I told him I will happily share.