veriquote 0.2.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/CITATION.cff +2 -2
  2. package/README.md +91 -36
  3. package/dist/cli/main.js +12 -1
  4. package/dist/cli/main.js.map +1 -1
  5. package/dist/gate.d.ts +1 -1
  6. package/dist/gate.d.ts.map +1 -1
  7. package/dist/gate.js +14 -0
  8. package/dist/gate.js.map +1 -1
  9. package/dist/index.d.ts +2 -1
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +2 -1
  12. package/dist/index.js.map +1 -1
  13. package/dist/judge/decisions-judge.d.ts +72 -0
  14. package/dist/judge/decisions-judge.d.ts.map +1 -0
  15. package/dist/judge/decisions-judge.js +160 -0
  16. package/dist/judge/decisions-judge.js.map +1 -0
  17. package/dist/match/fuzzy.d.ts +10 -2
  18. package/dist/match/fuzzy.d.ts.map +1 -1
  19. package/dist/match/fuzzy.js +87 -11
  20. package/dist/match/fuzzy.js.map +1 -1
  21. package/dist/protocol/evi1.d.ts +21 -1
  22. package/dist/protocol/evi1.d.ts.map +1 -1
  23. package/dist/protocol/evi1.js +169 -28
  24. package/dist/protocol/evi1.js.map +1 -1
  25. package/dist/protocol/prompt.d.ts +6 -0
  26. package/dist/protocol/prompt.d.ts.map +1 -1
  27. package/dist/protocol/prompt.js +35 -10
  28. package/dist/protocol/prompt.js.map +1 -1
  29. package/dist/report.d.ts.map +1 -1
  30. package/dist/report.js +52 -15
  31. package/dist/report.js.map +1 -1
  32. package/dist/types.d.ts +23 -2
  33. package/dist/types.d.ts.map +1 -1
  34. package/package.json +3 -3
  35. package/src/cli/main.ts +13 -2
  36. package/src/gate.ts +16 -1
  37. package/src/index.ts +10 -0
  38. package/src/judge/decisions-judge.ts +230 -0
  39. package/src/match/fuzzy.ts +98 -11
  40. package/src/protocol/evi1.ts +174 -29
  41. package/src/protocol/prompt.ts +42 -9
  42. package/src/report.ts +53 -21
  43. package/src/types.ts +20 -2
package/CITATION.cff CHANGED
@@ -9,12 +9,12 @@ authors:
9
9
  orcid: "https://orcid.org/0009-0009-5596-736X"
10
10
  repository-code: "https://github.com/rickintoplace/veriquote"
11
11
  license: MIT
12
- version: 0.2.2
12
+ version: 0.4.0
13
13
  identifiers:
14
14
  - type: doi
15
15
  value: 10.5281/zenodo.21552379
16
16
  description: Concept DOI, resolves to the latest version
17
- date-released: "2026-09-22"
17
+ date-released: "2026-10-08"
18
18
  keywords:
19
19
  - large language models
20
20
  - retrieval-augmented generation
package/README.md CHANGED
@@ -13,12 +13,13 @@ deterministic matcher confirms that the quote is in the source, and an LLM
13
13
  judge decides whether the quote supports the claim.
14
14
 
15
15
  Both checks are needed. Strong models copy quotes reliably: the best open
16
- models in my tests quoted verbatim in over 99% of cases, and a recent study
17
- measured 98% for a frontier model. But a real quote is not a supported claim;
16
+ models in my tests quoted verbatim in 100% of cases, and a recent study
17
+ measured 98% for a frontier model. But a real quote is not a supported claim:
18
18
  in that study, only 37% of the model's claims were fully supported by their
19
- quotes.[^zhang] Weaker models also leave citations without any quote, and a
20
- judge asked whether a quote supports a claim is not built to notice that the
21
- quote was made up. VeriQuote is written in TypeScript, has no dependencies and
19
+ quotes,[^zhang] and in my tests 71% to 97% were, depending on the model.
20
+ Weaker models also leave citations without any quote, and a judge asked
21
+ whether a quote supports a claim is not built to notice that the quote was
22
+ made up. VeriQuote is written in TypeScript, has no dependencies and
22
23
  runs in Node and in the browser.
23
24
 
24
25
  **Try it in the browser:** [rickinto.place/veriquote](https://rickinto.place/veriquote)
@@ -111,13 +112,13 @@ it: in the example above, it rates the made-up quote in `c4` as "entailed 0.90".
111
112
 
112
113
  <picture>
113
114
  <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/rickintoplace/veriquote/main/bench/figures/matcher-dark.svg">
114
- <img alt="Matcher score ranges for fifteen kinds of quote damage: faithful quotes score between 0.66 and 1.0, quotes that are not in the source between 0.14 and 0.40, and quotes whose meaning was changed score high because they are still near-verbatim." src="https://raw.githubusercontent.com/rickintoplace/veriquote/main/bench/figures/matcher-light.svg">
115
+ <img alt="Matcher score ranges for fifteen kinds of quote damage: faithful quotes score between 0.85 and 1.0, quotes that are not in the source between 0.14 and 0.40, and quotes whose meaning was changed score high because they are still near-verbatim." src="https://raw.githubusercontent.com/rickintoplace/veriquote/main/bench/figures/matcher-light.svg">
115
116
  </picture>
116
117
 
117
118
  The matcher benchmark needs no API key and no labels, because the right answer
118
119
  is known by construction: 2,061 quotes built from five Wikipedia articles, then
119
120
  copied faithfully, reformatted, altered or replaced in fifteen different ways. `npm run bench:matcher` reproduces it in
120
- about two seconds. Faithfully copied quotes never score below 0.660, quotes
121
+ about two seconds. Faithfully copied quotes never score below 0.851, quotes
121
122
  that are not in the source never above 0.396, and the default threshold of 0.4
122
123
  sits in that gap. The amber rows are there on purpose: a quote whose meaning was
123
124
  changed is still near-verbatim, and catching it is the judge's job.
@@ -131,7 +132,7 @@ fails every citation below 0.5 and leaves the rest to the judge.
131
132
 
132
133
  <picture>
133
134
  <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/rickintoplace/veriquote/main/bench/figures/judges-dark.svg">
134
- <img alt="Five open judge models against the human labels of ALCE: they catch between 75% and 84% of unsupported citations, and agree with the annotators on 76.7% to 80.3% of pairs, around the 77.6% of the TRUE NLI model." src="https://raw.githubusercontent.com/rickintoplace/veriquote/main/bench/figures/judges-light.svg">
135
+ <img alt="Open judge models, asked as chat judges or read through their logprobs, and two decision models against the human labels of ALCE: they catch between 75% and 89.3% of unsupported citations, and agree with the annotators on 74.0% to 84.2% of pairs, around the 77.6% of the TRUE NLI model." src="https://raw.githubusercontent.com/rickintoplace/veriquote/main/bench/figures/judges-light.svg">
135
136
  </picture>
136
137
 
137
138
  The judge is measured against the human annotators of ALCE[^alce], with the
@@ -145,8 +146,41 @@ reaches Cohen's κ 0.53 on the three-way labels (full, partial or no support).
145
146
  For comparison, ALCE reports κ 0.525 between its automatic metric and the
146
147
  annotators on citation precision.
147
148
 
149
+ Decision models are a different kind of judge: they return a probability per
150
+ class instead of text, so they give no reasons, take one request of a few
151
+ hundred tokens per citation, and pay nothing for output. VeriQuote ships one
152
+ as `DecisionsJudge` (OpenRouter's decisions endpoint), and two were measured:
153
+
154
+ - `pplx-decider-v1.1-27b` (Perplexity, **open weights**, the default) agreed
155
+ with the annotators more often than any other judge on the 240 pairs (84.2%,
156
+ κ 0.594) and caught 85.7% of the unsupported citations, for $0.002 in
157
+ 9 seconds. On all 2,896 ALCE pairs: 81.9% agreement, κ 0.550, 84.1% caught,
158
+ for $0.028.
159
+ - `jev-1.13` (TypeSafe, closed) caught more, 87.5% on the 240 pairs and 89.7%
160
+ on all 2,896, with less agreement overall (79.6% and 81.6%, κ 0.530), for
161
+ $0.09 on the full set.
162
+
163
+ So the two trade places: the open model is the better judge overall and costs
164
+ a third as much; the closed one lets fewer unsupported citations through. Both
165
+ are far cheaper than a chat judge with reasoning: `glm-5.3-flash` costs about
166
+ $0.00023 per citation through OpenRouter (measured on 48 pairs) against
167
+ $0.00001 for `pplx-decider`, roughly 24 times as much, and takes about 1.4 s
168
+ per citation against 30 ms. ALCE has been public since 2023, so training
169
+ contamination cannot be ruled out for these or for any other judge here.
170
+
171
+ The same idea works with open models. With `--logprobs`, a chat model answers
172
+ with a single letter (fully, partially or not supported), and the judge reads
173
+ the three probabilities from that token's logprobs: no reasoning, one token per
174
+ citation. Read this way, `qwen3.5-397b-a17b` caught 89.3% of the unsupported
175
+ citations (κ 0.526) and `qwen3.6-35b-a3b` 85.7% (κ 0.507), more than either
176
+ model reached as a chat judge with reasoning on. One caveat: this judge's short
177
+ prompt is not the chat judge's prompt, so part of the difference may come from
178
+ the wording rather than the readout. It needs an endpoint that returns logprobs
179
+ and continues a prefilled answer, as vLLM and llama.cpp do
180
+ ([`bench/lib/logprobs-judge.mjs`](bench/lib/logprobs-judge.mjs)).
181
+
148
182
  Before trusting any of this, look at the left panel: even the best judge lets
149
- one unsupported citation in six through as fully supported. No judge should be
183
+ about one unsupported citation in nine through as fully supported. No judge should be
150
184
  the only check. With only 56 unsupported pairs per run the intervals are wide,
151
185
  so neighbouring models are not really separated. With reasoning switched off,
152
186
  all three hybrid models caught less and agreed less while answering five to ten
@@ -158,27 +192,39 @@ rather than a quote, which makes its task harder than in normal use.
158
192
 
159
193
  <picture>
160
194
  <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/rickintoplace/veriquote/main/bench/figures/protocol-dark.svg">
161
- <img alt="Protocol compliance for eight answering models: qwen3.6, qwen3.5, deepseek-v4-flash and glm-5.3-flash are close to 100% complete and verbatim; gpt-oss-120b is complete in 33.3% of answers; mistral-medium quotes verbatim in 81.0% of citations; llama-3.1-8b manages about half." src="https://raw.githubusercontent.com/rickintoplace/veriquote/main/bench/figures/protocol-light.svg">
195
+ <img alt="Four open answering models with the current citation instructions: all quote verbatim in 100% of cases; fully supported citations range from 71.4% to 97.4% depending on model and judge, highest for qwen3.8-27b and glm-5.3-flash, lowest for qwen3.6-35b-a3b." src="https://raw.githubusercontent.com/rickintoplace/veriquote/main/bench/figures/protocol-light.svg">
162
196
  </picture>
163
197
 
164
- Each model answered 18 questions twice, with the citation instructions in its
165
- system prompt, and `parseAnswer()` decided mechanically whether it complied.
166
- Every raw answer is in
167
- [`bench/results/protocol-answers.jsonl`](bench/results/protocol-answers.jsonl).
168
- The strongest open models tested follow the format almost perfectly. Two
169
- others show failures a reader would not notice: `gpt-oss-120b` almost always
170
- prints the appendix, yet only a third of its answers give every citation a
171
- quote. `mistral-medium` is nearly always complete, but only 81% of its quotes
172
- are exact copies; the rest mostly join passages with "..." or change a few
173
- words, and the matcher still finds them at a lower score. On the three
174
- questions the sources cannot answer, no model attached a citation without a
175
- real quote.
198
+ Four good open models answered 18 questions twice with the citation
199
+ instructions in their system prompt. Every quote was matched against its
200
+ source, and two judges rated whether the quotes cover every detail of the claim
201
+ (*fully supported*). All quotes were verbatim. The share of fully supported
202
+ citations depends more on the model than on the judge.
203
+
204
+ The instructions were revised on the strength of this benchmark: they now ask
205
+ that the quotes of a sentence contain every number, population, condition and
206
+ hedge it states, and otherwise drop the detail. On the same tasks and models,
207
+ that raised full support by 7.6 points (95% interval 1.5–14.2) with the chat
208
+ judge, by 14.1 points (7.6–21.5) with `jev-1.13` and by 11.7 points (4.8–19.2)
209
+ with `pplx-decider`, while the answers
210
+ stated as many cited claims as before. Writing the evidence before the answer
211
+ (`evidenceFirst`) added nothing reliable (+3.6 and −0.3 points, both intervals
212
+ spanning zero), made one model drop quotes, and hides the answer until the
213
+ evidence is written, so it is not the default. On the three questions the
214
+ sources cannot answer, no model attached a citation without a real quote.
215
+ Every raw answer is in `bench/results/`, and
216
+ [`bench/README.md`](bench/README.md#2-protocol-compliance) has the full tables,
217
+ including weaker models under the previous instructions.
176
218
 
177
219
  <details>
178
220
  <summary>The numbers behind the figures</summary>
179
221
 
180
222
  | judge model | caught ↑ | agreement | Cohen's κ |
181
223
  | --- | ---: | ---: | ---: |
224
+ | `qwen3.5-397b-a17b` (logprobs) | 89.3% | 81.3% | 0.526 |
225
+ | `jev-1.13` (decision model) | 87.5% | 79.6% | 0.497 |
226
+ | `pplx-decider-v1.1-27b` (decision model, open) | 85.7% | **84.2%** | **0.594** |
227
+ | `qwen3.6-35b-a3b` (logprobs) | 85.7% | 80.0% | 0.507 |
182
228
  | `glm-5.3-flash` | 83.9% | 80.3% | 0.529 |
183
229
  | `deepseek-v4-flash` | 81.8% | 78.7% | 0.435 |
184
230
  | `qwen3.6-35b-a3b` | 81.8% | 78.1% | 0.454 |
@@ -195,16 +241,15 @@ real quote.
195
241
  | near-verbatim, meaning changed | 586 | 0.932 | 100.0% |
196
242
  | not in the source | 187 | 0.249 | 0.0% |
197
243
 
198
- | answering model | appendix | complete | verbatim | warning-free |
199
- | --- | ---: | ---: | ---: | ---: |
200
- | qwen3.6-35b-a3b | 100.0% | 100.0% | 100.0% | 100.0% |
201
- | qwen3.5-397b-a17b | 100.0% | 100.0% | 100.0% | 100.0% |
202
- | deepseek-v4-flash | 100.0% | 100.0% | 99.2% | 93.3% |
203
- | glm-5.3-flash | 96.6% | 96.6% | 99.6% | 96.6% |
204
- | gemma-4-31b-it | 80.0% | 80.0% | 96.6% | 80.0% |
205
- | mistral-medium-3.5-128b | 96.7% | 93.3% | 81.0% | 96.7% |
206
- | gpt-oss-120b | 96.7% | 33.3% | 91.1% | 33.3% |
207
- | llama-3.1-8b-instruct | 66.7% | 43.3% | 50.3% | 20.0% |
244
+ | answering model | verbatim | complete | fully supported (deepseek-v4-flash) | fully supported (jev-1.13) | fully supported (pplx-decider) |
245
+ | --- | ---: | ---: | ---: | ---: | ---: |
246
+ | qwen3.8-27b | 100.0% | 100.0% | 97.4% | 97.4% | 97.4% |
247
+ | glm-5.3-flash | 100.0% | 100.0% | 95.1% | 93.0% | 90.8% |
248
+ | deepseek-v4-flash | 100.0% | 100.0% | 88.0% | 90.0% | 89.0% |
249
+ | qwen3.6-35b-a3b | 100.0% | 96.7% | 76.9% | 71.4% | 71.4% |
250
+
251
+ `deepseek-v4-flash` also judges its own answers here; the two decision models
252
+ are the independent checks, and all three judges rank the models the same way.
208
253
 
209
254
  The figures are rendered from `bench/results/*.json` by
210
255
  [`bench/figures/render.mjs`](bench/figures/render.mjs).
@@ -252,7 +297,7 @@ const systemPrompt = `${yourAssistantPrompt}\n\n${buildCitationInstructions()}`;
252
297
  ```
253
298
 
254
299
  ```ts
255
- import { ChatCompletionsJudge, verifyAnswer } from 'veriquote';
300
+ import { ChatCompletionsJudge, DecisionsJudge, verifyAnswer } from 'veriquote';
256
301
 
257
302
  const judge = new ChatCompletionsJudge({
258
303
  baseUrl: 'https://openrouter.ai/api/v1', // any OpenAI-compatible endpoint
@@ -260,6 +305,13 @@ const judge = new ChatCompletionsJudge({
260
305
  model: 'your-judge-model', // pick one with bench/judge
261
306
  });
262
307
 
308
+ // Or a decision model: one request per citation, ~$0.00001 each, no reasons.
309
+ // const judge = new DecisionsJudge({
310
+ // apiKey: process.env.OPENROUTER_API_KEY,
311
+ // provider: { zdr: true, data_collection: 'deny' }, // zero retention
312
+ // });
313
+ // In a browser, pass `fetch` pointing at your own proxy and no apiKey.
314
+
263
315
  const report = await verifyAnswer({
264
316
  answer: rawModelOutput, // including the EVI1 appendix
265
317
  sources: [
@@ -290,8 +342,10 @@ single source.
290
342
  | `verifyAnswer(options)` | The full pipeline: parse, match, judge, report. |
291
343
  | `parseAnswer(answer)` | Claims, quotes and protocol warnings, without verifying anything. |
292
344
  | `parseEvi1Appendix` / `stripEvi1Appendix` / `serializeEvi1Appendix` | Low-level handling of the appendix. |
345
+ | `stripForDisplay(text)` | The answer as a reader sees it, also mid-stream: no appendix, no `{cX}` markers, no half-streamed `EVI1` or `{c`. |
293
346
  | `matchQuoteAgainstSource(quote, source, options?)` | The deterministic matcher on its own. |
294
347
  | `ChatCompletionsJudge` | Judge for any OpenAI-compatible API. |
348
+ | `DecisionsJudge` | Judge backed by a decision model (OpenRouter's decisions endpoint); default `perplexity/pplx-decider-v1.1-27b`. |
295
349
  | `EntailmentJudge` (interface) | Bring your own judge, such as a local NLI model. |
296
350
  | `gateReport(report, answer)` | Pass or revise, the list of problems, uncited sentences and a correction prompt. |
297
351
  | `fetchSource(url)` / `htmlToText(html)` | Fetch a source independently of the model and extract its text. |
@@ -343,8 +397,9 @@ with its judge measured against human labels.
343
397
 
344
398
  ## Security
345
399
 
346
- - **Keep your key on the server.** `ChatCompletionsJudge` needs an API key; in
347
- your own app, call `verifyAnswer` from a backend. The demo runs the judge in
400
+ - **Keep your key on the server.** `ChatCompletionsJudge` and `DecisionsJudge`
401
+ need an API key; in your own app, call `verifyAnswer` from a backend, or give
402
+ the judge a `fetch` that goes through a proxy holding the key. The demo runs the judge in
348
403
  the browser only with a key the visitor enters.
349
404
  - **Source text is untrusted.** Judge inputs are length-capped, stripped of
350
405
  control characters and HTML, and marked as data in the prompt. The judge's
@@ -374,4 +429,4 @@ are also in [`CITATION.cff`](CITATION.cff).
374
429
 
375
430
  [^zhang]: Zhang, J., Chen, Y., Commodore-Mensah, Y., & Oberst, M. (2026). *Verifiable by construction: Claim-level evaluation of verbatim citation in clinical question answering* (Version 2) [Preprint]. arXiv. https://doi.org/10.48550/arXiv.2609.15964
376
431
 
377
- [^veriquote]: Heilmann, E. (2026). *VeriQuote: Deterministic and semantic verification of quote-grounded LLM citations* (Version 0.2.2) [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.21552379
432
+ [^veriquote]: Heilmann, E. (2026). *VeriQuote: Deterministic and semantic verification of quote-grounded LLM citations* (Version 0.4.0) [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.21552379
package/dist/cli/main.js CHANGED
@@ -227,6 +227,12 @@ function judgeFromEnv(args, io) {
227
227
  };
228
228
  }
229
229
  // ------------------------------------------------------------------ output
230
+ const MATCH_LABEL = {
231
+ exact: 'verbatim',
232
+ normalized: 'verbatim',
233
+ elided: 'verbatim with omission',
234
+ fuzzy: 'fuzzy',
235
+ };
230
236
  function renderHuman(report, gate, sources, model, color, minScore) {
231
237
  const c = (code, s) => (color ? `\x1b[${code}m${s}\x1b[0m` : s);
232
238
  const green = (s) => c('32', s);
@@ -241,7 +247,7 @@ function renderHuman(report, gate, sources, model, color, minScore) {
241
247
  const mark = bad ? red('✗') : cit.score === null ? yellow('?') : green('✓');
242
248
  const match = cit.textMatch.method === 'not_found'
243
249
  ? red(`quote not in source (best ${cit.textMatch.score.toFixed(2)})`)
244
- : `${cit.textMatch.method === 'fuzzy' ? 'fuzzy' : 'verbatim'} ${cit.textMatch.score.toFixed(2)}`;
250
+ : `${MATCH_LABEL[cit.textMatch.method]} ${cit.textMatch.score.toFixed(2)}`;
245
251
  const judged = cit.entailment
246
252
  ? cit.entailment.class === 'error'
247
253
  ? yellow('judge error')
@@ -249,8 +255,13 @@ function renderHuman(report, gate, sources, model, color, minScore) {
249
255
  : '';
250
256
  out.push(`${mark} ${cit.claimId} [${cit.sourceIndex}] ${[match, judged].filter(Boolean).join(' · ')}`);
251
257
  out.push(` ${truncate(cit.claimText || '(no claim text)', 160)}`);
258
+ const hides = gate.problems.find((p) => p.claimId === cit.claimId && p.sourceIndex === cit.sourceIndex)?.type === 'ellipsis_hides_qualifier';
252
259
  if (bad && cit.textMatch.method === 'not_found')
253
260
  out.push(dim(' the quoted text does not occur in the source'));
261
+ else if (hides) {
262
+ const cues = (cit.textMatch.omittedCues ?? []).map((c) => `"${c}"`).join(', ');
263
+ out.push(dim(` the ellipsis leaves out ${cues}; run with a judge to check the full passage`));
264
+ }
254
265
  else if (bad && cit.entailment?.reasons.length)
255
266
  out.push(dim(` ${cit.entailment.reasons.map((r) => r.trim().replace(/[.;]+$/, '')).join('; ')}`));
256
267
  else if (bad && cit.score !== null && cit.textMatch.method !== 'not_found') {
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAmB,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAiBjE,MAAM,CAAC,MAAM,IAAI,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAW,CAAC;AAE9D,MAAM,IAAI,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;2EA2B8D,CAAC;AAgB5E,MAAM,UAAW,SAAQ,KAAK;CAAG;AAEjC,SAAS,SAAS,CAAC,IAAc;IAC/B,MAAM,CAAC,GAAS,EAAE,UAAU,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAA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,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;QAC7C,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM;YAAE,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,4BAA4B,IAAI,CAAC,QAAQ,CAAC,MAAM,eAAe,CAAC,CAAC,CAAC;IAC9G,CAAC;IACD,IAAI,CAAC,KAAK;QAAE,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,gGAAgG,CAAC,CAAC,CAAC;IAC5H,OAAO,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AAC/B,CAAC;AAED,SAAS,QAAQ,CAAC,CAAS,EAAE,CAAS;IACpC,MAAM,IAAI,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IAC3C,OAAO,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC;AAC9D,CAAC"}
package/dist/gate.d.ts CHANGED
@@ -11,7 +11,7 @@ export interface GateThresholds {
11
11
  /** Uncited sentences shorter than this are ignored. Default 40. */
12
12
  minUncitedChars?: number;
13
13
  }
14
- export type ProblemType = 'quote_not_in_source' | 'contradicted_by_source' | 'overstated' | 'weakly_supported';
14
+ export type ProblemType = 'quote_not_in_source' | 'contradicted_by_source' | 'overstated' | 'weakly_supported' | 'ellipsis_hides_qualifier';
15
15
  export interface GateProblem {
16
16
  claimId: string;
17
17
  sourceIndex: number;
@@ -1 +1 @@
1
- {"version":3,"file":"gate.d.ts","sourceRoot":"","sources":["../src/gate.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAwB,eAAe,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAG5F,MAAM,WAAW,cAAc;IAC7B,oDAAoD;IACpD,QAAQ,CA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AAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,MAAM,EACd,UAAU,GAAE,cAAmB,GAC9B,UAAU,CAgCZ"}
package/dist/gate.js CHANGED
@@ -43,15 +43,28 @@ export function gateReport(report, answer, thresholds = {}) {
43
43
  function isProblem(c, minScore) {
44
44
  if (c.textMatch.method === 'not_found')
45
45
  return true;
46
+ if (hidesQualifier(c))
47
+ return true;
46
48
  const cls = c.entailment?.class;
47
49
  if (cls === 'contradicted' || cls === 'overstated')
48
50
  return true;
49
51
  // A null score means the judge errored; an outage is not evidence against the claim.
50
52
  return c.score !== null && c.score < minScore;
51
53
  }
54
+ /**
55
+ * The ellipsis leaves out a word such as "not" or "except", and no judge has
56
+ * read the full passage. A judge verdict settles it either way ("not only …
57
+ * but also" is harmless), so this only fires without one.
58
+ */
59
+ function hidesQualifier(c) {
60
+ const judged = c.entailment && c.entailment.class !== 'error';
61
+ return !judged && (c.textMatch.omittedCues?.length ?? 0) > 0;
62
+ }
52
63
  function problemType(c) {
53
64
  if (c.textMatch.method === 'not_found')
54
65
  return 'quote_not_in_source';
66
+ if (hidesQualifier(c))
67
+ return 'ellipsis_hides_qualifier';
55
68
  if (c.entailment?.class === 'contradicted')
56
69
  return 'contradicted_by_source';
57
70
  if (c.entailment?.class === 'overstated')
@@ -97,6 +110,7 @@ const FIX = {
97
110
  contradicted_by_source: 'the cited source contradicts this claim — remove the claim or correct it to match the source',
98
111
  overstated: 'this claim is stronger or more general than the evidence — weaken it to exactly what the quote supports',
99
112
  weakly_supported: 'this claim is only weakly supported — cite a better passage or soften the wording',
113
+ ellipsis_hides_qualifier: 'the ellipsis in the quote leaves out a word that may reverse or limit the statement — quote the passage without the omission, or split it into separate quotes',
100
114
  };
101
115
  function correctionInstructions(problems, uncited) {
102
116
  const lines = [
package/dist/gate.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"gate.js","sourceRoot":"","sources":["../src/gate.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO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C;IACvC,mBAAmB,EACjB,mHAAmH;IACrH,sBAAsB,EAAE,8FAA8F;IACtH,UAAU,EAAE,yGAAyG;IACrH,gBAAgB,EAAE,mFAAmF;IACrG,wBAAwB,EACtB,gKAAgK;CACnK,CAAC;AAEF,SAAS,sBAAsB,CAAC,QAAuB,EAAE,OAAiB;IACxE,MAAM,KAAK,GAAG;QACZ,oIAAoI;KACrI,CAAC;IACF,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;QACzB,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,MAAM,QAAQ,CAAC,CAAC,CAAC,SAAS,EAAE,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACxF,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,KAAK,CAAC,IAAI,CAAC,iCAAiC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,yDAAyD,CAAC,CAAC;IACzH,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,0EAA0E,CAAC,CAAC;IACvF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,SAAS,QAAQ,CAAC,CAAS,EAAE,CAAS;IACpC,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC;AACrD,CAAC;AAED,SAAS,KAAK,CAAC,CAAS;IACtB,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;AACnC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -11,11 +11,12 @@
11
11
  * which claims are verbatim-backed, supported, overstated, or unsupported.
12
12
  */
13
13
  export * from './types.js';
14
- export { EVI1_START, EVI1_END, parseAnswer, parseEvi1Appendix, stripEvi1Appendix, serializeEvi1Appendix, extractClaims, stripClaimMarkers, } from './protocol/evi1.js';
14
+ export { EVI1_START, EVI1_END, parseAnswer, parseEvi1Appendix, stripEvi1Appendix, stripForDisplay, serializeEvi1Appendix, extractClaims, stripClaimMarkers, } from './protocol/evi1.js';
15
15
  export { buildCitationInstructions, type CitationPromptOptions } from './protocol/prompt.js';
16
16
  export { matchQuoteAgainstSource, matchQuoteAgainstText, trigramCounts, diceSimilarity, bestFuzzyWindow, type MatchOptions, } from './match/fuzzy.js';
17
17
  export { normalizeForMatch, type NormalizedText } from './match/normalize.js';
18
18
  export { ChatCompletionsJudge, ENTAILMENT_CLASSES, type ChatJudgeOptions, } from './judge/chat-judge.js';
19
+ export { DecisionsJudge, DEFAULT_DECISION_MODEL, DECISION_CRITERIA, DECISION_SUPPORT, type DecisionsJudgeOptions, type DecisionsUsage, } from './judge/decisions-judge.js';
19
20
  export { verifyAnswer, type VerifyOptions } from './report.js';
20
21
  export { gateReport, type GateResult, type GateProblem, type GateThresholds, type ProblemType } from './gate.js';
21
22
  export { fetchSource, sourceFromBody, type FetchSourceOptions } from './source/fetch.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,cAAc,YAAY,CAAC;AAE3B,OAAO,EACL,UAAU,EACV,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,aAAa,EACb,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,yBAAyB,EAAE,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7F,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,aAAa,EACb,cAAc,EACd,eAAe,EACf,KAAK,YAAY,GAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,KAAK,cAAc,EAAE,MAAM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,aAAa,CAAC;AAE/D,OAAO,EAAE,UAAU,EAAE,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AACjH,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACzF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
package/dist/index.js CHANGED
@@ -11,11 +11,12 @@
11
11
  * which claims are verbatim-backed, supported, overstated, or unsupported.
12
12
  */
13
13
  export * from './types.js';
14
- export { EVI1_START, EVI1_END, parseAnswer, parseEvi1Appendix, stripEvi1Appendix, serializeEvi1Appendix, extractClaims, stripClaimMarkers, } from './protocol/evi1.js';
14
+ export { EVI1_START, EVI1_END, parseAnswer, parseEvi1Appendix, stripEvi1Appendix, stripForDisplay, serializeEvi1Appendix, extractClaims, stripClaimMarkers, } from './protocol/evi1.js';
15
15
  export { buildCitationInstructions } from './protocol/prompt.js';
16
16
  export { matchQuoteAgainstSource, matchQuoteAgainstText, trigramCounts, diceSimilarity, bestFuzzyWindow, } from './match/fuzzy.js';
17
17
  export { normalizeForMatch } from './match/normalize.js';
18
18
  export { ChatCompletionsJudge, ENTAILMENT_CLASSES, } from './judge/chat-judge.js';
19
+ export { DecisionsJudge, DEFAULT_DECISION_MODEL, DECISION_CRITERIA, DECISION_SUPPORT, } from './judge/decisions-judge.js';
19
20
  export { verifyAnswer } from './report.js';
20
21
  export { gateReport } from './gate.js';
21
22
  export { fetchSource, sourceFromBody } from './source/fetch.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,cAAc,YAAY,CAAC;AAE3B,OAAO,EACL,UAAU,EACV,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,aAAa,E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OAAO,EAAE,UAAU,EAA4E,MAAM,WAAW,CAAC;AACjH,OAAO,EAAE,WAAW,EAAE,cAAc,EAA2B,MAAM,mBAAmB,CAAC;AACzF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Entailment judge backed by a decision model through OpenRouter's
3
+ * Decisions API (`POST /api/alpha/decisions`). A decision model returns a
4
+ * probability per class instead of text: no reasons, no JSON to repair,
5
+ * a few hundred input tokens per citation and free output.
6
+ *
7
+ * Measured on the ALCE benchmark (bench/README.md):
8
+ * - perplexity/pplx-decider-v1.1-27b (open weights, the default):
9
+ * 2,896 pairs, binary agreement 81.9 %, kappa 0.550, false green
10
+ * 15.9 %, $0.028 in 74 s.
11
+ * - typesafe/jev-1.13 (closed): 81.6 %, kappa 0.530, false green
12
+ * 10.3 %, $0.090 in 70 s.
13
+ *
14
+ * Each class has a description the model chooses among; confidence is the
15
+ * expected degree of support under the class probabilities (the middle of
16
+ * each class's band in the chat judge's rubric). Class descriptions and
17
+ * support values are fixed and were not tuned on the benchmark.
18
+ *
19
+ * Security: run this server-side, or through a proxy that adds the key
20
+ * (pass `fetch` and leave `apiKey` empty). Inputs are length-capped.
21
+ */
22
+ import type { EntailmentClass, EntailmentInput, EntailmentJudge, EntailmentResult } from '../types.js';
23
+ export declare const DECISION_CRITERIA: Readonly<Record<EntailmentClass, string>>;
24
+ /** Degree of support per class, used to turn probabilities into a confidence. */
25
+ export declare const DECISION_SUPPORT: Readonly<Record<EntailmentClass, number>>;
26
+ export declare const DEFAULT_DECISION_MODEL = "perplexity/pplx-decider-v1.1-27b";
27
+ export interface DecisionsJudgeOptions {
28
+ /** API key. Leave empty when `fetch` goes through a proxy that adds it. */
29
+ apiKey?: string;
30
+ /** Decision model. Default "perplexity/pplx-decider-v1.1-27b" (open weights). */
31
+ model?: string;
32
+ /** Base URL of the decisions API. Default "https://openrouter.ai/api/alpha". */
33
+ baseUrl?: string;
34
+ /** Extra HTTP headers (e.g. OpenRouter attribution headers). */
35
+ headers?: Record<string, string>;
36
+ /**
37
+ * OpenRouter provider preferences sent with every request, e.g.
38
+ * `{ zdr: true, data_collection: 'deny' }` to require zero data retention.
39
+ */
40
+ provider?: Record<string, unknown>;
41
+ /** Parallel requests (one citation each). Default 4. */
42
+ concurrency?: number;
43
+ /** Per-request timeout in milliseconds. Default 20000. */
44
+ timeoutMs?: number;
45
+ /** Retries per citation on network/429/5xx errors. Default 2. */
46
+ maxRetries?: number;
47
+ /** Character caps applied to inputs. */
48
+ caps?: {
49
+ claim?: number;
50
+ quote?: number;
51
+ context?: number;
52
+ };
53
+ /** Custom fetch (proxy, tests, non-standard runtimes). Default globalThis.fetch. */
54
+ fetch?: typeof globalThis.fetch;
55
+ }
56
+ export interface DecisionsUsage {
57
+ requests: number;
58
+ inputTokens: number;
59
+ cost: number;
60
+ }
61
+ export declare class DecisionsJudge implements EntailmentJudge {
62
+ /** Totals over the lifetime of this judge, as reported by the API. */
63
+ readonly usage: DecisionsUsage;
64
+ private readonly opts;
65
+ constructor(options?: DecisionsJudgeOptions);
66
+ judge(items: EntailmentInput[], options?: {
67
+ signal?: AbortSignal;
68
+ }): Promise<EntailmentResult[]>;
69
+ private judgeOne;
70
+ private request;
71
+ }
72
+ //# sourceMappingURL=decisions-judge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decisions-judge.d.ts","sourceRoot":"","sources":["../../src/judge/decisions-judge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEvG,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAMvE,CAAC;AAMF,iFAAiF;AACjF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,eAAe,EAA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