Recipe catalog / task-overlap
Detect overlapping tasks
task-overlap is a Jev recipe from the jev-recipes TypeScript package. Do firstTask and secondTask cover overlapping work, such that two workers would duplicate or collide? Use it when you are about to fan work out to several agents or people and need a yes/no check that two assignments will not step on each other.
Last updated .
Explore this recipe interactively · Source and implementation guide · Markdown version
How do I use task-overlap 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 { taskOverlap } from 'jev-recipes/task-overlap';
const result = await taskOverlap({
"firstTask": "Add input validation to the user registration form so that email and password fields show inline errors before submit.",
"secondTask": "Refactor the registration form to use the shared FormField component and wire up its built-in error display for every field.",
"minConfidence": 0.8
});
console.log(result);
What input does task-overlap take?
| Field | Type | Needed |
|---|---|---|
| firstTask | string | Required |
| secondTask | string | Required |
| minConfidence | number | Optional |
Full input and result schemas
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"firstTask": {
"type": "string"
},
"secondTask": {
"type": "string"
},
"minConfidence": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"firstTask",
"secondTask"
]
},
"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": [
"overlapping",
"disjoint"
]
}
},
"required": [
"model",
"usage",
"status",
"probability",
"confidence",
"verdict"
],
"additionalProperties": false
}
}What does a task-overlap 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 task-overlap.
{
"model": "demo-fixture",
"usage": {
"input_tokens": 0,
"output_tokens": 0
},
"status": "ready",
"probability": 0.93,
"confidence": 0.93,
"verdict": "overlapping"
}
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 overlapping when Jev's yes probability is at least 0.5 and disjoint otherwise. probability is that yes probability. confidence is the probability of the chosen side, so a 0.1 yes probability yields disjoint 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, such as running the two tasks sequentially or assigning them to the same worker.
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 recipe compares the two descriptions as written. Tasks that would touch the same files or records without saying so look disjoint, so pair it with a code-level check when collisions are costly. It reports that overlap exists, not which task should absorb the shared work. Whether two items are the same request is task-duplicate; whether one must finish before the other starts is task-dependency.
Example input
demo.json contains editable input and a hand-authored response. After installing jev-recipes, npx jev-recipes demo task-overlap shows an offline illustration, not an accuracy measurement. Use npx jev-recipes describe task-overlap to inspect the input and result schemas.
How accurate is task-overlap?
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 task-overlap?
- Judges overlap from the task descriptions alone. Tasks that touch the same files without saying so will look disjoint.
- Reports that overlap exists, not which task should absorb the shared work or how to split it.
Which recipes are related to task-overlap?
- task-duplicate: Use task-duplicate when the question is whether two items are the same request, rather than whether distinct requests share work.
- task-dependency: Use task-dependency to check whether one task must finish before the other can start, which overlap does not imply.