@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.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  handleAsk
3
- } from "./chunk-ODHIVW3M.js";
4
- import "./chunk-BHWG556Q.js";
3
+ } from "./chunk-TDKNQPA2.js";
4
+ import "./chunk-F66NYFUK.js";
5
5
  import "./chunk-2RKYO3OC.js";
6
6
  import "./chunk-A3QHHUN5.js";
7
7
  import "./chunk-JGKSUSF5.js";
@@ -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 = [];
@@ -7,7 +7,7 @@ import {
7
7
  sessionFrom,
8
8
  telemetry,
9
9
  understandQuery
10
- } from "./chunk-BHWG556Q.js";
10
+ } from "./chunk-F66NYFUK.js";
11
11
  import {
12
12
  corsHeaders,
13
13
  err,
@@ -28,7 +28,7 @@ import {
28
28
  syntheticUnderstanding,
29
29
  telemetry,
30
30
  understandQuery
31
- } from "./chunk-BHWG556Q.js";
31
+ } from "./chunk-F66NYFUK.js";
32
32
  import {
33
33
  corsHeaders,
34
34
  err,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  handleSearch
3
- } from "./chunk-RI2SRLZY.js";
4
- import "./chunk-BHWG556Q.js";
3
+ } from "./chunk-S7NLWPNX.js";
4
+ import "./chunk-F66NYFUK.js";
5
5
  import "./chunk-2RKYO3OC.js";
6
6
  import "./chunk-A3QHHUN5.js";
7
7
  import "./chunk-JGKSUSF5.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  handleSearch
3
- } from "../../chunk-RI2SRLZY.js";
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-ODHIVW3M.js";
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-BHWG556Q.js";
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-UAJHC6U7.js")).handleAsk(env, ctx, inner, tier, key) : await (await import("../../search-ICNVGXUY.js")).handleSearch(env, ctx, inner, tier, key);
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.29",
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;