@indexnetwork/protocol 11.2.0-rc.458.1 → 11.2.1

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/CHANGELOG.md CHANGED
@@ -20,6 +20,30 @@ went 6.7.1 → 8.0.2 with no 7.x in between because the whole 7.x line shipped a
20
20
  prereleases between the two promotions. To track every change, read `rc`; to
21
21
  pin a supported release, use `latest`.
22
22
 
23
+ ## 11.2.1 - 2026-08-11
24
+
25
+ ### Added
26
+
27
+ - Added the guarded historical-quality runtime for single-configuration,
28
+ dual-trigger shared-pool evaluation.
29
+
30
+ ### Fixed
31
+
32
+ - Hardened historical-quality readiness with attested database credentials,
33
+ frozen embedding requests, and fail-closed protected-base refresh gating.
34
+
35
+ ## 10.2.0 - 2026-08-10
36
+
37
+ ### Changed
38
+
39
+ - Refined the canonical V2 historical-quality artifact contract so execution
40
+ completeness is independent of verdict availability: complete filtered
41
+ case/trigger selections are valid descriptive evidence with
42
+ `completeness.complete: true` and
43
+ `measurement.qualityVerdictAvailable: false`; only complete full-corpus,
44
+ full-trigger selections may publish a quality verdict. Legacy and canonical
45
+ parser selection remain unchanged.
46
+
23
47
  ## 10.1.0 - 2026-08-07
24
48
 
25
49
  ### Added
@@ -81,6 +105,13 @@ pin a supported release, use `latest`.
81
105
  - Remove unsupported deprecated source/deep forwarding shims after migrating repository consumers to canonical modules; stable package-root exports are unchanged.
82
106
  - Add a fail-closed isolated provider-free test gate (10.1.1). Tooling-only
83
107
  safety foundation; no runtime or public API behavior changes.
108
+ - For the planned 10.2.0 release, refine the canonical V2 historical-quality
109
+ artifact contract so execution completeness is independent of verdict
110
+ availability: complete filtered case/trigger selections are valid descriptive
111
+ evidence with `completeness.complete: true` and
112
+ `measurement.qualityVerdictAvailable: false`; only complete full-corpus,
113
+ full-trigger selections may publish a quality verdict. Legacy and canonical
114
+ parser selection remain unchanged.
84
115
  - Share capability classification metadata between the existing architecture
85
116
  boundary gate and the protocol atlas generator; allowed dependency directions
86
117
  are unchanged.
@@ -31,8 +31,8 @@ export interface ModelConfig {
31
31
  /** Override the chat reasoning effort. Falls back to CHAT_REASONING_EFFORT env var. */
32
32
  chatReasoningEffort?: 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
33
33
  }
34
- /** Per-agent model settings before any eval-only override is applied. */
35
- declare function getBaseModelConfig(config?: ModelConfig): {
34
+ /** Per-agent model settings before canonical assignments are applied. */
35
+ declare function getBaseModelConfig(config?: ModelConfig): { [Agent in "intentInferrer" | "intentIndexer" | "intentVerifier" | "intentReconciler" | "intentClarifier" | "profileGenerator" | "hydeGenerator" | "hydeValidator" | "lensInferrer" | "opportunityEvaluator" | "opportunityPresenter" | "negotiator" | "negotiationScreener" | "negotiationReflector" | "homeCategorizer" | "suggestionGenerator" | "chatTitleGenerator" | "negotiationInsights" | "chatContextSummarizer" | "questioner" | "signalIntakePack" | "negotiationSummarizer" | "poolDiscriminatorMiner" | "poolDiscriminatorAssigner" | "negotiationEvidenceMiner" | "inviteGenerator" | "premiseAnalyzer" | "premiseDecomposer" | "premiseIndexer" | "userContextGenerator" | "networkRecommender" | "interruptClassifier" | "chat"]: Omit<{
36
36
  readonly intentInferrer: {
37
37
  readonly model: "google/gemini-2.5-flash";
38
38
  };
@@ -164,14 +164,16 @@ declare function getBaseModelConfig(config?: ModelConfig): {
164
164
  readonly maxTokens: 16;
165
165
  };
166
166
  readonly chat: {
167
- readonly model: string;
167
+ readonly model: "google/gemini-3-pro-preview";
168
168
  readonly maxTokens: 8192;
169
169
  readonly reasoning: {
170
170
  readonly effort: NonNullable<ModelSettings["reasoning"]>["effort"];
171
171
  readonly exclude: true;
172
172
  };
173
173
  };
174
- };
174
+ }[Agent], "model"> & {
175
+ model: string;
176
+ }; };
175
177
  /** Key identifying one of the per-agent model configurations. */
176
178
  export type ModelAgent = keyof ReturnType<typeof getBaseModelConfig>;
177
179
  /**
@@ -1,50 +1,8 @@
1
1
  import { ChatOpenAI } from "@langchain/openai";
2
- /**
3
- * Eval-only per-agent model overrides, e.g.
4
- * `EVAL_MODEL_OVERRIDES={"opportunityEvaluator":"anthropic/claude-sonnet-4"}`.
5
- *
6
- * Read on every call (no caching) to match the surrounding env convention, and
7
- * ignored entirely in production so a deployed process can never be repointed at
8
- * another model by an environment variable. A malformed value or an unknown agent
9
- * key throws: a typo must not silently produce a run that measured the default.
10
- */
11
- function readModelOverrides(agentKeys) {
12
- if (process.env.NODE_ENV === "production")
13
- return {};
14
- const raw = process.env.EVAL_MODEL_OVERRIDES?.trim();
15
- if (!raw)
16
- return {};
17
- let parsed;
18
- try {
19
- parsed = JSON.parse(raw);
20
- }
21
- catch (err) {
22
- // `new Error(msg, { cause })` needs lib ES2022; this package targets ES2020,
23
- // so the cause is attached after construction (same pattern as elsewhere in src).
24
- const wrapped = new Error(`EVAL_MODEL_OVERRIDES is not valid JSON: ${raw}`);
25
- wrapped.cause = err;
26
- throw wrapped;
27
- }
28
- if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
29
- throw new Error("EVAL_MODEL_OVERRIDES must be a JSON object of agent -> model id");
30
- }
31
- const overrides = {};
32
- for (const [agent, model] of Object.entries(parsed)) {
33
- if (!agentKeys.includes(agent)) {
34
- throw new Error(`EVAL_MODEL_OVERRIDES names an unknown agent "${agent}". Known agents: ${agentKeys.join(", ")}`);
35
- }
36
- if (typeof model !== "string" || model.trim() === "") {
37
- throw new Error(`EVAL_MODEL_OVERRIDES value for "${agent}" must be a non-empty model id string`);
38
- }
39
- // Store trimmed: surrounding whitespace in the JSON value would otherwise be
40
- // sent verbatim to OpenRouter as part of the model id.
41
- overrides[agent] = model.trim();
42
- }
43
- return overrides;
44
- }
45
- /** Per-agent model settings before any eval-only override is applied. */
2
+ import { resolveCanonicalAllAgentModels } from "./model.resolver.js";
3
+ /** Per-agent model settings before canonical assignments are applied. */
46
4
  function getBaseModelConfig(config) {
47
- return {
5
+ const settings = {
48
6
  intentInferrer: { model: "google/gemini-2.5-flash" },
49
7
  intentIndexer: { model: "google/gemini-2.5-flash" },
50
8
  intentVerifier: { model: "google/gemini-2.5-flash" },
@@ -78,7 +36,7 @@ function getBaseModelConfig(config) {
78
36
  networkRecommender: { model: "google/gemini-2.5-flash", temperature: 0.2, maxTokens: 512 },
79
37
  interruptClassifier: { model: "google/gemini-2.5-flash", temperature: 0.0, maxTokens: 16 },
80
38
  chat: {
81
- model: config?.chatModel ?? process.env.CHAT_MODEL ?? "google/gemini-3-pro-preview",
39
+ model: "google/gemini-3-pro-preview",
82
40
  maxTokens: 8192,
83
41
  reasoning: {
84
42
  effort: (config?.chatReasoningEffort ?? process.env.CHAT_REASONING_EFFORT ?? "low"),
@@ -86,22 +44,15 @@ function getBaseModelConfig(config) {
86
44
  },
87
45
  },
88
46
  };
47
+ const assignments = resolveCanonicalAllAgentModels({
48
+ CHAT_MODEL: config?.chatModel ?? process.env.CHAT_MODEL,
49
+ EVAL_MODEL_OVERRIDES: process.env.EVAL_MODEL_OVERRIDES,
50
+ }, { applyEvalOverrides: process.env.NODE_ENV !== "production" });
51
+ return Object.fromEntries(Object.entries(settings).map(([agent, value]) => [agent, { ...value, model: assignments[agent] }]));
89
52
  }
90
- /**
91
- * Per-agent model settings, with `EVAL_MODEL_OVERRIDES` applied when present.
92
- * Only the model id is overridable: temperature, token limits and reasoning
93
- * effort stay fixed so an eval measures a model swap and nothing else.
94
- */
53
+ /** Canonical assignments preserve sampling, token, and reasoning settings. */
95
54
  function getModelConfig(config) {
96
- const base = getBaseModelConfig(config);
97
- const overrides = readModelOverrides(Object.keys(base));
98
- if (Object.keys(overrides).length === 0)
99
- return base;
100
- const merged = Object.fromEntries(Object.entries(base).map(([agent, settings]) => {
101
- const model = overrides[agent];
102
- return [agent, model ? { ...settings, model } : settings];
103
- }));
104
- return merged;
55
+ return getBaseModelConfig(config);
105
56
  }
106
57
  /**
107
58
  * Returns the model name string for the given agent key.
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Canonical model-assignment authority for every protocol agent.
3
+ *
4
+ * The resolver is pure: callers provide the complete environment projection it
5
+ * may read. Historical eval planning uses the returned all-agent map so an
6
+ * unmentioned agent cannot drift behind an implicit runtime default.
7
+ */
8
+ export declare const CANONICAL_AGENT_MODEL_DEFAULTS: Readonly<{
9
+ readonly intentInferrer: "google/gemini-2.5-flash";
10
+ readonly intentIndexer: "google/gemini-2.5-flash";
11
+ readonly intentVerifier: "google/gemini-2.5-flash";
12
+ readonly intentReconciler: "google/gemini-2.5-flash";
13
+ readonly intentClarifier: "google/gemini-2.5-flash";
14
+ readonly profileGenerator: "google/gemini-2.5-flash";
15
+ readonly hydeGenerator: "google/gemini-2.5-flash";
16
+ readonly hydeValidator: "google/gemini-2.5-flash";
17
+ readonly lensInferrer: "google/gemini-2.5-flash";
18
+ readonly opportunityEvaluator: "google/gemini-2.5-flash";
19
+ readonly opportunityPresenter: "google/gemini-2.5-flash";
20
+ readonly negotiator: "google/gemini-2.5-flash";
21
+ readonly negotiationScreener: "google/gemini-2.5-flash";
22
+ readonly negotiationReflector: "google/gemini-2.5-flash";
23
+ readonly homeCategorizer: "google/gemini-2.5-flash";
24
+ readonly suggestionGenerator: "google/gemini-2.5-flash";
25
+ readonly chatTitleGenerator: "google/gemini-2.5-flash";
26
+ readonly negotiationInsights: "google/gemini-2.5-flash";
27
+ readonly chatContextSummarizer: "google/gemini-2.5-flash";
28
+ readonly questioner: "google/gemini-2.5-flash";
29
+ readonly signalIntakePack: "google/gemini-2.5-flash";
30
+ readonly negotiationSummarizer: "google/gemini-2.5-flash";
31
+ readonly poolDiscriminatorMiner: "google/gemini-2.5-flash";
32
+ readonly poolDiscriminatorAssigner: "google/gemini-2.5-flash";
33
+ readonly negotiationEvidenceMiner: "google/gemini-2.5-flash";
34
+ readonly inviteGenerator: "google/gemini-2.5-flash";
35
+ readonly premiseAnalyzer: "google/gemini-2.5-flash";
36
+ readonly premiseDecomposer: "google/gemini-2.5-flash";
37
+ readonly premiseIndexer: "google/gemini-2.5-flash";
38
+ readonly userContextGenerator: "google/gemini-2.5-flash";
39
+ readonly networkRecommender: "google/gemini-2.5-flash";
40
+ readonly interruptClassifier: "google/gemini-2.5-flash";
41
+ readonly chat: "google/gemini-3-pro-preview";
42
+ }>;
43
+ export type CanonicalModelAgent = keyof typeof CANONICAL_AGENT_MODEL_DEFAULTS;
44
+ export type CanonicalAllAgentModels = Readonly<Record<CanonicalModelAgent, string>>;
45
+ export declare const CANONICAL_MODEL_AGENTS: readonly ("intentInferrer" | "intentIndexer" | "intentVerifier" | "intentReconciler" | "intentClarifier" | "profileGenerator" | "hydeGenerator" | "hydeValidator" | "lensInferrer" | "opportunityEvaluator" | "opportunityPresenter" | "negotiator" | "negotiationScreener" | "negotiationReflector" | "homeCategorizer" | "suggestionGenerator" | "chatTitleGenerator" | "negotiationInsights" | "chatContextSummarizer" | "questioner" | "signalIntakePack" | "negotiationSummarizer" | "poolDiscriminatorMiner" | "poolDiscriminatorAssigner" | "negotiationEvidenceMiner" | "inviteGenerator" | "premiseAnalyzer" | "premiseDecomposer" | "premiseIndexer" | "userContextGenerator" | "networkRecommender" | "interruptClassifier" | "chat")[];
46
+ export declare function resolveCanonicalAllAgentModels(environment: Readonly<Record<string, string | undefined>>, options?: {
47
+ applyEvalOverrides?: boolean;
48
+ }): CanonicalAllAgentModels;
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Canonical model-assignment authority for every protocol agent.
3
+ *
4
+ * The resolver is pure: callers provide the complete environment projection it
5
+ * may read. Historical eval planning uses the returned all-agent map so an
6
+ * unmentioned agent cannot drift behind an implicit runtime default.
7
+ */
8
+ export const CANONICAL_AGENT_MODEL_DEFAULTS = Object.freeze({
9
+ intentInferrer: "google/gemini-2.5-flash",
10
+ intentIndexer: "google/gemini-2.5-flash",
11
+ intentVerifier: "google/gemini-2.5-flash",
12
+ intentReconciler: "google/gemini-2.5-flash",
13
+ intentClarifier: "google/gemini-2.5-flash",
14
+ profileGenerator: "google/gemini-2.5-flash",
15
+ hydeGenerator: "google/gemini-2.5-flash",
16
+ hydeValidator: "google/gemini-2.5-flash",
17
+ lensInferrer: "google/gemini-2.5-flash",
18
+ opportunityEvaluator: "google/gemini-2.5-flash",
19
+ opportunityPresenter: "google/gemini-2.5-flash",
20
+ negotiator: "google/gemini-2.5-flash",
21
+ negotiationScreener: "google/gemini-2.5-flash",
22
+ negotiationReflector: "google/gemini-2.5-flash",
23
+ homeCategorizer: "google/gemini-2.5-flash",
24
+ suggestionGenerator: "google/gemini-2.5-flash",
25
+ chatTitleGenerator: "google/gemini-2.5-flash",
26
+ negotiationInsights: "google/gemini-2.5-flash",
27
+ chatContextSummarizer: "google/gemini-2.5-flash",
28
+ questioner: "google/gemini-2.5-flash",
29
+ signalIntakePack: "google/gemini-2.5-flash",
30
+ negotiationSummarizer: "google/gemini-2.5-flash",
31
+ poolDiscriminatorMiner: "google/gemini-2.5-flash",
32
+ poolDiscriminatorAssigner: "google/gemini-2.5-flash",
33
+ negotiationEvidenceMiner: "google/gemini-2.5-flash",
34
+ inviteGenerator: "google/gemini-2.5-flash",
35
+ premiseAnalyzer: "google/gemini-2.5-flash",
36
+ premiseDecomposer: "google/gemini-2.5-flash",
37
+ premiseIndexer: "google/gemini-2.5-flash",
38
+ userContextGenerator: "google/gemini-2.5-flash",
39
+ networkRecommender: "google/gemini-2.5-flash",
40
+ interruptClassifier: "google/gemini-2.5-flash",
41
+ chat: "google/gemini-3-pro-preview",
42
+ });
43
+ export const CANONICAL_MODEL_AGENTS = Object.freeze(Object.keys(CANONICAL_AGENT_MODEL_DEFAULTS));
44
+ function parseOverrides(raw) {
45
+ if (raw?.trim() === undefined || raw.trim() === "")
46
+ return {};
47
+ let parsed;
48
+ try {
49
+ parsed = JSON.parse(raw);
50
+ }
51
+ catch {
52
+ throw new Error("EVAL_MODEL_OVERRIDES is not valid JSON");
53
+ }
54
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
55
+ throw new Error("EVAL_MODEL_OVERRIDES must be a JSON object of agent -> model id");
56
+ }
57
+ const overrides = {};
58
+ for (const [agent, model] of Object.entries(parsed)) {
59
+ if (!CANONICAL_MODEL_AGENTS.includes(agent)) {
60
+ throw new Error(`EVAL_MODEL_OVERRIDES names an unknown agent "${agent}". Known agents: ${CANONICAL_MODEL_AGENTS.join(", ")}`);
61
+ }
62
+ if (typeof model !== "string" || model.trim() === "") {
63
+ throw new Error(`EVAL_MODEL_OVERRIDES value for "${agent}" must be a non-empty model id string`);
64
+ }
65
+ overrides[agent] = model.trim();
66
+ }
67
+ return overrides;
68
+ }
69
+ export function resolveCanonicalAllAgentModels(environment, options = {}) {
70
+ const models = { ...CANONICAL_AGENT_MODEL_DEFAULTS };
71
+ const chatModel = environment.CHAT_MODEL?.trim();
72
+ if (chatModel)
73
+ models.chat = chatModel;
74
+ if (options.applyEvalOverrides !== false) {
75
+ Object.assign(models, parseOverrides(environment.EVAL_MODEL_OVERRIDES));
76
+ }
77
+ return Object.freeze(models);
78
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indexnetwork/protocol",
3
- "version": "11.2.0-rc.458.1",
3
+ "version": "11.2.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",