Recipe catalog / headline-fit
Check headline fit
headline-fit is a Jev recipe from the jev-recipes TypeScript package. Does headline accurately represent what body says, without promising more than the body delivers? Use it when you publish or review articles and want to catch headlines that overstate, contradict, or misdirect from the body before they go live.
Last updated .
Explore this recipe interactively · Source and implementation guide · Markdown version
How do I use headline-fit 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 { headlineFit } from 'jev-recipes/headline-fit';
const result = await headlineFit({
"headline": "New Study Proves Coffee Cures Depression",
"body": "A small observational study of 212 adults published this week found that participants who drank two or more cups of coffee a day reported fewer depressive symptoms over a six-month period. The authors caution that the design cannot establish causation and that unmeasured lifestyle factors may explain the association. They call for randomized trials before drawing clinical conclusions.",
"minConfidence": 0.8
});
console.log(result);
What input does headline-fit take?
| Field | Type | Needed |
|---|---|---|
| headline | string | Required |
| body | string | Required |
| minConfidence | number | Optional |
Full input and result schemas
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"headline": {
"type": "string"
},
"body": {
"type": "string"
},
"minConfidence": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"headline",
"body"
]
},
"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"
]
},
"probability": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"confidence": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"verdict": {
"type": "string",
"enum": [
"accurate",
"misleading"
]
}
},
"required": [
"model",
"usage",
"status",
"probability",
"confidence",
"verdict"
],
"additionalProperties": false
}
}What does a headline-fit 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 headline-fit.
{
"model": "demo-fixture",
"usage": {
"input_tokens": 0,
"output_tokens": 0
},
"status": "ready",
"probability": 0.08,
"confidence": 0.92,
"verdict": "misleading"
}
Input
See shared options and behavior for client configuration, validation, and errors. Types are inferred from this folder's Zod 4 schemas.
Result
verdict is accurate when Jev's yes probability is at least 0.5 and misleading otherwise. probability is that yes probability. confidence is the probability of the chosen side, so a 0.1 yes probability yields misleading with 0.9 confidence.
A result is ready when confidence meets minConfidence. Otherwise it is review. Treat a review result as unknown and fall back to your safe default.
Reuse and calls
Uses the shared gate helper, a single yes/no question. This folder owns the question wording, the outcome descriptions, and the review policy. A live invocation makes one logical Jev request.
Limits
The verdict compares the headline to the supplied body and nothing else, so an accurate headline over a false body still reads as accurate. It does not grade style, length, search performance, or emotional appeal; use a separate check for those. Publishing rules such as character limits, banned words, and required disclaimers belong in application code.
Example input
demo.json contains editable input and a hand-authored response. After installing jev-recipes, npx jev-recipes demo headline-fit shows an offline illustration, not an accuracy measurement. Use npx jev-recipes describe headline-fit to inspect the input and result schemas.
How accurate is headline-fit?
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 headline-fit?
- Judges the headline against the supplied body only; it does not check whether the body itself is true.
- Does not measure engagement, search ranking, or style. Editorial house rules and length limits belong in code.
Which recipes are related to headline-fit?
- summary-coverage: Use summary-coverage to judge whether a longer summary captures the main points of a source.
- attribution-match: Use attribution-match to check whether a quoted claim is attributed to the source that actually made it.