Recipe catalog / paragraph-boundary
Recover a paragraph boundary
paragraph-boundary is a Jev recipe from the jev-recipes TypeScript package. Do two adjacent extracted text fragments continue one paragraph or belong to separate blocks? Use it when extraction preserved reading order but lost the difference between a hard line wrap and a paragraph break.
Last updated .
Explore this recipe interactively · Source and implementation guide · Markdown version
How do I use paragraph-boundary 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 { paragraphBoundary } from 'jev-recipes/paragraph-boundary';
const result = await paragraphBoundary({
"left": "To finish installing the package, run",
"right": "the command shown in the next example.",
"minConfidence": 0.8
});
console.log(result);
What input does paragraph-boundary take?
| Field | Type | Needed |
|---|---|---|
| left | string | Required |
| right | string | Required |
| before | string | Optional |
| after | string | Optional |
| context | string | Optional |
| minConfidence | number | Optional |
Full input and result schemas
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"left": {
"type": "string"
},
"right": {
"type": "string"
},
"before": {
"type": "string"
},
"after": {
"type": "string"
},
"context": {
"type": "string"
},
"minConfidence": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"left",
"right"
]
},
"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": [
"continue",
"separate",
"unclear"
]
},
"confidence": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"probabilities": {
"type": "object",
"propertyNames": {
"type": "string",
"enum": [
"continue",
"separate",
"unclear"
]
},
"additionalProperties": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"required": [
"continue",
"separate",
"unclear"
]
}
},
"required": [
"model",
"usage",
"status",
"verdict",
"confidence",
"probabilities"
],
"additionalProperties": false
}
}What does a paragraph-boundary 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 paragraph-boundary.
{
"model": "demo-fixture",
"usage": {
"input_tokens": 0,
"output_tokens": 0
},
"status": "ready",
"verdict": "continue",
"confidence": 0.96,
"probabilities": {
"continue": 0.96,
"separate": 0.02,
"unclear": 0.02
}
}
Input
See shared options and behavior for client configuration, validation, and errors. Types are inferred from this folder's Zod 4 schemas. before and after and context are optional and are omitted from the request when absent.
Result
Returns continue, separate, or unclear with probabilities and ready or review status. A review result never authorizes joining.
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.
Limits
The caller owns ordering, whitespace, native structure, dehyphenation, and source offsets. Preserve the boundary unless a ready continue result meets the application policy. Experimental: the demo is a fixture, not an accuracy measurement.
Example input
demo.json contains editable input and a hand-authored response. After installing jev-recipes, npx jev-recipes demo paragraph-boundary shows an offline illustration, not an accuracy measurement. Use npx jev-recipes describe paragraph-boundary to inspect the input and result schemas.
Measured accuracy
The public evaluation corpus and reproducible transformations are described in the evaluation guide. The ingestion example preserves original text and offsets while returning a proposal.
How accurate is paragraph-boundary?
jev-1.13.0 / 2026-10-04 / 112 development cases
Scoring revision 2.
55 ready decisions, with 100% accuracy among those decisions.
95% case-level interval: 88% to 97%. Related synthetic cases are correlated.
This measures the recorded dataset, not general readiness. Label sources: public-dataset: https://raw.githubusercontent.com/nodejs/node/v22.20.0/doc/api/assert.md; source Markdown labels, transformed by build-ingestion-cases.mjs; no independent human review; Node.js MIT license.; public-dataset: https://raw.githubusercontent.com/nodejs/node/v22.20.0/doc/api/child_process.md; source Markdown labels, transformed by build-ingestion-cases.mjs; no independent human review; Node.js MIT license.; public-dataset: https://raw.githubusercontent.com/nodejs/node/v22.20.0/doc/api/crypto.md; source Markdown labels, transformed by build-ingestion-cases.mjs; no independent human review; Node.js MIT license.; public-dataset: https://raw.githubusercontent.com/nodejs/node/v22.20.0/doc/api/diagnostics_channel.md; source Markdown labels, transformed by build-ingestion-cases.mjs; no independent human review; Node.js MIT license.; public-dataset: https://raw.githubusercontent.com/nodejs/node/v22.20.0/doc/api/dns.md; source Markdown labels, transformed by build-ingestion-cases.mjs; no independent human review; Node.js MIT license.; public-dataset: https://raw.githubusercontent.com/nodejs/node/v22.20.0/doc/api/errors.md; source Markdown labels, transformed by build-ingestion-cases.mjs; no independent human review; Node.js MIT license.; public-dataset: https://raw.githubusercontent.com/nodejs/node/v22.20.0/doc/api/process.md; source Markdown labels, transformed by build-ingestion-cases.mjs; no independent human review; Node.js MIT license.; public-dataset: https://raw.githubusercontent.com/nodejs/node/v22.20.0/doc/api/repl.md; source Markdown labels, transformed by build-ingestion-cases.mjs; no independent human review; Node.js MIT license.; public-dataset: https://raw.githubusercontent.com/nodejs/node/v22.20.0/doc/api/timers.md; source Markdown labels, transformed by build-ingestion-cases.mjs; no independent human review; Node.js MIT license.; public-dataset: https://raw.githubusercontent.com/nodejs/node/v22.20.0/doc/api/tls.md; source Markdown labels, transformed by build-ingestion-cases.mjs; no independent human review; Node.js MIT license.; public-dataset: https://raw.githubusercontent.com/nodejs/node/v22.20.0/doc/api/util.md; source Markdown labels, transformed by build-ingestion-cases.mjs; no independent human review; Node.js MIT license.; public-dataset: https://raw.githubusercontent.com/nodejs/node/v22.20.0/doc/api/vm.md; source Markdown labels, transformed by build-ingestion-cases.mjs; no independent human review; Node.js MIT license.; public-dataset: https://raw.githubusercontent.com/nodejs/node/v22.20.0/doc/api/wasi.md; source Markdown labels, transformed by build-ingestion-cases.mjs; no independent human review; Node.js MIT license.; public-dataset: https://raw.githubusercontent.com/nodejs/node/v22.20.0/doc/api/webcrypto.md; source Markdown labels, transformed by build-ingestion-cases.mjs; no independent human review; Node.js MIT license.
Use the evaluation guide to measure this decision on your own labeled cases.
What are the limits of paragraph-boundary?
- Judges adjacent text only; it does not reconstruct reading order, perform OCR, dehyphenate, or merge text.
- Shared subject matter alone does not establish paragraph continuity. Preserve the boundary on review.
- Experimental until document-separated evaluation meets the published accepted-join precision criteria.
Which recipes are related to paragraph-boundary?
- passage-standalone: Use passage-standalone to judge unresolved references within a passage.
- topic-shift: Use topic-shift for conversational subject changes rather than text boundaries.
- text-block-role: Use text-block-role to classify an individual block before considering a join.