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

  1. Create a controlled unsafe MR on synthetic data.
  2. GitLab CI runs unit tests, PostgreSQL rehearsal, dependency audit, SAST, secret detection, container checks and the release compatibility gate.
  3. The gate compares the append-only event ledger with the result read by the old application after rollback.
  4. A human mention starts the GitLab Duo flow on the failed MR.
  5. Duo reads the real diff and job evidence, traces the broken business meaning and opens a one-line repair MR.
  6. 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

Share this project:

Updates

Submission history