Stabilize first
Before asking AI to change code, decide whether the immediate need is to stop harm, restore availability, protect data, or simply understand the failure. A feature flag, rollback, queue pause, permission change, or temporary message may be the right first action. Do not bury stabilization inside a speculative code change.
Write down the impact in plain language: who is affected, what they cannot do, and whether data or money is at risk. That gives the hotfix a priority and prevents the team from optimizing a minor symptom while a larger failure continues.
Create a hotfix contract
A hotfix contract is a short statement of the failure, intended behavior, exact scope, and proof required. It should name the environment, service, branch, and deployment target. It should also say what the fix must not change.
For example: ‘When an authenticated user submits a PDF, the upload request should remain available while OCR is delayed. Change only the queue handoff and status display. Preserve existing retry behavior. Verify with the four-ticket regression set in the preview environment before production.’
Verify the target before deployment
A correct fix deployed to the wrong project, branch, environment, or domain is still a failed release. Check the active repository, commit, provider project, environment variables, and alias before sending the change. This is especially important when multiple projects have similar names or when preview and production use different data.
After deployment, verify the actual public or authenticated surface. Confirm the reported behavior, the main adjacent path, and the relevant logs or metrics. A provider saying ‘ready’ proves deployment status, not customer-visible acceptance.
Close the loop
A hotfix is not finished when the code merges. Record what happened, what changed, what was tested, what remains uncertain, and whether a follow-up cleanup is needed. If the incident exposed a missing test, unclear ownership, or fragile deployment path, create that follow-up separately so it does not get forgotten inside the urgency of the fix.
The best hotfix process leaves the system easier to operate than it was before: better evidence, clearer boundaries, and a small amount of durable documentation for the next person and the next AI session.
