Recipe catalog / deadline-risk
Grade the risk of missing a deadline
How at risk is the work of missing deadline given progress, from on track to already missed or impossible?
A supervisor or planner has a stated deadline and a progress report and needs a graded read on whether to escalate, replan, or leave the work alone.
Explore this recipe interactively ยท Source and implementation guide
Use deadline-risk 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 { deadlineRisk } from 'jev-recipes/deadline-risk';
const result = await deadlineRisk({
"deadline": "The migrated customer records must be live in the new CRM by end of day Friday, per the signed contract. It is now Thursday at 6pm.",
"progress": "The export from the old system finished Wednesday. The import script rejects about 30% of records with a schema mismatch that nobody has diagnosed yet. The engineer who wrote the field mapping is out until Monday. No fallback or partial go-live has been agreed with the customer.",
"minConfidence": 0.8
});
console.log(result);
Input contract
| Field | Type | Needed |
|---|---|---|
| deadline | string | Required |
| progress | string | Required |
| minConfidence | number | Optional |
Full input and result schemas
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"deadline": {
"type": "string"
},
"progress": {
"type": "string"
},
"minConfidence": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"deadline",
"progress"
]
},
"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"
]
},
"score": {
"type": "number",
"minimum": 0
},
"level": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"confidence": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"probabilities": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"risk": {
"type": "string",
"enum": [
"none",
"minor",
"moderate",
"high",
"missed"
]
}
},
"required": [
"model",
"usage",
"status",
"score",
"level",
"confidence",
"probabilities",
"risk"
],
"additionalProperties": false
}
}Saved example result
This hand-authored response demonstrates the contract. It is not a model accuracy measurement. Run it without an API key: npx jev-recipes demo deadline-risk.
{
"model": "demo-fixture",
"usage": {
"input_tokens": 0,
"output_tokens": 0
},
"status": "ready",
"score": 2.99,
"level": 3,
"confidence": 0.82,
"probabilities": {
"0": 0,
"1": 0.01,
"2": 0.08,
"3": 0.82,
"4": 0.09
},
"risk": "high"
}
Evaluation evidence
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.
Limitations
- Judges described progress against the described deadline. Date arithmetic, calendar lookups, and working-hour calculations belong in application code; state the time remaining in the text.
- Trusts the progress report as written. Optimistic or stale reports produce optimistic grades.
- A grade is not a plan. Escalation and replanning decisions belong to the caller.
Related recipes
- step-progress: Use step-progress to judge whether a single new observation moved the task forward, rather than how the whole effort stands against a deadline.
- task-complexity: Use task-complexity to grade how hard a task is before it starts, rather than how it is tracking once underway.