Guardrails & review
GitHub Action that uses Jev (TypeSafe AI via Vercel AI Gateway) to cheaply triage pull requests before expensive LLM/human review
// `experimental_evaluate` (typed decisions), since FR-006's secondaryThe link points at the commit we read, so the line number still holds.
These question sets are lifted from this project's source exactly as written.
from src/jev.ts:31
should_reviewtrue/falseDoes this pull request need a human or LLM code review at all, or is it trivial
riskchoiceHow risky is this change, based on the diff content and changed files?
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.routechoiceGiven the risk above, how should this PR be routed?
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_secretstrue/falseDoes 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?' },
},
});