@resolveio/server-lib 22.3.153 → 22.3.155
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/package.json +1 -1
- package/util/ai-runner-manager-policy.js +1 -1
- package/util/ai-runner-manager-policy.js.map +1 -1
- package/util/aicoder-runner-v6.d.ts +23 -0
- package/util/aicoder-runner-v6.js +608 -4
- package/util/aicoder-runner-v6.js.map +1 -1
- package/util/support-runner-v5.d.ts +13 -0
- package/util/support-runner-v5.js +75 -1
- package/util/support-runner-v5.js.map +1 -1
|
@@ -47,6 +47,10 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
47
47
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
48
48
|
};
|
|
49
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
+
exports.extractResolveIOAICoderJourneyContractFromMarkdown = extractResolveIOAICoderJourneyContractFromMarkdown;
|
|
51
|
+
exports.buildResolveIOAICoderWorkflowQaRowsFromJourneyContract = buildResolveIOAICoderWorkflowQaRowsFromJourneyContract;
|
|
52
|
+
exports.validateResolveIOAICoderJourneyContract = validateResolveIOAICoderJourneyContract;
|
|
53
|
+
exports.collectResolveIOAICoderJourneyContractIssues = collectResolveIOAICoderJourneyContractIssues;
|
|
50
54
|
exports.fingerprintResolveIOAICoderV6Blocker = fingerprintResolveIOAICoderV6Blocker;
|
|
51
55
|
exports.buildResolveIOAICoderV6Budget = buildResolveIOAICoderV6Budget;
|
|
52
56
|
exports.initializeResolveIOAICoderV6State = initializeResolveIOAICoderV6State;
|
|
@@ -99,12 +103,573 @@ function cleanList(values, limit, max) {
|
|
|
99
103
|
}
|
|
100
104
|
return result;
|
|
101
105
|
}
|
|
106
|
+
function readField(source, keys) {
|
|
107
|
+
var e_2, _a;
|
|
108
|
+
if (!source || typeof source !== 'object') {
|
|
109
|
+
return undefined;
|
|
110
|
+
}
|
|
111
|
+
try {
|
|
112
|
+
for (var keys_1 = __values(keys), keys_1_1 = keys_1.next(); !keys_1_1.done; keys_1_1 = keys_1.next()) {
|
|
113
|
+
var key = keys_1_1.value;
|
|
114
|
+
if (source[key] !== undefined && source[key] !== null) {
|
|
115
|
+
return source[key];
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
120
|
+
finally {
|
|
121
|
+
try {
|
|
122
|
+
if (keys_1_1 && !keys_1_1.done && (_a = keys_1.return)) _a.call(keys_1);
|
|
123
|
+
}
|
|
124
|
+
finally { if (e_2) throw e_2.error; }
|
|
125
|
+
}
|
|
126
|
+
return undefined;
|
|
127
|
+
}
|
|
128
|
+
function cleanField(source, keys, max) {
|
|
129
|
+
if (max === void 0) { max = 500; }
|
|
130
|
+
return cleanText(readField(source, keys), max);
|
|
131
|
+
}
|
|
132
|
+
function concatFields(source, keys, maxEach) {
|
|
133
|
+
if (maxEach === void 0) { maxEach = 500; }
|
|
134
|
+
if (!source || typeof source !== 'object') {
|
|
135
|
+
return '';
|
|
136
|
+
}
|
|
137
|
+
return keys
|
|
138
|
+
.map(function (key) { return cleanText(source[key], maxEach); })
|
|
139
|
+
.filter(Boolean)
|
|
140
|
+
.join(' ');
|
|
141
|
+
}
|
|
142
|
+
function asArray(value) {
|
|
143
|
+
if (!Array.isArray(value)) {
|
|
144
|
+
return [];
|
|
145
|
+
}
|
|
146
|
+
return value;
|
|
147
|
+
}
|
|
148
|
+
function stripJsonComments(value) {
|
|
149
|
+
var output = '';
|
|
150
|
+
var inString = false;
|
|
151
|
+
var escaped = false;
|
|
152
|
+
for (var index = 0; index < value.length; index += 1) {
|
|
153
|
+
var char = value[index];
|
|
154
|
+
var next = value[index + 1];
|
|
155
|
+
if (inString) {
|
|
156
|
+
output += char;
|
|
157
|
+
if (escaped) {
|
|
158
|
+
escaped = false;
|
|
159
|
+
}
|
|
160
|
+
else if (char === '\\') {
|
|
161
|
+
escaped = true;
|
|
162
|
+
}
|
|
163
|
+
else if (char === '"') {
|
|
164
|
+
inString = false;
|
|
165
|
+
}
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
if (char === '"') {
|
|
169
|
+
inString = true;
|
|
170
|
+
output += char;
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
if (char === '/' && next === '/') {
|
|
174
|
+
while (index < value.length && value[index] !== '\n') {
|
|
175
|
+
index += 1;
|
|
176
|
+
}
|
|
177
|
+
output += '\n';
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
if (char === '/' && next === '*') {
|
|
181
|
+
index += 2;
|
|
182
|
+
while (index < value.length && !(value[index] === '*' && value[index + 1] === '/')) {
|
|
183
|
+
index += 1;
|
|
184
|
+
}
|
|
185
|
+
index += 1;
|
|
186
|
+
continue;
|
|
187
|
+
}
|
|
188
|
+
output += char;
|
|
189
|
+
}
|
|
190
|
+
return output;
|
|
191
|
+
}
|
|
192
|
+
function parseJsonObject(value) {
|
|
193
|
+
try {
|
|
194
|
+
var parsed = JSON.parse(stripJsonComments(value));
|
|
195
|
+
return parsed && typeof parsed === 'object' && !Array.isArray(parsed) ? parsed : null;
|
|
196
|
+
}
|
|
197
|
+
catch (_a) {
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
function extractResolveIOAICoderJourneyContractFromMarkdown(content) {
|
|
202
|
+
var normalized = String(content || '').replace(/\r\n/g, '\n');
|
|
203
|
+
var sectionMatch = normalized.match(/##\s*journey_contract[\s\S]*?```json\s*([\s\S]*?)```/i)
|
|
204
|
+
|| normalized.match(/##\s*journey_contract[\s\S]*?```\s*([\s\S]*?)```/i);
|
|
205
|
+
if (sectionMatch === null || sectionMatch === void 0 ? void 0 : sectionMatch[1]) {
|
|
206
|
+
return parseJsonObject(sectionMatch[1].trim());
|
|
207
|
+
}
|
|
208
|
+
var fencedMatch = normalized.match(/```json\s*([\s\S]*?)```/i);
|
|
209
|
+
if (fencedMatch === null || fencedMatch === void 0 ? void 0 : fencedMatch[1]) {
|
|
210
|
+
return parseJsonObject(fencedMatch[1].trim());
|
|
211
|
+
}
|
|
212
|
+
var objectMatch = normalized.match(/\{\s*"app_archetype"[\s\S]*\}\s*$/m);
|
|
213
|
+
if (objectMatch === null || objectMatch === void 0 ? void 0 : objectMatch[0]) {
|
|
214
|
+
return parseJsonObject(objectMatch[0].trim());
|
|
215
|
+
}
|
|
216
|
+
return null;
|
|
217
|
+
}
|
|
218
|
+
function looksLikeAbsoluteRoute(value) {
|
|
219
|
+
return value.startsWith('/') && !/\s/.test(value);
|
|
220
|
+
}
|
|
221
|
+
function looksPlaceholder(value) {
|
|
222
|
+
return /\b(tbd|todo|placeholder|generic crud|crud-only|lorem ipsum|add details|fill in|coming soon)\b/i.test(value || '');
|
|
223
|
+
}
|
|
224
|
+
function isNavigationOnlyAction(source) {
|
|
225
|
+
var effect = cleanField(source, ['effect', 'outcome', 'state_change', 'expected_state_transition', 'expected_next_state'], 500).toLowerCase();
|
|
226
|
+
var implementation = cleanField(source, [
|
|
227
|
+
'method_or_calculation',
|
|
228
|
+
'server_method_or_publication',
|
|
229
|
+
'local_calculation_path',
|
|
230
|
+
'action_implementation',
|
|
231
|
+
'calculation_path',
|
|
232
|
+
'data_mutation',
|
|
233
|
+
'mutation',
|
|
234
|
+
'persisted_result'
|
|
235
|
+
], 500);
|
|
236
|
+
if (implementation) {
|
|
237
|
+
return false;
|
|
238
|
+
}
|
|
239
|
+
var actionType = cleanField(source, ['action_type', 'type', 'kind'], 120).toLowerCase();
|
|
240
|
+
var actionText = [
|
|
241
|
+
cleanField(source, ['action', 'visible_cta', 'cta', 'label'], 300),
|
|
242
|
+
cleanField(source, ['next_step_destination', 'next_step', 'destination'], 300)
|
|
243
|
+
].join(' ').toLowerCase();
|
|
244
|
+
var navigationSignals = /\b(navigate|go to|open|view|link|route|page)\b/.test(actionText)
|
|
245
|
+
|| /^(?:link|nav|navigation|route)$/i.test(actionType);
|
|
246
|
+
var productiveEffect = /\b(save|saved|create|created|update|updated|calculate|calculated|optimize|optimized|import|export|report|persist|queued|submitted|validated|generated|compare|recommendation|complete|completed)\b/.test(effect);
|
|
247
|
+
return navigationSignals && !productiveEffect;
|
|
248
|
+
}
|
|
249
|
+
function addJourneyIssue(issues, code, path, message, severity) {
|
|
250
|
+
if (severity === void 0) { severity = 'error'; }
|
|
251
|
+
issues.push({ code: code, path: path, message: message, severity: severity });
|
|
252
|
+
}
|
|
253
|
+
function normalizeWorkflowStepPosition(step, index, total) {
|
|
254
|
+
var explicit = cleanField(step, ['position', 'phase', 'order_role'], 60).toLowerCase();
|
|
255
|
+
if (explicit) {
|
|
256
|
+
return explicit;
|
|
257
|
+
}
|
|
258
|
+
if (index === 0) {
|
|
259
|
+
return 'first';
|
|
260
|
+
}
|
|
261
|
+
if (index === total - 1) {
|
|
262
|
+
return 'last';
|
|
263
|
+
}
|
|
264
|
+
return 'next';
|
|
265
|
+
}
|
|
266
|
+
function buildWorkflowStepId(step, index) {
|
|
267
|
+
return cleanField(step, ['id', 'step_id', 'key'], 120)
|
|
268
|
+
|| cleanField(step, ['label', 'title', 'visible_cta'], 120).toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '')
|
|
269
|
+
|| "step-".concat(index + 1);
|
|
270
|
+
}
|
|
271
|
+
function buildResolveIOAICoderWorkflowQaRowsFromJourneyContract(input) {
|
|
272
|
+
var contract = typeof input === 'string'
|
|
273
|
+
? extractResolveIOAICoderJourneyContractFromMarkdown(input)
|
|
274
|
+
: (input && typeof input === 'object' && !Array.isArray(input) ? input : null);
|
|
275
|
+
if (!contract) {
|
|
276
|
+
return [];
|
|
277
|
+
}
|
|
278
|
+
var workflowId = cleanField(contract, ['primary_workflow_id', 'workflow_id', 'id'], 160) || 'north-star';
|
|
279
|
+
var rows = [];
|
|
280
|
+
var qaAssertions = asArray(contract.qa_assertions);
|
|
281
|
+
qaAssertions.forEach(function (assertion, index) {
|
|
282
|
+
if (!assertion || typeof assertion !== 'object' || Array.isArray(assertion)) {
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
var route = cleanField(assertion, ['route', 'screen_route', 'path'], 240);
|
|
286
|
+
var action = cleanField(assertion, ['action', 'browser_steps', 'cta', 'visible_cta'], 500);
|
|
287
|
+
var expectedState = cleanField(assertion, ['expected_state', 'expected_result', 'expected_dom_or_data_proof', 'proof'], 500);
|
|
288
|
+
var assertionText = cleanField(assertion, ['assertion', 'expected_dom_or_data_proof', 'proof', 'expected_result'], 700);
|
|
289
|
+
if (!route && !action && !assertionText) {
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
rows.push({
|
|
293
|
+
index: cleanNumber(readField(assertion, ['index', 'order'])) || index + 1,
|
|
294
|
+
workflowId: cleanField(assertion, ['workflow_id', 'workflowId'], 160) || workflowId,
|
|
295
|
+
stepId: cleanField(assertion, ['step_id', 'stepId', 'id'], 160) || "qa-".concat(index + 1),
|
|
296
|
+
route: route || undefined,
|
|
297
|
+
action: action || undefined,
|
|
298
|
+
assertion: assertionText || undefined,
|
|
299
|
+
expectedState: expectedState || undefined,
|
|
300
|
+
status: cleanField(assertion, ['status'], 120) || undefined,
|
|
301
|
+
artifactPaths: cleanList(readField(assertion, ['artifact_paths', 'artifactPaths']), 20, 500)
|
|
302
|
+
});
|
|
303
|
+
});
|
|
304
|
+
if (rows.length) {
|
|
305
|
+
return rows.slice(0, 80);
|
|
306
|
+
}
|
|
307
|
+
asArray(contract.north_star_workflow).forEach(function (step, index, workflow) {
|
|
308
|
+
if (!step || typeof step !== 'object' || Array.isArray(step)) {
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
rows.push({
|
|
312
|
+
index: index + 1,
|
|
313
|
+
workflowId: workflowId,
|
|
314
|
+
stepId: buildWorkflowStepId(step, index),
|
|
315
|
+
route: cleanField(step, ['route'], 240) || undefined,
|
|
316
|
+
action: cleanField(step, ['visible_cta', 'action', 'cta'], 500) || undefined,
|
|
317
|
+
assertion: cleanField(step, ['success_confirmation', 'expected_state_transition', 'final_result'], 700) || undefined,
|
|
318
|
+
expectedState: cleanField(step, ['expected_state_transition', 'success_confirmation', 'final_result'], 500) || undefined,
|
|
319
|
+
status: undefined,
|
|
320
|
+
artifactPaths: []
|
|
321
|
+
});
|
|
322
|
+
void workflow;
|
|
323
|
+
});
|
|
324
|
+
return rows.slice(0, 80);
|
|
325
|
+
}
|
|
326
|
+
function validateResolveIOAICoderJourneyContract(input, options) {
|
|
327
|
+
var e_3, _a, e_4, _b, e_5, _c, e_6, _d;
|
|
328
|
+
if (options === void 0) { options = {}; }
|
|
329
|
+
var pathLabel = cleanText(options.pathLabel || 'docs/APP_JOURNEY_CONTRACT.md', 240) || 'docs/APP_JOURNEY_CONTRACT.md';
|
|
330
|
+
var issues = [];
|
|
331
|
+
var contract = null;
|
|
332
|
+
if (typeof input === 'string') {
|
|
333
|
+
var normalized = input.replace(/\r\n/g, '\n');
|
|
334
|
+
if (!normalized.trim()) {
|
|
335
|
+
addJourneyIssue(issues, 'missing_contract', pathLabel, "".concat(pathLabel, ": missing app journey contract."));
|
|
336
|
+
return { valid: false, contract: null, issues: issues, workflowQaRows: [], primaryWorkflowId: '' };
|
|
337
|
+
}
|
|
338
|
+
if (options.requireMarkdownEnvelope !== false && !/^\s*#\s+App Journey Contract/im.test(normalized)) {
|
|
339
|
+
addJourneyIssue(issues, 'missing_heading', pathLabel, "".concat(pathLabel, ": missing \"# App Journey Contract\" heading."));
|
|
340
|
+
}
|
|
341
|
+
if (options.requireMarkdownEnvelope !== false && !/##\s*journey_contract/i.test(normalized)) {
|
|
342
|
+
addJourneyIssue(issues, 'missing_json_section', pathLabel, "".concat(pathLabel, ": missing \"## journey_contract\" JSON section."));
|
|
343
|
+
}
|
|
344
|
+
if (looksPlaceholder(normalized)) {
|
|
345
|
+
addJourneyIssue(issues, 'placeholder_text', pathLabel, "".concat(pathLabel, ": contains placeholder or generic journey text."));
|
|
346
|
+
}
|
|
347
|
+
contract = extractResolveIOAICoderJourneyContractFromMarkdown(normalized);
|
|
348
|
+
}
|
|
349
|
+
else if (input && typeof input === 'object' && !Array.isArray(input)) {
|
|
350
|
+
contract = input;
|
|
351
|
+
}
|
|
352
|
+
if (!contract) {
|
|
353
|
+
addJourneyIssue(issues, 'invalid_json', pathLabel, "".concat(pathLabel, ": journey_contract JSON is missing or invalid."));
|
|
354
|
+
return { valid: false, contract: null, issues: issues, workflowQaRows: [], primaryWorkflowId: '' };
|
|
355
|
+
}
|
|
356
|
+
var requiredKeys = [
|
|
357
|
+
'app_archetype',
|
|
358
|
+
'primary_actor',
|
|
359
|
+
'primary_goal',
|
|
360
|
+
'first_screen',
|
|
361
|
+
'north_star_workflow',
|
|
362
|
+
'secondary_workflows',
|
|
363
|
+
'screen_sequence',
|
|
364
|
+
'data_story',
|
|
365
|
+
'completion_states',
|
|
366
|
+
'qa_assertions'
|
|
367
|
+
];
|
|
368
|
+
try {
|
|
369
|
+
for (var requiredKeys_1 = __values(requiredKeys), requiredKeys_1_1 = requiredKeys_1.next(); !requiredKeys_1_1.done; requiredKeys_1_1 = requiredKeys_1.next()) {
|
|
370
|
+
var key = requiredKeys_1_1.value;
|
|
371
|
+
if (!(key in contract)) {
|
|
372
|
+
addJourneyIssue(issues, 'missing_key', "".concat(pathLabel, ".journey_contract.").concat(key), "".concat(pathLabel, ": journey_contract missing key \"").concat(key, "\"."));
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
377
|
+
finally {
|
|
378
|
+
try {
|
|
379
|
+
if (requiredKeys_1_1 && !requiredKeys_1_1.done && (_a = requiredKeys_1.return)) _a.call(requiredKeys_1);
|
|
380
|
+
}
|
|
381
|
+
finally { if (e_3) throw e_3.error; }
|
|
382
|
+
}
|
|
383
|
+
try {
|
|
384
|
+
for (var _e = __values(['app_archetype', 'primary_actor', 'primary_goal']), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
385
|
+
var key = _f.value;
|
|
386
|
+
var value = cleanText(contract[key], 500);
|
|
387
|
+
if (value.length < 4) {
|
|
388
|
+
addJourneyIssue(issues, 'empty_core_field', "".concat(pathLabel, ".journey_contract.").concat(key), "".concat(pathLabel, ": journey_contract.").concat(key, " must be non-empty."));
|
|
389
|
+
}
|
|
390
|
+
if (looksPlaceholder(value)) {
|
|
391
|
+
addJourneyIssue(issues, 'placeholder_core_field', "".concat(pathLabel, ".journey_contract.").concat(key), "".concat(pathLabel, ": journey_contract.").concat(key, " is placeholder text."));
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
396
|
+
finally {
|
|
397
|
+
try {
|
|
398
|
+
if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
|
|
399
|
+
}
|
|
400
|
+
finally { if (e_4) throw e_4.error; }
|
|
401
|
+
}
|
|
402
|
+
var firstScreen = contract.first_screen;
|
|
403
|
+
if (!firstScreen || typeof firstScreen !== 'object' || Array.isArray(firstScreen)) {
|
|
404
|
+
addJourneyIssue(issues, 'invalid_first_screen', "".concat(pathLabel, ".journey_contract.first_screen"), "".concat(pathLabel, ": first_screen must be an object."));
|
|
405
|
+
}
|
|
406
|
+
else {
|
|
407
|
+
var route = cleanField(firstScreen, ['route'], 240);
|
|
408
|
+
try {
|
|
409
|
+
for (var _g = __values([
|
|
410
|
+
['route', ['route']],
|
|
411
|
+
['purpose', ['purpose', 'screen_purpose']],
|
|
412
|
+
['visible_cta', ['visible_cta', 'cta', 'primary_cta']],
|
|
413
|
+
['next_step', ['next_step', 'next_step_destination', 'expected_next_state']]
|
|
414
|
+
]), _h = _g.next(); !_h.done; _h = _g.next()) {
|
|
415
|
+
var _j = __read(_h.value, 2), label = _j[0], keys = _j[1];
|
|
416
|
+
if (cleanField(firstScreen, keys, 500).length < 4) {
|
|
417
|
+
addJourneyIssue(issues, 'incomplete_first_screen', "".concat(pathLabel, ".journey_contract.first_screen.").concat(label), "".concat(pathLabel, ": first_screen.").concat(label, " must be non-empty."));
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
422
|
+
finally {
|
|
423
|
+
try {
|
|
424
|
+
if (_h && !_h.done && (_c = _g.return)) _c.call(_g);
|
|
425
|
+
}
|
|
426
|
+
finally { if (e_5) throw e_5.error; }
|
|
427
|
+
}
|
|
428
|
+
if (route && !looksLikeAbsoluteRoute(route)) {
|
|
429
|
+
addJourneyIssue(issues, 'relative_first_screen_route', "".concat(pathLabel, ".journey_contract.first_screen.route"), "".concat(pathLabel, ": first_screen.route must be an absolute app route."));
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
var workflow = asArray(contract.north_star_workflow);
|
|
433
|
+
if (workflow.length < 3) {
|
|
434
|
+
addJourneyIssue(issues, 'workflow_too_short', "".concat(pathLabel, ".journey_contract.north_star_workflow"), "".concat(pathLabel, ": north_star_workflow must include at least first, next, and last steps."));
|
|
435
|
+
}
|
|
436
|
+
var positions = new Set(workflow.map(function (step, index) { return normalizeWorkflowStepPosition(step, index, workflow.length); }));
|
|
437
|
+
try {
|
|
438
|
+
for (var _k = __values(['first', 'next', 'last']), _l = _k.next(); !_l.done; _l = _k.next()) {
|
|
439
|
+
var requiredPosition = _l.value;
|
|
440
|
+
if (!positions.has(requiredPosition)) {
|
|
441
|
+
addJourneyIssue(issues, 'missing_workflow_position', "".concat(pathLabel, ".journey_contract.north_star_workflow"), "".concat(pathLabel, ": north_star_workflow missing position \"").concat(requiredPosition, "\"."));
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
446
|
+
finally {
|
|
447
|
+
try {
|
|
448
|
+
if (_l && !_l.done && (_d = _k.return)) _d.call(_k);
|
|
449
|
+
}
|
|
450
|
+
finally { if (e_6) throw e_6.error; }
|
|
451
|
+
}
|
|
452
|
+
workflow.forEach(function (step, index) {
|
|
453
|
+
var e_7, _a;
|
|
454
|
+
var stepPath = "".concat(pathLabel, ".journey_contract.north_star_workflow[").concat(index, "]");
|
|
455
|
+
if (!step || typeof step !== 'object' || Array.isArray(step)) {
|
|
456
|
+
addJourneyIssue(issues, 'invalid_workflow_step', stepPath, "".concat(pathLabel, ": north_star_workflow[").concat(index, "] must be an object."));
|
|
457
|
+
return;
|
|
458
|
+
}
|
|
459
|
+
var position = normalizeWorkflowStepPosition(step, index, workflow.length);
|
|
460
|
+
var route = cleanField(step, ['route'], 240);
|
|
461
|
+
var embeddedAction = cleanField(step, ['embedded_hub_action', 'hub_action'], 240);
|
|
462
|
+
var implementation = cleanField(step, [
|
|
463
|
+
'method_or_calculation',
|
|
464
|
+
'server_method_or_publication',
|
|
465
|
+
'local_calculation_path',
|
|
466
|
+
'action_implementation',
|
|
467
|
+
'calculation_path',
|
|
468
|
+
'data_mutation',
|
|
469
|
+
'mutation',
|
|
470
|
+
'persisted_result'
|
|
471
|
+
], 500);
|
|
472
|
+
var requiredStepFields = [
|
|
473
|
+
['position', ['position']],
|
|
474
|
+
['visible_cta', ['visible_cta', 'cta', 'label']],
|
|
475
|
+
['data_input_or_selection', ['data_input_or_selection', 'data_input', 'selection', 'input']],
|
|
476
|
+
['expected_state_transition', ['expected_state_transition', 'expected_next_state', 'state_change']],
|
|
477
|
+
['success_confirmation', ['success_confirmation', 'confirmation', 'success_message']],
|
|
478
|
+
['next_step_destination', ['next_step_destination', 'next_step', 'destination']]
|
|
479
|
+
];
|
|
480
|
+
try {
|
|
481
|
+
for (var requiredStepFields_1 = __values(requiredStepFields), requiredStepFields_1_1 = requiredStepFields_1.next(); !requiredStepFields_1_1.done; requiredStepFields_1_1 = requiredStepFields_1.next()) {
|
|
482
|
+
var _b = __read(requiredStepFields_1_1.value, 2), fieldName = _b[0], keys = _b[1];
|
|
483
|
+
if (fieldName === 'next_step_destination' && position === 'last') {
|
|
484
|
+
continue;
|
|
485
|
+
}
|
|
486
|
+
if (cleanField(step, keys, 500).length < 3) {
|
|
487
|
+
addJourneyIssue(issues, 'incomplete_workflow_step', "".concat(stepPath, ".").concat(fieldName), "".concat(pathLabel, ": north_star_workflow[").concat(index, "].").concat(fieldName, " must be non-empty."));
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
|
492
|
+
finally {
|
|
493
|
+
try {
|
|
494
|
+
if (requiredStepFields_1_1 && !requiredStepFields_1_1.done && (_a = requiredStepFields_1.return)) _a.call(requiredStepFields_1);
|
|
495
|
+
}
|
|
496
|
+
finally { if (e_7) throw e_7.error; }
|
|
497
|
+
}
|
|
498
|
+
if (!route && !embeddedAction) {
|
|
499
|
+
addJourneyIssue(issues, 'workflow_step_missing_route_or_hub_action', stepPath, "".concat(pathLabel, ": north_star_workflow[").concat(index, "] must specify a route or embedded hub action."));
|
|
500
|
+
}
|
|
501
|
+
if (route && !looksLikeAbsoluteRoute(route)) {
|
|
502
|
+
addJourneyIssue(issues, 'relative_workflow_route', "".concat(stepPath, ".route"), "".concat(pathLabel, ": north_star_workflow[").concat(index, "].route must be an absolute app route."));
|
|
503
|
+
}
|
|
504
|
+
if (!implementation) {
|
|
505
|
+
addJourneyIssue(issues, 'workflow_step_missing_implementation', stepPath, "".concat(pathLabel, ": north_star_workflow[").concat(index, "] must map the CTA to a server method, publication, local calculation, persisted mutation, or export/report action."));
|
|
506
|
+
}
|
|
507
|
+
if (isNavigationOnlyAction(step)) {
|
|
508
|
+
addJourneyIssue(issues, 'navigation_only_workflow_step', stepPath, "".concat(pathLabel, ": north_star_workflow[").concat(index, "] appears to be navigation-only instead of advancing state."));
|
|
509
|
+
}
|
|
510
|
+
if (position === 'last' && cleanField(step, ['final_result', 'saved_exported_reported_result', 'completion_result'], 700).length < 8) {
|
|
511
|
+
addJourneyIssue(issues, 'last_step_missing_final_result', "".concat(stepPath, ".final_result"), "".concat(pathLabel, ": last workflow step must define the saved, exported, reported, or calculated final result."));
|
|
512
|
+
}
|
|
513
|
+
});
|
|
514
|
+
var secondaryWorkflows = asArray(contract.secondary_workflows);
|
|
515
|
+
if (secondaryWorkflows.length < 3) {
|
|
516
|
+
addJourneyIssue(issues, 'missing_secondary_workflows', "".concat(pathLabel, ".journey_contract.secondary_workflows"), "".concat(pathLabel, ": secondary_workflows must include setup, manage, report/export, settings/secrets, or recovery coverage."));
|
|
517
|
+
}
|
|
518
|
+
var screenSequence = asArray(contract.screen_sequence);
|
|
519
|
+
if (screenSequence.length < Math.min(3, Math.max(workflow.length, 3))) {
|
|
520
|
+
addJourneyIssue(issues, 'screen_sequence_too_short', "".concat(pathLabel, ".journey_contract.screen_sequence"), "".concat(pathLabel, ": screen_sequence must map workflow steps to routes, CTAs, data, and next state."));
|
|
521
|
+
}
|
|
522
|
+
screenSequence.forEach(function (screen, index) {
|
|
523
|
+
var e_8, _a;
|
|
524
|
+
var screenPath = "".concat(pathLabel, ".journey_contract.screen_sequence[").concat(index, "]");
|
|
525
|
+
if (!screen || typeof screen !== 'object' || Array.isArray(screen)) {
|
|
526
|
+
addJourneyIssue(issues, 'invalid_screen_sequence_row', screenPath, "".concat(pathLabel, ": screen_sequence[").concat(index, "] must be an object."));
|
|
527
|
+
return;
|
|
528
|
+
}
|
|
529
|
+
try {
|
|
530
|
+
for (var _b = __values([
|
|
531
|
+
['route', ['route']],
|
|
532
|
+
['screen_purpose', ['screen_purpose', 'purpose']],
|
|
533
|
+
['visible_cta', ['visible_cta', 'cta']],
|
|
534
|
+
['expected_next_state', ['expected_next_state', 'expected_state_transition']],
|
|
535
|
+
['data_shown', ['data_shown', 'data', 'records_shown']]
|
|
536
|
+
]), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
537
|
+
var _d = __read(_c.value, 2), fieldName = _d[0], keys = _d[1];
|
|
538
|
+
if (cleanField(screen, keys, 500).length < 3) {
|
|
539
|
+
addJourneyIssue(issues, 'incomplete_screen_sequence_row', "".concat(screenPath, ".").concat(fieldName), "".concat(pathLabel, ": screen_sequence[").concat(index, "].").concat(fieldName, " must be non-empty."));
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
544
|
+
finally {
|
|
545
|
+
try {
|
|
546
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
547
|
+
}
|
|
548
|
+
finally { if (e_8) throw e_8.error; }
|
|
549
|
+
}
|
|
550
|
+
var route = cleanField(screen, ['route'], 240);
|
|
551
|
+
if (route && !looksLikeAbsoluteRoute(route)) {
|
|
552
|
+
addJourneyIssue(issues, 'relative_screen_route', "".concat(screenPath, ".route"), "".concat(pathLabel, ": screen_sequence[").concat(index, "].route must be an absolute app route."));
|
|
553
|
+
}
|
|
554
|
+
if (isNavigationOnlyAction(screen)) {
|
|
555
|
+
addJourneyIssue(issues, 'navigation_only_screen_action', screenPath, "".concat(pathLabel, ": screen_sequence[").concat(index, "] CTA appears to navigate without changing workflow state."));
|
|
556
|
+
}
|
|
557
|
+
});
|
|
558
|
+
var firstScreenRoute = cleanField(firstScreen, ['route'], 240);
|
|
559
|
+
var hubScreens = screenSequence.filter(function (screen) {
|
|
560
|
+
var route = cleanField(screen, ['route'], 240);
|
|
561
|
+
return route === firstScreenRoute || /hub|dashboard/i.test(route);
|
|
562
|
+
});
|
|
563
|
+
var hubHasEmbeddedAction = hubScreens.some(function (screen) {
|
|
564
|
+
var text = [
|
|
565
|
+
cleanField(screen, ['embedded_action', 'hub_action', 'action'], 500),
|
|
566
|
+
cleanField(screen, ['method_or_calculation', 'server_method_or_publication', 'local_calculation_path', 'action_implementation'], 500),
|
|
567
|
+
cleanField(screen, ['expected_next_state', 'expected_state_transition'], 500)
|
|
568
|
+
].join(' ');
|
|
569
|
+
return text.trim().length >= 8 && !isNavigationOnlyAction(screen);
|
|
570
|
+
});
|
|
571
|
+
if (!hubHasEmbeddedAction) {
|
|
572
|
+
addJourneyIssue(issues, 'hub_missing_embedded_action', "".concat(pathLabel, ".journey_contract.screen_sequence"), "".concat(pathLabel, ": dashboard hub/first screen must embed at least one primary workflow action instead of acting as a link farm."));
|
|
573
|
+
}
|
|
574
|
+
var dataStory = contract.data_story;
|
|
575
|
+
if (!dataStory || typeof dataStory !== 'object' || Array.isArray(dataStory)) {
|
|
576
|
+
addJourneyIssue(issues, 'invalid_data_story', "".concat(pathLabel, ".journey_contract.data_story"), "".concat(pathLabel, ": data_story must be an object."));
|
|
577
|
+
}
|
|
578
|
+
else {
|
|
579
|
+
if (cleanField(dataStory, ['seeded_scenario', 'scenario'], 800).length < 12) {
|
|
580
|
+
addJourneyIssue(issues, 'missing_seeded_scenario', "".concat(pathLabel, ".journey_contract.data_story.seeded_scenario"), "".concat(pathLabel, ": data_story.seeded_scenario must describe the launch sample scenario."));
|
|
581
|
+
}
|
|
582
|
+
if (!asArray(readField(dataStory, ['records', 'seed_records'])).length) {
|
|
583
|
+
addJourneyIssue(issues, 'missing_seed_records', "".concat(pathLabel, ".journey_contract.data_story.records"), "".concat(pathLabel, ": data_story.records must list seeded records."));
|
|
584
|
+
}
|
|
585
|
+
if (!asArray(readField(dataStory, ['relationships', 'record_relationships'])).length) {
|
|
586
|
+
addJourneyIssue(issues, 'missing_seed_relationships', "".concat(pathLabel, ".journey_contract.data_story.relationships"), "".concat(pathLabel, ": data_story.relationships must list seeded data relationships."));
|
|
587
|
+
}
|
|
588
|
+
if (asArray(readField(dataStory, ['non_empty_states', 'non_empty_dashboard_states'])).length < 2) {
|
|
589
|
+
addJourneyIssue(issues, 'missing_non_empty_states', "".concat(pathLabel, ".journey_contract.data_story.non_empty_states"), "".concat(pathLabel, ": data_story.non_empty_states must list non-empty dashboard, workflow, or report states."));
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
if (asArray(contract.completion_states).length < 2) {
|
|
593
|
+
addJourneyIssue(issues, 'missing_completion_states', "".concat(pathLabel, ".journey_contract.completion_states"), "".concat(pathLabel, ": completion_states must define what done looks like to the user."));
|
|
594
|
+
}
|
|
595
|
+
var qaAssertions = asArray(contract.qa_assertions);
|
|
596
|
+
if (qaAssertions.length < 5) {
|
|
597
|
+
addJourneyIssue(issues, 'qa_assertions_too_short', "".concat(pathLabel, ".journey_contract.qa_assertions"), "".concat(pathLabel, ": qa_assertions must include login, hub action, workflow completion, sample data, and mobile proof."));
|
|
598
|
+
}
|
|
599
|
+
var hasMobileQa = false;
|
|
600
|
+
var hasRecoveryQa = false;
|
|
601
|
+
var hasCompletionQa = false;
|
|
602
|
+
var hasNonEmptyQa = false;
|
|
603
|
+
qaAssertions.forEach(function (assertion, index) {
|
|
604
|
+
var e_9, _a;
|
|
605
|
+
var qaPath = "".concat(pathLabel, ".journey_contract.qa_assertions[").concat(index, "]");
|
|
606
|
+
if (!assertion || typeof assertion !== 'object' || Array.isArray(assertion)) {
|
|
607
|
+
addJourneyIssue(issues, 'invalid_qa_assertion', qaPath, "".concat(pathLabel, ": qa_assertions[").concat(index, "] must be an object."));
|
|
608
|
+
return;
|
|
609
|
+
}
|
|
610
|
+
try {
|
|
611
|
+
for (var _b = __values([
|
|
612
|
+
['route', ['route', 'screen_route', 'path']],
|
|
613
|
+
['action', ['action', 'browser_steps', 'visible_cta']],
|
|
614
|
+
['expected_dom_or_data_proof', ['expected_dom_or_data_proof', 'proof', 'expected_result']]
|
|
615
|
+
]), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
616
|
+
var _d = __read(_c.value, 2), fieldName = _d[0], keys = _d[1];
|
|
617
|
+
if (cleanField(assertion, keys, 700).length < 3) {
|
|
618
|
+
addJourneyIssue(issues, 'incomplete_qa_assertion', "".concat(qaPath, ".").concat(fieldName), "".concat(pathLabel, ": qa_assertions[").concat(index, "].").concat(fieldName, " must be non-empty."));
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
catch (e_9_1) { e_9 = { error: e_9_1 }; }
|
|
623
|
+
finally {
|
|
624
|
+
try {
|
|
625
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
626
|
+
}
|
|
627
|
+
finally { if (e_9) throw e_9.error; }
|
|
628
|
+
}
|
|
629
|
+
var route = cleanField(assertion, ['route', 'screen_route', 'path'], 240);
|
|
630
|
+
if (route && !looksLikeAbsoluteRoute(route)) {
|
|
631
|
+
addJourneyIssue(issues, 'relative_qa_route', "".concat(qaPath, ".route"), "".concat(pathLabel, ": qa_assertions[").concat(index, "].route must be an absolute app route."));
|
|
632
|
+
}
|
|
633
|
+
var text = [
|
|
634
|
+
concatFields(assertion, ['id', 'type', 'kind', 'coverage', 'viewport'], 300),
|
|
635
|
+
concatFields(assertion, ['action', 'browser_steps', 'expected_dom_or_data_proof', 'proof', 'expected_result'], 1000)
|
|
636
|
+
].join(' ').toLowerCase();
|
|
637
|
+
hasMobileQa = hasMobileQa || /\b(mobile|390x844|viewport)\b/.test(text);
|
|
638
|
+
hasRecoveryQa = hasRecoveryQa || /\b(empty|error|recovery|invalid)\b/.test(text);
|
|
639
|
+
hasCompletionQa = hasCompletionQa || /\b(complete|saved|export|report|result|recommendation|calculated|optimized)\b/.test(text);
|
|
640
|
+
hasNonEmptyQa = hasNonEmptyQa || /\b(sample|seeded|non[-\s]?empty|kpi|table|chart|record|row)\b/.test(text);
|
|
641
|
+
});
|
|
642
|
+
if (!hasCompletionQa) {
|
|
643
|
+
addJourneyIssue(issues, 'missing_completion_qa', "".concat(pathLabel, ".journey_contract.qa_assertions"), "".concat(pathLabel, ": qa_assertions missing business completion proof."));
|
|
644
|
+
}
|
|
645
|
+
if (!hasNonEmptyQa) {
|
|
646
|
+
addJourneyIssue(issues, 'missing_non_empty_qa', "".concat(pathLabel, ".journey_contract.qa_assertions"), "".concat(pathLabel, ": qa_assertions missing non-empty seeded data proof."));
|
|
647
|
+
}
|
|
648
|
+
if (!hasMobileQa) {
|
|
649
|
+
addJourneyIssue(issues, 'missing_mobile_qa', "".concat(pathLabel, ".journey_contract.qa_assertions"), "".concat(pathLabel, ": qa_assertions missing mobile viewport proof."));
|
|
650
|
+
}
|
|
651
|
+
if (!hasRecoveryQa) {
|
|
652
|
+
addJourneyIssue(issues, 'missing_recovery_qa', "".concat(pathLabel, ".journey_contract.qa_assertions"), "".concat(pathLabel, ": qa_assertions missing empty/error recovery proof."));
|
|
653
|
+
}
|
|
654
|
+
var workflowQaRows = buildResolveIOAICoderWorkflowQaRowsFromJourneyContract(contract);
|
|
655
|
+
return {
|
|
656
|
+
valid: !issues.some(function (issue) { return issue.severity === 'error'; }),
|
|
657
|
+
contract: contract,
|
|
658
|
+
issues: issues,
|
|
659
|
+
workflowQaRows: workflowQaRows,
|
|
660
|
+
primaryWorkflowId: cleanField(contract, ['primary_workflow_id', 'workflow_id', 'id'], 160) || 'north-star'
|
|
661
|
+
};
|
|
662
|
+
}
|
|
663
|
+
function collectResolveIOAICoderJourneyContractIssues(input, options) {
|
|
664
|
+
if (options === void 0) { options = {}; }
|
|
665
|
+
return validateResolveIOAICoderJourneyContract(input, options).issues.map(function (issue) { return issue.message; });
|
|
666
|
+
}
|
|
102
667
|
function cleanNumber(value) {
|
|
103
668
|
var parsed = Number(value);
|
|
104
669
|
return Number.isFinite(parsed) && parsed > 0 ? Math.floor(parsed) : 0;
|
|
105
670
|
}
|
|
106
671
|
function cleanWorkflowQaRows(values, limit) {
|
|
107
|
-
var
|
|
672
|
+
var e_10, _a;
|
|
108
673
|
if (limit === void 0) { limit = 40; }
|
|
109
674
|
if (!Array.isArray(values)) {
|
|
110
675
|
return [];
|
|
@@ -135,12 +700,12 @@ function cleanWorkflowQaRows(values, limit) {
|
|
|
135
700
|
}
|
|
136
701
|
}
|
|
137
702
|
}
|
|
138
|
-
catch (
|
|
703
|
+
catch (e_10_1) { e_10 = { error: e_10_1 }; }
|
|
139
704
|
finally {
|
|
140
705
|
try {
|
|
141
706
|
if (values_2_1 && !values_2_1.done && (_a = values_2.return)) _a.call(values_2);
|
|
142
707
|
}
|
|
143
|
-
finally { if (
|
|
708
|
+
finally { if (e_10) throw e_10.error; }
|
|
144
709
|
}
|
|
145
710
|
return rows;
|
|
146
711
|
}
|
|
@@ -347,6 +912,45 @@ function recordResolveIOAICoderV6Step(bundle, step) {
|
|
|
347
912
|
|| (previousRecord === null || previousRecord === void 0 ? void 0 : previousRecord.evidenceHash) !== record.evidenceHash
|
|
348
913
|
? 1
|
|
349
914
|
: bundle.aiCoderV6Budget.loopCount + 1;
|
|
915
|
+
var budget = buildResolveIOAICoderV6Budget(bundle.aiCoderV6Budget);
|
|
916
|
+
var shouldParkForRepeatedNoProgress = !managerDecision.loopBudgetShouldReset
|
|
917
|
+
&& nextLoopCount > budget.maxRepeatedNoProgress
|
|
918
|
+
&& step.outcome !== 'pass'
|
|
919
|
+
&& step.outcome !== 'ready_to_publish'
|
|
920
|
+
&& step.outcome !== 'published';
|
|
921
|
+
var recordedRecoveryPlan = shouldParkForRepeatedNoProgress
|
|
922
|
+
? (0, ai_runner_manager_policy_1.buildResolveIOAIManagerRecoveryPlan)({
|
|
923
|
+
action: 'park_repeated_failure',
|
|
924
|
+
reason: 'aicoder_v6_repeated_no_progress',
|
|
925
|
+
failureClass: record.failureClass,
|
|
926
|
+
lane: record.lane,
|
|
927
|
+
stepType: record.stepType,
|
|
928
|
+
blocker: record.blocker || record.summary,
|
|
929
|
+
changedFiles: record.changedFiles,
|
|
930
|
+
artifactPaths: record.artifactPaths,
|
|
931
|
+
maxSameFailureRepeats: budget.maxRepeatedNoProgress + 1
|
|
932
|
+
})
|
|
933
|
+
: managerDecision.recoveryPlan;
|
|
934
|
+
var recordedRecoveryCheckpoint = shouldParkForRepeatedNoProgress
|
|
935
|
+
? (0, ai_runner_manager_policy_1.buildResolveIOAIManagerRecoveryCheckpoint)({
|
|
936
|
+
plan: recordedRecoveryPlan,
|
|
937
|
+
current: record
|
|
938
|
+
})
|
|
939
|
+
: managerDecision.recoveryCheckpoint;
|
|
940
|
+
var recordedRecoveryEvidenceProbe = shouldParkForRepeatedNoProgress
|
|
941
|
+
? (0, ai_runner_manager_policy_1.buildResolveIOAIManagerRecoveryEvidenceProbe)({
|
|
942
|
+
checkpoint: recordedRecoveryCheckpoint,
|
|
943
|
+
current: record
|
|
944
|
+
})
|
|
945
|
+
: managerDecision.recoveryEvidenceProbe;
|
|
946
|
+
var recordedRecoveryAction = shouldParkForRepeatedNoProgress
|
|
947
|
+
? (0, ai_runner_manager_policy_1.buildResolveIOAIManagerRecoveryActionPacket)({
|
|
948
|
+
plan: recordedRecoveryPlan,
|
|
949
|
+
checkpoint: recordedRecoveryCheckpoint,
|
|
950
|
+
probe: recordedRecoveryEvidenceProbe,
|
|
951
|
+
current: record
|
|
952
|
+
})
|
|
953
|
+
: managerDecision.recoveryAction;
|
|
350
954
|
var previousLane = bundle.aiCoderV6LaneMemory[step.lane];
|
|
351
955
|
var laneMemory = __assign(__assign({}, bundle.aiCoderV6LaneMemory), (_a = {}, _a[step.lane] = __assign(__assign({}, previousLane), { model: record.model || previousLane.model, threadKey: record.threadKey || previousLane.threadKey, activeStep: step.stepType, activeBlocker: record.blocker || previousLane.activeBlocker || '', activeQaRow: step.activeQaRow || previousLane.activeQaRow, changedFiles: ((_b = record.changedFiles) === null || _b === void 0 ? void 0 : _b.length) ? record.changedFiles : previousLane.changedFiles, artifactPaths: ((_c = record.artifactPaths) === null || _c === void 0 ? void 0 : _c.length) ? record.artifactPaths : previousLane.artifactPaths, latestPromptVersion: record.promptVersion || previousLane.latestPromptVersion, latestPromptTokenEstimate: promptTokens || previousLane.latestPromptTokenEstimate, updatedAt: now }), _a));
|
|
352
956
|
var complete = step.outcome === 'published' || step.outcome === 'ready_to_publish';
|
|
@@ -360,7 +964,7 @@ function recordResolveIOAICoderV6Step(bundle, step) {
|
|
|
360
964
|
blockedWorkflowStep: blockedWorkflowStep,
|
|
361
965
|
businessProofArtifacts: businessProofArtifacts,
|
|
362
966
|
updatedAt: now
|
|
363
|
-
}, aiCoderV6StepHistory: __spreadArray(__spreadArray([], __read(bundle.aiCoderV6StepHistory), false), [record], false).slice(-120), aiCoderV6Budget: __assign(__assign({}, bundle.aiCoderV6Budget), { totalPromptTokenEstimate: bundle.aiCoderV6Budget.totalPromptTokenEstimate + promptTokens, totalInputTokens: bundle.aiCoderV6Budget.totalInputTokens + inputTokens, totalCachedInputTokens: bundle.aiCoderV6Budget.totalCachedInputTokens + cachedInputTokens, totalOutputTokens: bundle.aiCoderV6Budget.totalOutputTokens + outputTokens, totalRuntimeMs: bundle.aiCoderV6Budget.totalRuntimeMs + runtimeMs, loopCount: nextLoopCount }), aiCoderV6RecoveryPlan:
|
|
967
|
+
}, aiCoderV6StepHistory: __spreadArray(__spreadArray([], __read(bundle.aiCoderV6StepHistory), false), [record], false).slice(-120), aiCoderV6Budget: __assign(__assign({}, bundle.aiCoderV6Budget), { totalPromptTokenEstimate: bundle.aiCoderV6Budget.totalPromptTokenEstimate + promptTokens, totalInputTokens: bundle.aiCoderV6Budget.totalInputTokens + inputTokens, totalCachedInputTokens: bundle.aiCoderV6Budget.totalCachedInputTokens + cachedInputTokens, totalOutputTokens: bundle.aiCoderV6Budget.totalOutputTokens + outputTokens, totalRuntimeMs: bundle.aiCoderV6Budget.totalRuntimeMs + runtimeMs, loopCount: nextLoopCount }), aiCoderV6RecoveryPlan: recordedRecoveryPlan, aiCoderV6RecoveryCheckpoint: recordedRecoveryCheckpoint, aiCoderV6RecoveryEvidenceProbe: recordedRecoveryEvidenceProbe, aiCoderV6RecoveryAction: recordedRecoveryAction });
|
|
364
968
|
}
|
|
365
969
|
function decideResolveIOAICoderV6Continuation(bundle) {
|
|
366
970
|
var history = bundle.aiCoderV6StepHistory || [];
|