Shipping changes
A verified change still has to reach the shared source line, then a running environment, then its users. Each step is a separate claim with its own evidence. This page covers integration, deployment, database migrations, feature flags, and rollouts.
Integration
The accountable human chooses the integration method for each repository: branches with pull requests, direct commits to trunk, or a merge queue. Every method needs current evidence, a traceable candidate, and a way to handle concurrent changes. An agent never switches methods to get around a gate.
Before integrating:
- Inspect local changes before editing or rewriting history. Keep other tasks' work intact.
- Fetch the current base, update the candidate, read the combined diff, and run the affected checks.
- Wait for every required check to finish. Missing, pending, cancelled, and unknown results are not passes.
- Resolve open review findings: fixed, dismissed with evidence, or passed to the product decision owner.
Agents resolve mechanical conflicts. A conflict that changes behavior, acceptance criteria, or authority goes to the owner.
Never force-push shared history, discard someone else's changes, or override branch protection to retry. When a check fails, classify the cause: the candidate, the base, access, or infrastructure. To claim a failure already existed, run the unchanged base and keep both results. Skipping a failing required check needs a check exception: the protection skipped, the evidence that the base fails, the risk, the approver, the scope, an expiry, and a follow-up owner. An agent cannot grant itself one.
Report both the revision you submitted and the revision that landed.
Builds and deployments
Link each deployment to the source revision, the build inputs, the immutable artifact, the configuration, the target, and the system that promoted it. A rebuild is a new artifact.
Before deploying, confirm the checks, the current authority, the target environment, and that recovery is ready. After deploying, identify the artifact that is actually running and check its behavior. A version endpoint proves identity, not behavior. During a rolling deployment, check how many instances run each version.
A failed or stalled deployment stays unconfirmed. Record the failed instances, the last healthy release, the impact, and the owner. Find out what changed before you retry.
For client apps, publication is not installation. Track published, installed, and active versions separately.
Database migrations
Old and new code run at the same time during a deployment. Plan for it.
- Assign a data owner to every migration. Running each phase in production needs that owner's approval. See What needs approval.
- Use three phases: expand (add the new shape while the old one still works), transition (move readers and writers over), and contract (remove the old shape). Contract only after the compatibility window closes and the recovery consequences are accepted.
- List every reader and writer: services, jobs, clients, replicas, and downstream consumers.
- Dual writes and backfills need a rule for which copy is the source of truth, plus retries, deduplication, conflict handling, and a completion check. A progress counter does not prove correctness.
- Before production, test at realistic volume, test failure, establish the last recoverable point, and test recovery.
- Record each completed step so another owner can resume. Keep irreversible cleanup as a separate decision with its own owner.
Feature flags
A flag separates deploying code from turning it on. It only helps if it can contain the failure. If the risk sits in background work or a data change, a flag may not help, and you need another release method.
A flag record names its purpose, owner, safe default, targeting unit, environments, who may change it, where changes are logged, and when it will be removed.
- Test the disabled path, the enabled path, the targeting, and a live switch between them.
- Know what "off" stops: new work, running work, both, or neither.
- Document what happens when the flag service is down or the configuration is missing, and test that fallback.
- Keep release, entitlement, experiment, and emergency flags apart. They have different owners and lifetimes.
- A flag is not an access control unless it was built and tested as one.
When a flag passes its removal date, review it. Do not remove it automatically. Removing a flag is part of the work. Delete the dead branch, the split tests, the stale targeting rules, and the dashboards, then the key itself once old clients no longer read it.
Rollouts
Write the rollout plan before exposure grows. It names the release, the flag or rule, each stage's cohort, the evidence needed to move on, the observation window, the minimum traffic, the guardrail signals, who decides each stage, and the recovery owner. The product sets the numbers. This handbook sets none.
Before the first stage, confirm the deployed version, the targeting, and that monitoring can see the cohort. Rehearse the mitigation.
At each stage, decide using this table:
| Observation | Action |
|---|---|
| Criteria met with enough evidence | Expand, within your authority. |
| Regression or a guardrail breached | Stop and mitigate. |
| Too little traffic, missing telemetry, unclear version, or a failed monitor | Hold. Report the stage as inconclusive. |
| The criteria themselves changed | Stop and replan with the release owner. |
Assign users by a stable unit, such as an account ID, so a user stays in one cohort. Before each targeting change, record the current configuration. After it, compare the expected and observed cohort sizes.
A flat overall error rate never outweighs a confirmed defect that users can see.
A rollout closes when the intended audience has the behavior, the criteria are met, the limits are recorded, and remaining monitoring and cleanup have owners.
Changes without a flag
Most bug fixes have no flag, so the deployment exposes every user at once. Treat the deployment as a rollout with one stage.
- Before deploying, write down the success signal, the guardrail signals, the observation window, and the trigger for rolling back. For a fix, the success signal is that the failing case now succeeds. Confirm that rollback is tested. If the change includes a migration, confirm that the previous version can still read data the new version writes. See Choosing a recovery.
- If the platform can send part of the traffic to the new version, use that as a first stage.
- After deploying, record the deployment as the evidence for enabled. Watch the signals over the observation window. Roll back when the trigger fires.
- The change is observed working when the success signal holds for the affected users over the window and no guardrail is breached.
Experiments
A staged rollout tests safety. An experiment tests a product hypothesis. Before an experiment starts, define the hypothesis, the assignment unit, the primary outcome, the guardrails, the control group, and how the decision will be made. Record who was exposed separately from who was assigned. The product decision owner decides whether to expand, revise, abandon, or study further.