The default answer is rescue. Rebuilding throws away the product decisions the prototype validated and costs more than most teams expect. But there are cases where a layer must be rebuilt. The decision should be evidence-based, not aesthetic.
Rescue in place when
- The data model fits the real domain.
- Tenancy and authorization can be enforced in the existing schema.
- The framework and dependencies are maintained.
- The failures are in access control, secrets, reliability, or cost, not in the core data shape.
Rebuild a layer when
- The data model no longer fits the product.
- Tenancy cannot be enforced without restructuring storage.
- The code depends on abandoned libraries.
- One fix touches most of the system.
The rule
If the schema is sound, everything above it can be repaired in place. A wrong schema drags every layer above it along, so the audit should answer the data-model question first. That is why an audit comes before any remediation quote.
How an audit decides
A fixed-scope audit reads the code, configuration, and infrastructure, then returns a findings register with severity and a rescue-effort estimate per item. Nothing is fixed during the audit. The output tells you whether to harden, refactor, or rebuild, and in what order.
See the production readiness audit → See the vibe coder path →