Skip to main content

Migration, Compatibility, and Rollback

Design expand/migrate/contract sequences, mixed-version compatibility, backfill, feature flags, rollback triggers, data preservation, and verification. A rollback that cannot reverse a data change requires a roll-forward plan.

TaskFlow working chapter: Migration, Compatibility, and Rollback

TaskFlow is not a greenfield demonstration. It already serves multiple organizations, contains undocumented behavior, and runs background work with incomplete telemetry. This chapter changes one precise part of that system: organization-scoped audit exports. Its role in architecture and constraints is to turn migration, compatibility, and rollback into an engineering decision that survives implementation, review, release, and incident recovery. The primary deliverable is the architecture plan and decision records; a chat transcript or plausible code diff is not a substitute.

Decision in focus

Create a deployment manifest linked to spec, commit, tests, evals, approvals, and artifact digests. The change remains anchored to OUT-001: an organization administrator can request and download a complete audit export without learning whether another tenant's records exist. Record tenant boundaries, compatibility, reliability, cost, and rollback. In particular, distinguish the actor making the request, the organization used for authorization, the organization embedded in the queued job, and the organization used by the worker query. Those values should normally agree, but the design must fail closed when they do not.

The chapter's central review question is: what new fact or control does Migration, Compatibility, and Rollback contribute that the surrounding chapters do not? Answer it in the owning artifact. For this topic, reviewers must exercise blocked promotion, tenant-scoped canary, rollback, roll-forward, and database compatibility. Link the result to stable identifiers instead of copying requirements into several documents: FR-AE-001 covers authorized export creation, FR-AE-004 covers expiration, NFR-AE-002 sets the latency objective, RISK-AE-001 covers cross-tenant disclosure, and EVD-AE-* identifies retained proof.

Concrete scenario

Assume administrator Ana requests an export for organization org-a. The API authorizes Ana, writes a job containing org-a, and returns 202 Accepted with an opaque job identifier. Before the worker starts, Ana loses the administrator role. Decide explicitly whether execution uses authorization captured at request time or revalidates current authorization; document the privacy, usability, and audit implications. Next, inject org-b into the worker payload and verify that the worker rejects it without revealing whether org-b exists. Finally, retry the same job after object storage succeeds but the database status update fails. The recovery path must avoid duplicate disclosures and must leave enough evidence to reconcile the artifact.

This scenario prevents a common failure in agent-generated changes: each component looks locally reasonable while the end-to-end authority chain is inconsistent. It also forces the chapter topic to influence observable behavior. If applying migration, compatibility, and rollback does not change an artifact, gate, test, policy, or production signal, it has not yet contributed to the lifecycle.

Verification and exit evidence

Run deterministic checks for tenant scoping, role changes, state transitions, idempotency, retention, and download authorization. Use probabilistic evaluation only where judgment is genuinely required, such as assessing whether an agent's handoff explains residual risk. Retain the specification revision, code commit, exact commands, test and eval results, reviewer identity, approvals, environment, artifact digest, and timestamp. Redact secrets and exported audit contents while retaining correlation identifiers needed for investigation.

The chapter is complete when reviewers can trace OUT-001 → FR/NFR → DEC → TASK → TEST/EVAL → EVD, reproduce the important failure cases, and explain the return path if evidence fails. promote only while authorization errors, queue latency, export completeness, and cost remain within budget. Any unresolved authority question, incompatible migration, or missing rollback mechanism returns to the owning specification or decision record; it does not become an implementation-time guess.

Workshop

Apply the chapter to the scenario above and produce the named artifact. Include one denied action, one approval boundary, one failure injection, one measurable production signal, and one rollback or reconciliation step. Exchange artifacts with another reviewer who has only the repository and evidence manifest. If that reviewer cannot identify the permitted authority and independently determine whether RISK-AE-001 is controlled, revise the artifact rather than adding explanatory chat.

Sources and currency

Last technically verified: 2026-08-09

Commands, product support, and preview status can change. Verify the applicable version before adopting an example as policy.