护栏与审查

ci-gatekeeper-bot-jev

@NemanjaManic1Shell更新于 2026-09-19可当场跑

基于 GitHub Action,使用 Jev 通过 Vercel AI Gateway 低成本筛选 pull request,减少昂贵的 LLM 或人工审核。

英文原文

GitHub Action that uses Jev (TypeSafe AI via Vercel AI Gateway) to cheaply triage pull requests before expensive LLM/human review

NemanjaManic/ci-gatekeeper-bot-jev

它在哪儿调用了 Jev

// `experimental_evaluate` (typed decisions), since FR-006's secondary

src/fallback-review.ts:3

链接指向我们抓取当天的那个 commit,行号是准的。

它问 Jev 的问题

下面是从这个项目源码里原样取出来的 question 组合。

取自 src/jev.ts:31

  1. should_review是/否

    Does this pull request need a human or LLM code review at all, or is it trivial

  2. risk选项

    How risky is this change, based on the diff content and changed files?

    • cosmeticDocs, comments, formatting, or other non-functional changes.
    • moderateOrdinary code changes with limited blast radius.
    • blockingTouches authentication, database migrations, CI/CD configuration, or other sensitive surface area.
  3. route选项

    Given the risk above, how should this PR be routed?

    • auto-approveSafe to merge without further review.
    • human-reviewA human should review this before it is merged.
    • blockThis must not be merged until a human explicitly approves it.
  4. touches_secrets是/否

    Does the diff contain content that looks like an API key, password, or other credential?

用你自己的内容跑一遍

代码
import { experimental_evaluate as evaluate } from 'ai';

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    should_review: { type: 'boolean', instructions: 'Does this pull request need a human or LLM code review at all, or is it trivial' },
    risk: { type: 'choice', instructions: 'How risky is this change, based on the diff content and changed files?',
      criteria: { cosmetic: 'Docs, comments, formatting, or other non-functional changes.', moderate: 'Ordinary code changes with limited blast radius.', blocking: 'Touches authentication, database migrations, CI/CD configuration, or other sensitive surface area.' } },
    route: { type: 'choice', instructions: 'Given the risk above, how should this PR be routed?',
      criteria: { auto-approve: 'Safe to merge without further review.', human-review: 'A human should review this before it is merged.', block: 'This must not be merged until a human explicitly approves it.' } },
    touches_secrets: { type: 'boolean', instructions: 'Does the diff contain content that looks like an API key, password, or other credential?' },
  },
});

同类的其他项目