The problem
A deployment can be green and still leave business data that the previous application version cannot understand. Health checks pass. The schema looks unchanged. Then a rollback sends traffic back to old code, which reads records written by the new code with the wrong meaning.
A 10-second example
Version 1 stores cartons in receipt_projections.quantity. One carton means 10 parts. An unsafe version 2 writer stores 10 individual parts in that same legacy field. The accepted receipts total 20 parts, but after rollback version 1 treats the new value as cartons and reports 110 parts.
Rolling back code does not roll back the stored row.
What Switchback does
Switchback is a deterministic release gate for persistent-data compatibility. It runs old and candidate FastAPI versions against one disposable database, retries the same event across versions, sends the final read through the old application and compares the result with an append-only ledger of accepted facts.
The unsafe candidate produces BLOCK: 20 expected, 110 after rollback. The compatible writer preserves carton meaning in the legacy field, stores canonical parts separately and produces ALLOW: 20 expected, 20 observed.
Each run writes JSON, HTML and JUnit evidence. A failed invariant exits with a release-blocking status.
How the process works
- A developer opens a controlled merge request.
- GitLab CI runs tests, a PostgreSQL mixed-version rehearsal, dependency audit, SAST, secret detection, container checks and the compatibility gate.
- The gate records the old-to-new-to-old request sequence and blocks the unsafe release.
- A person starts the custom GitLab Duo flow on the failed MR.
- Duo reads the real diff, failed job and reviewed data contract, then opens a focused repair MR.
- Fresh CI reruns the same proof. A person owns the merge decision.
GitLab Duo proof
A human mention on public unsafe MR !1 started GitLab Duo session 10014531. The service account traced the failure to one application setting, created commit 91c25301 and opened repair MR !4. Pipeline 2986179598 passed all 11 jobs.
The flow cannot approve or merge, relabel the MR or edit the contract, tests, gate, pipeline or its own files. CI proves the repair. Human review remains the release boundary.
Live proof for judges
- Interactive Google Cloud replay lab: https://switchback-demo-xysezuipaq-uc.a.run.app/
- Judge-facing evidence site: https://switchback-57184a.gitlab.io/
- Public MIT repository: https://gitlab.com/gitlab-ai-hackathon/transcend-october-2026/43539705/switchback
- Unsafe MR !1: https://gitlab.com/gitlab-ai-hackathon/transcend-october-2026/43539705/switchback/-/merge_requests/1
- Duo repair MR !4: https://gitlab.com/gitlab-ai-hackathon/transcend-october-2026/43539705/switchback/-/merge_requests/4
- Passing repair pipeline: https://gitlab.com/gitlab-ai-hackathon/transcend-october-2026/43539705/switchback/-/pipelines/2986179598
The Cloud Run service is public, scales to zero and is capped at two instances. Its replay buttons execute fixed unsafe and compatible scenarios against a fresh disposable SQLite database. It has no production database, customer data or GitLab credential.
Who this helps
Switchback is aimed at teams shipping rolling upgrades for inventory, payments, billing, orders and other systems where old and new application versions may share persisted data. It catches a class of failure that API health checks and version-local tests do not test.
Scope
This is a synthetic compatibility demonstration, not production migration automation. It proves one reviewed inventory contract and does not claim that every schema change is safe.
Built With
- docker
- fastapi
- gitlab
- gitlab-ci/cd
- gitlab-duo-agent-platform
- gitlab-pages
- google-cloud-run
- postgresql
- pytest
- python
- ruff
- sqlalchemy
- sqlite
