@nexus-cortex/core 4.69.0 → 4.70.0
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/models/configurators/DeepSeekConfigurator.d.ts +3 -0
- package/dist/models/configurators/DeepSeekConfigurator.d.ts.map +1 -1
- package/dist/models/configurators/DeepSeekConfigurator.js +1 -0
- package/dist/models/configurators/DeepSeekConfigurator.js.map +1 -1
- package/dist/models/configurators/XAIConfigurator.d.ts +3 -0
- package/dist/models/configurators/XAIConfigurator.d.ts.map +1 -1
- package/dist/models/configurators/XAIConfigurator.js +1 -0
- package/dist/models/configurators/XAIConfigurator.js.map +1 -1
- package/dist/orchestrator/CortexOrchestrator.d.ts +9 -0
- package/dist/orchestrator/CortexOrchestrator.d.ts.map +1 -1
- package/dist/orchestrator/CortexOrchestrator.js +535 -15
- package/dist/orchestrator/CortexOrchestrator.js.map +1 -1
- package/dist/orchestrator/inactionGuard.d.ts +42 -0
- package/dist/orchestrator/inactionGuard.d.ts.map +1 -0
- package/dist/orchestrator/inactionGuard.js +47 -0
- package/dist/orchestrator/inactionGuard.js.map +1 -0
- package/dist/orchestrator/requirementsVerification.d.ts +43 -0
- package/dist/orchestrator/requirementsVerification.d.ts.map +1 -0
- package/dist/orchestrator/requirementsVerification.js +87 -0
- package/dist/orchestrator/requirementsVerification.js.map +1 -0
- package/dist/tools/ToolProfile.d.ts +9 -0
- package/dist/tools/ToolProfile.d.ts.map +1 -1
- package/dist/tools/ToolProfile.js +19 -0
- package/dist/tools/ToolProfile.js.map +1 -1
- package/dist/tools/registries/BaseToolRegistry.d.ts.map +1 -1
- package/dist/tools/registries/BaseToolRegistry.js +14 -0
- package/dist/tools/registries/BaseToolRegistry.js.map +1 -1
- package/dist/training/DecisionPriorInjector.d.ts +7 -0
- package/dist/training/DecisionPriorInjector.d.ts.map +1 -1
- package/dist/training/DecisionPriorInjector.js +22 -0
- package/dist/training/DecisionPriorInjector.js.map +1 -1
- package/dist/training/DecisionStore.d.ts +39 -0
- package/dist/training/DecisionStore.d.ts.map +1 -1
- package/dist/training/DecisionStore.js +94 -0
- package/dist/training/DecisionStore.js.map +1 -1
- package/dist/training/errorFamily.d.ts +15 -0
- package/dist/training/errorFamily.d.ts.map +1 -0
- package/dist/training/errorFamily.js +40 -0
- package/dist/training/errorFamily.js.map +1 -0
- package/dist/training/loopLadder.d.ts +35 -0
- package/dist/training/loopLadder.d.ts.map +1 -0
- package/dist/training/loopLadder.js +58 -0
- package/dist/training/loopLadder.js.map +1 -0
- package/dist/training/toolOutcome.d.ts +20 -0
- package/dist/training/toolOutcome.d.ts.map +1 -0
- package/dist/training/toolOutcome.js +100 -0
- package/dist/training/toolOutcome.js.map +1 -0
- package/package.json +3 -3
|
@@ -31,6 +31,25 @@ export interface Decision {
|
|
|
31
31
|
/** Active tool-surface arm (CORTEX_TOOL_PROFILE) — stamped when not 'full',
|
|
32
32
|
* so the tool-profile A/B can slice selection/success per arm. */
|
|
33
33
|
toolProfile?: string;
|
|
34
|
+
/** Present ONLY on event rows (recordEvent) — steering/guard observability
|
|
35
|
+
* records riding the same JSONL. Rows with `kind` set are EXCLUDED from
|
|
36
|
+
* every prior-lookup path (lookup/recent/familyFailures/stats) so events
|
|
37
|
+
* can never pollute priors. TB2 finding: injected steering (budget/
|
|
38
|
+
* diversity/ladder signals) mutates tool_results AFTER session persist, so
|
|
39
|
+
* the durable session lacks what the model saw — these records are the
|
|
40
|
+
* distiller's only view of it. */
|
|
41
|
+
kind?: SteeringEventKind;
|
|
42
|
+
/** Free-shape event payload (small — truncated summaries only). */
|
|
43
|
+
detail?: Record<string, unknown>;
|
|
44
|
+
}
|
|
45
|
+
/** Observability event kinds (docs/HARNESS_IMPROVEMENT_BACKLOG.md item 3). */
|
|
46
|
+
export type SteeringEventKind = 'steering_injected' | 'loop_escalation' | 'endturn_gate_fallback' | 'inaction_nudge';
|
|
47
|
+
export interface SteeringEventInput {
|
|
48
|
+
sessionId: string;
|
|
49
|
+
kind: SteeringEventKind;
|
|
50
|
+
/** Tool the event concerns, when there is one (ladder escalations). */
|
|
51
|
+
toolName?: string;
|
|
52
|
+
detail?: Record<string, unknown>;
|
|
34
53
|
}
|
|
35
54
|
export interface DecisionStats {
|
|
36
55
|
total: number;
|
|
@@ -64,6 +83,13 @@ export declare class DecisionStore {
|
|
|
64
83
|
private rotateIfNeeded;
|
|
65
84
|
/** Append a decision. Idempotent at the filesystem level (mkdir -p). */
|
|
66
85
|
record(input: DecisionInput): Promise<void>;
|
|
86
|
+
/** Append a steering/guard observability EVENT row. Event rows carry `kind`
|
|
87
|
+
* and are invisible to every prior-lookup path — they exist for the
|
|
88
|
+
* distiller/harvest side (the steering the model saw but the session
|
|
89
|
+
* record does not show). Best-effort by design at call sites. */
|
|
90
|
+
recordEvent(input: SteeringEventInput): Promise<void>;
|
|
91
|
+
/** All event rows, oldest→newest (optionally one kind). Harvest-side read. */
|
|
92
|
+
readEvents(kind?: SteeringEventKind): Promise<Decision[]>;
|
|
67
93
|
/**
|
|
68
94
|
* Read all decisions matching the given (toolName, inputHash). Lines that
|
|
69
95
|
* fail to parse are skipped — the store is resilient to partial writes
|
|
@@ -76,6 +102,19 @@ export declare class DecisionStore {
|
|
|
76
102
|
* specific recent outcomes rather than just aggregate counts.
|
|
77
103
|
*/
|
|
78
104
|
recent(toolName: string, inputHash: string, limit: number): Promise<Decision[]>;
|
|
105
|
+
/**
|
|
106
|
+
* Failures for (toolName, error FAMILY) across ALL inputs — the
|
|
107
|
+
* repeated-approach lens (see errorFamily.ts). `distinctInputs` lets the
|
|
108
|
+
* caller require the family to span >=2 different inputs before hinting
|
|
109
|
+
* (identical retries are the exact-input reminder's job).
|
|
110
|
+
*/
|
|
111
|
+
familyFailures(toolName: string, family: string, recentLimit?: number): Promise<{
|
|
112
|
+
count: number;
|
|
113
|
+
distinctInputs: number;
|
|
114
|
+
recent: Decision[];
|
|
115
|
+
}>;
|
|
116
|
+
/** All decisions for a tool, oldest->newest (rotated gen first). */
|
|
117
|
+
private readAllForTool;
|
|
79
118
|
stats(toolName: string, inputHash: string): Promise<DecisionStats>;
|
|
80
119
|
}
|
|
81
120
|
//# sourceMappingURL=DecisionStore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecisionStore.d.ts","sourceRoot":"","sources":["../../src/training/DecisionStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"DecisionStore.d.ts","sourceRoot":"","sources":["../../src/training/DecisionStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAOH,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,wDAAwD;IACxD,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;uEACmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;uCAMmC;IACnC,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,8EAA8E;AAC9E,MAAM,MAAM,iBAAiB,GACzB,mBAAmB,GACnB,iBAAiB,GACjB,uBAAuB,GACvB,gBAAgB,CAAC;AAErB,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,iBAAiB,CAAC;IACxB,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;OAKG;IACG,cAAc,CAClB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,WAAW,SAAI,GACd,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,QAAQ,EAAE,CAAA;KAAE,CAAC;IAczE,oEAAoE;YACtD,cAAc;IAkBtB,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;CAmBzE"}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import * as fs from 'fs/promises';
|
|
15
15
|
import * as path from 'path';
|
|
16
|
+
import { classifyErrorFamily } from './errorFamily.js';
|
|
16
17
|
import { createHash } from 'crypto';
|
|
17
18
|
const MAX_INPUT_SUMMARY = 300;
|
|
18
19
|
const MAX_ERROR_SNIPPET = 200;
|
|
@@ -99,6 +100,52 @@ export class DecisionStore {
|
|
|
99
100
|
await this.rotateIfNeeded();
|
|
100
101
|
await fs.appendFile(this.storePath, JSON.stringify(decision) + '\n', 'utf-8');
|
|
101
102
|
}
|
|
103
|
+
/** Append a steering/guard observability EVENT row. Event rows carry `kind`
|
|
104
|
+
* and are invisible to every prior-lookup path — they exist for the
|
|
105
|
+
* distiller/harvest side (the steering the model saw but the session
|
|
106
|
+
* record does not show). Best-effort by design at call sites. */
|
|
107
|
+
async recordEvent(input) {
|
|
108
|
+
const row = {
|
|
109
|
+
ts: Date.now(),
|
|
110
|
+
sessionId: input.sessionId,
|
|
111
|
+
toolName: input.toolName ?? '',
|
|
112
|
+
inputHash: '',
|
|
113
|
+
inputSummary: '',
|
|
114
|
+
success: true,
|
|
115
|
+
kind: input.kind,
|
|
116
|
+
...(input.detail ? { detail: input.detail } : {}),
|
|
117
|
+
};
|
|
118
|
+
await fs.mkdir(path.dirname(this.storePath), { recursive: true });
|
|
119
|
+
await this.rotateIfNeeded();
|
|
120
|
+
await fs.appendFile(this.storePath, JSON.stringify(row) + '\n', 'utf-8');
|
|
121
|
+
}
|
|
122
|
+
/** All event rows, oldest→newest (optionally one kind). Harvest-side read. */
|
|
123
|
+
async readEvents(kind) {
|
|
124
|
+
const readMaybe = async (p) => {
|
|
125
|
+
try {
|
|
126
|
+
return await fs.readFile(p, 'utf-8');
|
|
127
|
+
}
|
|
128
|
+
catch (err) {
|
|
129
|
+
if (err.code === 'ENOENT')
|
|
130
|
+
return '';
|
|
131
|
+
throw err;
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
const rotated = await readMaybe(this.storePath + '.1');
|
|
135
|
+
const main = await readMaybe(this.storePath);
|
|
136
|
+
const out = [];
|
|
137
|
+
for (const line of (rotated + main).split('\n')) {
|
|
138
|
+
if (!line.trim())
|
|
139
|
+
continue;
|
|
140
|
+
try {
|
|
141
|
+
const d = JSON.parse(line);
|
|
142
|
+
if (d.kind && (!kind || d.kind === kind))
|
|
143
|
+
out.push(d);
|
|
144
|
+
}
|
|
145
|
+
catch { /* torn line — skip */ }
|
|
146
|
+
}
|
|
147
|
+
return out;
|
|
148
|
+
}
|
|
102
149
|
/**
|
|
103
150
|
* Read all decisions matching the given (toolName, inputHash). Lines that
|
|
104
151
|
* fail to parse are skipped — the store is resilient to partial writes
|
|
@@ -133,6 +180,8 @@ export class DecisionStore {
|
|
|
133
180
|
catch {
|
|
134
181
|
continue;
|
|
135
182
|
}
|
|
183
|
+
if (parsed.kind)
|
|
184
|
+
continue; // event rows never feed priors
|
|
136
185
|
if (parsed.toolName === toolName && parsed.inputHash === inputHash) {
|
|
137
186
|
out.push(parsed);
|
|
138
187
|
}
|
|
@@ -151,6 +200,51 @@ export class DecisionStore {
|
|
|
151
200
|
// `lookup` returns in file order (oldest first). Reverse and slice.
|
|
152
201
|
return all.slice().reverse().slice(0, limit);
|
|
153
202
|
}
|
|
203
|
+
/**
|
|
204
|
+
* Failures for (toolName, error FAMILY) across ALL inputs — the
|
|
205
|
+
* repeated-approach lens (see errorFamily.ts). `distinctInputs` lets the
|
|
206
|
+
* caller require the family to span >=2 different inputs before hinting
|
|
207
|
+
* (identical retries are the exact-input reminder's job).
|
|
208
|
+
*/
|
|
209
|
+
async familyFailures(toolName, family, recentLimit = 3) {
|
|
210
|
+
if (!family)
|
|
211
|
+
return { count: 0, distinctInputs: 0, recent: [] };
|
|
212
|
+
const all = await this.readAllForTool(toolName);
|
|
213
|
+
const matches = all.filter((d) => !d.success && classifyErrorFamily(d.errorSnippet ?? '') === family);
|
|
214
|
+
const distinct = new Set(matches.map((d) => d.inputHash));
|
|
215
|
+
return {
|
|
216
|
+
count: matches.length,
|
|
217
|
+
distinctInputs: distinct.size,
|
|
218
|
+
recent: matches.slice(-recentLimit).reverse(),
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
/** All decisions for a tool, oldest->newest (rotated gen first). */
|
|
222
|
+
async readAllForTool(toolName) {
|
|
223
|
+
const readMaybe = async (p) => {
|
|
224
|
+
try {
|
|
225
|
+
return await fs.readFile(p, 'utf-8');
|
|
226
|
+
}
|
|
227
|
+
catch (err) {
|
|
228
|
+
if (err.code === 'ENOENT')
|
|
229
|
+
return '';
|
|
230
|
+
throw err;
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
const rotated = await readMaybe(this.storePath + '.1');
|
|
234
|
+
const main = await readMaybe(this.storePath);
|
|
235
|
+
const out = [];
|
|
236
|
+
for (const line of (rotated + main).split('\n')) {
|
|
237
|
+
if (!line.trim())
|
|
238
|
+
continue;
|
|
239
|
+
try {
|
|
240
|
+
const d = JSON.parse(line);
|
|
241
|
+
if (!d.kind && d.toolName === toolName)
|
|
242
|
+
out.push(d);
|
|
243
|
+
}
|
|
244
|
+
catch { /* torn line — skip */ }
|
|
245
|
+
}
|
|
246
|
+
return out;
|
|
247
|
+
}
|
|
154
248
|
async stats(toolName, inputHash) {
|
|
155
249
|
const hits = await this.lookup(toolName, inputHash);
|
|
156
250
|
let lastError;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecisionStore.js","sourceRoot":"","sources":["../../src/training/DecisionStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"DecisionStore.js","sourceRoot":"","sources":["../../src/training/DecisionStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AA0DpC,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAC9B,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAE9B;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,MAAM,SAAS,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IACvC,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAC3E,CAAC;AAED,SAAS,aAAa,CAAC,KAAc;IACnC,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAChD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,C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;QACH,CAAC;QACD,OAAO;YACL,KAAK,EAAE,IAAI,CAAC,MAAM;YAClB,SAAS;YACT,QAAQ;YACR,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACpC,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* classifyErrorFamily — normalize an error snippet into a stable "family"
|
|
3
|
+
* key so the decision store can recognize REPEATED-APPROACH failures across
|
|
4
|
+
* non-identical inputs (AHE borrow, 2026-08-23: the TB2 #1 harness's
|
|
5
|
+
* execution_risk_hints middleware hints on error-FAMILY repetition, where
|
|
6
|
+
* our exact-input prior only catches byte-identical retries).
|
|
7
|
+
*
|
|
8
|
+
* Normalization is deliberately crude and deterministic: first meaningful
|
|
9
|
+
* line, lowercased, with the volatile tokens (paths, digits, hex ids,
|
|
10
|
+
* quoted strings) collapsed to placeholders. Two snippets from the same
|
|
11
|
+
* failing approach should collide; different error classes should not.
|
|
12
|
+
* Empty input returns '' (callers treat that as "no family").
|
|
13
|
+
*/
|
|
14
|
+
export declare function classifyErrorFamily(snippet: string): string;
|
|
15
|
+
//# sourceMappingURL=errorFamily.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errorFamily.d.ts","sourceRoot":"","sources":["../../src/training/errorFamily.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAsB3D"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* classifyErrorFamily — normalize an error snippet into a stable "family"
|
|
3
|
+
* key so the decision store can recognize REPEATED-APPROACH failures across
|
|
4
|
+
* non-identical inputs (AHE borrow, 2026-08-23: the TB2 #1 harness's
|
|
5
|
+
* execution_risk_hints middleware hints on error-FAMILY repetition, where
|
|
6
|
+
* our exact-input prior only catches byte-identical retries).
|
|
7
|
+
*
|
|
8
|
+
* Normalization is deliberately crude and deterministic: first meaningful
|
|
9
|
+
* line, lowercased, with the volatile tokens (paths, digits, hex ids,
|
|
10
|
+
* quoted strings) collapsed to placeholders. Two snippets from the same
|
|
11
|
+
* failing approach should collide; different error classes should not.
|
|
12
|
+
* Empty input returns '' (callers treat that as "no family").
|
|
13
|
+
*/
|
|
14
|
+
const MAX_FAMILY_LEN = 96;
|
|
15
|
+
export function classifyErrorFamily(snippet) {
|
|
16
|
+
if (!snippet)
|
|
17
|
+
return '';
|
|
18
|
+
// First non-blank line carries the error class in practice (shell errors,
|
|
19
|
+
// Python tracebacks lead with the exception line, node errors likewise).
|
|
20
|
+
const line = snippet
|
|
21
|
+
.split('\n')
|
|
22
|
+
.map((l) => l.trim())
|
|
23
|
+
.find((l) => l.length > 0);
|
|
24
|
+
if (!line)
|
|
25
|
+
return '';
|
|
26
|
+
let fam = line.toLowerCase();
|
|
27
|
+
// Quoted strings first (may contain paths/digits).
|
|
28
|
+
fam = fam.replace(/"[^"]*"/g, '<q>').replace(/'[^']*'/g, '<q>');
|
|
29
|
+
// Hex ids (container ids, hashes) BEFORE the generic digit collapse so
|
|
30
|
+
// mixed hex like a3f9b2 doesn't leave letter residue that differs per id.
|
|
31
|
+
fam = fam.replace(/\b[0-9a-f]{6,}\b/g, '<hex>');
|
|
32
|
+
// Path-like tokens (absolute or ./relative with at least one slash).
|
|
33
|
+
fam = fam.replace(/(?:\.{0,2}\/)[^\s:,;)]+/g, '<path>');
|
|
34
|
+
// Remaining digits.
|
|
35
|
+
fam = fam.replace(/\d+/g, '#');
|
|
36
|
+
// Collapse whitespace.
|
|
37
|
+
fam = fam.replace(/\s+/g, ' ').trim();
|
|
38
|
+
return fam.slice(0, MAX_FAMILY_LEN);
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=errorFamily.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errorFamily.js","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ING approaches (per tool +
|
|
3
|
+
* approachHash), replacing independent blunt guards with teach-then-break:
|
|
4
|
+
* remind(2) → diversify(4) → break(6); an ok on the approach resets it.
|
|
5
|
+
* (docs/UNIFIED_OUTCOME_LADDER.md. The exact-hash MAX_LOOP_REPETITIONS
|
|
6
|
+
* detector remains as the fast path for byte-identical spam.)
|
|
7
|
+
*/
|
|
8
|
+
import type { ToolOutcome } from './toolOutcome.js';
|
|
9
|
+
export type LadderAction = 'none' | 'remind' | 'diversify' | 'break';
|
|
10
|
+
export interface LadderResult {
|
|
11
|
+
action: LadderAction;
|
|
12
|
+
/** Consecutive not-ok observations for this (tool, approach). */
|
|
13
|
+
count: number;
|
|
14
|
+
family?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface LoopLadderThresholds {
|
|
17
|
+
remindAt?: number;
|
|
18
|
+
diversifyAt?: number;
|
|
19
|
+
breakAt?: number;
|
|
20
|
+
}
|
|
21
|
+
export declare class LoopLadder {
|
|
22
|
+
private readonly remindAt;
|
|
23
|
+
private readonly diversifyAt;
|
|
24
|
+
private readonly breakAt;
|
|
25
|
+
private readonly counts;
|
|
26
|
+
constructor(thresholds?: LoopLadderThresholds);
|
|
27
|
+
observe(toolName: string, outcome: Pick<ToolOutcome, 'status' | 'approachHash' | 'family'>): LadderResult;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Format the tool-result signal text for a ladder escalation. `null` for
|
|
31
|
+
* none/remind — the exact-prior and family reminders (processToolTraining)
|
|
32
|
+
* already cover the remind rung; the ladder speaks only when it must.
|
|
33
|
+
*/
|
|
34
|
+
export declare function formatLadderSignal(toolName: string, result: LadderResult): string | null;
|
|
35
|
+
//# sourceMappingURL=loopLadder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loopLadder.d.ts","sourceRoot":"","sources":["../../src/training/loopLadder.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,QAAQ,GAAG,WAAW,GAAG,OAAO,CAAC;AAErE,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,YAAY,CAAC;IACrB,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAOD,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyD;gBAEpE,UAAU,GAAE,oBAAyB;IAMjD,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,WAAW,EAAE,QAAQ,GAAG,cAAc,GAAG,QAAQ,CAAC,GAAG,YAAY;CAiB1G;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,GAAG,IAAI,CAoBxF"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
function envInt(name, fallback) {
|
|
2
|
+
const v = parseInt(process.env[name] ?? '', 10);
|
|
3
|
+
return Number.isNaN(v) || v <= 0 ? fallback : v;
|
|
4
|
+
}
|
|
5
|
+
export class LoopLadder {
|
|
6
|
+
remindAt;
|
|
7
|
+
diversifyAt;
|
|
8
|
+
breakAt;
|
|
9
|
+
counts = new Map();
|
|
10
|
+
constructor(thresholds = {}) {
|
|
11
|
+
this.remindAt = thresholds.remindAt ?? envInt('LOOP_REMIND_AT', 2);
|
|
12
|
+
this.diversifyAt = thresholds.diversifyAt ?? envInt('LOOP_DIVERSIFY_AT', 4);
|
|
13
|
+
this.breakAt = thresholds.breakAt ?? envInt('LOOP_BREAK_AT', 6);
|
|
14
|
+
}
|
|
15
|
+
observe(toolName, outcome) {
|
|
16
|
+
const key = `${toolName}\n${outcome.approachHash}`;
|
|
17
|
+
if (outcome.status === 'ok') {
|
|
18
|
+
this.counts.delete(key);
|
|
19
|
+
return { action: 'none', count: 0 };
|
|
20
|
+
}
|
|
21
|
+
const entry = this.counts.get(key) ?? { count: 0 };
|
|
22
|
+
entry.count += 1;
|
|
23
|
+
if (outcome.family)
|
|
24
|
+
entry.family = outcome.family;
|
|
25
|
+
this.counts.set(key, entry);
|
|
26
|
+
let action = 'none';
|
|
27
|
+
if (entry.count >= this.breakAt)
|
|
28
|
+
action = 'break';
|
|
29
|
+
else if (entry.count >= this.diversifyAt)
|
|
30
|
+
action = 'diversify';
|
|
31
|
+
else if (entry.count >= this.remindAt)
|
|
32
|
+
action = 'remind';
|
|
33
|
+
return { action, count: entry.count, ...(entry.family ? { family: entry.family } : {}) };
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Format the tool-result signal text for a ladder escalation. `null` for
|
|
38
|
+
* none/remind — the exact-prior and family reminders (processToolTraining)
|
|
39
|
+
* already cover the remind rung; the ladder speaks only when it must.
|
|
40
|
+
*/
|
|
41
|
+
export function formatLadderSignal(toolName, result) {
|
|
42
|
+
if (result.action === 'diversify') {
|
|
43
|
+
const fam = result.family ? ` (failure family: "${result.family}")` : '';
|
|
44
|
+
return (`<system-reminder>\nLOOP ESCALATION: this ${toolName} approach has failed ${result.count} ` +
|
|
45
|
+
`consecutive times${fam}. STOP retrying variants of the same command. Take a genuinely ` +
|
|
46
|
+
`different approach: state what has been ruled out, run ONE diagnostic to test a new ` +
|
|
47
|
+
`hypothesis, or check the built-in skill guides for this domain (list them via the Skill ` +
|
|
48
|
+
`tool or \`ls "$CORTEX_ROOT/.cortex/skills"\`).\n</system-reminder>`);
|
|
49
|
+
}
|
|
50
|
+
if (result.action === 'break') {
|
|
51
|
+
return (`<system-reminder>\nLOOP BREAK: this approach has failed ${result.count} consecutive times ` +
|
|
52
|
+
`and further retries are not productive. Do not call tools for this approach again. ` +
|
|
53
|
+
`Summarize honestly what was attempted, what is known, and why it is stuck — then either ` +
|
|
54
|
+
`attempt ONE clearly different strategy or conclude with your best final answer.\n</system-reminder>`);
|
|
55
|
+
}
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=loopLadder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loopLadder.js","sourceRoot":"","sources":["../../src/training/loopLadder.ts"],"names":[],"mappings":"AAwBA,SAAS,MAAM,CAAC,IAAY,EAAE,QAAgB;IAC5C,MAAM,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAChD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AAClD,CAAC;AAED,MAAM,OAAO,UAAU;IACJ,QAAQ,CAAS;IACjB,WAAW,CAAS;IACpB,OAAO,CAAS;IAChB,MAAM,GAAG,IAAI,GAAG,EAA8C,CAAC;IAEhF,YAAY,aAAmC,EAAE;QAC/C,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ,IAAI,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC;QACnE,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,WAAW,IAAI,MAAM,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC;QAC5E,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,OAAO,IAAI,MAAM,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,CAAC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,CAAC;QAClC,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,sBAAsB,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QACzE,OAAO,CACL,4CAA4C,QAAQ,wBAAwB,MAAM,CAAC,KAAK,GAAG;YAC3F,oBAAoB,GAAG,iEAAiE;YACxF,sFAAsF;YACtF,0FAA0F;YAC1F,oEAAoE,CACrE,CAAC;IACJ,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;QAC9B,OAAO,CACL,2DAA2D,MAAM,CAAC,KAAK,qBAAqB;YAC5F,qFAAqF;YACrF,0FAA0F;YAC1F,qGAAqG,CACtG,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface ToolOutcome {
|
|
2
|
+
status: 'ok' | 'failed' | 'error';
|
|
3
|
+
/** Normalized failure fingerprint (present when status !== 'ok'). */
|
|
4
|
+
family?: string;
|
|
5
|
+
/** Normalized "same approach" hash — near-duplicate retries collide. */
|
|
6
|
+
approachHash: string;
|
|
7
|
+
/** Byte-sensitive input hash (the existing exact-prior key). */
|
|
8
|
+
exactHash: string;
|
|
9
|
+
}
|
|
10
|
+
interface ToolResultLike {
|
|
11
|
+
content: string;
|
|
12
|
+
is_error?: boolean;
|
|
13
|
+
metadata?: {
|
|
14
|
+
exitCode?: number | null;
|
|
15
|
+
} & Record<string, unknown>;
|
|
16
|
+
}
|
|
17
|
+
export declare function approachHash(toolName: string, input: unknown): string;
|
|
18
|
+
export declare function classifyToolOutcome(toolName: string, input: unknown, result: ToolResultLike): ToolOutcome;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=toolOutcome.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolOutcome.d.ts","sourceRoot":"","sources":["../../src/training/toolOutcome.ts"],"names":[],"mappings":"AAkBA,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,IAAI,GAAG,QAAQ,GAAG,OAAO,CAAC;IAClC,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wEAAwE;IACxE,YAAY,EAAE,MAAM,CAAC;IACrB,gEAAgE;IAChE,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,cAAc;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnE;AA+BD,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAYrE;AAED,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,cAAc,GACrB,WAAW,CAwBb"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* toolOutcome — the SINGLE failure semantics every guard consumes.
|
|
3
|
+
* (docs/UNIFIED_OUTCOME_LADDER.md; TB2 root cause: ShellTool returns a
|
|
4
|
+
* success result for exit!=0 commands, so consecutive-error breaking,
|
|
5
|
+
* decision-store priors, and the family lens all recorded thrash as wins.)
|
|
6
|
+
*
|
|
7
|
+
* status:
|
|
8
|
+
* ok — the tool ran and succeeded (exitCode 0, or no exit semantics
|
|
9
|
+
* and not an error result)
|
|
10
|
+
* failed — the tool RAN but did not succeed (nonzero exitCode in result
|
|
11
|
+
* metadata, or a recognized failure signature in content)
|
|
12
|
+
* error — transport/abort/exception results (wire is_error; untouched
|
|
13
|
+
* semantics — we never rewrite what the model sees)
|
|
14
|
+
*/
|
|
15
|
+
import { createHash } from 'crypto';
|
|
16
|
+
import { classifyErrorFamily } from './errorFamily.js';
|
|
17
|
+
import { stableInputHash } from './DecisionStore.js';
|
|
18
|
+
/** Content signatures that mean "the command ran and failed" even when the
|
|
19
|
+
* result carries no exit metadata (older executors, remote shells). */
|
|
20
|
+
const FAILURE_SIGNATURES = [
|
|
21
|
+
/Command failed with exit code \d+/,
|
|
22
|
+
/Command timed out after/i,
|
|
23
|
+
];
|
|
24
|
+
/** Normalize an input's text the way errorFamily normalizes error snippets:
|
|
25
|
+
* quoted strings, hex ids, paths, and digit runs collapse so "retry with a
|
|
26
|
+
* tweaked flag/version/path" lands on the same approach bucket. */
|
|
27
|
+
function normalizeApproachText(text) {
|
|
28
|
+
return text
|
|
29
|
+
.toLowerCase()
|
|
30
|
+
.replace(/(["'])(?:\\.|(?!\1).)*\1/g, '<q>')
|
|
31
|
+
.replace(/\b0x[0-9a-f]+\b/g, '<hex>')
|
|
32
|
+
.replace(/(?:^|[\s='"([{:,])((?:\/|(?:[a-z]:)?\\)[^\s'")\]},:]*)/g, ' <path>')
|
|
33
|
+
// Version-pin skeletons and option flags are RETRY VARIATION, not a new
|
|
34
|
+
// approach (probe-3 finding: `pkg`, `pkg==2.1`, `pkg --no-cache-dir` must
|
|
35
|
+
// land in one bucket or the ladder never counts past 1).
|
|
36
|
+
.replace(/[=<>!~]=[\w.*]+/g, '')
|
|
37
|
+
.replace(/(?:^|\s)--?[\w-]+(=\S*)?/g, ' ')
|
|
38
|
+
.replace(/\d+/g, '#')
|
|
39
|
+
// A standalone number token is a flag argument or count, not an approach.
|
|
40
|
+
.replace(/(?:^|\s)#+(?=\s|$)/g, ' ')
|
|
41
|
+
.replace(/\s+/g, ' ')
|
|
42
|
+
.trim()
|
|
43
|
+
.slice(0, 160);
|
|
44
|
+
}
|
|
45
|
+
export function approachHash(toolName, input) {
|
|
46
|
+
let text;
|
|
47
|
+
if (input && typeof input === 'object') {
|
|
48
|
+
// Sort keys so property order can't split a bucket; normalize each value.
|
|
49
|
+
const entries = Object.entries(input)
|
|
50
|
+
.sort(([a], [b]) => (a < b ? -1 : 1))
|
|
51
|
+
.map(([k, v]) => `${k}=${normalizeApproachText(typeof v === 'string' ? v : JSON.stringify(v))}`);
|
|
52
|
+
text = entries.join('|');
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
text = normalizeApproachText(String(input));
|
|
56
|
+
}
|
|
57
|
+
return createHash('sha256').update(`${toolName}\n${text}`).digest('hex').slice(0, 16);
|
|
58
|
+
}
|
|
59
|
+
export function classifyToolOutcome(toolName, input, result) {
|
|
60
|
+
const exactHash = stableInputHash(input);
|
|
61
|
+
const aHash = approachHash(toolName, input);
|
|
62
|
+
const content = String(result.content ?? '');
|
|
63
|
+
let status;
|
|
64
|
+
if (result.is_error) {
|
|
65
|
+
status = 'error';
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
const exit = result.metadata?.exitCode;
|
|
69
|
+
if (typeof exit === 'number' && exit !== 0)
|
|
70
|
+
status = 'failed';
|
|
71
|
+
else if (typeof exit === 'number')
|
|
72
|
+
status = 'ok';
|
|
73
|
+
else if (FAILURE_SIGNATURES.some((re) => re.test(content)))
|
|
74
|
+
status = 'failed';
|
|
75
|
+
else
|
|
76
|
+
status = 'ok';
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
status,
|
|
80
|
+
...(status !== 'ok'
|
|
81
|
+
? { family: classifyErrorFamily(stripLeadingReminders(content).slice(0, 200)) || 'unclassified' }
|
|
82
|
+
: {}),
|
|
83
|
+
approachHash: aHash,
|
|
84
|
+
exactHash,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
/** Loop-level classification sees results ALREADY augmented with prepended
|
|
88
|
+
* <system-reminder> blocks (processToolTraining runs first) — strip them so
|
|
89
|
+
* the family fingerprint reflects the tool's own output, not our reminder. */
|
|
90
|
+
function stripLeadingReminders(content) {
|
|
91
|
+
let out = content;
|
|
92
|
+
// eslint-disable-next-line no-constant-condition
|
|
93
|
+
while (true) {
|
|
94
|
+
const next = out.replace(/^\s*<system-reminder>[\s\S]*?<\/system-reminder>\s*/, '');
|
|
95
|
+
if (next === out)
|
|
96
|
+
return out;
|
|
97
|
+
out = next;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=toolOutcome.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolOutcome.js","sourceRoot":"","sources":["../../src/training/toolOutcome.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAkBrD;wEACwE;AACxE,MAAM,kBAAkB,GAAG;IACzB,mCAAmC;IACnC,0BAA0B;CAC3B,CAAC;AAEF;;oEAEoE;AACpE,SAAS,qBAAqB,CAAC,IAAY;IACzC,OAAO,IAAI;SACR,WAAW,EAAE;SACb,OAAO,CAAC,2BAA2B,EAAE,KAAK,CAAC;SAC3C,OAAO,CAAC,kBAAkB,EAAE,OAAO,CAAC;SACpC,OAAO,CAAC,yDAAyD,EAAE,SAAS,CAAC;QAC9E,wEAAwE;QACxE,0EAA0E;QAC1E,yDAAyD;SACxD,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;SAC/B,OAAO,CAAC,2BAA2B,EAAE,GAAG,CAAC;SACzC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;QACrB,0EAA0E;SACzE,OAAO,CAAC,qBAAqB,EAAE,GAAG,CAAC;SACnC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;SACpB,IAAI,EAAE;SACN,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,QAAgB,EAAE,KAAc;IAC3D,IAAI,IAAY,CAAC;IACjB,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;Q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AAI,GAAG,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC;QACvC,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,CAAC;YAAE,MAAM,GAAG,QAAQ,CAAC;aACzD,IAAI,OAAO,IAAI,KAAK,QAAQ;YAAE,MAAM,GAAG,IAAI,CAAC;aAC5C,IAAI,kBAAkB,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAAE,MAAM,GAAG,QAAQ,CAAC;;YACzE,MAAM,GAAG,IAAI,CAAC;IACrB,CAAC;IAED,OAAO;QACL,MAAM;QACN,GAAG,CAAC,MAAM,KAAK,IAAI;YACjB,CAAC,CAAC,EAAE,MAAM,EAAE,mBAAmB,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,cAAc,EAAE;YACjG,CAAC,CAAC,EAAE,CAAC;QACP,YAAY,EAAE,KAAK;QACnB,SAAS;KACV,CAAC;AACJ,CAAC;AAED;;+EAE+E;AAC/E,SAAS,qBAAqB,CAAC,OAAe;IAC5C,IAAI,GAAG,GAAG,OAAO,CAAC;IAClB,iDAAiD;IACjD,OAAO,IAAI,EAAE,CAAC;QACZ,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,qDAAqD,EAAE,EAAE,CAAC,CAAC;QACpF,IAAI,IAAI,KAAK,GAAG;YAAE,OAAO,GAAG,CAAC;QAC7B,GAAG,GAAG,IAAI,CAAC;IACb,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nexus-cortex/core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.70.0",
|
|
4
4
|
"description": "Core orchestration library implementing Claude CLI architecture patterns",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"@google/generative-ai": "^0.2.1",
|
|
48
48
|
"@gradio/client": "^2.3.1",
|
|
49
49
|
"@modelcontextprotocol/sdk": "^1.20.2",
|
|
50
|
-
"@nexus-cortex/executors": "4.
|
|
51
|
-
"@nexus-cortex/types": "4.
|
|
50
|
+
"@nexus-cortex/executors": "4.70.0",
|
|
51
|
+
"@nexus-cortex/types": "4.70.0",
|
|
52
52
|
"@types/uuid": "^10.0.0",
|
|
53
53
|
"ajv": "^8.12.0",
|
|
54
54
|
"chokidar": "^3.6.0",
|