Getting started

Overview

Riven is an Orbit-backed merge governance layer for AI-written code. On every merge request it maps changed definitions, traverses graph-proven static CALLS impact, emits risk-contract.yaml, and lets GitLab CI block unsafe merges.

It is not an AI reviewer comment. It is a contract-first control plane for agent-authored code changes.

The one rule

The merge decision comes from risk-contract.yaml and the CI exit code, not from a model summary, a code review vibe, or a best-effort explanation.

What Riven does

Given a merge request, Riven:

  1. Indexes the checked-out repository with Orbit Local.
  2. Maps the diff to the concrete gl_definition rows it changed.
  3. Traverses inbound static CALLS edges through gl_edge to find impacted callers.
  4. Scores the change using deterministic risk factors such as blast radius, signature change, verification gaps, and owner coverage.
  5. Emits a machine-readable risk-contract.yaml plus remediation artifacts.
  6. Blocks merge in GitLab CI when required gate conditions are unmet.
  7. Exposes the same workflow over MCP so external agents can explain, plan, and verify bounded remediation.

Why it's different

  • It turns code review into policy infrastructure, not persuasion.
  • It uses Orbit as a real graph, not as a loose retrieval layer.
  • It reports graph-proven static impact, not a made-up runtime call graph.
  • It keeps AI inside a hard boundary: proposal, patch plan, candidate diff validation, sandbox verification, evidence.
  • It is reusable as infrastructure: CLI, GitLab CI scaffold, MCP server, AI Catalog agent, and documentation surface.

A concrete proof run

The included demo-repo contains a planted breaking change: parseOrder() changes shape while downstream callers still depend on the old contract. Riven finds the callers through Orbit CALLS edges, emits a failing contract, and exits non-zero the same way the GitLab merge gate does.

You can also see the live public proof:

Where to next