@konneal/engine 0.2.175 → 0.2.176

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/ablate.d.ts CHANGED
@@ -13,11 +13,16 @@ export interface AblateConfig {
13
13
  * diversified subset + one strong verifier. Off in serving until the
14
14
  * gate promotes it; the grid arms it per ask. */
15
15
  speculative: boolean;
16
- /** Extractive prompt compression (TODO.sota/02 row 5): each passage
17
- * body is query-weighted sentence selection at a fraction of its
18
- * budget before the answer model reads it. Off in serving; the grid
19
- * arms it per ask (the row's accuracy-at-token-budget gate). */
16
+ /** Extractive prompt compression (TODO.sota/02 row 5): PROMOTED — the
17
+ * passage bodies are query-weighted sentence selection at a fraction
18
+ * of their budget in serving (the row's gate: identical accuracy at
19
+ * ~1/20th the prompt, the whole-document baseline measured it).
20
+ * ablate_compress survives for the grid's explicit arm;
21
+ * ablate_no_compress is the measurement stand-down. */
20
22
  compress: boolean;
23
+ /** Per-request stand-down for the promoted compressor (the
24
+ * measurement arm; the serving default is on). */
25
+ noCompress: boolean;
21
26
  /** The decision pass (TODO.decisions/01): per-request stand-down for
22
27
  * the measurement — the serving switch is DECISIONS_ENABLED. */
23
28
  noDecisions: boolean;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  handleAsk
3
- } from "./chunk-ZZLUGHZ2.js";
3
+ } from "./chunk-T6T2QUO6.js";
4
4
  import "./chunk-ECOYO7EX.js";
5
5
  import "./chunk-B2MU4ZWM.js";
6
6
  import "./chunk-CLDMP5YH.js";
@@ -1404,10 +1404,11 @@ function parseAblate(body, adminToken, presentedToken, knownStages) {
1404
1404
  const rawRoute = body?.ablate_route;
1405
1405
  const speculative = body?.ablate_speculative === true;
1406
1406
  const compress = body?.ablate_compress === true;
1407
+ const noCompress = body?.ablate_no_compress === true;
1407
1408
  const noDecisions = body?.ablate_no_decisions === true;
1408
1409
  const namesAblation = rawStages !== void 0 && rawStages !== null;
1409
1410
  const routeAblation = rawRoute !== void 0 && rawRoute !== null && rawRoute !== "adaptive";
1410
- if (!namesAblation && !noVerdict && !routeAblation && !speculative && !compress && !noDecisions) return { ok: true, config: null };
1411
+ if (!namesAblation && !noVerdict && !routeAblation && !speculative && !compress && !noCompress && !noDecisions) return { ok: true, config: null };
1411
1412
  if (!adminToken || presentedToken !== adminToken) {
1412
1413
  return {
1413
1414
  ok: false,
@@ -1438,7 +1439,7 @@ function parseAblate(body, adminToken, presentedToken, knownStages) {
1438
1439
  }
1439
1440
  stages = [...new Set(rawStages)];
1440
1441
  }
1441
- return { ok: true, config: { stages, noVerdict, route, speculative, compress, noDecisions } };
1442
+ return { ok: true, config: { stages, noVerdict, route, speculative, compress, noCompress, noDecisions } };
1442
1443
  }
1443
1444
 
1444
1445
  // workers/worker_public/src/decisions.ts
@@ -2837,7 +2838,7 @@ Answer account questions from these records ONLY: name the record when you use i
2837
2838
  [ops.note, processNote, eNote, regNote, contextNote(declaredCtx, docScope), accountNote, modelNote, vocabNote, memNote, machineNote, conditionNote, aggregationNote, boundaryNote, licenseNote, ...retrieved.notes ?? []].filter(Boolean).join("\n") || void 0,
2838
2839
  summary,
2839
2840
  budget,
2840
- ablate?.compress === true
2841
+ ablate?.noCompress !== true
2841
2842
  );
2842
2843
  const decisionPromise = decisionsArmed && decisionsGatePromise ? decisionsGatePromise.then((g) => g != null && g >= THRESHOLDS.decisionsGateMin ? runDecisionPass(env, {
2843
2844
  question: q2.query,
@@ -3175,7 +3176,7 @@ Answer account questions from these records ONLY: name the record when you use i
3175
3176
  ...routeSubset ? { stageSubset: routeSubset ?? void 0 } : {}
3176
3177
  });
3177
3178
  if (retryRetrieve.hits.length > 0) {
3178
- const { messages: retryMessages, usedHits: retryUsed } = buildMessages(q2.query, retryRetrieve.hits, q2.lang, keptHistory, void 0, summary, budget, ablate?.compress === true);
3179
+ const { messages: retryMessages, usedHits: retryUsed } = buildMessages(q2.query, retryRetrieve.hits, q2.lang, keptHistory, void 0, summary, budget, ablate?.noCompress !== true);
3179
3180
  const retryAnswer = await generateOnce(env, model, retryMessages, routeEffort(routed.route));
3180
3181
  if (retryAnswer) {
3181
3182
  answer = canonicalRefusal(retryAnswer, refusalScope(answerCites(retryAnswer)));
@@ -51,9 +51,10 @@ export declare function splitHistory(history: HistoryTurn[], budgetTokens: numbe
51
51
  * incoming order (timeout/parse failure never blocks serving). */
52
52
  export declare function listwiseRerank(env: any, model: string, query: string, hits: Hit[]): Promise<Hit[] | null>;
53
53
  export declare function buildMessages(query: string, hits: Hit[], lang?: string, history?: HistoryTurn[], retrievalNote?: string, conversationSummary?: string, budgetTokens?: number,
54
- /** the extractive compression arm (TODO.sota/02 row 5): ablate_compress
55
- * arms it per ask — each passage body becomes query-weighted sentence
56
- * selection at compressShare of its budget. Off in serving. */
54
+ /** the extractive compression (TODO.sota/02 row 5): PROMOTED — on in
55
+ * serving; ablate_no_compress stands it down per ask for the
56
+ * measurement. Each passage body becomes query-weighted sentence
57
+ * selection at compressShare of its budget. */
57
58
  compress?: boolean): BuiltMessages;
58
59
  export declare function citations(hits: Hit[]): {
59
60
  doc_id: string;
@@ -4,7 +4,7 @@ import {
4
4
  handleMemories,
5
5
  scoreFaithfulness,
6
6
  scoreJudge
7
- } from "../../chunk-ZZLUGHZ2.js";
7
+ } from "../../chunk-T6T2QUO6.js";
8
8
  import "../../chunk-ECOYO7EX.js";
9
9
  import {
10
10
  TOOLS_REGISTRY,
@@ -1181,7 +1181,7 @@ async function callToolOnce(env, ctx, _req, tier, key, name, args, t0) {
1181
1181
  const r = await runTool({ ...env, DB: env.DB }, { name, args }, "mcp");
1182
1182
  payload = r ? { tool: r.name, query: r.query, result: r.output } : { error: { message: `tool ${name} returned nothing for the given arguments` } };
1183
1183
  } else {
1184
- const res = name === "ask" ? await (await import("../../ask-7TNQCRD6.js")).handleAsk(env, ctx, inner, tier, key) : await (await import("../../search-KNPPTHMG.js")).handleSearch(env, ctx, inner, tier, key);
1184
+ const res = name === "ask" ? await (await import("../../ask-ZWZFZBKZ.js")).handleAsk(env, ctx, inner, tier, key) : await (await import("../../search-KNPPTHMG.js")).handleSearch(env, ctx, inner, tier, key);
1185
1185
  payload = await res.json().catch(() => ({ error: { message: "tool transport failed", status: res.status } }));
1186
1186
  }
1187
1187
  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.175",
30
+ "version": "0.2.176",
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",
@@ -34,11 +34,16 @@ export interface AblateConfig {
34
34
  * diversified subset + one strong verifier. Off in serving until the
35
35
  * gate promotes it; the grid arms it per ask. */
36
36
  speculative: boolean;
37
- /** Extractive prompt compression (TODO.sota/02 row 5): each passage
38
- * body is query-weighted sentence selection at a fraction of its
39
- * budget before the answer model reads it. Off in serving; the grid
40
- * arms it per ask (the row's accuracy-at-token-budget gate). */
37
+ /** Extractive prompt compression (TODO.sota/02 row 5): PROMOTED — the
38
+ * passage bodies are query-weighted sentence selection at a fraction
39
+ * of their budget in serving (the row's gate: identical accuracy at
40
+ * ~1/20th the prompt, the whole-document baseline measured it).
41
+ * ablate_compress survives for the grid's explicit arm;
42
+ * ablate_no_compress is the measurement stand-down. */
41
43
  compress: boolean;
44
+ /** Per-request stand-down for the promoted compressor (the
45
+ * measurement arm; the serving default is on). */
46
+ noCompress: boolean;
42
47
  /** The decision pass (TODO.decisions/01): per-request stand-down for
43
48
  * the measurement — the serving switch is DECISIONS_ENABLED. */
44
49
  noDecisions: boolean;
@@ -64,11 +69,12 @@ export function parseAblate(
64
69
  const rawRoute = body?.ablate_route;
65
70
  const speculative = body?.ablate_speculative === true;
66
71
  const compress = body?.ablate_compress === true;
72
+ const noCompress = body?.ablate_no_compress === true;
67
73
  const noDecisions = body?.ablate_no_decisions === true;
68
74
  const namesAblation = rawStages !== undefined && rawStages !== null;
69
75
  const routeAblation = rawRoute !== undefined && rawRoute !== null && rawRoute !== "adaptive";
70
76
 
71
- if (!namesAblation && !noVerdict && !routeAblation && !speculative && !compress && !noDecisions) return { ok: true, config: null };
77
+ if (!namesAblation && !noVerdict && !routeAblation && !speculative && !compress && !noCompress && !noDecisions) return { ok: true, config: null };
72
78
 
73
79
  if (!adminToken || presentedToken !== adminToken) {
74
80
  return {
@@ -103,5 +109,5 @@ export function parseAblate(
103
109
  stages = [...new Set(rawStages as string[])];
104
110
  }
105
111
 
106
- return { ok: true, config: { stages, noVerdict, route, speculative, compress, noDecisions } };
112
+ return { ok: true, config: { stages, noVerdict, route, speculative, compress, noCompress, noDecisions } };
107
113
  }
@@ -1507,7 +1507,7 @@ let convEntities: Array<{ entity: string; kind: string }> = [];
1507
1507
  [ops.note, processNote, eNote, regNote, contextNote(declaredCtx, docScope), accountNote, modelNote, vocabNote, memNote, machineNote, conditionNote, aggregationNote, boundaryNote, licenseNote, ...(retrieved.notes ?? [])].filter(Boolean).join("\n") || undefined,
1508
1508
  summary,
1509
1509
  budget,
1510
- ablate?.compress === true,
1510
+ ablate?.noCompress !== true,
1511
1511
  );
1512
1512
  // the decision pass (TODO.decisions/01): starts here so its calls run
1513
1513
  // concurrently with generation — the checklist section arrives the
@@ -2005,7 +2005,7 @@ let convEntities: Array<{ entity: string; kind: string }> = [];
2005
2005
  ...(routeSubset ? { stageSubset: routeSubset ?? undefined } : {}),
2006
2006
  });
2007
2007
  if (retryRetrieve.hits.length > 0) {
2008
- const { messages: retryMessages, usedHits: retryUsed } = buildMessages(q.query, retryRetrieve.hits, q.lang, keptHistory, undefined, summary, budget, ablate?.compress === true);
2008
+ const { messages: retryMessages, usedHits: retryUsed } = buildMessages(q.query, retryRetrieve.hits, q.lang, keptHistory, undefined, summary, budget, ablate?.noCompress !== true);
2009
2009
  const retryAnswer = await generateOnce(env, model, retryMessages, routeEffort(routed.route));
2010
2010
  // the answer now comes from the retry passages — citations must follow
2011
2011
  if (retryAnswer) {
@@ -288,9 +288,10 @@ export function buildMessages(
288
288
  retrievalNote?: string,
289
289
  conversationSummary?: string,
290
290
  budgetTokens: number = LIMITS.inputTokenBudget,
291
- /** the extractive compression arm (TODO.sota/02 row 5): ablate_compress
292
- * arms it per ask — each passage body becomes query-weighted sentence
293
- * selection at compressShare of its budget. Off in serving. */
291
+ /** the extractive compression (TODO.sota/02 row 5): PROMOTED — on in
292
+ * serving; ablate_no_compress stands it down per ask for the
293
+ * measurement. Each passage body becomes query-weighted sentence
294
+ * selection at compressShare of its budget. */
294
295
  compress?: boolean,
295
296
  ): BuiltMessages {
296
297
  // per-corpus guidance travels WITH the dataset (config.ts): every