the short answer
Jev cannot generate arbitrary strings, dates or identifiers. For extraction, first produce candidates with deterministic parsing, retrieval or a generative structured-output model; validate and normalize them in code; then use Jev Choice or Noul to select or verify a bounded candidate. Include not-stated handling, preserve source spans and evaluate extraction and selection as separate stages.
- Native Jev capability
- Bounded selection and semantic verification
- Not native
- Arbitrary value generation
- Candidate sources
- Parser, retrieval, dictionary or generative model
- Exact validation
- Code
- Required escape
- Not stated / no valid candidate
Extraction Contains Generation and Judgment
Finding an arbitrary company name, address or contract clause can require producing text that was not enumerated in advance. Jev is not trained for generation. TypeSafe’s jaggedness guidance recommends generating or finding possible options first and letting Jev select among them.
This decomposition makes errors diagnosable. Candidate recall asks whether the correct value was found; selection accuracy asks whether Jev chose it; validation asks whether the value conforms to syntax and business rules. A single end-to-end accuracy number hides which component needs work.
Choose Candidate Generation from the Field Type
spaCy’s entity recognizer is one example of a component that proposes text spans; JSON Schema is one way to validate the structure of generated candidates. Neither determines which candidate fulfills the business meaning. Jev can perform that bounded semantic selection after candidates exist.
Prefer the least flexible generator that reaches adequate recall. A date parser is easier to test than an LLM for ISO dates; a controlled vocabulary is safer than extracting a new category name. The alternatives guide compares these components by output contract.
| Field type | Candidate generator | Why |
|---|---|---|
| Known enum | Application schema or database lookup | Every legal value is already enumerable |
| Date, amount or identifier | Parser, regex or typed library | Syntax and normalization are deterministic |
| Named entity in prose | NER, span search or structured LLM | The value must first be located in source text |
| Value from a large catalog | Keyword/vector retrieval with permission filters | The complete answer space is too large for one Choice |
| Novel summary or clause rewrite | Generative model | The required output is new text, not selection |
Contract Termination Date Without Asking Jev to Calculate Dates
After selection, code parses the chosen text into a real date and performs ordering, duration or window arithmetic. Jev 1.13 reads dates as text and TypeSafe advises exact date comparisons in code. The source span travels with the candidate so a reviewer can verify the result.
{
"state": {
"question": "Which stated date is the contract termination date?",
"candidates": {
"c1": {"text": "September 1, 2026", "source_span": "section 2"},
"c2": {"text": "December 31, 2026", "source_span": "section 9"},
"not_stated": {"text": "No candidate is identified as termination"}
}
},
"questions": {
"termination_date_candidate": {
"type": "choice",
"instructions": "Which candidate is explicitly identified as the contract termination date?",
"criteria": {"c1": null, "c2": null, "not_stated": null}
}
}
}Carry Provenance Through Normalization and Deduplication
This is an application-owned candidate record. Deduplicate by normalized meaning while retaining every source span; otherwise repeated mentions can crowd the Choice and make one date appear more supported simply because it occurs more often. Never discard the raw text needed to verify the normalization.
Candidate IDs should be opaque and stable. Do not embed the preferred answer into an ID such as correct_termination_date. Labels, field names and candidate descriptions are part of Jev’s evidence and can leak the answer.
{
"candidate_id": "c2",
"raw_text": "December 31, 2026",
"normalized_value": "2026-12-31",
"document_id": "contract-77",
"span": {"start": 1842, "end": 1859},
"generator": {"kind": "date_parser", "version": "v3"},
"validation": {"schema": "date", "status": "valid"},
"aliases": ["December 31st, 2026"]
}Selection Cannot Recover a Missing Candidate
Report end-to-end exact match and the stage metrics. Improving selection cannot compensate for poor candidate recall. Conversely, a high-recall generator that floods Jev with near-duplicates increases ambiguity, tokens and latency.
| Failure | Owner | Metric |
|---|---|---|
| Correct value never proposed | Candidate generator | Candidate recall |
| Malformed or impossible value survives | Normalizer/validator | Validation failure rate |
| Jev chooses wrong present value | Selection question/model | Conditional selection accuracy |
| No value exists but one is forced | Taxonomy/no-match design | False extraction rate |
| Correct value selected but wrong action follows | Application policy | End-to-end task outcome |
Handle Zero, One and Many Values Explicitly
A Choice encodes mutual competition. It is the wrong shape when every listed regulation, diagnosis code or contract party can independently apply. Multiple Nouls avoid forced exclusivity, but their probabilities do not form one normalized distribution and each label needs evaluation.
| Document truth | Question design | Application result |
|---|---|---|
| No value stated | Explicit not-stated candidate or separate presence Noul | Missing by source, not extraction failure |
| Exactly one value | Choice among deduplicated candidates | Selected value plus source spans |
| Several values allowed | One Noul per candidate or repeated selection with removal | Array of independently accepted values |
| Conflicting values | Preserve each candidate and its context | Conflict state requiring rule or review |
| Candidate list truncated | Do not run a forced final selection | Unscorable or retry candidate retrieval |
Use the Smallest Bounded Representation
Do not encode thousands of arbitrary candidates in one Choice because the API permits a large list. Candidate-set size changes probability semantics and can exceed useful context. Filter deterministically and benchmark shortlist recall.
- Enumerations: Choice over valid canonical values plus not-stated.
- Multi-label entities: one Noul per validated candidate when several can apply.
- Ordered qualitative attributes: Score with explicit rubric levels.
- Dates and numbers: extract components, parse and calculate in code.
- Long documents: retrieve source passages before candidate generation and selection.
Validate Syntax, Source Support and Business Meaning Separately
Do not ask one model call to certify all six layers. Separating them makes failures reproducible and keeps exact rules out of probabilistic inference. A Jev result can identify semantic role; it cannot turn an invalid value into a valid one or grant access to the source document.
| Layer | Example check | Mechanism |
|---|---|---|
| Syntax | 2026-02-30 is not a date | Typed parser or JSON Schema format validation |
| Normalization | $1,200.00 becomes decimal 1200.00 USD | Locale-aware deterministic code |
| Source support | Selected value occurs at the recorded span | Offset or token-span verification |
| Semantic role | The date is termination, not signature | Jev Choice/Noul or reviewed classifier |
| Business rule | Termination falls inside a notice window | Date arithmetic and policy code |
| Authorization | Caller may access and act on this contract | Identity and access-control system |
Preserve Provenance and Treat Source Text as Untrusted
Each candidate needs a stable source document, span and extraction-method reference. Never let a selected string become a database key, URL, command or account identifier without deterministic validation and authorization. Adversarial document text can steer Jev 1.13, so model selection is not a trust conversion.
For personal, legal or financial records, minimize fields and apply the deployment’s retention and access policies. The state guide covers trust separation, while the relevant domain use cases describe human-review boundaries.
Document Text Can Attack the Selector
A contract, email or webpage can contain instructions addressed to an AI system. Those strings are evidence, not trusted application instructions. Keep the extraction criterion outside the document, label source boundaries clearly and never let selected text become a command, URL or identifier without deterministic validation. OWASP’s prompt-injection guidance treats external content as untrusted even when it arrives through retrieval.
Test candidates whose surrounding text says “ignore previous instructions,” visually hides a different value, repeats one option many times or places conflicting values in appendices. TypeSafe documents adversarial steering and long irrelevant state as Jev 1.13 weaknesses; the limitations guide turns them into regression cases.
Evaluate Stages and Slices
Report candidate recall, conditional selection accuracy and end-to-end exact match with separate denominators. For 100 fields, a generator that contains the truth in 90 candidate sets and a selector correct on 81 of those has 90% candidate recall, 90% conditional selection accuracy and 81% end-to-end accuracy. Reporting only 90% selection accuracy hides the missing candidates.
Measure source-span precision and not-stated false positives as first-class outcomes. A plausible value copied from the wrong clause can pass normalized-value checks while failing provenance. Use the evaluator scorecard for uncertainty and release gates.
- Freeze documents, source annotations and a held-out split.
- Measure candidate recall before Jev sees the list.
- Measure conditional selection and not-stated calibration when the truth is present or absent.
- Measure end-to-end exact match, source-span correctness, review coverage, latency and cost.
- Slice by document type, length, language, number of candidates and adversarial content.
Monitor the Extraction Pipeline by Stage
A shift in final accuracy can originate in document layout, OCR, the candidate generator, normalization, Jev, thresholding or reviewer practice. Version each stage and preserve the intermediate artifacts so drift monitoring can locate the change.
- Documents with zero, one, many, conflicting or truncated candidates.
- Candidate count, deduplication rate and source-span validation failures.
- Jev answer distributions, no-match rate and review-band coverage.
- End-to-end corrections by field type, document type, language and generator version.
- Latency and cost for parsing, retrieval or generation, Jev selection and human review.
FAQ
Can Jev return a name not in the candidates?
No. Jev’s native interface returns bounded typed decisions. Use a parser or generative model to propose arbitrary text first.
How do I handle a missing value?
Include a clear not-stated/no-valid-candidate option or separate fit Noul, then route uncertainty rather than forcing a value.
Should Jev parse dates?
It may select among text candidates, but TypeSafe recommends parsing and comparing exact dates in code.
What is the most important extraction metric?
End-to-end correctness matters, but candidate recall and conditional selection accuracy reveal which pipeline stage fails.
Sources
Checked against the sources below on September 22, 2026. Model versions, prices and limits change.
- TypeSafe AI docs: Jev 1.13 jaggedness
- TypeSafe AI docs: How to build with System One
- TypeSafe AI docs: Primitives
- TypeSafe AI docs: State
- TypeSafe AI docs: HTTP API reference
- JSON Schema: Understanding JSON Schema
- spaCy: EntityRecognizer API
- OWASP: Prompt Injection