@konneal/engine 0.2.29 → 0.2.31
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-UAJHC6U7.js → ask-43C2WZZO.js} +2 -2
- package/dist/{chunk-BHWG556Q.js → chunk-F66NYFUK.js} +8 -1
- package/dist/{chunk-RI2SRLZY.js → chunk-S7NLWPNX.js} +1 -1
- package/dist/{chunk-ODHIVW3M.js → chunk-TDKNQPA2.js} +1 -1
- package/dist/{search-ICNVGXUY.js → search-NHTT5DDI.js} +2 -2
- package/dist/worker_public/src/index.js +4 -4
- package/package.json +1 -1
- package/workers/worker_public/src/stages/seal.ts +8 -1
- package/workers/worker_public/src/stages/types.ts +6 -0
|
@@ -22747,7 +22747,7 @@ var federate = {
|
|
|
22747
22747
|
// workers/worker_public/src/stages/seal.ts
|
|
22748
22748
|
var seal = {
|
|
22749
22749
|
name: "seal",
|
|
22750
|
-
when: (c) => !!c.opts.sealScope || !!c.opts.editionSteer,
|
|
22750
|
+
when: (c) => !!c.opts.sealScope || !!c.opts.editionSteer || !!c.opts.editionExclude,
|
|
22751
22751
|
run: (c) => {
|
|
22752
22752
|
const before = c.hits.length;
|
|
22753
22753
|
const scope = c.opts.sealScope;
|
|
@@ -22756,6 +22756,13 @@ var seal = {
|
|
|
22756
22756
|
console.log("context seal:", before, "\u2192", c.hits.length, "candidates within", `doc#${scope.doc_number}${scope.edition ? "@" + scope.edition : ""}`);
|
|
22757
22757
|
return;
|
|
22758
22758
|
}
|
|
22759
|
+
const exclude = c.opts.editionExclude;
|
|
22760
|
+
if (exclude) {
|
|
22761
|
+
const before2 = c.hits.length;
|
|
22762
|
+
c.hits = c.hits.filter((h) => !(h.metadata.doc_number === exclude.doc_number && h.metadata.edition !== exclude.edition));
|
|
22763
|
+
console.log("edition exclude:", before2, "\u2192", c.hits.length, "after dropping superseded candidates of", `doc#${exclude.doc_number}@${exclude.edition}`);
|
|
22764
|
+
return;
|
|
22765
|
+
}
|
|
22759
22766
|
const steer = c.opts.editionSteer;
|
|
22760
22767
|
const current = [];
|
|
22761
22768
|
const superseded = [];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
handleSearch
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-S7NLWPNX.js";
|
|
4
4
|
import {
|
|
5
5
|
bindModelNode,
|
|
6
6
|
checkQuoteAnchors,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
modelGroundingBlock,
|
|
10
10
|
scoreJudge,
|
|
11
11
|
standardForDocNumber
|
|
12
|
-
} from "../../chunk-
|
|
12
|
+
} from "../../chunk-TDKNQPA2.js";
|
|
13
13
|
import {
|
|
14
14
|
buildMessages,
|
|
15
15
|
citations,
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
sessionFrom,
|
|
33
33
|
telemetry,
|
|
34
34
|
understandQuery
|
|
35
|
-
} from "../../chunk-
|
|
35
|
+
} from "../../chunk-F66NYFUK.js";
|
|
36
36
|
import {
|
|
37
37
|
authenticate,
|
|
38
38
|
corsHeaders,
|
|
@@ -996,7 +996,7 @@ async function handleMcp(env, ctx, req, tier, key) {
|
|
|
996
996
|
// stream:false forces the JSON lane (anon defaults to SSE)
|
|
997
997
|
body: JSON.stringify({ ...args, stream: false })
|
|
998
998
|
});
|
|
999
|
-
const res = name === "ask" ? await (await import("../../ask-
|
|
999
|
+
const res = name === "ask" ? await (await import("../../ask-43C2WZZO.js")).handleAsk(env, ctx, inner, tier, key) : await (await import("../../search-NHTT5DDI.js")).handleSearch(env, ctx, inner, tier, key);
|
|
1000
1000
|
return res.json().catch(() => ({ error: { message: "tool transport failed", status: res.status } }));
|
|
1001
1001
|
});
|
|
1002
1002
|
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.31",
|
|
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",
|
|
@@ -6,7 +6,7 @@ import type { Stage } from "./types.ts";
|
|
|
6
6
|
|
|
7
7
|
export const seal: Stage = {
|
|
8
8
|
name: "seal",
|
|
9
|
-
when: (c) => !!c.opts.sealScope || !!c.opts.editionSteer,
|
|
9
|
+
when: (c) => !!c.opts.sealScope || !!c.opts.editionSteer || !!c.opts.editionExclude,
|
|
10
10
|
run: (c) => {
|
|
11
11
|
const before = c.hits.length;
|
|
12
12
|
const scope = c.opts.sealScope!;
|
|
@@ -15,6 +15,13 @@ export const seal: Stage = {
|
|
|
15
15
|
console.log("context seal:", before, "→", c.hits.length, "candidates within", `doc#${scope.doc_number}${scope.edition ? "@" + scope.edition : ""}`);
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
|
+
const exclude = c.opts.editionExclude!;
|
|
19
|
+
if (exclude) {
|
|
20
|
+
const before = c.hits.length;
|
|
21
|
+
c.hits = c.hits.filter((h) => !(h.metadata.doc_number === exclude.doc_number && h.metadata.edition !== exclude.edition));
|
|
22
|
+
console.log("edition exclude:", before, "→", c.hits.length, "after dropping superseded candidates of", `doc#${exclude.doc_number}@${exclude.edition}`);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
18
25
|
const steer = c.opts.editionSteer!;
|
|
19
26
|
const current: typeof c.hits = [];
|
|
20
27
|
const superseded: typeof c.hits = [];
|
|
@@ -34,6 +34,12 @@ export interface RetrieveOptions {
|
|
|
34
34
|
* of the candidate pool — superseded passages stay servable but stop
|
|
35
35
|
* competing for the window against the current edition. */
|
|
36
36
|
editionSteer?: { doc_number: string; edition: string } | null;
|
|
37
|
+
/** Verify's grounding cut: hits of the named document whose edition
|
|
38
|
+
* differs from the active one are REMOVED — a grounding endpoint
|
|
39
|
+
* judges against the current edition; a superseded passage cannot
|
|
40
|
+
* ground a current-edition claim. Everything else (other documents,
|
|
41
|
+
* undated vocabulary) survives. */
|
|
42
|
+
editionExclude?: { doc_number: string; edition: string } | null;
|
|
37
43
|
/** Option C: dense-lane results computed concurrently with
|
|
38
44
|
* understanding (same folded-query vector, retrieve's exact query
|
|
39
45
|
* parameters). With no filter they REPLACE the primary dense query;
|