The key issue of disclosure - your 3rd step - happens at A-publication which is usually quite some time prior to the patent being granted but still can be a couple of years after the filing date. (this is the source of many of the 'I can't believe they granted this patent' articles because the A-document is printed from the submission prior to substantive examination).
I don't know about the US situation but in the UK Section 64 of the Patents Act (http://www.ipo.gov.uk/pro-types/pro-patent/p-law/p-manual/p-... and http://www.legislation.gov.uk/ukpga/1977/37/section/64) allows a person to continue activity which was started prior to the grant of a patent in secret or where sufficient preparations for that [infringing] activity were made prior to the application/grant in good faith. If the activity wasn't in secret then it forms part of the prior art and invalidates, or forces amendment of, the patent in question.
If there isn't an equivalent US clause I'd be surprised: 35 U.S.C. 273 "Defense to infringement based on earlier inventor." looks like a candidate.
I don't know about the US situation but in the UK Section 64 of the Patents Act (http://www.ipo.gov.uk/pro-types/pro-patent/p-law/p-manual/p-... and http://www.legislation.gov.uk/ukpga/1977/37/section/64) allows a person to continue activity which was started prior to the grant of a patent in secret or where sufficient preparations for that [infringing] activity were made prior to the application/grant in good faith. If the activity wasn't in secret then it forms part of the prior art and invalidates, or forces amendment of, the patent in question.
If there isn't an equivalent US clause I'd be surprised: 35 U.S.C. 273 "Defense to infringement based on earlier inventor." looks like a candidate.