@konneal/engine 0.2.79 → 0.2.80
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.
|
@@ -3081,6 +3081,18 @@ ${q.query}` }],
|
|
|
3081
3081
|
if (completionBlocks.length) console.log("contract completion:", completionBlocks.length, "table block(s) attached server-side");
|
|
3082
3082
|
}
|
|
3083
3083
|
completionBlocks.push(...await completeFigures(env.DB, answer, [...c2ns.blocks, ...completionBlocks], used));
|
|
3084
|
+
if (withImage && register?.rows?.length && answer.includes(refusalAnswer())) {
|
|
3085
|
+
console.log("blind-answer: the register note carried rows but the answer refused \u2014 regenerating once");
|
|
3086
|
+
const regen = await generateOnce(env, model, [
|
|
3087
|
+
...messages.slice(0, -1),
|
|
3088
|
+
{ role: "user", content: "The photograph was attached and the register note lists actual matching certificate rows. Present those rows \u2014 number, holder, model, status, and every document link \u2014 as the answer. Do not claim that nothing was provided." },
|
|
3089
|
+
messages[messages.length - 1]
|
|
3090
|
+
], effort);
|
|
3091
|
+
if (regen && !regen.includes(refusalAnswer())) {
|
|
3092
|
+
answer = canonicalRefusal(regen);
|
|
3093
|
+
console.log("blind-answer: regeneration grounded");
|
|
3094
|
+
}
|
|
3095
|
+
}
|
|
3084
3096
|
const jsonQuality = answerQuality(finalCites.map((c) => c.quality));
|
|
3085
3097
|
let entailment = null;
|
|
3086
3098
|
let entailmentNote = "";
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
modelGroundingBlock,
|
|
7
7
|
scoreFaithfulness,
|
|
8
8
|
scoreJudge
|
|
9
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-LTGOJVDF.js";
|
|
10
10
|
import {
|
|
11
11
|
handleSearch
|
|
12
12
|
} from "../../chunk-KO6DRI7C.js";
|
|
@@ -959,7 +959,7 @@ async function handleMcp(env, ctx, req, tier, key) {
|
|
|
959
959
|
// stream:false forces the JSON lane (anon defaults to SSE)
|
|
960
960
|
body: JSON.stringify({ ...args, stream: false })
|
|
961
961
|
});
|
|
962
|
-
const res = name === "ask" ? await (await import("../../ask-
|
|
962
|
+
const res = name === "ask" ? await (await import("../../ask-7V4ECBLN.js")).handleAsk(env, ctx, inner, tier, key) : await (await import("../../search-LVUQLA3C.js")).handleSearch(env, ctx, inner, tier, key);
|
|
963
963
|
return res.json().catch(() => ({ error: { message: "tool transport failed", status: res.status } }));
|
|
964
964
|
});
|
|
965
965
|
if (out.ok && "accepted" in out) return new Response(null, { status: 202 });
|
package/package.json
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"playwright": "^1.62.1",
|
|
28
28
|
"yaml": "^2.9.1"
|
|
29
29
|
},
|
|
30
|
-
"version": "0.2.
|
|
30
|
+
"version": "0.2.80",
|
|
31
31
|
"description": "The Konneal engine: the publisher-agnostic build pipeline and API plane for standards intelligence (retrieval, answer contract, verdicts, evaluation).",
|
|
32
32
|
"license": "BSD-3-Clause",
|
|
33
33
|
"type": "module",
|
|
@@ -1503,6 +1503,24 @@ let convEntities: Array<{ entity: string; kind: string }> = [];
|
|
|
1503
1503
|
// figure completion (#172) — see ./completion for the rationale
|
|
1504
1504
|
completionBlocks.push(...(await completeFigures(env.DB, answer, [...c2ns.blocks, ...completionBlocks], used)));
|
|
1505
1505
|
|
|
1506
|
+
// the blind-answer regeneration (2026-10-03, live on the photo case):
|
|
1507
|
+
// the multimodal call can answer AROUND an attached image — a 200 whose
|
|
1508
|
+
// text claims nothing was provided — while the bridge succeeded and the
|
|
1509
|
+
// register note carries actual rows. One bounded regeneration, decided on
|
|
1510
|
+
// that exact signature; the retry carries a sterner ground instruction.
|
|
1511
|
+
if (withImage && register?.rows?.length && answer.includes(refusalAnswer())) {
|
|
1512
|
+
console.log("blind-answer: the register note carried rows but the answer refused — regenerating once");
|
|
1513
|
+
const regen = await generateOnce(env, model, [
|
|
1514
|
+
...messages.slice(0, -1),
|
|
1515
|
+
{ role: "user", content: "The photograph was attached and the register note lists actual matching certificate rows. Present those rows — number, holder, model, status, and every document link — as the answer. Do not claim that nothing was provided." },
|
|
1516
|
+
messages[messages.length - 1],
|
|
1517
|
+
], effort);
|
|
1518
|
+
if (regen && !regen.includes(refusalAnswer())) {
|
|
1519
|
+
answer = canonicalRefusal(regen);
|
|
1520
|
+
console.log("blind-answer: regeneration grounded");
|
|
1521
|
+
}
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1506
1524
|
const jsonQuality = answerQuality(finalCites.map((c: any) => c.quality));
|
|
1507
1525
|
// the entailment gate (TODO.new-era/10): the eval battery's faithfulness
|
|
1508
1526
|
// scorer, promoted onto the serving path — the confidence line states a
|