Skip to content

overlane pr route

Route a pull request by risk: blocked, fast path, standard or approver

Updated View as MarkdownOpen in ChatGPTOpen in Claude

Reads the change between –base and –head in this checkout, takes the check results you pass, and asks the service for a lane. Deterministic checks come first: any check that is not passed blocks every lane (a check you do not report counts as missing). Sensitive paths (auth, billing, migrations, workflows, secrets, infrastructure) force the approver lane. Only then, and only if the team switched the review_risk decision on, a decision model labels the risk; it can raise a lane, never lower one, and never approves. A blocked pull request exits 6 and names the first blocker’s next command. Pass –author-token when an agent opened the pull request, so its own approval is refused.

Usage

overlane pr route --number N [--head REF] [--base REF] [--repo OWNER/NAME] [--title TEXT] [--author NAME] [--author-token TOKEN_ID] [--task TASK] [--scope GLOB...] [--fork] [--ci STATE] [--secret-scan STATE] [--guardrails STATE] [--conflict STATE] [--critical N] [--review-done] [--dry-run]

Flags

Flag Type Required Default Description
--number string yes The pull request number
--head string no The head commit or branch (default HEAD)
--base string no The base to compare with (default origin/main, else main)
--repo string no The repository name the pull request belongs to (default: the origin remote)
--title string no The pull request title
--author string no The pull request author’s name
--author-token string no The agent token that opened it, so its lineage is known to the independence check
--task string no The task this pull request belongs to, for batching
--scope string (repeatable) no A claimed scope pattern, for batching; repeat for more
--fork boolean no The head comes from a fork
--ci one of passed, failed, pending, missing no CI result: passed, failed, pending or missing (default missing, which blocks)
--secret-scan one of passed, failed, pending, missing no Secret scan result (default missing, which blocks)
--guardrails one of passed, failed, pending, missing no Guardrails result (default missing, which blocks)
--conflict one of passed, failed, pending, missing no Merge conflict check result, passed meaning no conflict (default missing, which blocks)
--critical string no Unresolved critical review findings (default 0)
--review-done boolean no The review run finished for this head
--dry-run boolean no Print the requests and file changes this command would make, then stop. Needs no credentials.

Examples

overlane pr route --number 7 --ci passed --secret-scan passed --guardrails passed --conflict passed --review-done
overlane pr route --number 7 --base origin/main --task task-12 --dry-run

Behavior

  • Effect: write (changes local or hosted state).
  • Needs credentials: yes. Uses the network: yes.
  • Supports --dry-run: yes. Accepts --force: no.
  • Machine-readable description: overlane schema pr route.

Result

With --json (the default when stdout is not a terminal) the command prints this JSON Schema’s shape on stdout.

{
  "anyOf": [
    {
      "type": "object",
      "properties": {
        "tenantId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]*$",
          "description": "tenant identifier"
        },
        "projectId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]*$",
          "description": "project identifier"
        },
        "repository": {
          "type": "string",
          "minLength": 1
        },
        "number": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991
        },
        "headSha": {
          "type": "string",
          "minLength": 1
        },
        "title": {
          "type": "string"
        },
        "author": {
          "type": "string"
        },
        "taskId": {
          "type": [
            "string",
            "null"
          ]
        },
        "branch": {
          "type": [
            "string",
            "null"
          ]
        },
        "baseRef": {
          "type": [
            "string",
            "null"
          ]
        },
        "route": {
          "type": "object",
          "properties": {
            "lane": {
              "type": "string",
              "enum": [
                "blocked",
                "fast",
                "standard",
                "approver"
              ]
            },
            "risk": {
              "type": "string",
              "enum": [
                "low",
                "medium",
                "high"
              ]
            },
            "deterministic": {
              "type": "object",
              "properties": {
                "level": {
                  "type": "string",
                  "enum": [
                    "low",
                    "medium",
                    "high"
                  ]
                },
                "linesChanged": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "filesChanged": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "sensitive": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "path": {
                        "type": "string"
                      },
                      "category": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "path",
                      "category"
                    ],
                    "additionalProperties": false
                  }
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "docs",
                    "tests",
                    "code",
                    "mixed",
                    "empty"
                  ]
                },
                "signals": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string",
                        "minLength": 1
                      },
                      "message": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "required": [
                      "code",
                      "message"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "level",
                "linesChanged",
                "filesChanged",
                "sensitive",
                "kind",
                "signals"
              ],
              "additionalProperties": false
            },
            "blockers": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "minLength": 1
                  },
                  "message": {
                    "type": "string",
                    "minLength": 1
                  },
                  "nextCommand": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "code",
                  "message",
                  "nextCommand"
                ],
                "additionalProperties": false
              }
            },
            "model": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "string",
                  "enum": [
                    "off",
                    "skipped",
                    "undecided",
                    "failed",
                    "used"
                  ]
                },
                "level": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "low",
                        "medium",
                        "high"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "raised": {
                  "type": "boolean"
                },
                "note": {
                  "type": "string"
                }
              },
              "required": [
                "status",
                "level",
                "raised",
                "note"
              ],
              "additionalProperties": false
            },
            "approval": {
              "type": "object",
              "properties": {
                "requirement": {
                  "type": "string",
                  "enum": [
                    "none",
                    "independent",
                    "approver"
                  ]
                },
                "reviewRequired": {
                  "type": "boolean"
                }
              },
              "required": [
                "requirement",
                "reviewRequired"
              ],
              "additionalProperties": false
            },
            "reasons": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "nextCommand": {
              "type": [
                "string",
                "null"
              ]
            },
            "modelEligible": {
              "type": "boolean"
            }
          },
          "required": [
            "lane",
            "risk",
            "deterministic",
            "blockers",
            "model",
            "approval",
            "reasons",
            "nextCommand",
            "modelEligible"
          ],
          "additionalProperties": false
        },
        "checks": {
          "type": "object",
          "properties": {
            "ci": {
              "default": "missing",
              "type": "string",
              "enum": [
                "passed",
                "failed",
                "pending",
                "missing"
              ]
            },
            "secretScan": {
              "default": "missing",
              "type": "string",
              "enum": [
                "passed",
                "failed",
                "pending",
                "missing"
              ]
            },
            "guardrails": {
              "default": "missing",
              "type": "string",
              "enum": [
                "passed",
                "failed",
                "pending",
                "missing"
              ]
            },
            "conflict": {
              "default": "missing",
              "type": "string",
              "enum": [
                "passed",
                "failed",
                "pending",
                "missing"
              ]
            },
            "criticalFindings": {
              "default": 0,
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "reviewDone": {
              "default": false,
              "type": "boolean"
            }
          },
          "required": [
            "ci",
            "secretScan",
            "guardrails",
            "conflict",
            "criticalFindings",
            "reviewDone"
          ],
          "additionalProperties": false
        },
        "approvals": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "source": {
                "type": "string",
                "enum": [
                  "agent",
                  "person",
                  "model"
                ]
              },
              "approver": {
                "type": "string"
              },
              "via": {
                "type": "string"
              },
              "at": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              }
            },
            "required": [
              "id",
              "source",
              "approver",
              "via",
              "at"
            ],
            "additionalProperties": false
          }
        },
        "approved": {
          "type": "boolean"
        },
        "routedAt": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
        }
      },
      "required": [
        "tenantId",
        "projectId",
        "repository",
        "number",
        "headSha",
        "title",
        "author",
        "taskId",
        "branch",
        "baseRef",
        "route",
        "checks",
        "approvals",
        "approved",
        "routedAt"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "dryRun": {
          "type": "boolean",
          "const": true
        },
        "service": {
          "type": "string"
        },
        "requests": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "method": {
                "type": "string"
              },
              "path": {
                "type": "string"
              },
              "body": {},
              "note": {
                "type": "string"
              }
            },
            "required": [
              "method",
              "path"
            ],
            "additionalProperties": false
          }
        },
        "commands": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "writes": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "path": {
                "type": "string"
              },
              "action": {
                "type": "string",
                "enum": [
                  "write",
                  "append",
                  "delete"
                ]
              },
              "description": {
                "type": "string"
              }
            },
            "required": [
              "path",
              "action",
              "description"
            ],
            "additionalProperties": false
          }
        },
        "notes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "dryRun",
        "requests",
        "commands",
        "writes",
        "notes"
      ],
      "additionalProperties": false
    }
  ]
}

See exit codes for the status the process returns.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close

Overlane Agent

Ask about the docs. Answers are quoted from the pages, with links. This panel cannot change anything.

    Questions are answered in your browser from the docs index. Nothing you type here is stored or sent anywhere.