How do Foundry upgrades work?
Solution 1:
Yes, all items upgraded through the Foundry will be upgraded automatically once you research the upgrade, the only exception is the S.H.I.V laser, which will not upgrade your S.H.I.V if it's researched after the plasma S.H.I.V, which is superior.
No, all the Foundry projects are upgrades, except for the S.H.I.V, which allows you to build S.H.I.Vs at your workshops. Each S.H.I.V that you build costs resources according to its type.
Solution 2:
Yes, all currently built items are automatically upgraded to the new version. Upgraded items cost exactly the same as they did before the upgrade.