Recipe catalog / review-comment-kind
Classify review comment kind
review-comment-kind is a Jev recipe from the jev-recipes TypeScript package. What is the primary kind of comment? Use it when you need to sort code review comments so blocking defects surface first and optional polish can be batched or deferred.
Last updated .
Explore this recipe interactively · Source and implementation guide · Markdown version
How do I use review-comment-kind in TypeScript?
Install with npm install jev-recipes. Requires Node.js 22.9 or newer and ES modules. Set TYPESAFE_API_KEY in your server environment for live calls, which send input to TypeSafe and use API quota. See the installation guide.
import { reviewCommentKind } from 'jev-recipes/review-comment-kind';
const result = await reviewCommentKind({
"comment": "This returns undefined when the list is empty because items[0] is read before the length check. Guard on items.length first.",
"context": "Comment left on a helper function in a pull request that adds a formatting utility."
});
console.log(result);
What input does review-comment-kind take?
| Field | Type | Needed |
|---|---|---|
| comment | string | Required |
| context | string | Optional |
| minConfidence | number | Optional |
Full input and result schemas
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"comment": {
"type": "string"
},
"context": {
"type": "string"
},
"minConfidence": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"comment"
]
},
"result": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"model": {
"type": "string"
},
"usage": {
"type": "object",
"properties": {
"input_tokens": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"output_tokens": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"input_tokens",
"output_tokens"
],
"additionalProperties": false
},
"status": {
"type": "string",
"enum": [
"ready",
"review"
]
},
"verdict": {
"type": "string",
"enum": [
"bug",
"design",
"style",
"question",
"nit",
"praise",
"unclear"
]
},
"confidence": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"probabilities": {
"type": "object",
"propertyNames": {
"type": "string",
"enum": [
"bug",
"design",
"style",
"question",
"nit",
"praise",
"unclear"
]
},
"additionalProperties": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"required": [
"bug",
"design",
"style",
"question",
"nit",
"praise",
"unclear"
]
}
},
"required": [
"model",
"usage",
"status",
"verdict",
"confidence",
"probabilities"
],
"additionalProperties": false
}
}What does a review-comment-kind result look like?
This hand-authored response demonstrates the contract. It is not a model accuracy measurement. Run it without an API key: npx jev-recipes demo review-comment-kind.
{
"model": "demo-fixture",
"usage": {
"input_tokens": 0,
"output_tokens": 0
},
"status": "ready",
"verdict": "bug",
"confidence": 0.91,
"probabilities": {
"bug": 0.91,
"design": 0.04,
"style": 0.01,
"question": 0.01,
"nit": 0.02,
"praise": 0,
"unclear": 0.01
}
}
Input
See shared options and behavior for client configuration, validation, and errors. context is optional and is omitted from the request when absent.
Result
| Verdict | Meaning |
|---|---|
bug |
The comment points at incorrect behavior, a defect, or a case the code handles wrongly. |
design |
The comment concerns structure, architecture, or the overall approach rather than a specific defect. |
style |
The comment concerns naming, formatting, or idiom without changing behavior. |
question |
The comment asks for clarification or explanation without asserting a problem. |
nit |
The comment suggests trivial optional polish that the author may ignore. |
praise |
The comment expresses approval or appreciation without requesting a change. |
unclear |
The primary kind of the comment is not established by the supplied text. |
The result includes verdict, confidence, and all choice probabilities. unclear always requires review, even at high confidence. Other verdicts can be ready.
Results include model and token usage. Decisions below minConfidence require review. Inspect the outcome as well as the status.
Reuse and calls
Uses the shared choice helper for the Jev call and response parsing. This folder owns its question, verdict criteria, and review policy. A live invocation makes one logical Jev request; SDK retries can add transport attempts.
Limits
Classifies what the comment says, not whether it is correct or whether the author must act on it. A comment that mixes kinds, such as a bug report with a naming aside, is graded by its primary purpose. Blocking, merge, and notification rules belong in application code.
Example input
demo.json contains editable input and a hand-authored response. After installing jev-recipes, npx jev-recipes demo review-comment-kind shows the result offline. The fixture is an illustration, not an accuracy measurement. npx jev-recipes describe review-comment-kind shows the input and result schemas.
How accurate is review-comment-kind?
No verified live accuracy measurement is available. Evaluate representative cases before using this decision in your workflow.
Use the evaluation guide to measure this decision on your own labeled cases.
What are the limits of review-comment-kind?
- Classifies what the comment says, not whether it is correct or whether the author must act on it. Blocking and merge rules belong in application code.
Which recipes are related to review-comment-kind?
- feedback-kind: Use feedback-kind to classify general product or service feedback outside code review.
- turn-intent: Use turn-intent to classify the communicative purpose of a conversational message.