@konneal/engine 0.2.139 → 0.2.140

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-4GNKOTIK.js";
3
+ } from "./chunk-KAHL4SZU.js";
4
4
  import "./chunk-GBGRHXRU.js";
5
5
  import "./chunk-RKNN3WAV.js";
6
6
  import "./chunk-XH5QGX2O.js";
@@ -2633,7 +2633,7 @@ Answer account questions from these records ONLY: name the record when you use i
2633
2633
  }
2634
2634
  }
2635
2635
  }
2636
- const canonical0 = usedHits.length > 0 ? exciseMisplacedPin(canonicalRefusal(full, refusalScope(answerCites(full))), true) : canonicalRefusal(full, refusalScope(false));
2636
+ const canonical0 = exciseMisplacedPin(canonicalRefusal(full, refusalScope(answerCites(full))), answerCites(full));
2637
2637
  const c2 = canonical0.includes(refusalAnswer()) ? { text: canonical0, blocks: [], dropped: [] } : await contractV2(env.DB, canonical0, usedHits);
2638
2638
  send({
2639
2639
  type: "done",
@@ -2718,7 +2718,7 @@ Answer account questions from these records ONLY: name the record when you use i
2718
2718
  answer = await generateOnce(env, MODELS.fallback, flat, routeEffort(routed.route));
2719
2719
  }
2720
2720
  if (answer) answer = canonicalRefusal(answer, refusalScope(answerCites(answer)));
2721
- if (answer && usedHits.length > 0) answer = exciseMisplacedPin(answer, true);
2721
+ if (answer) answer = exciseMisplacedPin(answer, answerCites(answer));
2722
2722
  stageTiming.generate = Date.now() - tGen;
2723
2723
  let used = usedHits;
2724
2724
  if (answer && !answer.includes(refusalAnswer())) {
@@ -4,7 +4,7 @@ import {
4
4
  handleMemories,
5
5
  scoreFaithfulness,
6
6
  scoreJudge
7
- } from "../../chunk-4GNKOTIK.js";
7
+ } from "../../chunk-KAHL4SZU.js";
8
8
  import "../../chunk-GBGRHXRU.js";
9
9
  import {
10
10
  TOOLS_REGISTRY,
@@ -1079,7 +1079,7 @@ async function callToolOnce(env, ctx, _req, tier, key, name, args, t0) {
1079
1079
  const r = await runTool({ ...env, DB: env.DB }, { name, args }, "mcp");
1080
1080
  payload = r ? { tool: r.name, query: r.query, result: r.output } : { error: { message: `tool ${name} returned nothing for the given arguments` } };
1081
1081
  } else {
1082
- const res = name === "ask" ? await (await import("../../ask-UL5NL5O7.js")).handleAsk(env, ctx, inner, tier, key) : await (await import("../../search-VEGQBEFC.js")).handleSearch(env, ctx, inner, tier, key);
1082
+ const res = name === "ask" ? await (await import("../../ask-YVGMSXVO.js")).handleAsk(env, ctx, inner, tier, key) : await (await import("../../search-VEGQBEFC.js")).handleSearch(env, ctx, inner, tier, key);
1083
1083
  payload = await res.json().catch(() => ({ error: { message: "tool transport failed", status: res.status } }));
1084
1084
  }
1085
1085
  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.139",
30
+ "version": "0.2.140",
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",
@@ -1570,7 +1570,7 @@ let convEntities: Array<{ entity: string; kind: string }> = [];
1570
1570
  }
1571
1571
  // the misplaced-pin wall rides the streamed path too: a
1572
1572
  // CITED stream is not a refusal
1573
- const canonical0 = usedHits.length > 0 ? exciseMisplacedPin(canonicalRefusal(full, refusalScope(answerCites(full))), true) : canonicalRefusal(full, refusalScope(false));
1573
+ const canonical0 = exciseMisplacedPin(canonicalRefusal(full, refusalScope(answerCites(full))), answerCites(full));
1574
1574
  // answer contract v2: validate [[u:]] refs, resolve typed blocks
1575
1575
  const c2 = canonical0.includes(refusalAnswer())
1576
1576
  ? { text: canonical0, blocks: [], dropped: [] as string[] }
@@ -1679,7 +1679,7 @@ let convEntities: Array<{ entity: string; kind: string }> = [];
1679
1679
  // the pinned sentence if the model dropped it in as a disclaimer
1680
1680
  // (measured on chip-scoped asks: correct cited answers carrying the
1681
1681
  // pin mid-text, read by users and graders as total refusals)
1682
- if (answer && usedHits.length > 0) answer = exciseMisplacedPin(answer, true);
1682
+ if (answer) answer = exciseMisplacedPin(answer, answerCites(answer));
1683
1683
  stageTiming.generate = Date.now() - tGen;
1684
1684
 
1685
1685
  // ── Deterministic quote-anchor + table-retyping check ──