@konneal/engine 0.2.141 → 0.2.143

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,8 +1,8 @@
1
1
  import {
2
2
  handleAsk
3
- } from "./chunk-VTQ7FWRI.js";
4
- import "./chunk-GBGRHXRU.js";
5
- import "./chunk-RKNN3WAV.js";
3
+ } from "./chunk-BDJ3ZBP5.js";
4
+ import "./chunk-ECOYO7EX.js";
5
+ import "./chunk-363Q6FOL.js";
6
6
  import "./chunk-XH5QGX2O.js";
7
7
  import "./chunk-NI4CIK6W.js";
8
8
  import "./chunk-W7J5SFXJ.js";
@@ -11,7 +11,7 @@ import {
11
11
  registerNote,
12
12
  registerTokens,
13
13
  searchRegister
14
- } from "./chunk-GBGRHXRU.js";
14
+ } from "./chunk-ECOYO7EX.js";
15
15
  import "./chunk-3FYJM7LH.js";
16
16
  export {
17
17
  aggregateBlock,
@@ -1441,7 +1441,7 @@ var certificatesSearch = {
1441
1441
  handler: async (env, args) => {
1442
1442
  const query = String(args?.query ?? "").trim().slice(0, 160);
1443
1443
  if (!query) return null;
1444
- const { searchRegister, registerNote, certificateLinks } = await import("./certificates-TMYS7XLD.js");
1444
+ const { searchRegister, registerNote, certificateLinks } = await import("./certificates-F5G7GRWK.js");
1445
1445
  const reg = await searchRegister(env.DB, query, true);
1446
1446
  const output = reg?.rows?.length ? [registerNote(reg.rows), certificateLinks(reg.rows)].filter(Boolean).join("\n") : `No certificate was found for "${query}" in the certificates database (the register snapshot). State this as the search's result, with the searched string visible.`;
1447
1447
  return { name: "certificates.search", query, output };
@@ -7,7 +7,7 @@ import {
7
7
  registerAggregateIntent,
8
8
  registerNote,
9
9
  searchRegister
10
- } from "./chunk-GBGRHXRU.js";
10
+ } from "./chunk-ECOYO7EX.js";
11
11
  import {
12
12
  TOOL_DECLARATION,
13
13
  bindConstraintByQuantities,
@@ -32,7 +32,7 @@ import {
32
32
  tableRetyped,
33
33
  toolNote,
34
34
  verdictNote
35
- } from "./chunk-RKNN3WAV.js";
35
+ } from "./chunk-363Q6FOL.js";
36
36
  import {
37
37
  NO_CONTEXT,
38
38
  STAGE_NAMES,
@@ -32,11 +32,13 @@ async function registerAggregate(db, family) {
32
32
  }
33
33
  }
34
34
  function aggregateNote(agg) {
35
+ const series = agg.latest?.num?.match(/^[A-Za-z]+/)?.[0] ?? "";
36
+ const familyName = `${P().publisher.name} ${series} ${agg.family}`.trim();
35
37
  const latest = agg.latest ? `The latest certificate in the snapshot is ${agg.latest.num} (holder ${agg.latest.holder}, model "${agg.latest.model}"${agg.latest.year ? `, issued ${agg.latest.year}` : ""}, status ${agg.latest.status}).` : "No certificate rows are present in the snapshot.";
36
38
  const link = agg.latest?.pdf_key ? ` Its document: https://www.oimlsmart.org/cert-pdf/${agg.latest.pdf_key}` : "";
37
39
  return [
38
40
  `CERTIFICATE REGISTER \u2014 THIS NOTE ANSWERS THE QUESTION. Answer from THIS note; do not refuse for want of passages (the retrieval passages are irrelevant for register questions).`,
39
- `The ${agg.family} family holds ${agg.count} certificate${agg.count === 1 ? "" : "s"} (${agg.valid} valid${agg.suspended ? `, ${agg.suspended} suspended` : ""}) \u2014 computed over the register snapshot; state these numbers verbatim.`,
41
+ `The ${familyName} family holds ${agg.count} certificate${agg.count === 1 ? "" : "s"} (${agg.valid} valid${agg.suspended ? `, ${agg.suspended} suspended` : ""}) \u2014 computed over the register snapshot; state these numbers verbatim.`,
40
42
  latest + link,
41
43
  "Certificates are issued per RECOMMENDATION FAMILY \u2014 the register carries no edition dimension, so an edition named in the question (e.g. 2021) does not narrow it; say so when the question names an edition. Qualify that the register is a snapshot, and cite the register."
42
44
  ].join("\n");
@@ -4,7 +4,7 @@ import {
4
4
  parseToolCall,
5
5
  runTool,
6
6
  toolNote
7
- } from "./chunk-RKNN3WAV.js";
7
+ } from "./chunk-363Q6FOL.js";
8
8
  import "./chunk-NI4CIK6W.js";
9
9
  import "./chunk-4NXH5ZI6.js";
10
10
  import "./chunk-VT7DR6NQ.js";
@@ -4,13 +4,13 @@ import {
4
4
  handleMemories,
5
5
  scoreFaithfulness,
6
6
  scoreJudge
7
- } from "../../chunk-VTQ7FWRI.js";
8
- import "../../chunk-GBGRHXRU.js";
7
+ } from "../../chunk-BDJ3ZBP5.js";
8
+ import "../../chunk-ECOYO7EX.js";
9
9
  import {
10
10
  TOOLS_REGISTRY,
11
11
  bindModelNode,
12
12
  modelGroundingBlock
13
- } from "../../chunk-RKNN3WAV.js";
13
+ } from "../../chunk-363Q6FOL.js";
14
14
  import {
15
15
  handleSearch
16
16
  } from "../../chunk-5WITTJQD.js";
@@ -1073,13 +1073,13 @@ async function callToolOnce(env, ctx, _req, tier, key, name, args, t0) {
1073
1073
  // stream:false forces the JSON lane (anon defaults to SSE)
1074
1074
  body: JSON.stringify({ ...args, stream: false })
1075
1075
  });
1076
- const { runTool, TOOLS_REGISTRY: TOOLS_REGISTRY2 } = await import("../../tools-EZRLYLTM.js");
1076
+ const { runTool, TOOLS_REGISTRY: TOOLS_REGISTRY2 } = await import("../../tools-5Y763UWT.js");
1077
1077
  let payload;
1078
1078
  if (TOOLS_REGISTRY2.some((t) => t.name === name && t.audiences.includes("mcp"))) {
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-WZCRMTTX.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-4CYUZR4V.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.141",
30
+ "version": "0.2.143",
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",
@@ -82,6 +82,11 @@ export async function registerAggregate(db: any, family: string): Promise<Regist
82
82
  * model narrates, never recomputes. The edition disclaimer rides every
83
83
  * family-scoped answer (the register has no edition dimension). */
84
84
  export function aggregateNote(agg: RegisterAggregate): string {
85
+ // the register stores the family as digits ("60"); the user-facing
86
+ // name carries the series letter, which the certificate numbers
87
+ // themselves carry ("R60/…") — derived from the data, never hardcoded
88
+ const series = agg.latest?.num?.match(/^[A-Za-z]+/)?.[0] ?? "";
89
+ const familyName = `${P().publisher.name} ${series} ${agg.family}`.trim();
85
90
  const latest = agg.latest
86
91
  ? `The latest certificate in the snapshot is ${agg.latest.num} (holder ${agg.latest.holder}, model "${agg.latest.model}"${agg.latest.year ? `, issued ${agg.latest.year}` : ""}, status ${agg.latest.status}).`
87
92
  : "No certificate rows are present in the snapshot.";
@@ -90,7 +95,7 @@ export function aggregateNote(agg: RegisterAggregate): string {
90
95
  : "";
91
96
  return [
92
97
  `CERTIFICATE REGISTER — THIS NOTE ANSWERS THE QUESTION. Answer from THIS note; do not refuse for want of passages (the retrieval passages are irrelevant for register questions).`,
93
- `The ${agg.family} family holds ${agg.count} certificate${agg.count === 1 ? "" : "s"} (${agg.valid} valid${agg.suspended ? `, ${agg.suspended} suspended` : ""}) — computed over the register snapshot; state these numbers verbatim.`,
98
+ `The ${familyName} family holds ${agg.count} certificate${agg.count === 1 ? "" : "s"} (${agg.valid} valid${agg.suspended ? `, ${agg.suspended} suspended` : ""}) — computed over the register snapshot; state these numbers verbatim.`,
94
99
  latest + link,
95
100
  "Certificates are issued per RECOMMENDATION FAMILY — the register carries no edition dimension, so an edition named in the question (e.g. 2021) does not narrow it; say so when the question names an edition. Qualify that the register is a snapshot, and cite the register.",
96
101
  ].join("\n");