Inspiration

"Code generation is solved. What happens next is the challenge."

Today's agentic tools stop at the merge request. The risky, expensive part is everything after code: review, security, packaging, release, monitoring, rollback, governance. Teams face a false choice: do it all manually (slow) or hand it to automation with no proof (dangerous). When automation can't prove what it did, trust collapses — dashboards go green, reviews become rubber stamps, and one bad incident flips the whole org back to manual gates.

Ratchet builds the missing middle: agents allowed to act, but only with receipts. Every release must carry a Release Passport whose every cell is real, executed evidence. No evidence, no release.

What it does

Ratchet turns GitLab's DevSecOps lifecycle into an evidence machine, then hands production autonomy to a ratchet that only turns when proof allows.

  1. One push starts everything. A nine-stage pipeline runs plan → create → verify → package → secure → release → configure → monitor → govern. Every stage produces a real artifact — no stubs.
    • plan: release-intent.json declares, up front, the evidence this run must produce.
    • create: the release bundle is built and hashed (sha256 manifest).
    • verify: 9 unit tests actually execute, plus a real rollback rehearsal — the previous release is reconstructed from git, booted, and must reproduce its own baseline.
    • package: a CycloneDX SBOM is produced.
    • secure: SAST (semgrep) + secret detection + a per-release SCI carbon estimate.
    • release: staging and canary rungs are logged, then the autonomy gate decides.
    • configure: config drift is checked against a committed baseline.
    • monitor: a canary watchdog boots the candidate and samples its live error-rate signal against soft/hard limits.
    • govern: the autonomy ledger is audited and exported with a full-pipeline carbon receipt.
  2. The Passport agent reads every artifact and posts its evidence card. Tests, rollback, SBOM, SAST, secrets, SCI, drift, canary — with a cross-check against the CI-rendered verdict. Missing or failed evidence downgrades the verdict; invented results are forbidden by design.
  3. Autonomy is earned, and revocable. Three clean passes promote a change class from manual → supervised → auto; one incident demotes it immediately. Even a fully-auto class is paused fail-closed if this run's evidence isn't clean. The gate dispatches production as a child pipeline — auto-run when earned, or a single human play button when sign-off is required.
  4. The whole thing renders itself. Every green pipeline rebuilds the nine-stage lifecycle map and the ratchet trust panel on GitLab Pages from the run's own artifacts. Cells stay dark rather than pretend.

How we built it

  • GitLab Duo Agent Platform — two custom flows (Passport Evidence Reader → Card Poster; SAST Triage), a pipeline-events trigger that renders the Passport automatically after every green pipeline, and a mention trigger for on-demand runs. The agent posts to a designated standing inbox issue — it never guesses where to comment.
  • GitLab CI/CD — a nine-stage pipeline of 17 real jobs (unit tests, semgrep, detect-secrets, Trivy, plus our own evidence tools) ending in a dynamically generated production child pipeline.
  • Our own evidence tooling — Python stdlib only: rollback rehearsal harness, SCI estimator, drift detector, canary watchdog, evidence-gated ratchet gate + auditor, child-pipeline dispatcher, lifecycle-map renderer.
  • Deployment — the demo service runs live from the repo's Dockerfile on Render; the production rung can trigger the service's deploy hook and probe /health until it answers, and journals an honest "no live trigger" state when no hook is configured.

Challenges we ran into

  • The system's honesty rules caught its own authors. Our newest rollback-harness code generated a module name with sha1; semgrep flagged it, the passport dropped to needs_human_signoff, and the evidence gate paused that release even though the ratchet had earned auto. We fixed the hash in the open — and the next run went the full circle: clean SAST, green passport, zero-click production dispatch.
  • A scanner that proves nothing is not evidence. The Passport agent refused to trust our SAST report because it couldn't prove any file had been scanned (semgrep leaves its target counts at zero even when it scans). It was right. We hardened the artifacts instead of loosening the rules: a scan-coverage finalizer that records scanned files and bytes, an explicit checksum_match field in the rollback report, and a passport rule that treats an unprovable scan as review, not pass. The next card closed the loop in the agent's own words: "No evidence is missing."
  • The first Passport card refused to count 8 CI-reported tests as evidence because the agent couldn't read the XML itself — so the pipeline now emits a machine-readable JSON summary instead of loosening the honesty rule.
  • Our first carbon number was silently 0.0 because it read CI variables GitLab doesn't define. Rewritten to measure the pipeline's real wall-clock from timestamps and labeled an honest lower bound.

Nine stages, nine pieces of evidence

Stage Automation Artifact
plan release-intent declares required evidence + current autonomy mode release-intent.json
create versioned bundle + hash manifest ratchet-app-*.tar.gz + sha256
verify 9 tests + reconstructed rollback rehearsal test-summary.json, rollback-report.json
package CycloneDX SBOM sbom.cdx.json
secure SAST + secrets + SCI carbon sast-report.json, secrets-report.json, sci.json
release staging → canary → ratchet-gated production ledger-decision.json + child pipeline
configure drift vs committed baseline drift-report.json
monitor canary watchdog on live error rate canary-report.json
govern ledger audit + carbon receipt audit export + pipeline SCI

What's next

  • Expand the change-class classifier so the ratchet learns per-module classes.
  • Trend the carbon receipt across releases on the Pages map.
  • Swap the demo deploy target for any real service — the evidence pipeline is target-agnostic.

Links

Built With

  • cyclonedx
  • docker
  • gitlab-ci/cd
  • gitlab-duo-agent-platform
  • python
  • render
  • semgrep
  • trivy
Share this project:

Updates

Submission history