Skip to main content

Configure a PR-to-merge pipeline

In AI-native engineering organizations, generating code is no longer the slowest part of shipping software. Review, verification, repair, and human decision-making become the bottlenecks. Cosmos addresses the complete PR-to-merge loop: agents do the mechanical work while humans provide judgment, knowledge transfer, and the final merge decision. This is loop engineering applied to the PR lifecycle. Optimize the verified, understood, merge-ready outcome—not an individual review agent or time to first comment. Cosmos code review pipeline

The Cosmos code review fleet

Each specialized Expert owns part of the loop. Together they turn a chain of manual handoffs into a coordinated system.

PR Author / PR Fixer

Choose the Expert that matches how the change entered review:
  • PR Author turns a task or ticket into a reviewed pull request or merge request, then stays with it through review comments, CI failures, and merge conflicts.
  • PR Fixer provides the same follow-up loop for changes created without PR Author. It repairs review findings, CI failures, and merge conflicts, explaining what changed and asking for human judgment when a safe repair is ambiguous.
Together, they provide interchangeable paths into the author-side loop: PR Author for changes it creates, or PR Fixer for changes created elsewhere. Both pair with Deep Reviewer, Pair Reviewer, Verifier, and CI.

Risk Analyzer

Risk Analyzer classifies every new or ready-for-review change and applies your organization’s auto-approval policy to intrinsically low-risk changes. It routes higher-risk changes to human review with a focused explanation of what needs attention.
  • Role in the pipeline: Prevents every change from receiving the same expensive level of human attention.
  • Pairs with: Pair Reviewer for changes that need deeper context or human judgment.

Deep Reviewer

Deep Reviewer performs exhaustive, line-by-line analysis for objective correctness defects. It runs autonomously and checks the change against repository guidance such as AGENTS.md and CLAUDE.md.
  • Role in the pipeline: Handles objective correctness review before a human spends attention on judgment calls.
  • Pairs with: PR Fixer, which can repair its findings, and Pair Reviewer for broader judgment.

Pair Reviewer

Pair Reviewer reconstructs intent, architecture, product context, and tradeoffs, then guides a human through the decisions that require judgment. It posts comments or a verdict only after human authorization. When instructed, it can monitor whether its comments are addressed and approve on the reviewer’s behalf.
  • Role in the pipeline: Preserves human judgment and knowledge transfer without requiring line-by-line human review.
  • Pairs with: Risk Analyzer for routing, PR Fixer for repairs, and Memory Manager for team-specific standards.

Verifier

Verifier exercises affected behavior end to end in a running environment and reports inspectable evidence such as screenshots, logs, traces, and captured outputs.
  • Role in the pipeline: Replaces confidence based on code inspection alone with runtime evidence.
  • Pairs with: PR Fixer when verification finds a defect and Pair Reviewer when a human must assess the evidence.

PR Dashboard Manager

PR Dashboard Manager observes and summarizes each Expert’s status, evidence, reviewed commits, and available actions. It is an observer and entry point, not a controller of the other Experts.
  • Role in the pipeline: Makes the complete review state legible without searching across comments and checks.

cosmos approve

A PR author can comment cosmos approve to request evaluation against a configurable approval policy. This path is disabled by default and is distinct from Risk Analyzer’s automatic approval of intrinsically low-risk changes. A policy can require:
  1. Ownership: The requester is the PR author and an effective CODEOWNER for every modified file.
  2. Current-head review: There are no unresolved Deep Reviewer findings, Pair Reviewer blockers, or unaddressed human comments.
  3. Runtime evidence: Verifier has not reported an unaddressed defect against the current commit.
An approval never merges the change. A human always owns and performs the final merge.

Memory Manager

Memory Manager learns from merged changes and human feedback. It distills comments, replies, reactions, and Pair Reviewer sessions into reusable per-repository knowledge for future reviews.
  • Role in the pipeline: Makes the review system adapt to local conventions over time.
  • Pairs with: Every review Expert that benefits from shared team standards and prior feedback.
Start with the complete fleet except Verifier: PR Author, PR Fixer, Risk Analyzer, Deep Reviewer, Pair Reviewer, PR Dashboard Manager, and Memory Manager. This gives your team the core authoring, review, repair, and visibility loops immediately. Optionally enable cosmos approve after defining ownership and review requirements. Once the team is comfortable with that workflow, add Verifier. Runtime verification takes more time to set up because it needs a working test environment and access to exercise the affected behavior. Finally, customize the fleet for your organization: add custom Experts for domain-specific checks or workflows, and remove Experts that do not provide value for your team.
Teams with strict compliance requirements should define which changes can be auto-approved, who can request approval, which paths always require human review, and how agent approvals are audited.

What changes for engineers

  • Agents handle mechanical analysis, repair, and verification.
  • Humans focus on architecture, product behavior, security, rollout, and other consequential decisions.
  • Evidence and Expert state are visible in one place.
  • A human always makes the final merge decision.

See Also