Switchback Public source ↗

Live on Google Cloud Run

Rolling back code does not roll back data.

Switchback blocks a release when new code writes business data that the previous application version will misread after rollback.

  • 20 → 110unsafe rollback
  • 20 → 20compatible repair
  • Humanowns the merge

01 · The problem

A green deployment can leave data the old version no longer understands.

Health checks, schema checks and version-local tests may all pass. The failure appears later, when yesterday's code reads records written by today's code.

Meaning changed

The database column looks the same. Its unit does not.

v1 contractquantity = cartons
→
unsafe v2 writequantity = parts

A code rollback changes which application is running. It does not rewrite the records already stored by v2.

Why normal testing misses it

Each version can be right when tested alone.

Switchback tests the mixed-version sequence that matters: old writes, new writes, requests retry across versions, then traffic returns to old code.

The final answer is compared with an append-only ledger of accepted receipt facts.

02 · What Switchback does

Test the rollback before the release.

The release gate runs both application versions against one disposable database and refuses the release when old code cannot recover the right business answer.

01

Write with v1

Create the first accepted receipt using the old application and its known data contract.

02

Write with v2

Let the candidate write to the same database, including an idempotent retry across versions.

03

Return to v1

Send the final read through old code, which recreates the result of a real code rollback.

04

Fail closed

Compare with accepted facts. A mismatch returns BLOCK and stops the release.

03 · Live compatibility lab

Run the failure yourself.

Each button creates a fresh disposable SQLite database and runs real FastAPI requests. The verdict comes from the source-controlled gate, not an LLM.

Loading recorded unsafe evidence…
Release decision
—
Waiting for a run
Accepted facts
—
parts in the receipt ledger
After rollback
—
parts reported by v1

Business checks

Actual old → new → old sequence

04 · How we solved it with GitLab

Evidence first. Agent repair second. Human decision last.

  1. 01

    Open a controlled unsafe MR

    MR !1 changes one application setting on synthetic data. Ordinary checks pass, but the compatibility gate reports 20 expected and 110 after rollback.

  2. 02

    Block with repeatable evidence

    GitLab CI records JSON, HTML and JUnit evidence and exits with a release-blocking status.

  3. 03

    A person starts the GitLab Duo flow

    Session 10014531 reads the MR diff, the failed job and the reviewed business-data contract.

  4. 04

    Duo opens one focused repair

    Repair MR !4 selects the compatible writer. It cannot approve or merge itself.

  5. 05

    The same gate proves the repair

    Pipeline 2986179598 passes all 11 jobs and reports 20 expected and 20 after rollback. A person still owns the merge decision.

05 · Public proof

Inspect the code, failure and repair without signing in.

The GitLab Duo session page is private, so the public merge requests, passing pipeline and video carry the judge-facing proof.

Scope

What this demo proves.

It does

Prove one inventory contract across mixed-version writes, retries, reads and code rollback.

It does not

Claim that every database migration is safe or change any production data.

Data boundary

Every run uses fixed synthetic receipts and a disposable database.

Decision boundary

CI verifies the repair. A person decides whether anything merges.