@resolveio/server-lib 22.3.156 → 22.3.158
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-run-evidence-adapters.js +225 -41
- package/util/ai-run-evidence-adapters.js.map +1 -1
- package/util/ai-run-evidence.d.ts +1 -1
- package/util/ai-run-evidence.js.map +1 -1
- package/util/ai-runner-manager-policy.d.ts +32 -0
- package/util/ai-runner-manager-policy.js +90 -0
- package/util/ai-runner-manager-policy.js.map +1 -1
- package/util/support-runner-v5.d.ts +47 -0
- package/util/support-runner-v5.js +225 -0
- package/util/support-runner-v5.js.map +1 -1
package/package.json
CHANGED
|
@@ -51,6 +51,7 @@ exports.buildSupportAIRunFromEvidence = buildSupportAIRunFromEvidence;
|
|
|
51
51
|
exports.buildAICoderAIRunFromEvidence = buildAICoderAIRunFromEvidence;
|
|
52
52
|
exports.buildAssistantAIRunFromEvidence = buildAssistantAIRunFromEvidence;
|
|
53
53
|
var ai_run_evidence_1 = require("./ai-run-evidence");
|
|
54
|
+
var ai_runner_manager_policy_1 = require("./ai-runner-manager-policy");
|
|
54
55
|
function cleanText(value, max) {
|
|
55
56
|
if (max === void 0) { max = 1000; }
|
|
56
57
|
return String(value || '').replace(/\s+/g, ' ').trim().slice(0, max);
|
|
@@ -123,8 +124,185 @@ function pushEvent(events, event) {
|
|
|
123
124
|
function eventDate(record) {
|
|
124
125
|
return dateValue(record, ['recordedAt', 'createdAt', 'updatedAt', 'timestamp', 'time', 'date']);
|
|
125
126
|
}
|
|
126
|
-
function
|
|
127
|
+
function hotfixEvidenceCandidates() {
|
|
127
128
|
var e_3, _a;
|
|
129
|
+
var sources = [];
|
|
130
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
131
|
+
sources[_i] = arguments[_i];
|
|
132
|
+
}
|
|
133
|
+
var result = [];
|
|
134
|
+
var seen = new Set();
|
|
135
|
+
var pushCandidate = function (value) {
|
|
136
|
+
var e_4, _a, e_5, _b;
|
|
137
|
+
var _c, _d;
|
|
138
|
+
if (Array.isArray(value)) {
|
|
139
|
+
try {
|
|
140
|
+
for (var value_1 = __values(value), value_1_1 = value_1.next(); !value_1_1.done; value_1_1 = value_1.next()) {
|
|
141
|
+
var entry = value_1_1.value;
|
|
142
|
+
pushCandidate(entry);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
146
|
+
finally {
|
|
147
|
+
try {
|
|
148
|
+
if (value_1_1 && !value_1_1.done && (_a = value_1.return)) _a.call(value_1);
|
|
149
|
+
}
|
|
150
|
+
finally { if (e_4) throw e_4.error; }
|
|
151
|
+
}
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
if (!value || typeof value !== 'object') {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
var nestedValues = [
|
|
158
|
+
value.hotfixEvidence,
|
|
159
|
+
value.hotfix_evidence,
|
|
160
|
+
value.releaseHotfixEvidence,
|
|
161
|
+
value.release_hotfix_evidence,
|
|
162
|
+
value.managerHotfixEvidence,
|
|
163
|
+
value.manager_hotfix_evidence,
|
|
164
|
+
value.backendHotfixEvidence,
|
|
165
|
+
value.backend_hotfix_evidence
|
|
166
|
+
].filter(Boolean);
|
|
167
|
+
if (nestedValues.length) {
|
|
168
|
+
try {
|
|
169
|
+
for (var nestedValues_1 = __values(nestedValues), nestedValues_1_1 = nestedValues_1.next(); !nestedValues_1_1.done; nestedValues_1_1 = nestedValues_1.next()) {
|
|
170
|
+
var nestedValue = nestedValues_1_1.value;
|
|
171
|
+
pushCandidate(nestedValue);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
175
|
+
finally {
|
|
176
|
+
try {
|
|
177
|
+
if (nestedValues_1_1 && !nestedValues_1_1.done && (_b = nestedValues_1.return)) _b.call(nestedValues_1);
|
|
178
|
+
}
|
|
179
|
+
finally { if (e_5) throw e_5.error; }
|
|
180
|
+
}
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
if (!(value.channel || value.hotfixChannel || value.hotfix_channel)) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
var key = JSON.stringify({
|
|
187
|
+
channel: value.channel || value.hotfixChannel || value.hotfix_channel,
|
|
188
|
+
host: ((_c = value.target) === null || _c === void 0 ? void 0 : _c.host) || value.host,
|
|
189
|
+
path: ((_d = value.target) === null || _d === void 0 ? void 0 : _d.path) || value.path || value.remotePath || value.remote_path,
|
|
190
|
+
checksum: value.remoteChecksumAfter || value.remote_checksum_after || value.remoteChecksum || value.remote_checksum
|
|
191
|
+
});
|
|
192
|
+
if (seen.has(key)) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
seen.add(key);
|
|
196
|
+
result.push(value);
|
|
197
|
+
};
|
|
198
|
+
try {
|
|
199
|
+
for (var sources_1 = __values(sources), sources_1_1 = sources_1.next(); !sources_1_1.done; sources_1_1 = sources_1.next()) {
|
|
200
|
+
var source = sources_1_1.value;
|
|
201
|
+
pushCandidate(source);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
205
|
+
finally {
|
|
206
|
+
try {
|
|
207
|
+
if (sources_1_1 && !sources_1_1.done && (_a = sources_1.return)) _a.call(sources_1);
|
|
208
|
+
}
|
|
209
|
+
finally { if (e_3) throw e_3.error; }
|
|
210
|
+
}
|
|
211
|
+
return result;
|
|
212
|
+
}
|
|
213
|
+
function hotfixEvidenceArtifactPaths(evidence, normalized) {
|
|
214
|
+
var _a;
|
|
215
|
+
return [
|
|
216
|
+
normalized === null || normalized === void 0 ? void 0 : normalized.compiledArtifactPath,
|
|
217
|
+
normalized === null || normalized === void 0 ? void 0 : normalized.builtDistPath,
|
|
218
|
+
(_a = normalized === null || normalized === void 0 ? void 0 : normalized.target) === null || _a === void 0 ? void 0 : _a.artifactPath,
|
|
219
|
+
evidence.compiledArtifactPath,
|
|
220
|
+
evidence.compiled_artifact_path,
|
|
221
|
+
evidence.builtDistPath,
|
|
222
|
+
evidence.built_dist_path,
|
|
223
|
+
evidence.artifactPath,
|
|
224
|
+
evidence.artifact_path
|
|
225
|
+
].map(function (entry) { return cleanText(entry, 500); }).filter(Boolean).slice(0, 8);
|
|
226
|
+
}
|
|
227
|
+
function hotfixEvidenceGate(evidence, now) {
|
|
228
|
+
var _a, _b;
|
|
229
|
+
var validation = (0, ai_runner_manager_policy_1.validateResolveIOAIManagerHotfixEvidence)(evidence);
|
|
230
|
+
if (!validation.normalized && validation.status === 'missing') {
|
|
231
|
+
return undefined;
|
|
232
|
+
}
|
|
233
|
+
var status = validation.valid
|
|
234
|
+
? (validation.fullDeployAllowed ? 'warn' : 'pass')
|
|
235
|
+
: validation.status === 'blocked'
|
|
236
|
+
? 'blocked'
|
|
237
|
+
: 'fail';
|
|
238
|
+
var reason = validation.valid
|
|
239
|
+
? validation.fullDeployAllowed
|
|
240
|
+
? 'Hotfix evidence allows exactly one full deploy after force/new-artifact proof.'
|
|
241
|
+
: 'Hotfix evidence is sufficient; rerun the smallest release gate before continuing.'
|
|
242
|
+
: validation.blockers.join('; ');
|
|
243
|
+
return {
|
|
244
|
+
key: 'hotfix_evidence',
|
|
245
|
+
label: 'Hotfix evidence',
|
|
246
|
+
status: status,
|
|
247
|
+
reason: reason,
|
|
248
|
+
evidenceRefs: hotfixEvidenceArtifactPaths(evidence, validation.normalized),
|
|
249
|
+
recordedAt: isoNow(now || ((_a = validation.normalized) === null || _a === void 0 ? void 0 : _a.recordedAt)),
|
|
250
|
+
metadata: {
|
|
251
|
+
channel: validation.channel,
|
|
252
|
+
nextAction: validation.nextAction,
|
|
253
|
+
fullDeployAllowed: validation.fullDeployAllowed,
|
|
254
|
+
fullDeployBlocked: validation.fullDeployBlocked,
|
|
255
|
+
hotfixSatisfied: validation.hotfixSatisfied,
|
|
256
|
+
blockers: validation.blockers,
|
|
257
|
+
target: (_b = validation.normalized) === null || _b === void 0 ? void 0 : _b.target
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
function collectHotfixEvidenceEvents(sources, events, gates, now) {
|
|
262
|
+
var e_6, _a;
|
|
263
|
+
var _b, _c;
|
|
264
|
+
try {
|
|
265
|
+
for (var _d = __values(hotfixEvidenceCandidates.apply(void 0, __spreadArray([], __read(sources), false))), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
266
|
+
var evidence = _e.value;
|
|
267
|
+
var validation = (0, ai_runner_manager_policy_1.validateResolveIOAIManagerHotfixEvidence)(evidence);
|
|
268
|
+
if (!validation.normalized && validation.status === 'missing') {
|
|
269
|
+
continue;
|
|
270
|
+
}
|
|
271
|
+
var artifactPaths = hotfixEvidenceArtifactPaths(evidence, validation.normalized);
|
|
272
|
+
pushEvent(events, {
|
|
273
|
+
type: 'hotfix',
|
|
274
|
+
category: validation.channel || 'hotfix',
|
|
275
|
+
message: validation.valid
|
|
276
|
+
? "Hotfix evidence recorded for ".concat(validation.channel, ".")
|
|
277
|
+
: "Incomplete hotfix evidence for ".concat(validation.channel || 'unknown channel', "."),
|
|
278
|
+
artifactPaths: artifactPaths,
|
|
279
|
+
recordedAt: ((_b = validation.normalized) === null || _b === void 0 ? void 0 : _b.recordedAt) || eventDate(evidence),
|
|
280
|
+
metadata: {
|
|
281
|
+
status: validation.status,
|
|
282
|
+
nextAction: validation.nextAction,
|
|
283
|
+
fullDeployAllowed: validation.fullDeployAllowed,
|
|
284
|
+
fullDeployBlocked: validation.fullDeployBlocked,
|
|
285
|
+
hotfixSatisfied: validation.hotfixSatisfied,
|
|
286
|
+
blockers: validation.blockers,
|
|
287
|
+
target: (_c = validation.normalized) === null || _c === void 0 ? void 0 : _c.target
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
var gate = hotfixEvidenceGate(evidence, now);
|
|
291
|
+
if (gate) {
|
|
292
|
+
gates.push(gate);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
297
|
+
finally {
|
|
298
|
+
try {
|
|
299
|
+
if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
|
|
300
|
+
}
|
|
301
|
+
finally { if (e_6) throw e_6.error; }
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
function collectUsageEvents(entries, events) {
|
|
305
|
+
var e_7, _a;
|
|
128
306
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
129
307
|
if (!entries.length) {
|
|
130
308
|
return undefined;
|
|
@@ -155,17 +333,17 @@ function collectUsageEvents(entries, events) {
|
|
|
155
333
|
});
|
|
156
334
|
}
|
|
157
335
|
}
|
|
158
|
-
catch (
|
|
336
|
+
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
|
159
337
|
finally {
|
|
160
338
|
try {
|
|
161
339
|
if (normalizedEntries_1_1 && !normalizedEntries_1_1.done && (_a = normalizedEntries_1.return)) _a.call(normalizedEntries_1);
|
|
162
340
|
}
|
|
163
|
-
finally { if (
|
|
341
|
+
finally { if (e_7) throw e_7.error; }
|
|
164
342
|
}
|
|
165
343
|
return (0, ai_run_evidence_1.buildAIRunCost)(entries);
|
|
166
344
|
}
|
|
167
345
|
function collectCommitEvents(commits, events) {
|
|
168
|
-
var
|
|
346
|
+
var e_8, _a;
|
|
169
347
|
try {
|
|
170
348
|
for (var _b = __values(commits.slice(0, 80)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
171
349
|
var commit = _c.value;
|
|
@@ -181,12 +359,12 @@ function collectCommitEvents(commits, events) {
|
|
|
181
359
|
});
|
|
182
360
|
}
|
|
183
361
|
}
|
|
184
|
-
catch (
|
|
362
|
+
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
185
363
|
finally {
|
|
186
364
|
try {
|
|
187
365
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
188
366
|
}
|
|
189
|
-
finally { if (
|
|
367
|
+
finally { if (e_8) throw e_8.error; }
|
|
190
368
|
}
|
|
191
369
|
}
|
|
192
370
|
function statusFromBoolean(value, fallback) {
|
|
@@ -199,7 +377,7 @@ function statusFromBoolean(value, fallback) {
|
|
|
199
377
|
return fallback;
|
|
200
378
|
}
|
|
201
379
|
function collectArtifacts(evidence) {
|
|
202
|
-
var
|
|
380
|
+
var e_9, _a, e_10, _b;
|
|
203
381
|
var artifacts = [];
|
|
204
382
|
try {
|
|
205
383
|
for (var _c = __values(asArray(evidence === null || evidence === void 0 ? void 0 : evidence.artifacts)), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
@@ -214,12 +392,12 @@ function collectArtifacts(evidence) {
|
|
|
214
392
|
});
|
|
215
393
|
}
|
|
216
394
|
}
|
|
217
|
-
catch (
|
|
395
|
+
catch (e_9_1) { e_9 = { error: e_9_1 }; }
|
|
218
396
|
finally {
|
|
219
397
|
try {
|
|
220
398
|
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
221
399
|
}
|
|
222
|
-
finally { if (
|
|
400
|
+
finally { if (e_9) throw e_9.error; }
|
|
223
401
|
}
|
|
224
402
|
var screenshots = asArray((evidence === null || evidence === void 0 ? void 0 : evidence.screenshots) || (evidence === null || evidence === void 0 ? void 0 : evidence.qaScreenshots) || (evidence === null || evidence === void 0 ? void 0 : evidence.browserScreenshots));
|
|
225
403
|
try {
|
|
@@ -240,17 +418,17 @@ function collectArtifacts(evidence) {
|
|
|
240
418
|
}
|
|
241
419
|
}
|
|
242
420
|
}
|
|
243
|
-
catch (
|
|
421
|
+
catch (e_10_1) { e_10 = { error: e_10_1 }; }
|
|
244
422
|
finally {
|
|
245
423
|
try {
|
|
246
424
|
if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
|
|
247
425
|
}
|
|
248
|
-
finally { if (
|
|
426
|
+
finally { if (e_10) throw e_10.error; }
|
|
249
427
|
}
|
|
250
428
|
return artifacts;
|
|
251
429
|
}
|
|
252
430
|
function collectInfraChecks(evidence) {
|
|
253
|
-
var
|
|
431
|
+
var e_11, _a;
|
|
254
432
|
var _b;
|
|
255
433
|
var checks = [];
|
|
256
434
|
try {
|
|
@@ -267,12 +445,12 @@ function collectInfraChecks(evidence) {
|
|
|
267
445
|
});
|
|
268
446
|
}
|
|
269
447
|
}
|
|
270
|
-
catch (
|
|
448
|
+
catch (e_11_1) { e_11 = { error: e_11_1 }; }
|
|
271
449
|
finally {
|
|
272
450
|
try {
|
|
273
451
|
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
274
452
|
}
|
|
275
|
-
finally { if (
|
|
453
|
+
finally { if (e_11) throw e_11.error; }
|
|
276
454
|
}
|
|
277
455
|
if (evidence === null || evidence === void 0 ? void 0 : evidence.preflightStatus) {
|
|
278
456
|
checks.push({
|
|
@@ -305,7 +483,7 @@ function collectCompileResult(evidence) {
|
|
|
305
483
|
};
|
|
306
484
|
}
|
|
307
485
|
function collectRouteProbes(evidence) {
|
|
308
|
-
var
|
|
486
|
+
var e_12, _a, e_13, _b;
|
|
309
487
|
var probes = [];
|
|
310
488
|
try {
|
|
311
489
|
for (var _c = __values(asArray((evidence === null || evidence === void 0 ? void 0 : evidence.routeProbes) || (evidence === null || evidence === void 0 ? void 0 : evidence.routes) || (evidence === null || evidence === void 0 ? void 0 : evidence.browserRoutes))), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
@@ -324,12 +502,12 @@ function collectRouteProbes(evidence) {
|
|
|
324
502
|
});
|
|
325
503
|
}
|
|
326
504
|
}
|
|
327
|
-
catch (
|
|
505
|
+
catch (e_12_1) { e_12 = { error: e_12_1 }; }
|
|
328
506
|
finally {
|
|
329
507
|
try {
|
|
330
508
|
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
331
509
|
}
|
|
332
|
-
finally { if (
|
|
510
|
+
finally { if (e_12) throw e_12.error; }
|
|
333
511
|
}
|
|
334
512
|
var screenshots = asArray((evidence === null || evidence === void 0 ? void 0 : evidence.screenshots) || (evidence === null || evidence === void 0 ? void 0 : evidence.qaScreenshots) || (evidence === null || evidence === void 0 ? void 0 : evidence.browserScreenshots));
|
|
335
513
|
try {
|
|
@@ -351,17 +529,17 @@ function collectRouteProbes(evidence) {
|
|
|
351
529
|
}
|
|
352
530
|
}
|
|
353
531
|
}
|
|
354
|
-
catch (
|
|
532
|
+
catch (e_13_1) { e_13 = { error: e_13_1 }; }
|
|
355
533
|
finally {
|
|
356
534
|
try {
|
|
357
535
|
if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
|
|
358
536
|
}
|
|
359
|
-
finally { if (
|
|
537
|
+
finally { if (e_13) throw e_13.error; }
|
|
360
538
|
}
|
|
361
539
|
return probes;
|
|
362
540
|
}
|
|
363
541
|
function collectBusinessAssertions(evidence) {
|
|
364
|
-
var
|
|
542
|
+
var e_14, _a;
|
|
365
543
|
var assertions = [];
|
|
366
544
|
try {
|
|
367
545
|
for (var _b = __values(asArray((evidence === null || evidence === void 0 ? void 0 : evidence.businessAssertions) || (evidence === null || evidence === void 0 ? void 0 : evidence.workflowAssertions) || (evidence === null || evidence === void 0 ? void 0 : evidence.assertions))), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
@@ -382,12 +560,12 @@ function collectBusinessAssertions(evidence) {
|
|
|
382
560
|
});
|
|
383
561
|
}
|
|
384
562
|
}
|
|
385
|
-
catch (
|
|
563
|
+
catch (e_14_1) { e_14 = { error: e_14_1 }; }
|
|
386
564
|
finally {
|
|
387
565
|
try {
|
|
388
566
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
389
567
|
}
|
|
390
|
-
finally { if (
|
|
568
|
+
finally { if (e_14) throw e_14.error; }
|
|
391
569
|
}
|
|
392
570
|
if (!assertions.length && (evidence === null || evidence === void 0 ? void 0 : evidence.qaRunOutcome) === 'business_assertion_passed') {
|
|
393
571
|
assertions.push({
|
|
@@ -446,7 +624,7 @@ function businessAssertionPassed(assertion) {
|
|
|
446
624
|
return /^(pass|passed|success|ok|done)$/i.test(cleanText(assertion.status, 40));
|
|
447
625
|
}
|
|
448
626
|
function supportAssertionMatchesDiagnosisProof(assertion, proofPlan) {
|
|
449
|
-
var
|
|
627
|
+
var e_15, _a;
|
|
450
628
|
var metadata = assertion.metadata || {};
|
|
451
629
|
if (metadata.diagnosisProofPlanMatched === true || metadata.proofPlanMatched === true || metadata.supportDiagnosisProof === true) {
|
|
452
630
|
return true;
|
|
@@ -491,12 +669,12 @@ function supportAssertionMatchesDiagnosisProof(assertion, proofPlan) {
|
|
|
491
669
|
}
|
|
492
670
|
}
|
|
493
671
|
}
|
|
494
|
-
catch (
|
|
672
|
+
catch (e_15_1) { e_15 = { error: e_15_1 }; }
|
|
495
673
|
finally {
|
|
496
674
|
try {
|
|
497
675
|
if (proofTokens_1_1 && !proofTokens_1_1.done && (_a = proofTokens_1.return)) _a.call(proofTokens_1);
|
|
498
676
|
}
|
|
499
|
-
finally { if (
|
|
677
|
+
finally { if (e_15) throw e_15.error; }
|
|
500
678
|
}
|
|
501
679
|
return overlap >= Math.min(4, Math.max(3, Math.ceil(proofTokens.size * 0.45)));
|
|
502
680
|
}
|
|
@@ -539,7 +717,7 @@ function applySupportDiagnosisProofGate(qa, diagnosisGate, now) {
|
|
|
539
717
|
], false) });
|
|
540
718
|
}
|
|
541
719
|
function evidenceObject() {
|
|
542
|
-
var
|
|
720
|
+
var e_16, _a;
|
|
543
721
|
var values = [];
|
|
544
722
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
545
723
|
values[_i] = arguments[_i];
|
|
@@ -552,22 +730,23 @@ function evidenceObject() {
|
|
|
552
730
|
}
|
|
553
731
|
}
|
|
554
732
|
}
|
|
555
|
-
catch (
|
|
733
|
+
catch (e_16_1) { e_16 = { error: e_16_1 }; }
|
|
556
734
|
finally {
|
|
557
735
|
try {
|
|
558
736
|
if (values_1_1 && !values_1_1.done && (_a = values_1.return)) _a.call(values_1);
|
|
559
737
|
}
|
|
560
|
-
finally { if (
|
|
738
|
+
finally { if (e_16) throw e_16.error; }
|
|
561
739
|
}
|
|
562
740
|
return {};
|
|
563
741
|
}
|
|
564
742
|
function buildSupportAIRunFromEvidence(input) {
|
|
565
|
-
var
|
|
743
|
+
var e_17, _a, e_18, _b;
|
|
566
744
|
var _c, _d, _e, _f;
|
|
567
745
|
var ticket = input.ticket || {};
|
|
568
746
|
var job = input.job || {};
|
|
569
747
|
var evidence = evidenceObject(input.qaEvidence, job.qaEvidence, job.qa_evidence, ticket.qaEvidence, ticket.qa_evidence);
|
|
570
748
|
var events = [];
|
|
749
|
+
var gates = [];
|
|
571
750
|
var sourceIds = {};
|
|
572
751
|
addSourceId(sourceIds, 'ticketId', ticket._id || ticket.id || job.ticketId || job.supportTicketId);
|
|
573
752
|
addSourceId(sourceIds, 'ticketNumber', ticket.ticketNumber || ticket.number || job.ticketNumber);
|
|
@@ -589,12 +768,12 @@ function buildSupportAIRunFromEvidence(input) {
|
|
|
589
768
|
});
|
|
590
769
|
}
|
|
591
770
|
}
|
|
592
|
-
catch (
|
|
771
|
+
catch (e_17_1) { e_17 = { error: e_17_1 }; }
|
|
593
772
|
finally {
|
|
594
773
|
try {
|
|
595
774
|
if (_h && !_h.done && (_a = _g.return)) _a.call(_g);
|
|
596
775
|
}
|
|
597
|
-
finally { if (
|
|
776
|
+
finally { if (e_17) throw e_17.error; }
|
|
598
777
|
}
|
|
599
778
|
try {
|
|
600
779
|
for (var _j = __values(asArray(input.aiJobs)), _k = _j.next(); !_k.done; _k = _j.next()) {
|
|
@@ -613,14 +792,15 @@ function buildSupportAIRunFromEvidence(input) {
|
|
|
613
792
|
});
|
|
614
793
|
}
|
|
615
794
|
}
|
|
616
|
-
catch (
|
|
795
|
+
catch (e_18_1) { e_18 = { error: e_18_1 }; }
|
|
617
796
|
finally {
|
|
618
797
|
try {
|
|
619
798
|
if (_k && !_k.done && (_b = _j.return)) _b.call(_j);
|
|
620
799
|
}
|
|
621
|
-
finally { if (
|
|
800
|
+
finally { if (e_18) throw e_18.error; }
|
|
622
801
|
}
|
|
623
802
|
collectCommitEvents(asArray(input.commits), events);
|
|
803
|
+
collectHotfixEvidenceEvents([job, ticket, evidence, input.qaEvidence], events, gates, input.now);
|
|
624
804
|
var cost = collectUsageEvents(asArray(input.usageLedger), events);
|
|
625
805
|
var diagnosisGate = evidenceObject(job.supportV5DiagnosisGate, job.support_v5_diagnosis_gate, job.diagnosisGate, ticket.supportV5DiagnosisGate, ticket.diagnosisGate, evidence.diagnosisGate, evidence.supportV5DiagnosisGate);
|
|
626
806
|
var qa = applySupportDiagnosisProofGate(buildQaFromEvidence(evidence, input.now), diagnosisGate, input.now);
|
|
@@ -647,6 +827,7 @@ function buildSupportAIRunFromEvidence(input) {
|
|
|
647
827
|
startedAt: dateValue(job, ['startedAt', 'createdAt']) || dateValue(ticket, ['createdAt']),
|
|
648
828
|
completedAt: dateValue(job, ['completedAt', 'finishedAt', 'updatedAt']),
|
|
649
829
|
events: events,
|
|
830
|
+
gates: gates,
|
|
650
831
|
qa: qa,
|
|
651
832
|
cost: cost,
|
|
652
833
|
scorecardPassed: evidence.scorecardPassed === true || evidence.scorecardStatus === 'pass',
|
|
@@ -673,12 +854,13 @@ function buildSupportAIRunFromEvidence(input) {
|
|
|
673
854
|
});
|
|
674
855
|
}
|
|
675
856
|
function buildAICoderAIRunFromEvidence(input) {
|
|
676
|
-
var
|
|
857
|
+
var e_19, _a;
|
|
677
858
|
var _b, _c, _d, _e, _f, _g, _h;
|
|
678
859
|
var app = input.app || {};
|
|
679
860
|
var job = input.job || {};
|
|
680
861
|
var evidence = evidenceObject(input.qaEvidence, job.qaEvidence, job.qa_evidence, app.qaEvidence, app.qa_evidence);
|
|
681
862
|
var events = [];
|
|
863
|
+
var gates = [];
|
|
682
864
|
var sourceIds = {};
|
|
683
865
|
addSourceId(sourceIds, 'appId', app._id || app.id || job.appId || job.aicoderAppId);
|
|
684
866
|
addSourceId(sourceIds, 'jobId', job._id || job.id || job.jobId);
|
|
@@ -700,14 +882,15 @@ function buildAICoderAIRunFromEvidence(input) {
|
|
|
700
882
|
});
|
|
701
883
|
}
|
|
702
884
|
}
|
|
703
|
-
catch (
|
|
885
|
+
catch (e_19_1) { e_19 = { error: e_19_1 }; }
|
|
704
886
|
finally {
|
|
705
887
|
try {
|
|
706
888
|
if (_k && !_k.done && (_a = _j.return)) _a.call(_j);
|
|
707
889
|
}
|
|
708
|
-
finally { if (
|
|
890
|
+
finally { if (e_19) throw e_19.error; }
|
|
709
891
|
}
|
|
710
892
|
collectCommitEvents(asArray(input.commits), events);
|
|
893
|
+
collectHotfixEvidenceEvents([job, app, evidence, input.qaEvidence], events, gates, input.now);
|
|
711
894
|
var cost = collectUsageEvents(asArray(input.usageLedger), events);
|
|
712
895
|
var qa = buildQaFromEvidence(evidence, input.now);
|
|
713
896
|
var scorecardPassed = evidence.scorecardPassed === true
|
|
@@ -722,6 +905,7 @@ function buildAICoderAIRunFromEvidence(input) {
|
|
|
722
905
|
startedAt: dateValue(job, ['startedAt', 'createdAt']) || dateValue(app, ['createdAt']),
|
|
723
906
|
completedAt: dateValue(job, ['completedAt', 'finishedAt', 'updatedAt']),
|
|
724
907
|
events: events,
|
|
908
|
+
gates: gates,
|
|
725
909
|
qa: qa,
|
|
726
910
|
cost: cost,
|
|
727
911
|
scorecardPassed: scorecardPassed,
|
|
@@ -742,7 +926,7 @@ function buildAICoderAIRunFromEvidence(input) {
|
|
|
742
926
|
});
|
|
743
927
|
}
|
|
744
928
|
function buildAssistantAIRunFromEvidence(input) {
|
|
745
|
-
var
|
|
929
|
+
var e_20, _a, e_21, _b;
|
|
746
930
|
var _c;
|
|
747
931
|
var conversation = input.conversation || {};
|
|
748
932
|
var events = [];
|
|
@@ -768,12 +952,12 @@ function buildAssistantAIRunFromEvidence(input) {
|
|
|
768
952
|
});
|
|
769
953
|
}
|
|
770
954
|
}
|
|
771
|
-
catch (
|
|
955
|
+
catch (e_20_1) { e_20 = { error: e_20_1 }; }
|
|
772
956
|
finally {
|
|
773
957
|
try {
|
|
774
958
|
if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
|
|
775
959
|
}
|
|
776
|
-
finally { if (
|
|
960
|
+
finally { if (e_20) throw e_20.error; }
|
|
777
961
|
}
|
|
778
962
|
try {
|
|
779
963
|
for (var _f = __values(asArray(input.issueReports)), _g = _f.next(); !_g.done; _g = _f.next()) {
|
|
@@ -791,12 +975,12 @@ function buildAssistantAIRunFromEvidence(input) {
|
|
|
791
975
|
});
|
|
792
976
|
}
|
|
793
977
|
}
|
|
794
|
-
catch (
|
|
978
|
+
catch (e_21_1) { e_21 = { error: e_21_1 }; }
|
|
795
979
|
finally {
|
|
796
980
|
try {
|
|
797
981
|
if (_g && !_g.done && (_b = _f.return)) _b.call(_f);
|
|
798
982
|
}
|
|
799
|
-
finally { if (
|
|
983
|
+
finally { if (e_21) throw e_21.error; }
|
|
800
984
|
}
|
|
801
985
|
var cost = collectUsageEvents(asArray(input.usageLedger), events);
|
|
802
986
|
var correctnessEvidence = {
|