@konneal/engine 0.2.179 → 0.2.180

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  handleAsk
3
- } from "./chunk-LDSGL62W.js";
3
+ } from "./chunk-UMF7Y6JH.js";
4
4
  import "./chunk-IRCDOFP4.js";
5
5
  import "./chunk-ROXOL4GF.js";
6
6
  import "./chunk-CLDMP5YH.js";
@@ -2967,14 +2967,14 @@ Answer account questions from these records ONLY: name the record when you use i
2967
2967
  }
2968
2968
  const tq2 = await chargeAnswerTokens(env, bucketId, stats, messageChars(messages), full.length, probeTokensUsed);
2969
2969
  send({ type: "quota", quota: { ...quota, ...tq2, credits: await creditBudget(env, bucketId), credit_estimate: creditPreview } });
2970
- if (withImage && register?.rows?.length && full.includes(refusalAnswer())) {
2970
+ if (register?.rows?.length && full.includes(refusalAnswer())) {
2971
2971
  console.log("blind-answer(stream): regenerating once");
2972
2972
  streamRestarts += 1;
2973
2973
  mark("Re-answering from the register results");
2974
2974
  send({ type: "retry" });
2975
2975
  const regen = await generateStream(env, model, [
2976
2976
  ...messages.slice(0, -1),
2977
- { 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." },
2977
+ { role: "user", content: "The certificate register note above 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." },
2978
2978
  messages[messages.length - 1]
2979
2979
  ], routeEffort(routed.route));
2980
2980
  if (regen) {
@@ -3207,12 +3207,12 @@ Answer account questions from these records ONLY: name the record when you use i
3207
3207
  if (completionBlocks.length) console.log("contract completion:", completionBlocks.length, "table block(s) attached server-side");
3208
3208
  }
3209
3209
  completionBlocks.push(...await completeFigures(env.DB, answer, [...c2ns.blocks, ...completionBlocks], used, q2.query));
3210
- if (withImage && register?.rows?.length && answer.includes(refusalAnswer())) {
3210
+ if (register?.rows?.length && answer.includes(refusalAnswer())) {
3211
3211
  console.log("blind-answer: the register note carried rows but the answer refused \u2014 regenerating once");
3212
3212
  mark("Re-answering from the register results");
3213
3213
  const regen = await generateOnce(env, model, [
3214
3214
  ...messages.slice(0, -1),
3215
- { 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." },
3215
+ { role: "user", content: "The certificate register note above 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." },
3216
3216
  messages[messages.length - 1]
3217
3217
  ], effort);
3218
3218
  if (regen && !regen.includes(refusalAnswer())) {
@@ -4,7 +4,7 @@ import {
4
4
  handleMemories,
5
5
  scoreFaithfulness,
6
6
  scoreJudge
7
- } from "../../chunk-LDSGL62W.js";
7
+ } from "../../chunk-UMF7Y6JH.js";
8
8
  import "../../chunk-IRCDOFP4.js";
9
9
  import {
10
10
  TOOLS_REGISTRY,
@@ -1181,7 +1181,7 @@ async function callToolOnce(env, ctx, _req, tier, key, name, args, t0) {
1181
1181
  const r = await runTool({ ...env, DB: env.DB }, { name, args }, "mcp");
1182
1182
  payload = r ? { tool: r.name, query: r.query, result: r.output } : { error: { message: `tool ${name} returned nothing for the given arguments` } };
1183
1183
  } else {
1184
- const res = name === "ask" ? await (await import("../../ask-PWT4B6YE.js")).handleAsk(env, ctx, inner, tier, key) : await (await import("../../search-KNPPTHMG.js")).handleSearch(env, ctx, inner, tier, key);
1184
+ const res = name === "ask" ? await (await import("../../ask-TOJKDMU7.js")).handleAsk(env, ctx, inner, tier, key) : await (await import("../../search-KNPPTHMG.js")).handleSearch(env, ctx, inner, tier, key);
1185
1185
  payload = await res.json().catch(() => ({ error: { message: "tool transport failed", status: res.status } }));
1186
1186
  }
1187
1187
  telemetry(env, ctx, tier, `mcp:${name}`, null, !payload?.error, JSON.stringify(payload).length, await sha256Hex(`${name}:${JSON.stringify(args ?? {})}`), void 0, void 0, { durationMs: Date.now() - t0 });
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.179",
30
+ "version": "0.2.180",
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",
@@ -1722,20 +1722,23 @@ let convEntities: Array<{ entity: string; kind: string }> = [];
1722
1722
  const tq = await chargeAnswerTokens(env, bucketId, stats, messageChars(messages!), full.length, probeTokensUsed);
1723
1723
  send({ type: "quota", quota: { ...quota, ...tq, credits: await creditBudget(env, bucketId), credit_estimate: creditPreview } });
1724
1724
  // the blind-answer guard ON THE STREAM PATH (the JSON path has
1725
- // had it since 0.2.80): an image rode the turn, the register
1726
- // note carries rows, and the streamed text is the no-information
1727
- // refusal — the multimodal call answered around the photograph.
1728
- // One bounded regeneration: the retry sentinel tells the client
1729
- // to clear the buffer, the agent step says why, and the fresh
1730
- // tokens stream as the answer.
1731
- if (withImage && register?.rows?.length && full.includes(refusalAnswer())) {
1725
+ // had it since 0.2.80): the register note carries rows and the
1726
+ // streamed text is the no-information refusal — the model
1727
+ // answered around the register (originally the photograph's
1728
+ // shape; since 0.2.179 the note rides every register-owned
1729
+ // question, and the text-only lane refuses just the same —
1730
+ // measured 2026-10-29: 11/14 standing probes with the note in
1731
+ // the prompt). One bounded regeneration: the retry sentinel
1732
+ // tells the client to clear the buffer, the agent step says
1733
+ // why, and the fresh tokens stream as the answer.
1734
+ if (register?.rows?.length && full.includes(refusalAnswer())) {
1732
1735
  console.log("blind-answer(stream): regenerating once");
1733
1736
  streamRestarts += 1;
1734
1737
  mark("Re-answering from the register results");
1735
1738
  send({ type: "retry" });
1736
1739
  const regen = await generateStream(env, model, [
1737
1740
  ...messages.slice(0, -1),
1738
- { 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." },
1741
+ { role: "user", content: "The certificate register note above 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." },
1739
1742
  messages[messages.length - 1],
1740
1743
  ], routeEffort(routed.route));
1741
1744
  if (regen) {
@@ -2084,12 +2087,12 @@ let convEntities: Array<{ entity: string; kind: string }> = [];
2084
2087
  // text claims nothing was provided — while the bridge succeeded and the
2085
2088
  // register note carries actual rows. One bounded regeneration, decided on
2086
2089
  // that exact signature; the retry carries a sterner ground instruction.
2087
- if (withImage && register?.rows?.length && answer!.includes(refusalAnswer())) {
2090
+ if (register?.rows?.length && answer!.includes(refusalAnswer())) {
2088
2091
  console.log("blind-answer: the register note carried rows but the answer refused — regenerating once");
2089
2092
  mark("Re-answering from the register results");
2090
2093
  const regen = await generateOnce(env, model, [
2091
2094
  ...messages.slice(0, -1),
2092
- { 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." },
2095
+ { role: "user", content: "The certificate register note above 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." },
2093
2096
  messages[messages.length - 1],
2094
2097
  ], effort);
2095
2098
  if (regen && !regen!.includes(refusalAnswer())) {