https://en.wikipedia.org/wiki/Substantial_performance
At common law, substantial performance is an alternative principle to the perfect tender rule. It allows a court to imply a term that allows a partial or substantially similar performance to stand in for the performance specified in the contract.
This principle is relevant when a contractor's performance is in some way deficient, through no willful act by the contractor, yet is so nearly equivalent that it would be unreasonable for the owner to deny the agreed upon payment. If a contractor successfully demonstrates substantial performance, the owner remains obligated to fulfill payment, less any damages suffered as a result of the deficiencies in workmanship by the contractor.