agent-nuvira 3.1.3 → 3.2.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/agents/agents/reasoner.d.ts +8 -0
- package/dist/agents/agents/reasoner.d.ts.map +1 -1
- package/dist/agents/agents/reasoner.js +53 -2
- package/dist/agents/agents/reasoner.js.map +1 -1
- package/dist/agents/agents/writer.d.ts +24 -0
- package/dist/agents/agents/writer.d.ts.map +1 -1
- package/dist/agents/agents/writer.js +194 -0
- package/dist/agents/agents/writer.js.map +1 -1
- package/dist/agents/composite-plan.d.ts +143 -0
- package/dist/agents/composite-plan.d.ts.map +1 -0
- package/dist/agents/composite-plan.js +399 -0
- package/dist/agents/composite-plan.js.map +1 -0
- package/dist/agents/long-form-plan.d.ts +156 -0
- package/dist/agents/long-form-plan.d.ts.map +1 -0
- package/dist/agents/long-form-plan.js +274 -0
- package/dist/agents/long-form-plan.js.map +1 -0
- package/dist/agents/orchestrator.d.ts +107 -0
- package/dist/agents/orchestrator.d.ts.map +1 -1
- package/dist/agents/orchestrator.js +501 -35
- package/dist/agents/orchestrator.js.map +1 -1
- package/dist/agents/prompt-assembly.d.ts +8 -0
- package/dist/agents/prompt-assembly.d.ts.map +1 -1
- package/dist/agents/prompt-assembly.js +17 -0
- package/dist/agents/prompt-assembly.js.map +1 -1
- package/dist/cli/chat.d.ts +27 -0
- package/dist/cli/chat.d.ts.map +1 -1
- package/dist/cli/chat.js +116 -6
- package/dist/cli/chat.js.map +1 -1
- package/dist/cli/execute.d.ts +12 -0
- package/dist/cli/execute.d.ts.map +1 -1
- package/dist/cli/execute.js +105 -2
- package/dist/cli/execute.js.map +1 -1
- package/dist/cli/models.d.ts.map +1 -1
- package/dist/cli/models.js +10 -0
- package/dist/cli/models.js.map +1 -1
- package/dist/cli/trace.d.ts.map +1 -1
- package/dist/cli/trace.js +27 -0
- package/dist/cli/trace.js.map +1 -1
- package/dist/gateway/registry.d.ts +31 -0
- package/dist/gateway/registry.d.ts.map +1 -1
- package/dist/gateway/registry.js +143 -13
- package/dist/gateway/registry.js.map +1 -1
- package/dist/inference/model-entitlement.d.ts +46 -0
- package/dist/inference/model-entitlement.d.ts.map +1 -0
- package/dist/inference/model-entitlement.js +98 -0
- package/dist/inference/model-entitlement.js.map +1 -0
- package/dist/learning/autonomy-policy.d.ts +334 -0
- package/dist/learning/autonomy-policy.d.ts.map +1 -0
- package/dist/learning/autonomy-policy.js +500 -0
- package/dist/learning/autonomy-policy.js.map +1 -0
- package/dist/learning/credential-fingerprint.d.ts +58 -0
- package/dist/learning/credential-fingerprint.d.ts.map +1 -0
- package/dist/learning/credential-fingerprint.js +126 -0
- package/dist/learning/credential-fingerprint.js.map +1 -0
- package/dist/learning/deliverable-class.d.ts +130 -0
- package/dist/learning/deliverable-class.d.ts.map +1 -0
- package/dist/learning/deliverable-class.js +432 -0
- package/dist/learning/deliverable-class.js.map +1 -0
- package/dist/learning/long-form.d.ts +252 -0
- package/dist/learning/long-form.d.ts.map +1 -0
- package/dist/learning/long-form.js +510 -0
- package/dist/learning/long-form.js.map +1 -0
- package/dist/learning/model-first-router.d.ts +17 -0
- package/dist/learning/model-first-router.d.ts.map +1 -1
- package/dist/learning/model-first-router.js +27 -0
- package/dist/learning/model-first-router.js.map +1 -1
- package/dist/learning/model-registry.d.ts +66 -4
- package/dist/learning/model-registry.d.ts.map +1 -1
- package/dist/learning/model-registry.js +67 -6
- package/dist/learning/model-registry.js.map +1 -1
- package/dist/learning/model-warmup.d.ts +97 -2
- package/dist/learning/model-warmup.d.ts.map +1 -1
- package/dist/learning/model-warmup.js +165 -60
- package/dist/learning/model-warmup.js.map +1 -1
- package/dist/learning/prompt-layers.d.ts +61 -0
- package/dist/learning/prompt-layers.d.ts.map +1 -0
- package/dist/learning/prompt-layers.js +140 -0
- package/dist/learning/prompt-layers.js.map +1 -0
- package/dist/learning/provider-limits.d.ts +66 -0
- package/dist/learning/provider-limits.d.ts.map +1 -0
- package/dist/learning/provider-limits.js +184 -0
- package/dist/learning/provider-limits.js.map +1 -0
- package/dist/learning/reasoning-trace.d.ts +36 -1
- package/dist/learning/reasoning-trace.d.ts.map +1 -1
- package/dist/learning/reasoning-trace.js +36 -2
- package/dist/learning/reasoning-trace.js.map +1 -1
- package/dist/learning/resilient-call.d.ts +36 -1
- package/dist/learning/resilient-call.d.ts.map +1 -1
- package/dist/learning/resilient-call.js +80 -5
- package/dist/learning/resilient-call.js.map +1 -1
- package/dist/learning/unattended-job.d.ts +293 -0
- package/dist/learning/unattended-job.d.ts.map +1 -0
- package/dist/learning/unattended-job.js +544 -0
- package/dist/learning/unattended-job.js.map +1 -0
- package/dist/learning/unattended-progress.d.ts +95 -0
- package/dist/learning/unattended-progress.d.ts.map +1 -0
- package/dist/learning/unattended-progress.js +147 -0
- package/dist/learning/unattended-progress.js.map +1 -0
- package/dist/learning/working-state.d.ts +109 -0
- package/dist/learning/working-state.d.ts.map +1 -0
- package/dist/learning/working-state.js +244 -0
- package/dist/learning/working-state.js.map +1 -0
- package/dist/nlu/conversation-gate.d.ts +24 -0
- package/dist/nlu/conversation-gate.d.ts.map +1 -1
- package/dist/nlu/conversation-gate.js +47 -3
- package/dist/nlu/conversation-gate.js.map +1 -1
- package/dist/tools/coding-tools.d.ts.map +1 -1
- package/dist/tools/coding-tools.js +95 -19
- package/dist/tools/coding-tools.js.map +1 -1
- package/dist/tools/edit-verification.d.ts +125 -0
- package/dist/tools/edit-verification.d.ts.map +1 -0
- package/dist/tools/edit-verification.js +237 -0
- package/dist/tools/edit-verification.js.map +1 -0
- package/dist/tools/git-tool.d.ts.map +1 -1
- package/dist/tools/git-tool.js +37 -4
- package/dist/tools/git-tool.js.map +1 -1
- package/dist/tools/registry.d.ts +30 -2
- package/dist/tools/registry.d.ts.map +1 -1
- package/dist/tools/registry.js +40 -11
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/run-cli.d.ts.map +1 -1
- package/dist/tools/run-cli.js +40 -13
- package/dist/tools/run-cli.js.map +1 -1
- package/dist/tools/run-terminal.d.ts +6 -1
- package/dist/tools/run-terminal.d.ts.map +1 -1
- package/dist/tools/run-terminal.js +158 -18
- package/dist/tools/run-terminal.js.map +1 -1
- package/dist/tools/tool-loop.d.ts +35 -0
- package/dist/tools/tool-loop.d.ts.map +1 -1
- package/dist/tools/tool-loop.js +141 -1
- package/dist/tools/tool-loop.js.map +1 -1
- package/dist/web-dashboard/chat-console.d.ts +6 -0
- package/dist/web-dashboard/chat-console.d.ts.map +1 -1
- package/dist/web-dashboard/chat-console.js.map +1 -1
- package/dist/web-dashboard/chat-retry.d.ts.map +1 -1
- package/dist/web-dashboard/chat-retry.js +10 -2
- package/dist/web-dashboard/chat-retry.js.map +1 -1
- package/dist/web-dashboard/server.d.ts.map +1 -1
- package/dist/web-dashboard/server.js +80 -8
- package/dist/web-dashboard/server.js.map +1 -1
- package/dist/web-dashboard/src/types.d.ts +81 -4
- package/dist/web-dashboard/src/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/web-dashboard/public/assets/{index-Co7Hk2FT.js → index-kCUkORm7.js} +2 -2
- package/src/web-dashboard/public/assets/{index-Co7Hk2FT.js.map → index-kCUkORm7.js.map} +1 -1
- package/src/web-dashboard/public/index.html +1 -1
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prompt layers — deterministic splitting of a composed prompt into the
|
|
3
|
+
* layers that matter for review (enterprise hardening, session 3).
|
|
4
|
+
*
|
|
5
|
+
* WHY THIS EXISTS (the prompt audit of the last 30 traces):
|
|
6
|
+
* The trace stored ONE flat `promptPreview` capped at 300–500 chars, and for
|
|
7
|
+
* chat turns the preview deliberately shortened the system prompt to its first
|
|
8
|
+
* 80 characters. Result: in 106/106 chat steps the single most important
|
|
9
|
+
* artifact — the system prompt (persona, tool contract, response rules) — was
|
|
10
|
+
* INVISIBLE, and `promptDigest` hashed the whole thread so it could not show
|
|
11
|
+
* whether the stable layer was byte-stable (i.e. cacheable). Prompt
|
|
12
|
+
* engineering was, in practice, unreviewable.
|
|
13
|
+
*
|
|
14
|
+
* This module answers three questions from a flat prompt string, with no LLM
|
|
15
|
+
* and no caller changes:
|
|
16
|
+
* 1. Which bytes are the STABLE layer (identity / contract)?
|
|
17
|
+
* 2. Which are CONTEXT (project knowledge, recalled state, history, tools)?
|
|
18
|
+
* 3. Which are VOLATILE (the current task / ask)?
|
|
19
|
+
*
|
|
20
|
+
* Two transports are recognised because the codebase composes prompts two ways:
|
|
21
|
+
* - the chat thread serialisation: `[System]` / `[User]` / `[Assistant]` /
|
|
22
|
+
* `[Tool result]` markers (see `chat.ts` callModelWithTrace);
|
|
23
|
+
* - the layered assembler: `# Project Context` … `## Task` headings
|
|
24
|
+
* (see `agents/prompt-assembly.ts` assemblePrompt).
|
|
25
|
+
* Anything else falls back to a single `system` layer so a digest still detects
|
|
26
|
+
* change even when the shape is unknown.
|
|
27
|
+
*/
|
|
28
|
+
import { createHash } from 'node:crypto';
|
|
29
|
+
function sha256Prefix(input, length = 16) {
|
|
30
|
+
try {
|
|
31
|
+
return createHash('sha256').update(input).digest('hex').slice(0, length);
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return String(input.length);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/** The chat transport's role markers, at the START of a line. */
|
|
38
|
+
const CHAT_MARKER_RE = /^(?:\[System\]|\[User\]|\[Assistant\]|\[Tool result\])\s*$/;
|
|
39
|
+
/** The assembler transport's headings. */
|
|
40
|
+
const ASSEMBLED_CONTEXT_RE = /^#\s*Project Context\s*$/m;
|
|
41
|
+
const ASSEMBLED_VOLATILE_RE = /^##\s*Task\s*$/m;
|
|
42
|
+
/**
|
|
43
|
+
* Split a chat-thread serialisation. The LAST `[User]` block is the current
|
|
44
|
+
* ask (volatile); every earlier block — injected context, prior turns, tool
|
|
45
|
+
* results — is context; the leading `[System]` block is the stable layer.
|
|
46
|
+
*/
|
|
47
|
+
function splitChatThread(text) {
|
|
48
|
+
const lines = text.split('\n');
|
|
49
|
+
// Index of each marker line.
|
|
50
|
+
const marks = [];
|
|
51
|
+
lines.forEach((l, i) => {
|
|
52
|
+
if (CHAT_MARKER_RE.test(l.trim()))
|
|
53
|
+
marks.push({ i, kind: l.trim() });
|
|
54
|
+
});
|
|
55
|
+
if (marks.length === 0)
|
|
56
|
+
return { system: text, context: '', volatile: '' };
|
|
57
|
+
const lastUser = [...marks].reverse().find((m) => m.kind === '[User]');
|
|
58
|
+
const sys = marks.find((m) => m.kind === '[System]');
|
|
59
|
+
// Slice boundaries: a block runs from a marker to the next marker.
|
|
60
|
+
const blockEnd = (idx) => {
|
|
61
|
+
const next = marks.find((m) => m.i > marks[idx].i);
|
|
62
|
+
return next ? next.i : lines.length;
|
|
63
|
+
};
|
|
64
|
+
const blockAt = (mark) => {
|
|
65
|
+
const pos = marks.findIndex((m) => m.i === mark.i);
|
|
66
|
+
return lines.slice(mark.i, blockEnd(pos)).join('\n');
|
|
67
|
+
};
|
|
68
|
+
const system = sys ? blockAt(sys) : '';
|
|
69
|
+
const volatile = lastUser ? blockAt(lastUser) : '';
|
|
70
|
+
const context = lines
|
|
71
|
+
.filter((_, i) => {
|
|
72
|
+
// Everything except the system block and the LAST user block.
|
|
73
|
+
if (sys && i >= sys.i && i < blockEnd(marks.findIndex((m) => m.i === sys.i)))
|
|
74
|
+
return false;
|
|
75
|
+
if (lastUser && i >= lastUser.i && i < blockEnd(marks.findIndex((m) => m.i === lastUser.i)))
|
|
76
|
+
return false;
|
|
77
|
+
return true;
|
|
78
|
+
})
|
|
79
|
+
.join('\n');
|
|
80
|
+
return { system, context: context.trim(), volatile };
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Split an `assemblePrompt` result: everything before `# Project Context` is
|
|
84
|
+
* the stable layer, the Project Context block is context, and `## Task`
|
|
85
|
+
* onward is volatile.
|
|
86
|
+
*/
|
|
87
|
+
function splitAssembledPrompt(text) {
|
|
88
|
+
const ctxMatch = ASSEMBLED_CONTEXT_RE.exec(text);
|
|
89
|
+
const volMatch = ASSEMBLED_VOLATILE_RE.exec(text);
|
|
90
|
+
const ctxAt = ctxMatch?.index ?? -1;
|
|
91
|
+
const volAt = volMatch?.index ?? -1;
|
|
92
|
+
if (ctxAt === -1 && volAt === -1) {
|
|
93
|
+
// Unknown shape — keep it as one stable layer so change is still detected.
|
|
94
|
+
return { system: text, context: '', volatile: '' };
|
|
95
|
+
}
|
|
96
|
+
const systemEnd = ctxAt !== -1 ? ctxAt : volAt;
|
|
97
|
+
const system = text.slice(0, systemEnd).trim();
|
|
98
|
+
const context = ctxAt === -1 ? '' : text.slice(ctxAt, volAt === -1 ? text.length : volAt).trim();
|
|
99
|
+
const volatile = volAt === -1 ? '' : text.slice(volAt).trim();
|
|
100
|
+
return { system, context, volatile };
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Split a composed prompt into its stable / context / volatile layers.
|
|
104
|
+
* Deterministic and transport-aware; never throws.
|
|
105
|
+
*/
|
|
106
|
+
export function splitPromptLayers(text) {
|
|
107
|
+
const t = text || '';
|
|
108
|
+
if (!t.trim())
|
|
109
|
+
return { system: '', context: '', volatile: '' };
|
|
110
|
+
try {
|
|
111
|
+
if (CHAT_MARKER_RE.test(t.split('\n')[0].trim()) || /\n\[User\]\s*$|\n\[User\]\n/.test(t)) {
|
|
112
|
+
return splitChatThread(t);
|
|
113
|
+
}
|
|
114
|
+
return splitAssembledPrompt(t);
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
return { system: t, context: '', volatile: '' };
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Per-layer digests + sizes. The three digests SEPARATELY answer the review
|
|
122
|
+
* question the flat digest could not: did the stable layer change between
|
|
123
|
+
* steps (a cache-busting regression), or only the volatile one (expected)?
|
|
124
|
+
*/
|
|
125
|
+
export function digestPromptLayers(layers) {
|
|
126
|
+
return {
|
|
127
|
+
systemDigest: sha256Prefix(layers.system),
|
|
128
|
+
contextDigest: sha256Prefix(layers.context),
|
|
129
|
+
volatileDigest: sha256Prefix(layers.volatile),
|
|
130
|
+
systemChars: layers.system.length,
|
|
131
|
+
contextChars: layers.context.length,
|
|
132
|
+
volatileChars: layers.volatile.length,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
/** Convenience: split + digest in one call. */
|
|
136
|
+
export function digestPrompt(text) {
|
|
137
|
+
const layers = splitPromptLayers(text);
|
|
138
|
+
return { layers, digests: digestPromptLayers(layers) };
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=prompt-layers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-layers.js","sourceRoot":"","sources":["../../src/learning/prompt-layers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAqBzC,SAAS,YAAY,CAAC,KAAa,EAAE,MAAM,GAAG,EAAE;IAC9C,IAAI,CAAC;QACH,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IAC3E,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;AACH,CAAC;AAED,iEAAiE;AACjE,MAAM,cAAc,GAAG,4DAA4D,CAAC;AAEpF,0CAA0C;AAC1C,MAAM,oBAAoB,GAAG,2BAA2B,CAAC;AACzD,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEhD;;;;GAIG;AACH,SAAS,eAAe,CAAC,IAAY;IACnC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC/B,6BAA6B;IAC7B,MAAM,KAAK,GAAuC,EAAE,CAAC;IACrD,KAAK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;QACH,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,6BAA6B,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;YAC1F,OAAO,eAAe,CAAC,CAAC,CAAC,CAAC;QAC5B,CAAC;QACD,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC;IACjC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;IAClD,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAoB;IACrD,OAAO;QACL,YAAY,EAAE,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC;QACzC,aAAa,EAAE,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC;QAC3C,cAAc,EAAE,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC;QAC7C,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM;QACjC,YAAY,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM;QACnC,aAAa,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM;KACtC,CAAC;AACJ,CAAC;AAED,+CAA+C;AAC/C,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,MAAM,MAAM,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACvC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider output-cap learning (enterprise-grade hardening, G15).
|
|
3
|
+
*
|
|
4
|
+
* WHY THIS EXISTS. A live unattended story run (12 pages, no human input)
|
|
5
|
+
* failed EVERY prose unit with the same provider rejection:
|
|
6
|
+
*
|
|
7
|
+
* Groq API error (400): {"error":{"message":"`max_tokens` must be less than
|
|
8
|
+
* or equal to `512`, the maximum value for `max_tokens` is less than the
|
|
9
|
+
* `context_window` for this model","param":"max_tokens"}}
|
|
10
|
+
*
|
|
11
|
+
* The cause was OUR constant, not the model pool: the prose path asks for
|
|
12
|
+
* `maxTokens: 8192` (~900 words with headroom) because a chapter needs it, and
|
|
13
|
+
* the routed model happened to permit only 512. So:
|
|
14
|
+
*
|
|
15
|
+
* - the agent looked broken ("Repair budget exhausted") when it was misconfigured;
|
|
16
|
+
* - `resolveMaxOutputTokens()` could not have prevented it — that heuristic
|
|
17
|
+
* reads the CONTEXT WINDOW, and this model advertises a large window with a
|
|
18
|
+
* tiny output cap, which is exactly the case the window heuristic cannot see;
|
|
19
|
+
* - the failure repeated 6 batches in a row, because nothing learned from it.
|
|
20
|
+
*
|
|
21
|
+
* Two disciplines come out of that, and this module is both:
|
|
22
|
+
*
|
|
23
|
+
* 1. `parseMaxTokensLimit()` — a provider that TELLS us its limit has told us
|
|
24
|
+
* the truth. Read it from the error instead of discarding it, so the retry
|
|
25
|
+
* is targeted at a number the provider itself named.
|
|
26
|
+
*
|
|
27
|
+
* 2. `rememberMaxTokensLimit()` / `clampMaxTokens()` — the learned limit is
|
|
28
|
+
* remembered per provider × model and applied PREDICTIVELY to later calls,
|
|
29
|
+
* so one rejection costs one wasted call per process instead of one per
|
|
30
|
+
* unit. Only ever clamps DOWN: a provider that accepts our request is
|
|
31
|
+
* never overruled by a stale or mis-parsed limit.
|
|
32
|
+
*
|
|
33
|
+
* Deliberately pure + process-local (no config writes): a provider contract is
|
|
34
|
+
* a runtime fact, and persisting a mis-parse would poison future sessions.
|
|
35
|
+
*/
|
|
36
|
+
/**
|
|
37
|
+
* The smallest number any recognised phrasing names, or `null` when the error
|
|
38
|
+
* is not an output-cap rejection. Returning the SMALLEST is the safe read when
|
|
39
|
+
* a message contains several numbers: a retry that is too small still
|
|
40
|
+
* succeeds (shorter output), a retry that is too large fails again and wastes
|
|
41
|
+
* another call — and the whole point of this path is to stop wasting calls.
|
|
42
|
+
*/
|
|
43
|
+
export declare function parseMaxTokensLimit(error: unknown): number | null;
|
|
44
|
+
/**
|
|
45
|
+
* Record a provider-named output cap. Ignored when the key is incomplete
|
|
46
|
+
* (a bare provider or model is too coarse to clamp against) or the value is
|
|
47
|
+
* not a positive integer. Also clamps against any already-learned value so a
|
|
48
|
+
* later, larger claim cannot raise the cap back up.
|
|
49
|
+
*/
|
|
50
|
+
export declare function rememberMaxTokensLimit(provider: string | undefined, model: string | undefined, limit: number): void;
|
|
51
|
+
/** The learned cap for provider × model, or `undefined` when none is known. */
|
|
52
|
+
export declare function knownMaxTokensLimit(provider: string | undefined, model: string | undefined): number | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Apply the learned cap to a requested value. Only ever lowers: an unlearned
|
|
55
|
+
* pair and an already-small request both pass through unchanged, so a caller
|
|
56
|
+
* that deliberately asks for less keeps its value.
|
|
57
|
+
*/
|
|
58
|
+
export declare function clampMaxTokens(requested: number | undefined, provider: string | undefined, model: string | undefined): number | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Read a cap out of an error and remember it. Returns the parsed limit (so the
|
|
61
|
+
* caller can retry with it) or `null` when the error was not a cap rejection.
|
|
62
|
+
*/
|
|
63
|
+
export declare function learnMaxTokensLimitFromError(error: unknown, provider: string | undefined, model: string | undefined): number | null;
|
|
64
|
+
/** Test hook — clears the process-local table. */
|
|
65
|
+
export declare function resetLearnedMaxTokensLimits(): void;
|
|
66
|
+
//# sourceMappingURL=provider-limits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider-limits.d.ts","sourceRoot":"","sources":["../../src/learning/provider-limits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAsCH;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAajE;AA2CD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,KAAK,EAAE,MAAM,GACZ,IAAI,CAON;AAED,+EAA+E;AAC/E,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,MAAM,GAAG,SAAS,CAIpB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,MAAM,GAAG,SAAS,CAKpB;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,MAAM,GAAG,IAAI,CAKf;AAED,kDAAkD;AAClD,wBAAgB,2BAA2B,IAAI,IAAI,CAElD"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider output-cap learning (enterprise-grade hardening, G15).
|
|
3
|
+
*
|
|
4
|
+
* WHY THIS EXISTS. A live unattended story run (12 pages, no human input)
|
|
5
|
+
* failed EVERY prose unit with the same provider rejection:
|
|
6
|
+
*
|
|
7
|
+
* Groq API error (400): {"error":{"message":"`max_tokens` must be less than
|
|
8
|
+
* or equal to `512`, the maximum value for `max_tokens` is less than the
|
|
9
|
+
* `context_window` for this model","param":"max_tokens"}}
|
|
10
|
+
*
|
|
11
|
+
* The cause was OUR constant, not the model pool: the prose path asks for
|
|
12
|
+
* `maxTokens: 8192` (~900 words with headroom) because a chapter needs it, and
|
|
13
|
+
* the routed model happened to permit only 512. So:
|
|
14
|
+
*
|
|
15
|
+
* - the agent looked broken ("Repair budget exhausted") when it was misconfigured;
|
|
16
|
+
* - `resolveMaxOutputTokens()` could not have prevented it — that heuristic
|
|
17
|
+
* reads the CONTEXT WINDOW, and this model advertises a large window with a
|
|
18
|
+
* tiny output cap, which is exactly the case the window heuristic cannot see;
|
|
19
|
+
* - the failure repeated 6 batches in a row, because nothing learned from it.
|
|
20
|
+
*
|
|
21
|
+
* Two disciplines come out of that, and this module is both:
|
|
22
|
+
*
|
|
23
|
+
* 1. `parseMaxTokensLimit()` — a provider that TELLS us its limit has told us
|
|
24
|
+
* the truth. Read it from the error instead of discarding it, so the retry
|
|
25
|
+
* is targeted at a number the provider itself named.
|
|
26
|
+
*
|
|
27
|
+
* 2. `rememberMaxTokensLimit()` / `clampMaxTokens()` — the learned limit is
|
|
28
|
+
* remembered per provider × model and applied PREDICTIVELY to later calls,
|
|
29
|
+
* so one rejection costs one wasted call per process instead of one per
|
|
30
|
+
* unit. Only ever clamps DOWN: a provider that accepts our request is
|
|
31
|
+
* never overruled by a stale or mis-parsed limit.
|
|
32
|
+
*
|
|
33
|
+
* Deliberately pure + process-local (no config writes): a provider contract is
|
|
34
|
+
* a runtime fact, and persisting a mis-parse would poison future sessions.
|
|
35
|
+
*/
|
|
36
|
+
/**
|
|
37
|
+
* camelCase → snake_case, lowercased, so one set of patterns covers
|
|
38
|
+
* `max_tokens`, `maxCompletionTokens` and `maxOutputTokens` alike. Without
|
|
39
|
+
* this, `maxOutputTokens must be <= 2048` (Gemini) reads as an unrelated
|
|
40
|
+
* error and the agent would keep failing the same way.
|
|
41
|
+
*/
|
|
42
|
+
function normalize(text) {
|
|
43
|
+
return text.replace(/([a-z0-9])([A-Z])/g, '$1_$2').toLowerCase();
|
|
44
|
+
}
|
|
45
|
+
/** Guard: only text that talks about output caps can yield a limit. */
|
|
46
|
+
const MENTIONS_MAX_TOKENS = /max[_\s-]?(?:output[_\s-]|completion[_\s-])?tokens?/;
|
|
47
|
+
/** A max-output field name followed, within a short distance, by a number. */
|
|
48
|
+
const CAP_FIELD = 'max[_\\s-]?(?:output[_\\s-]|completion[_\\s-])?tokens?';
|
|
49
|
+
/**
|
|
50
|
+
* Phrasings observed across OpenAI-compatible providers (Groq, Together,
|
|
51
|
+
* Mistral, OpenRouter...), Anthropic and Gemini. Every pattern captures the
|
|
52
|
+
* named limit in group 1; the caller takes the SMALLEST of all matches.
|
|
53
|
+
*/
|
|
54
|
+
const LIMIT_PATTERNS = [
|
|
55
|
+
// "max_tokens must be <= 512" / "must be less than or equal to 512"
|
|
56
|
+
new RegExp(`${CAP_FIELD}[\\s"'\`]*(?:must be )?(?:less than or equal to|no more than|at most|not exceed|<=?)\\s*["'\`]*(\\d+)`),
|
|
57
|
+
// "max_tokens: 8192 > 4096, which is the maximum allowed number of output tokens"
|
|
58
|
+
new RegExp(`${CAP_FIELD}[\\s"'\`]*[:=]?\\s*(\\d+)[\\s\\S]{0,160}?maximum allowed number of output tokens`),
|
|
59
|
+
// "...which is the maximum allowed number of output tokens for <model>"
|
|
60
|
+
/(\d+)[\s,)\]]*(?:which is |is )?the maximum allowed number of output tokens/i,
|
|
61
|
+
// "maximum value for max_tokens is 512"
|
|
62
|
+
new RegExp(`maximum(?: allowed)?(?: value)?(?: for| of)?[\\s"'\`]*${CAP_FIELD}[^\\d]{0,60}?(\\d+)`),
|
|
63
|
+
];
|
|
64
|
+
/**
|
|
65
|
+
* The smallest number any recognised phrasing names, or `null` when the error
|
|
66
|
+
* is not an output-cap rejection. Returning the SMALLEST is the safe read when
|
|
67
|
+
* a message contains several numbers: a retry that is too small still
|
|
68
|
+
* succeeds (shorter output), a retry that is too large fails again and wastes
|
|
69
|
+
* another call — and the whole point of this path is to stop wasting calls.
|
|
70
|
+
*/
|
|
71
|
+
export function parseMaxTokensLimit(error) {
|
|
72
|
+
const text = normalize(errorText(error));
|
|
73
|
+
if (!text || !MENTIONS_MAX_TOKENS.test(text))
|
|
74
|
+
return null;
|
|
75
|
+
const found = [];
|
|
76
|
+
for (const pattern of LIMIT_PATTERNS) {
|
|
77
|
+
const match = pattern.exec(text);
|
|
78
|
+
if (!match)
|
|
79
|
+
continue;
|
|
80
|
+
const value = Number.parseInt(match[1], 10);
|
|
81
|
+
if (Number.isFinite(value) && value > 0)
|
|
82
|
+
found.push(value);
|
|
83
|
+
}
|
|
84
|
+
if (found.length === 0)
|
|
85
|
+
return null;
|
|
86
|
+
return Math.min(...found);
|
|
87
|
+
}
|
|
88
|
+
/** Error → searchable text, digging into `cause` and attached bodies. */
|
|
89
|
+
function errorText(error) {
|
|
90
|
+
if (error == null)
|
|
91
|
+
return '';
|
|
92
|
+
if (typeof error === 'string')
|
|
93
|
+
return error;
|
|
94
|
+
if (typeof error === 'object') {
|
|
95
|
+
const withMessage = error;
|
|
96
|
+
const parts = [];
|
|
97
|
+
if (typeof withMessage.message === 'string')
|
|
98
|
+
parts.push(withMessage.message);
|
|
99
|
+
// Provider bodies are frequently nested under `cause`/`response.data`.
|
|
100
|
+
const cause = withMessage.cause;
|
|
101
|
+
if (cause && cause !== error)
|
|
102
|
+
parts.push(errorText(cause));
|
|
103
|
+
const response = withMessage.response;
|
|
104
|
+
if (response?.data !== undefined) {
|
|
105
|
+
try {
|
|
106
|
+
parts.push(typeof response.data === 'string' ? response.data : JSON.stringify(response.data));
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
/* best-effort */
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (parts.length > 0)
|
|
113
|
+
return parts.join('\n');
|
|
114
|
+
try {
|
|
115
|
+
return JSON.stringify(error);
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
return '';
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return String(error);
|
|
122
|
+
}
|
|
123
|
+
// ── Learned limits ──────────────────────────────────────────────────────────
|
|
124
|
+
/** provider × model → the cap the provider itself named. Process-local. */
|
|
125
|
+
const learnedLimits = new Map();
|
|
126
|
+
function limitKey(provider, model) {
|
|
127
|
+
const p = (provider || '').trim().toLowerCase();
|
|
128
|
+
const m = (model || '').trim().toLowerCase();
|
|
129
|
+
if (!p || !m)
|
|
130
|
+
return null;
|
|
131
|
+
return `${p}::${m}`;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Record a provider-named output cap. Ignored when the key is incomplete
|
|
135
|
+
* (a bare provider or model is too coarse to clamp against) or the value is
|
|
136
|
+
* not a positive integer. Also clamps against any already-learned value so a
|
|
137
|
+
* later, larger claim cannot raise the cap back up.
|
|
138
|
+
*/
|
|
139
|
+
export function rememberMaxTokensLimit(provider, model, limit) {
|
|
140
|
+
const key = limitKey(provider, model);
|
|
141
|
+
if (!key)
|
|
142
|
+
return;
|
|
143
|
+
if (!Number.isFinite(limit) || limit <= 0)
|
|
144
|
+
return;
|
|
145
|
+
const existing = learnedLimits.get(key);
|
|
146
|
+
const next = existing === undefined ? limit : Math.min(existing, limit);
|
|
147
|
+
learnedLimits.set(key, Math.floor(next));
|
|
148
|
+
}
|
|
149
|
+
/** The learned cap for provider × model, or `undefined` when none is known. */
|
|
150
|
+
export function knownMaxTokensLimit(provider, model) {
|
|
151
|
+
const key = limitKey(provider, model);
|
|
152
|
+
if (!key)
|
|
153
|
+
return undefined;
|
|
154
|
+
return learnedLimits.get(key);
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Apply the learned cap to a requested value. Only ever lowers: an unlearned
|
|
158
|
+
* pair and an already-small request both pass through unchanged, so a caller
|
|
159
|
+
* that deliberately asks for less keeps its value.
|
|
160
|
+
*/
|
|
161
|
+
export function clampMaxTokens(requested, provider, model) {
|
|
162
|
+
const limit = knownMaxTokensLimit(provider, model);
|
|
163
|
+
if (limit === undefined)
|
|
164
|
+
return requested;
|
|
165
|
+
if (requested === undefined)
|
|
166
|
+
return limit;
|
|
167
|
+
return Math.min(requested, limit);
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Read a cap out of an error and remember it. Returns the parsed limit (so the
|
|
171
|
+
* caller can retry with it) or `null` when the error was not a cap rejection.
|
|
172
|
+
*/
|
|
173
|
+
export function learnMaxTokensLimitFromError(error, provider, model) {
|
|
174
|
+
const limit = parseMaxTokensLimit(error);
|
|
175
|
+
if (limit === null)
|
|
176
|
+
return null;
|
|
177
|
+
rememberMaxTokensLimit(provider, model, limit);
|
|
178
|
+
return limit;
|
|
179
|
+
}
|
|
180
|
+
/** Test hook — clears the process-local table. */
|
|
181
|
+
export function resetLearnedMaxTokensLimits() {
|
|
182
|
+
learnedLimits.clear();
|
|
183
|
+
}
|
|
184
|
+
//# sourceMappingURL=provider-limits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider-limits.js","sourceRoot":"","sources":["../../src/learning/provider-limits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH;;;;;GAKG;AACH,SAAS,SAAS,CAAC,IAAY;IAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;AACnE,CAAC;AAED,uEAAuE;AACvE,MAAM,mBAAmB,GAAG,qDAAqD,CAAC;AAElF,8EAA8E;AAC9E,MAAM,SAAS,GAAG,wDAAwD,CAAC;AAE3E;;;;GAIG;AACH,MAAM,cAAc,GAAa;IAC/B,oEAAoE;IACpE,IAAI,MAAM,CACR,GAAG,SAAS,uGAAuG,CACpH;IACD,kFAAkF;IAClF,IAAI,MAAM,CACR,GAAG,SAAS,kFAAkF,CAC/F;IACD,wEAAwE;IACxE,8EAA8E;IAC9E,wCAAwC;IACxC,IAAI,MAAM,CAAC,yDAAyD,SAAS,qBAAqB,CAAC;CACpG,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAChD,MAAM,IAAI,GAAG,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IACzC,IAAI,CAAC,IAAI,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAA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K,EAAE,KAAK,CAAC,CAAC;IAC/C,OAAO,KAAK,CAAC;AACf,CAAC;AAED,kDAAkD;AAClD,MAAM,UAAU,2BAA2B;IACzC,aAAa,CAAC,KAAK,EAAE,CAAC;AACxB,CAAC"}
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
* - Dashboard /api/traces endpoints (TracePanel)
|
|
21
21
|
*/
|
|
22
22
|
import type { LLMCallFn } from '../agents/agent.js';
|
|
23
|
+
import { type PromptLayerDigests } from './prompt-layers.js';
|
|
23
24
|
/** A compact routing snapshot captured at decision time (from AutoRouteResult). */
|
|
24
25
|
export interface TraceRoutingSnapshot {
|
|
25
26
|
provider: string;
|
|
@@ -64,6 +65,14 @@ export interface TraceStep {
|
|
|
64
65
|
error?: string;
|
|
65
66
|
/** Auto-router decision snapshot when the call was auto-routed. */
|
|
66
67
|
routing?: TraceRoutingSnapshot;
|
|
68
|
+
/**
|
|
69
|
+
* PER-LAYER prompt digests (stable / context / volatile) + their sizes.
|
|
70
|
+
* The flat `promptDigest` hashes the whole thread, which grows every step —
|
|
71
|
+
* so it can never show whether the STABLE layer (system prompt) was
|
|
72
|
+
* byte-stable across steps. These three digests answer that, which is what
|
|
73
|
+
* makes prompt-caching regressions reviewable at all.
|
|
74
|
+
*/
|
|
75
|
+
layers?: PromptLayerDigests;
|
|
67
76
|
/** True when this step is a REPAIR re-prompt escalated to a stronger model
|
|
68
77
|
* (v1.60.4 per-task/planner escalation — the routing snapshot then carries
|
|
69
78
|
* the escalated decision at the next complexity level). */
|
|
@@ -100,6 +109,19 @@ export interface TraceOutcome {
|
|
|
100
109
|
* instead of letting it read as work in progress.
|
|
101
110
|
*/
|
|
102
111
|
unfulfilledPromise?: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* True when this turn MUTATED the workspace (`edit_file`/`write_file`) and
|
|
114
|
+
* ran nothing that could observe the result (`run_terminal`/`test`/`browser`
|
|
115
|
+
* /`run_cli`). The edit is real but "it works" is unproven — the Trace tab
|
|
116
|
+
* surfaces this so an unverified change never reads as a verified one.
|
|
117
|
+
*/
|
|
118
|
+
unverifiedEdit?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* True when the answer ASSERTED a completed code change while the turn was
|
|
121
|
+
* unverified (see `detectUnverifiedEditClaim`). This is the edit analogue of
|
|
122
|
+
* `unverifiedClaim` — the honesty flag for a false "I have fixed it".
|
|
123
|
+
*/
|
|
124
|
+
unverifiedEditClaim?: boolean;
|
|
103
125
|
}
|
|
104
126
|
/** A full reasoning trace — one pipeline execution. */
|
|
105
127
|
export interface ReasoningTrace {
|
|
@@ -126,6 +148,15 @@ export interface ReasoningTrace {
|
|
|
126
148
|
outcome?: TraceOutcome;
|
|
127
149
|
/** LLM calls in execution order. */
|
|
128
150
|
steps: TraceStep[];
|
|
151
|
+
/**
|
|
152
|
+
* The FULL stable layer (system prompt), captured ONCE per trace.
|
|
153
|
+
* Previously every trace exposed only the first 80 characters of it, so the
|
|
154
|
+
* persona / tool contract / response rules were unreviewable. Capped to keep
|
|
155
|
+
* the trace file bounded; `systemPromptChars` records the true size.
|
|
156
|
+
*/
|
|
157
|
+
systemPrompt?: string;
|
|
158
|
+
/** True length of the stable layer (before the storage cap). */
|
|
159
|
+
systemPromptChars?: number;
|
|
129
160
|
}
|
|
130
161
|
/** Aggregated stats over all stored traces. */
|
|
131
162
|
export interface TraceStats {
|
|
@@ -172,7 +203,9 @@ export declare function beginTrace(meta: {
|
|
|
172
203
|
* Record one LLM call as a step in the trace. Best-effort: never throws.
|
|
173
204
|
* seq is assigned automatically from the current step count.
|
|
174
205
|
*/
|
|
175
|
-
export declare function recordStep(traceId: string, step: Omit<TraceStep, 'seq' | 'timestamp'>
|
|
206
|
+
export declare function recordStep(traceId: string, step: Omit<TraceStep, 'seq' | 'timestamp'> & {
|
|
207
|
+
promptFull?: string;
|
|
208
|
+
}): void;
|
|
176
209
|
/**
|
|
177
210
|
* Mark a trace finished (sets endedAt, durationMs, success). Idempotent: a
|
|
178
211
|
* second endTrace (e.g. from a finally block after an early close) is a no-op.
|
|
@@ -188,6 +221,8 @@ export declare function buildTraceOutcome(input: {
|
|
|
188
221
|
tools?: readonly string[];
|
|
189
222
|
unverifiedActionClaim?: boolean;
|
|
190
223
|
unfulfilledPromise?: boolean;
|
|
224
|
+
unverifiedEdit?: boolean;
|
|
225
|
+
unverifiedEditClaim?: boolean;
|
|
191
226
|
}): TraceOutcome;
|
|
192
227
|
/** Get one trace by id (null when missing). */
|
|
193
228
|
export declare function getTrace(id: string): ReasoningTrace | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reasoning-trace.d.ts","sourceRoot":"","sources":["../../src/learning/reasoning-trace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAOH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"reasoning-trace.d.ts","sourceRoot":"","sources":["../../src/learning/reasoning-trace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAOH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,EAAyC,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAIpG,mFAAmF;AACnF,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,mCAAmC;AACnC,MAAM,WAAW,SAAS;IACxB,yCAAyC;IACzC,GAAG,EAAE,MAAM,CAAC;IACZ,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,qEAAqE;IACrE,SAAS,EAAE,MAAM,CAAC;IAClB,mFAAmF;IACnF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,WAAW,CAA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,CAAC,KAAK,SAAK,GAAG,cAAc,EAAE,CAGvD;AAED,yDAAyD;AACzD,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAO/C;AAED,+BAA+B;AAC/B,wBAAgB,WAAW,IAAI,IAAI,CAElC;AAED,8CAA8C;AAC9C,wBAAgB,aAAa,IAAI,UAAU,CAyB1C;AAID;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,SAAS,EAClB,GAAG,EAAE,mBAAmB,GACvB,SAAS,CAgDX"}
|
|
@@ -24,6 +24,7 @@ import { envBuff, resolveNuviraHome } from '../config/paths.js';
|
|
|
24
24
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
25
25
|
import { join } from 'node:path';
|
|
26
26
|
import { estimateTokens } from './cost-tracker.js';
|
|
27
|
+
import { splitPromptLayers, digestPromptLayers } from './prompt-layers.js';
|
|
27
28
|
// ─── Storage ────────────────────────────────────────────────────────────────
|
|
28
29
|
const DEFAULT_MEMORY_DIR = join(resolveNuviraHome(), 'memory');
|
|
29
30
|
const CURRENT_VERSION = 1;
|
|
@@ -31,6 +32,8 @@ const CURRENT_VERSION = 1;
|
|
|
31
32
|
export const MAX_TRACES = 60;
|
|
32
33
|
/** Cap steps per trace at 200 (a long pipeline still fits). */
|
|
33
34
|
const MAX_STEPS_PER_TRACE = 200;
|
|
35
|
+
/** Cap the stored stable layer so 60 traces stay bounded (true size is kept). */
|
|
36
|
+
const MAX_SYSTEM_PROMPT_CHARS = 16_000;
|
|
34
37
|
/** Preview lengths (keep trace files small). */
|
|
35
38
|
const PROMPT_PREVIEW_CHARS = 300;
|
|
36
39
|
const RESPONSE_PREVIEW_CHARS = 1000;
|
|
@@ -111,8 +114,22 @@ export function recordStep(traceId, step) {
|
|
|
111
114
|
const trace = data.traces.find((t) => t.id === traceId);
|
|
112
115
|
if (!trace)
|
|
113
116
|
return;
|
|
117
|
+
// Layered review (session 3): when the caller passes the FULL prompt we
|
|
118
|
+
// derive per-layer digests and capture the stable layer ONCE per trace.
|
|
119
|
+
// `promptFull` itself is never stored — only the digests + the system layer.
|
|
120
|
+
const { promptFull, ...rest } = step;
|
|
121
|
+
let layers;
|
|
122
|
+
if (promptFull) {
|
|
123
|
+
const split = splitPromptLayers(promptFull);
|
|
124
|
+
layers = digestPromptLayers(split);
|
|
125
|
+
if (split.system && trace.systemPrompt === undefined) {
|
|
126
|
+
trace.systemPrompt = split.system.slice(0, MAX_SYSTEM_PROMPT_CHARS);
|
|
127
|
+
trace.systemPromptChars = split.system.length;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
114
130
|
trace.steps.push({
|
|
115
|
-
...
|
|
131
|
+
...rest,
|
|
132
|
+
...(layers ? { layers } : {}),
|
|
116
133
|
seq: trace.steps.length + 1,
|
|
117
134
|
timestamp: Date.now(),
|
|
118
135
|
});
|
|
@@ -169,6 +186,8 @@ export function buildTraceOutcome(input) {
|
|
|
169
186
|
...(delivered ? { delivered: true } : {}),
|
|
170
187
|
...(input.unverifiedActionClaim ? { unverifiedClaim: true } : {}),
|
|
171
188
|
...(input.unfulfilledPromise ? { unfulfilledPromise: true } : {}),
|
|
189
|
+
...(input.unverifiedEdit ? { unverifiedEdit: true } : {}),
|
|
190
|
+
...(input.unverifiedEditClaim ? { unverifiedEditClaim: true } : {}),
|
|
172
191
|
};
|
|
173
192
|
}
|
|
174
193
|
/** Get one trace by id (null when missing). */
|
|
@@ -243,7 +262,19 @@ export function withTraceCapture(callLLM, ctx) {
|
|
|
243
262
|
let output = '';
|
|
244
263
|
try {
|
|
245
264
|
output = await callLLM(prompt, inferenceOptions);
|
|
246
|
-
success
|
|
265
|
+
// G10 — an EMPTY response is not a success. Live evidence: the story
|
|
266
|
+
// session's writer step was recorded as `success: true` with
|
|
267
|
+
// `responseLength: 0` / `outputTokens: 0` from `local/gpt-oss:120b-cloud`.
|
|
268
|
+
// A green step for a call that returned nothing made the trace actively
|
|
269
|
+
// misleading — it hid the failure behind a passing checkmark, which is
|
|
270
|
+
// the same "ran ≠ worked" conflation the edit-verification gate exists
|
|
271
|
+
// to kill. Every call site wrapped here is a plain text generation (the
|
|
272
|
+
// orchestrator's planner/reasoner/per-task LLMs), so an empty string can
|
|
273
|
+
// only mean the provider returned no content.
|
|
274
|
+
const empty = output.trim().length === 0;
|
|
275
|
+
success = !empty;
|
|
276
|
+
if (empty)
|
|
277
|
+
errorMsg = 'empty response — the provider returned no content (0 chars)';
|
|
247
278
|
}
|
|
248
279
|
catch (err) {
|
|
249
280
|
errorMsg = err instanceof Error ? err.message : String(err);
|
|
@@ -254,6 +285,9 @@ export function withTraceCapture(callLLM, ctx) {
|
|
|
254
285
|
agentType: ctx.agentType,
|
|
255
286
|
taskId: ctx.taskId,
|
|
256
287
|
description: ctx.description,
|
|
288
|
+
// Session 3 — the FULL prompt feeds the layered digests + the one-time
|
|
289
|
+
// stable-layer capture (never stored raw).
|
|
290
|
+
promptFull: prompt,
|
|
257
291
|
provider: ctx.routing?.provider || ctx.provider || 'unknown',
|
|
258
292
|
model: inferenceOptions?.model || ctx.model || ctx.routing?.model || 'unknown',
|
|
259
293
|
promptDigest: sha256Prefix(prompt),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reasoning-trace.js","sourceRoot":"","sources":["../../src/learning/reasoning-trace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAC,OAAO,EAAE,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAIjC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"reasoning-trace.js","sourceRoot":"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