护栏与审查
基于 TypeSafe Jev 构建的分阶段代码评审流程和本地仪表盘。
A staged code-review workflow and local dashboard built with TypeSafe Jev.
import { choice, noul, score, TypeSafeClient } from "@typesafe-ai/sdk";src/review/codebase-judgments.ts:3
链接指向我们抓取当天的那个 commit,行号是准的。
下面是从这个项目源码里原样取出来的 question 组合。
取自 src/review/codebase-judgments.ts:52
correctness是/否Does file.content directly support that this code contains incorrect runtime behavior?
security是/否Does file.content directly support that this code weakens a security boundary?
reliability是/否Does file.content directly support that this code can crash, race, leak, deadlock, or recover poorly?
compatibility是/否Does file.content directly support an internal inconsistency that can break a caller, format, protocol, or documented behavior?
testGap是/否Does file.content contain important behavior without adequate targeted evidence in relatedTests?
import { experimental_evaluate as evaluate } from 'ai';
const { answers } = await evaluate({
model: 'typesafe-ai/jev',
state,
questions: {
correctness: { type: 'boolean', instructions: 'Does file.content directly support that this code contains incorrect runtime behavior?' },
security: { type: 'boolean', instructions: 'Does file.content directly support that this code weakens a security boundary?' },
reliability: { type: 'boolean', instructions: 'Does file.content directly support that this code can crash, race, leak, deadlock, or recover poorly?' },
compatibility: { type: 'boolean', instructions: 'Does file.content directly support an internal inconsistency that can break a caller, format, protocol, or documented behavior?' },
testGap: { type: 'boolean', instructions: 'Does file.content contain important behavior without adequate targeted evidence in relatedTests?' },
},
});correctness是/否Does file.patch directly support that this change likely introduces incorrect runtime behavior?
security是/否Does file.patch directly support that this change introduces or weakens a security boundary?
reliability是/否Does file.patch directly support that this change can crash, race, leak, deadlock, or recover poorly?
compatibility是/否Does file.patch directly support that this change can break an existing caller, format, protocol, or public behavior?
testGap是/否Does file.patch change important behavior without adequate targeted evidence in changedTests?
import { experimental_evaluate as evaluate } from 'ai';
const { answers } = await evaluate({
model: 'typesafe-ai/jev',
state,
questions: {
correctness: { type: 'boolean', instructions: 'Does file.patch directly support that this change likely introduces incorrect runtime behavior?' },
security: { type: 'boolean', instructions: 'Does file.patch directly support that this change introduces or weakens a security boundary?' },
reliability: { type: 'boolean', instructions: 'Does file.patch directly support that this change can crash, race, leak, deadlock, or recover poorly?' },
compatibility: { type: 'boolean', instructions: 'Does file.patch directly support that this change can break an existing caller, format, protocol, or public behavior?' },
testGap: { type: 'boolean', instructions: 'Does file.patch change important behavior without adequate targeted evidence in changedTests?' },
},
});