Agent 工具

hunch

@Kelbie1TypeScriptMIT更新于 2026-09-20可当场跑

使用 Jev、简单英文规则和 Agent Skills 进行语义代码审查。

英文原文

Semantic code review with Jev, plain-English rules and Agent Skills.

Kelbie/hunch

它在哪儿调用了 Jev

/** TypeSafe's own REST API: POST https://api.typesafe.ai/v1/systemone. */

packages/core/src/jev.ts:101

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

它问 Jev 的问题

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

取自 packages/core/src/find.ts:45

  1. edit选项

    Would carrying out `task` require editing the code shown in `hunk`?

    • trueThis code implements, renders, computes or decides the behaviour `task` changes. Someone doing `task` would open this file and change these lines.
    • falseThe code is about something else, or it only mentions the same words while doing unrelated work.
  2. contract选项

    Does `hunk` define the specific value, limit, type, schema or interface that `task` turns on — the thing the new code would have to read or satisfy to work at all?

    • trueWithout this declaration `task` could not be implemented correctly: it is where the bound, unit, shape, option or route that `task` depends on is actually defined.
    • falseIt is merely nearby infrastructure, a general-purpose type, or something `task` could be implemented without ever reading. Broad relevance is not enough — this facet is for the definition `task` hinges on.
  3. caller选项

    Does `hunk` call, render, navigate to or otherwise consume the behaviour that `task` would change, so that it would see the difference?

    • trueIt uses the screen, function, hook, store or value that `task` changes, and would behave differently or need updating once `task` is done.
    • falseIt does not reach that behaviour, or it is the implementation rather than a consumer of it.
  4. test选项

    Does `hunk` test or exercise the screen, function or flow that `task` would change — so that it would need updating, or would catch a mistake made while doing `task`?

    • trueIt asserts on, drives or provides fixtures for that area, including its edge cases and error paths. `task` has not been done yet, so a test of the surrounding behaviour counts; a test of the new behaviour cannot exist.
    • falseIt tests something else, or it is not a test at all.
  5. precedent选项

    Does `hunk` already solve the same kind of problem `task` describes, somewhere else in the codebase, closely enough to show the pattern to follow?

    • trueIt is an existing, working example of the same kind of work — the same sort of validation, warning, limit, screen or flow — that someone doing `task` would copy the shape of.
    • falseIt is the place `task` changes rather than a precedent for it, or it solves a different kind of problem.

用你自己的内容跑一遍

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

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    edit: { type: 'choice', instructions: 'Would carrying out `task` require editing the code shown in `hunk`?',
      criteria: { true: 'This code implements, renders, computes or decides the behaviour `task` changes. Someone doing `task` would open this file and change these lines.', false: 'The code is about something else, or it only mentions the same words while doing unrelated work.' } },
    contract: { type: 'choice', instructions: 'Does `hunk` define the specific value, limit, type, schema or interface that `task` turns on — the thing the new code would have to read or satisfy to work at all?',
      criteria: { true: 'Without this declaration `task` could not be implemented correctly: it is where the bound, unit, shape, option or route that `task` depends on is actually defined.', false: 'It is merely nearby infrastructure, a general-purpose type, or something `task` could be implemented without ever reading. Broad relevance is not enough — this facet is for the definition `task` hinges on.' } },
    caller: { type: 'choice', instructions: 'Does `hunk` call, render, navigate to or otherwise consume the behaviour that `task` would change, so that it would see the difference?',
      criteria: { true: 'It uses the screen, function, hook, store or value that `task` changes, and would behave differently or need updating once `task` is done.', false: 'It does not reach that behaviour, or it is the implementation rather than a consumer of it.' } },
    test: { type: 'choice', instructions: 'Does `hunk` test or exercise the screen, function or flow that `task` would change — so that it would need updating, or would catch a mistake made while doing `task`?',
      criteria: { true: 'It asserts on, drives or provides fixtures for that area, including its edge cases and error paths. `task` has not been done yet, so a test of the surrounding behaviour counts; a test of the new behaviour cannot exist.', false: 'It tests something else, or it is not a test at all.' } },
    precedent: { type: 'choice', instructions: 'Does `hunk` already solve the same kind of problem `task` describes, somewhere else in the codebase, closely enough to show the pattern to follow?',
      criteria: { true: 'It is an existing, working example of the same kind of work — the same sort of validation, warning, limit, screen or flow — that someone doing `task` would copy the shape of.', false: 'It is the place `task` changes rather than a precedent for it, or it solves a different kind of problem.' } },
  },
});

取自 packages/core/src/pulls.ts:71

  1. duplicate是/否

    Does this pull request already implement what `task` describes? `task` has not been started. Judge the change in `diff` against what `task` asks for, using `title` and `body` for intent.

  2. overlap是/否

    Would the work in `task` and the change in `diff` touch the same code, so that doing `task` now would conflict with this pull request or need rebasing onto it?

用你自己的内容跑一遍

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

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    duplicate: { type: 'boolean', instructions: 'Does this pull request already implement what `task` describes? `task` has not been started. Judge the change in `diff` against what `task` asks for, using `title` and `body` for intent.' },
    overlap: { type: 'boolean', instructions: 'Would the work in `task` and the change in `diff` touch the same code, so that doing `task` now would conflict with this pull request or need rebasing onto it?' },
  },
});

取自 packages/core/test/skills.test.ts:137

  1. leak是/否

    Does `hunk` log a password?

用你自己的内容跑一遍

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

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    leak: { type: 'boolean', instructions: 'Does `hunk` log a password?' },
  },
});

取自 scripts/live-smoke.ts:7

  1. boolean是/否

    Does `text` say the sky is blue?

  2. choice选项

    What color is the sky in `text`?

    • blueBlue
    • redRed
  3. score打分

    How clearly does `text` state the sky's color?

    • 0No color stated
    • 1A color is stated explicitly

用你自己的内容跑一遍

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

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    boolean: { type: 'boolean', instructions: 'Does `text` say the sky is blue?' },
    choice: { type: 'choice', instructions: 'What color is the sky in `text`?',
      criteria: { blue: 'Blue', red: 'Red' } },
    score: { type: 'score', instructions: 'How clearly does `text` state the sky\'s color?',
      criteria: ['No color stated', 'A color is stated explicitly'] },
  },
});

同类的其他项目