What Switchback does
Switchback is a release gate for a failure ordinary health checks miss: new code can write business data that old code misreads after rollback.
In the synthetic inventory demo, v1 stores cartons in receipt_projections.quantity. An unsafe v2 writer stores parts in that legacy field. The accepted-event ledger totals 20 parts, but after rollback v1 reports 110. Rolling back code does not undo the stored row.
The deterministic gate runs v1 and v2 against one disposable database, checks append-only event facts and cross-version idempotency, then writes JSON, HTML and JUnit evidence. The unsafe MR is blocked. The compatible strategy reports ALLOW with 20 expected and 20 observed.
GitLab Duo flow
Public unsafe MR !1 produced failed gate job 17446305750. A person then mentioned the custom Switchback Release Compatibility Investigator flow. GitLab Duo session 10014531 read the MR, failed job and human-written contract.
The service account traced the field-meaning change to one application setting. It created commit 91c25301 and opened repair MR !4 into the unsafe branch. The MR changes only PROJECTION_STRATEGY from unsafe to compatible.
Pipeline 2986179598 passed all 11 jobs. Nothing was merged automatically.
The flow cannot approve, merge, relabel or edit the contract, tests, gate, pipeline or its own files. CI proves the repair. A person owns the merge decision.
Process
- Create a controlled unsafe MR on synthetic data.
- GitLab CI runs unit tests, PostgreSQL rehearsal, dependency audit, SAST, secret detection, container checks and the release compatibility gate.
- The gate compares the append-only event ledger with the result read by the old application after rollback.
- A human mention starts the GitLab Duo flow on the failed MR.
- Duo reads the real diff and job evidence, traces the broken business meaning and opens a one-line repair MR.
- Fresh CI reruns the same proof. The repair MR stays open for human review.
DevSecOps stages
Switchback covers Create, Verify, Package, Secure, Release and Govern. CI saves machine-readable evidence and publishes a GitLab Pages report.
Run it
python -m pip install -e '.[dev]'
pytest -q
switchback gate --candidate current --output evidence/current
All data is synthetic. Switchback is a compatibility demonstrator, not production migration automation.
Built With
- docker
- fastapi
- gitlab
- gitlab-ci/cd
- gitlab-duo-agent-platform
- gitlab-pages
- postgresql
- pytest
- python
- ruff
- sqlalchemy
- sqlite

Log in or sign up for Devpost to join the conversation.