@konneal/engine 0.2.166 → 0.2.167
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.
- package/dist/ask-LV6WNGYK.js +16 -0
- package/dist/{chunk-FQYHT4VC.js → chunk-4FZNJR5Q.js} +1 -1
- package/dist/{chunk-SIT4XSD5.js → chunk-KD2AHOOQ.js} +4 -4
- package/dist/{chunk-5V2A3CAH.js → chunk-LU7VIMD7.js} +1 -1
- package/dist/{chunk-5AME76UW.js → chunk-OD3KBF4I.js} +10 -6
- package/dist/{chunk-AP73VIHB.js → chunk-PTY2OSC4.js} +3 -3
- package/dist/{chunk-TTEJQ5XA.js → chunk-QY556RJM.js} +1 -1
- package/dist/{chunk-OLO45N6D.js → chunk-Y7LWT24U.js} +1 -1
- package/dist/{chunk-2FME6R6J.js → chunk-YWXLXXGH.js} +6 -6
- package/dist/config.d.ts +1 -1
- package/dist/search-ZQCAISQV.js +14 -0
- package/dist/{tools-PR7PFAV6.js → tools-3RP7DHGI.js} +4 -4
- package/dist/worker_mcp/src/index.js +2 -2
- package/dist/worker_public/src/config.js +1 -1
- package/dist/worker_public/src/index.js +10 -10
- package/dist/worker_public/src/requestScope.js +2 -2
- package/package.json +1 -1
- package/workers/worker_public/src/config.ts +1 -1
- package/workers/worker_public/src/stages/dense.ts +10 -3
- package/dist/ask-XJOOMAXU.js +0 -16
- package/dist/search-6KM4P2E5.js +0 -14
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
handleAsk
|
|
3
|
+
} from "./chunk-YWXLXXGH.js";
|
|
4
|
+
import "./chunk-ECOYO7EX.js";
|
|
5
|
+
import "./chunk-PTY2OSC4.js";
|
|
6
|
+
import "./chunk-OD3KBF4I.js";
|
|
7
|
+
import "./chunk-LU7VIMD7.js";
|
|
8
|
+
import "./chunk-QY556RJM.js";
|
|
9
|
+
import "./chunk-ETLSWSZ7.js";
|
|
10
|
+
import "./chunk-Y7LWT24U.js";
|
|
11
|
+
import "./chunk-4FZNJR5Q.js";
|
|
12
|
+
import "./chunk-3FYJM7LH.js";
|
|
13
|
+
import "./chunk-LSZTJI7V.js";
|
|
14
|
+
export {
|
|
15
|
+
handleAsk
|
|
16
|
+
};
|
|
@@ -92,7 +92,7 @@ var THRESHOLDS = {
|
|
|
92
92
|
// when the in-code doc scope cuts the vector-level top-K to zero, the
|
|
93
93
|
// re-query runs at this depth and scopes in code (the native filter is
|
|
94
94
|
// dead — measured 2026-10-05)
|
|
95
|
-
denseStarveK:
|
|
95
|
+
denseStarveK: 100,
|
|
96
96
|
entailmentGate: true,
|
|
97
97
|
entailmentBudgetMs: 6e3,
|
|
98
98
|
entailmentSupportedFloor: 0.9,
|
|
@@ -6,24 +6,24 @@ import {
|
|
|
6
6
|
sessionFrom,
|
|
7
7
|
telemetry,
|
|
8
8
|
understandQuery
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-OD3KBF4I.js";
|
|
10
10
|
import {
|
|
11
11
|
corsHeaders,
|
|
12
12
|
err,
|
|
13
13
|
json,
|
|
14
14
|
readJson,
|
|
15
15
|
validateQuery
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-QY556RJM.js";
|
|
17
17
|
import {
|
|
18
18
|
entitlementScope,
|
|
19
19
|
standardKeysFrom
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-Y7LWT24U.js";
|
|
21
21
|
import {
|
|
22
22
|
LIMITS,
|
|
23
23
|
MODELS,
|
|
24
24
|
num,
|
|
25
25
|
sha256Hex
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-4FZNJR5Q.js";
|
|
27
27
|
import {
|
|
28
28
|
portModelRunner
|
|
29
29
|
} from "./chunk-LSZTJI7V.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
embed,
|
|
3
3
|
rerank
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LU7VIMD7.js";
|
|
5
5
|
import {
|
|
6
6
|
bubbleConfirmPage,
|
|
7
7
|
isAllowedBubbleOrigin
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-QY556RJM.js";
|
|
9
9
|
import {
|
|
10
10
|
DATASETS,
|
|
11
11
|
LIMITS,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
processExpansion,
|
|
16
16
|
sha256Hex,
|
|
17
17
|
today
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-4FZNJR5Q.js";
|
|
19
19
|
import {
|
|
20
20
|
P
|
|
21
21
|
} from "./chunk-3FYJM7LH.js";
|
|
@@ -22165,9 +22165,13 @@ var dense = {
|
|
|
22165
22165
|
if (filters.edition) matches = matches.filter((m) => !m.metadata?.edition || String(m.metadata.edition) === filters.edition);
|
|
22166
22166
|
console.log("dense scope (in code):", before, "\u2192", matches.length, "in doc", filters.doc_number, filters.edition ? `@${filters.edition}` : "");
|
|
22167
22167
|
if (!matches.length) {
|
|
22168
|
-
|
|
22169
|
-
|
|
22170
|
-
|
|
22168
|
+
try {
|
|
22169
|
+
const wide = await env.VECTORIZE.query(vector, { ...q, topK: THRESHOLDS.denseStarveK });
|
|
22170
|
+
matches = (wide.matches ?? []).filter((m) => matchesDocScope(m.metadata ?? {}, filters.doc_number));
|
|
22171
|
+
console.log("dense scope starvation \u2192 deep re-query:", matches.length, "doc members in the top", THRESHOLDS.denseStarveK);
|
|
22172
|
+
} catch (e) {
|
|
22173
|
+
console.log("dense scope starvation re-query failed:", String(e).slice(0, 120));
|
|
22174
|
+
}
|
|
22171
22175
|
}
|
|
22172
22176
|
if (filters && filters.edition && matches.length < 3) {
|
|
22173
22177
|
const docOnly = allMatches.filter((m) => matchesDocScope(m.metadata ?? {}, filters.doc_number));
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
embed
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LU7VIMD7.js";
|
|
4
4
|
import {
|
|
5
5
|
standardKeysFrom
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-Y7LWT24U.js";
|
|
7
7
|
import {
|
|
8
8
|
THRESHOLDS
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4FZNJR5Q.js";
|
|
10
10
|
import {
|
|
11
11
|
P
|
|
12
12
|
} from "./chunk-3FYJM7LH.js";
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
tableRetyped,
|
|
33
33
|
toolNote,
|
|
34
34
|
verdictNote
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-PTY2OSC4.js";
|
|
36
36
|
import {
|
|
37
37
|
NO_CONTEXT,
|
|
38
38
|
STAGE_NAMES,
|
|
@@ -75,18 +75,18 @@ import {
|
|
|
75
75
|
tokenBudget,
|
|
76
76
|
understandQuery,
|
|
77
77
|
usageTotal
|
|
78
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-OD3KBF4I.js";
|
|
79
79
|
import {
|
|
80
80
|
embed,
|
|
81
81
|
generateOnce
|
|
82
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-LU7VIMD7.js";
|
|
83
83
|
import {
|
|
84
84
|
corsHeaders,
|
|
85
85
|
err,
|
|
86
86
|
json,
|
|
87
87
|
readJson,
|
|
88
88
|
validateQuery
|
|
89
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-QY556RJM.js";
|
|
90
90
|
import {
|
|
91
91
|
cacheableAnswer,
|
|
92
92
|
canonicalRefusal,
|
|
@@ -99,7 +99,7 @@ import {
|
|
|
99
99
|
requestSalt,
|
|
100
100
|
resolveRequestScope,
|
|
101
101
|
standardKeysFrom
|
|
102
|
-
} from "./chunk-
|
|
102
|
+
} from "./chunk-Y7LWT24U.js";
|
|
103
103
|
import {
|
|
104
104
|
LIMITS,
|
|
105
105
|
MODELS,
|
|
@@ -110,7 +110,7 @@ import {
|
|
|
110
110
|
requestEffort,
|
|
111
111
|
roleModel,
|
|
112
112
|
sha256Hex
|
|
113
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-4FZNJR5Q.js";
|
|
114
114
|
import {
|
|
115
115
|
P
|
|
116
116
|
} from "./chunk-3FYJM7LH.js";
|
package/dist/config.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export declare const THRESHOLDS: {
|
|
|
51
51
|
* not only the source rung. Fails open (a slow or unparseable check
|
|
52
52
|
* leaves the source-rung note unchanged). */
|
|
53
53
|
readonly compressShare: 0.6;
|
|
54
|
-
readonly denseStarveK:
|
|
54
|
+
readonly denseStarveK: 100;
|
|
55
55
|
readonly entailmentGate: true;
|
|
56
56
|
readonly entailmentBudgetMs: 6000;
|
|
57
57
|
readonly entailmentSupportedFloor: 0.9;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
handleSearch
|
|
3
|
+
} from "./chunk-KD2AHOOQ.js";
|
|
4
|
+
import "./chunk-OD3KBF4I.js";
|
|
5
|
+
import "./chunk-LU7VIMD7.js";
|
|
6
|
+
import "./chunk-QY556RJM.js";
|
|
7
|
+
import "./chunk-ETLSWSZ7.js";
|
|
8
|
+
import "./chunk-Y7LWT24U.js";
|
|
9
|
+
import "./chunk-4FZNJR5Q.js";
|
|
10
|
+
import "./chunk-3FYJM7LH.js";
|
|
11
|
+
import "./chunk-LSZTJI7V.js";
|
|
12
|
+
export {
|
|
13
|
+
handleSearch
|
|
14
|
+
};
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
parseToolCall,
|
|
5
5
|
runTool,
|
|
6
6
|
toolNote
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-PTY2OSC4.js";
|
|
8
|
+
import "./chunk-LU7VIMD7.js";
|
|
9
|
+
import "./chunk-Y7LWT24U.js";
|
|
10
|
+
import "./chunk-4FZNJR5Q.js";
|
|
11
11
|
import "./chunk-3FYJM7LH.js";
|
|
12
12
|
import "./chunk-LSZTJI7V.js";
|
|
13
13
|
export {
|
|
@@ -4,16 +4,16 @@ import {
|
|
|
4
4
|
handleMemories,
|
|
5
5
|
scoreFaithfulness,
|
|
6
6
|
scoreJudge
|
|
7
|
-
} from "../../chunk-
|
|
7
|
+
} from "../../chunk-YWXLXXGH.js";
|
|
8
8
|
import "../../chunk-ECOYO7EX.js";
|
|
9
9
|
import {
|
|
10
10
|
TOOLS_REGISTRY,
|
|
11
11
|
bindModelNode,
|
|
12
12
|
modelGroundingBlock
|
|
13
|
-
} from "../../chunk-
|
|
13
|
+
} from "../../chunk-PTY2OSC4.js";
|
|
14
14
|
import {
|
|
15
15
|
handleSearch
|
|
16
|
-
} from "../../chunk-
|
|
16
|
+
} from "../../chunk-KD2AHOOQ.js";
|
|
17
17
|
import {
|
|
18
18
|
buildMessages,
|
|
19
19
|
citations,
|
|
@@ -38,11 +38,11 @@ import {
|
|
|
38
38
|
sessionFrom,
|
|
39
39
|
telemetry,
|
|
40
40
|
understandQuery
|
|
41
|
-
} from "../../chunk-
|
|
41
|
+
} from "../../chunk-OD3KBF4I.js";
|
|
42
42
|
import {
|
|
43
43
|
embed,
|
|
44
44
|
generateOnce
|
|
45
|
-
} from "../../chunk-
|
|
45
|
+
} from "../../chunk-LU7VIMD7.js";
|
|
46
46
|
import {
|
|
47
47
|
authenticate,
|
|
48
48
|
corsHeaders,
|
|
@@ -51,14 +51,14 @@ import {
|
|
|
51
51
|
readJson,
|
|
52
52
|
validateQuery,
|
|
53
53
|
withCors
|
|
54
|
-
} from "../../chunk-
|
|
54
|
+
} from "../../chunk-QY556RJM.js";
|
|
55
55
|
import {
|
|
56
56
|
canonicalRefusal
|
|
57
57
|
} from "../../chunk-ETLSWSZ7.js";
|
|
58
58
|
import {
|
|
59
59
|
entitlementScope,
|
|
60
60
|
standardKeysFrom
|
|
61
|
-
} from "../../chunk-
|
|
61
|
+
} from "../../chunk-Y7LWT24U.js";
|
|
62
62
|
import {
|
|
63
63
|
LIMITS,
|
|
64
64
|
MODELS,
|
|
@@ -69,7 +69,7 @@ import {
|
|
|
69
69
|
roleModel,
|
|
70
70
|
sha256Hex,
|
|
71
71
|
today
|
|
72
|
-
} from "../../chunk-
|
|
72
|
+
} from "../../chunk-4FZNJR5Q.js";
|
|
73
73
|
import {
|
|
74
74
|
P,
|
|
75
75
|
setProfile
|
|
@@ -1119,13 +1119,13 @@ async function callToolOnce(env, ctx, _req, tier, key, name, args, t0) {
|
|
|
1119
1119
|
// stream:false forces the JSON lane (anon defaults to SSE)
|
|
1120
1120
|
body: JSON.stringify({ ...args, stream: false })
|
|
1121
1121
|
});
|
|
1122
|
-
const { runTool, TOOLS_REGISTRY: TOOLS_REGISTRY2 } = await import("../../tools-
|
|
1122
|
+
const { runTool, TOOLS_REGISTRY: TOOLS_REGISTRY2 } = await import("../../tools-3RP7DHGI.js");
|
|
1123
1123
|
let payload;
|
|
1124
1124
|
if (TOOLS_REGISTRY2.some((t) => t.name === name && t.audiences.includes("mcp"))) {
|
|
1125
1125
|
const r = await runTool({ ...env, DB: env.DB }, { name, args }, "mcp");
|
|
1126
1126
|
payload = r ? { tool: r.name, query: r.query, result: r.output } : { error: { message: `tool ${name} returned nothing for the given arguments` } };
|
|
1127
1127
|
} else {
|
|
1128
|
-
const res = name === "ask" ? await (await import("../../ask-
|
|
1128
|
+
const res = name === "ask" ? await (await import("../../ask-LV6WNGYK.js")).handleAsk(env, ctx, inner, tier, key) : await (await import("../../search-ZQCAISQV.js")).handleSearch(env, ctx, inner, tier, key);
|
|
1129
1129
|
payload = await res.json().catch(() => ({ error: { message: "tool transport failed", status: res.status } }));
|
|
1130
1130
|
}
|
|
1131
1131
|
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 });
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
requestSalt,
|
|
5
5
|
resolveRequestScope,
|
|
6
6
|
standardKeysFrom
|
|
7
|
-
} from "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
7
|
+
} from "../../chunk-Y7LWT24U.js";
|
|
8
|
+
import "../../chunk-4FZNJR5Q.js";
|
|
9
9
|
import "../../chunk-3FYJM7LH.js";
|
|
10
10
|
export {
|
|
11
11
|
entitlementScope,
|
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.167",
|
|
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",
|
|
@@ -89,7 +89,7 @@ export const THRESHOLDS = {
|
|
|
89
89
|
// when the in-code doc scope cuts the vector-level top-K to zero, the
|
|
90
90
|
// re-query runs at this depth and scopes in code (the native filter is
|
|
91
91
|
// dead — measured 2026-10-05)
|
|
92
|
-
denseStarveK:
|
|
92
|
+
denseStarveK: 100,
|
|
93
93
|
entailmentGate: true,
|
|
94
94
|
entailmentBudgetMs: 6000,
|
|
95
95
|
entailmentSupportedFloor: 0.9,
|
|
@@ -51,9 +51,16 @@ export const dense: Stage = {
|
|
|
51
51
|
// reachable only through a wider net. Fires only when the scope
|
|
52
52
|
// starves to zero — zero behavior when the scope matches.
|
|
53
53
|
if (!matches.length) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
try {
|
|
55
|
+
const wide: any = await env.VECTORIZE.query(vector, { ...q, topK: THRESHOLDS.denseStarveK });
|
|
56
|
+
matches = (wide.matches ?? []).filter((m: any) => matchesDocScope(m.metadata ?? {}, filters.doc_number!));
|
|
57
|
+
console.log("dense scope starvation → deep re-query:", matches.length, "doc members in the top", THRESHOLDS.denseStarveK);
|
|
58
|
+
} catch (e) {
|
|
59
|
+
// the deep net must never break the ask: a rejected re-query
|
|
60
|
+
// (topK above the platform cap, a transient index error)
|
|
61
|
+
// degrades to the pre-fallback state — other lanes' leftovers
|
|
62
|
+
console.log("dense scope starvation re-query failed:", String(e).slice(0, 120));
|
|
63
|
+
}
|
|
57
64
|
}
|
|
58
65
|
// an edition pin corroborated by (almost) nothing means the pin
|
|
59
66
|
// was a guess — understanding emits editions for families it
|
package/dist/ask-XJOOMAXU.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
handleAsk
|
|
3
|
-
} from "./chunk-2FME6R6J.js";
|
|
4
|
-
import "./chunk-ECOYO7EX.js";
|
|
5
|
-
import "./chunk-AP73VIHB.js";
|
|
6
|
-
import "./chunk-5AME76UW.js";
|
|
7
|
-
import "./chunk-5V2A3CAH.js";
|
|
8
|
-
import "./chunk-TTEJQ5XA.js";
|
|
9
|
-
import "./chunk-ETLSWSZ7.js";
|
|
10
|
-
import "./chunk-OLO45N6D.js";
|
|
11
|
-
import "./chunk-FQYHT4VC.js";
|
|
12
|
-
import "./chunk-3FYJM7LH.js";
|
|
13
|
-
import "./chunk-LSZTJI7V.js";
|
|
14
|
-
export {
|
|
15
|
-
handleAsk
|
|
16
|
-
};
|
package/dist/search-6KM4P2E5.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
handleSearch
|
|
3
|
-
} from "./chunk-SIT4XSD5.js";
|
|
4
|
-
import "./chunk-5AME76UW.js";
|
|
5
|
-
import "./chunk-5V2A3CAH.js";
|
|
6
|
-
import "./chunk-TTEJQ5XA.js";
|
|
7
|
-
import "./chunk-ETLSWSZ7.js";
|
|
8
|
-
import "./chunk-OLO45N6D.js";
|
|
9
|
-
import "./chunk-FQYHT4VC.js";
|
|
10
|
-
import "./chunk-3FYJM7LH.js";
|
|
11
|
-
import "./chunk-LSZTJI7V.js";
|
|
12
|
-
export {
|
|
13
|
-
handleSearch
|
|
14
|
-
};
|