@resolveio/server-lib 22.3.163 → 22.3.164

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.
@@ -219,13 +219,12 @@ function supportManagerFailureRecords(job, evidence) {
219
219
  pushRecord(currentFailure);
220
220
  return records.slice(-80);
221
221
  }
222
- function supportManagerNoBlindLoopGate(job, evidence, now) {
222
+ function managerNoBlindLoopGateFromHistory(history, budgetSource, now) {
223
223
  var _a;
224
- var history = supportManagerFailureRecords(job, evidence);
225
224
  if (!history.length) {
226
225
  return undefined;
227
226
  }
228
- var budget = plainObject(job.supportV5Budget || job.support_v5_budget || evidence.supportV5Budget || evidence.support_v5_budget);
227
+ var budget = plainObject(budgetSource);
229
228
  var maxSameFailureRepeats = Math.max(1, Number(budget.maxRepeatedNoProgress || budget.max_repeated_no_progress || budget.maxSameFailureRepeats || budget.max_same_failure_repeats || 3) || 3);
230
229
  var decision = (0, ai_runner_manager_policy_1.decideResolveIOAIManagerPolicy)({
231
230
  history: history,
@@ -271,8 +270,176 @@ function supportManagerNoBlindLoopGate(job, evidence, now) {
271
270
  }
272
271
  };
273
272
  }
273
+ function supportManagerNoBlindLoopGate(job, evidence, now) {
274
+ return managerNoBlindLoopGateFromHistory(supportManagerFailureRecords(job, evidence), job.supportV5Budget || job.support_v5_budget || evidence.supportV5Budget || evidence.support_v5_budget, now);
275
+ }
276
+ function aicoderManagerFailureRecords(app, job, evidence) {
277
+ var e_5, _a, e_6, _b, e_7, _c, e_8, _d;
278
+ var records = [];
279
+ var pushRecord = function (value, fallback) {
280
+ if (fallback === void 0) { fallback = {}; }
281
+ var record = normalizeManagerFailureRecord(value, __assign({ lane: 'aicoder', stepType: 'workflow_step' }, fallback));
282
+ if (record) {
283
+ records.push(record);
284
+ }
285
+ };
286
+ var historySources = [
287
+ job.aicoderV6StepHistory,
288
+ job.aiCoderV6StepHistory,
289
+ job.aicoder_v6_step_history,
290
+ job.ai_coder_v6_step_history,
291
+ job.workflowStepHistory,
292
+ job.workflow_step_history,
293
+ job.stepHistory,
294
+ job.step_history,
295
+ job.managerFailureHistory,
296
+ job.manager_failure_history,
297
+ app.aicoderV6StepHistory,
298
+ app.aiCoderV6StepHistory,
299
+ app.aicoder_v6_step_history,
300
+ app.ai_coder_v6_step_history,
301
+ app.workflowStepHistory,
302
+ app.workflow_step_history,
303
+ evidence.aicoderV6StepHistory,
304
+ evidence.aiCoderV6StepHistory,
305
+ evidence.aicoder_v6_step_history,
306
+ evidence.ai_coder_v6_step_history,
307
+ evidence.workflowStepHistory,
308
+ evidence.workflow_step_history,
309
+ evidence.stepHistory,
310
+ evidence.step_history,
311
+ evidence.managerFailureHistory,
312
+ evidence.manager_failure_history
313
+ ];
314
+ try {
315
+ for (var historySources_1 = __values(historySources), historySources_1_1 = historySources_1.next(); !historySources_1_1.done; historySources_1_1 = historySources_1.next()) {
316
+ var source = historySources_1_1.value;
317
+ try {
318
+ for (var _e = (e_6 = void 0, __values(asArray(source))), _f = _e.next(); !_f.done; _f = _e.next()) {
319
+ var entry = _f.value;
320
+ pushRecord(entry);
321
+ }
322
+ }
323
+ catch (e_6_1) { e_6 = { error: e_6_1 }; }
324
+ finally {
325
+ try {
326
+ if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
327
+ }
328
+ finally { if (e_6) throw e_6.error; }
329
+ }
330
+ }
331
+ }
332
+ catch (e_5_1) { e_5 = { error: e_5_1 }; }
333
+ finally {
334
+ try {
335
+ if (historySources_1_1 && !historySources_1_1.done && (_a = historySources_1.return)) _a.call(historySources_1);
336
+ }
337
+ finally { if (e_5) throw e_5.error; }
338
+ }
339
+ var fingerprintSources = [
340
+ job.aicoderV6FailureFingerprints,
341
+ job.aiCoderV6FailureFingerprints,
342
+ job.aicoder_v6_failure_fingerprints,
343
+ job.ai_coder_v6_failure_fingerprints,
344
+ job.workflowFailureFingerprints,
345
+ job.workflow_failure_fingerprints,
346
+ job.failureFingerprints,
347
+ job.failure_fingerprints,
348
+ app.aicoderV6FailureFingerprints,
349
+ app.aiCoderV6FailureFingerprints,
350
+ app.aicoder_v6_failure_fingerprints,
351
+ app.ai_coder_v6_failure_fingerprints,
352
+ evidence.aicoderV6FailureFingerprints,
353
+ evidence.aiCoderV6FailureFingerprints,
354
+ evidence.aicoder_v6_failure_fingerprints,
355
+ evidence.ai_coder_v6_failure_fingerprints,
356
+ evidence.workflowFailureFingerprints,
357
+ evidence.workflow_failure_fingerprints,
358
+ evidence.failureFingerprints,
359
+ evidence.failure_fingerprints
360
+ ];
361
+ try {
362
+ for (var fingerprintSources_1 = __values(fingerprintSources), fingerprintSources_1_1 = fingerprintSources_1.next(); !fingerprintSources_1_1.done; fingerprintSources_1_1 = fingerprintSources_1.next()) {
363
+ var source = fingerprintSources_1_1.value;
364
+ try {
365
+ for (var _g = (e_8 = void 0, __values(asArray(source))), _h = _g.next(); !_h.done; _h = _g.next()) {
366
+ var entry = _h.value;
367
+ var fingerprint = plainObject(entry);
368
+ var count = Math.max(1, Math.min(8, Number(fingerprint.count || fingerprint.repeatedCount || fingerprint.repeated_count || 1) || 1));
369
+ var fallback = {
370
+ lane: cleanText(fingerprint.lane || 'aicoder', 80),
371
+ stepType: cleanText(fingerprint.stepType || fingerprint.step_type || 'workflow_step', 80),
372
+ outcome: cleanText(fingerprint.outcome || 'needs_repair', 80),
373
+ failureClass: cleanText(fingerprint.failureClass || fingerprint.failure_class || fingerprint.class, 120),
374
+ blocker: cleanText(fingerprint.blocker || fingerprint.reason || fingerprint.summary, 1200),
375
+ blockerFingerprint: cleanText(fingerprint.blockerFingerprint || fingerprint.blocker_fingerprint, 180),
376
+ evidenceHash: cleanText(fingerprint.evidenceHash || fingerprint.evidence_hash, 180)
377
+ };
378
+ for (var index = 0; index < count; index += 1) {
379
+ pushRecord(fingerprint, fallback);
380
+ }
381
+ }
382
+ }
383
+ catch (e_8_1) { e_8 = { error: e_8_1 }; }
384
+ finally {
385
+ try {
386
+ if (_h && !_h.done && (_d = _g.return)) _d.call(_g);
387
+ }
388
+ finally { if (e_8) throw e_8.error; }
389
+ }
390
+ }
391
+ }
392
+ catch (e_7_1) { e_7 = { error: e_7_1 }; }
393
+ finally {
394
+ try {
395
+ if (fingerprintSources_1_1 && !fingerprintSources_1_1.done && (_c = fingerprintSources_1.return)) _c.call(fingerprintSources_1);
396
+ }
397
+ finally { if (e_7) throw e_7.error; }
398
+ }
399
+ var currentFailure = evidenceObject(job.aicoderV6CurrentFailure, job.aiCoderV6CurrentFailure, job.aicoder_v6_current_failure, job.ai_coder_v6_current_failure, job.workflowCurrentFailure, job.workflow_current_failure, job.currentFailure, job.current_failure, evidence.aicoderV6CurrentFailure, evidence.aiCoderV6CurrentFailure, evidence.aicoder_v6_current_failure, evidence.ai_coder_v6_current_failure, evidence.workflowCurrentFailure, evidence.workflow_current_failure, evidence.currentFailure, evidence.current_failure);
400
+ pushRecord(currentFailure);
401
+ return records.slice(-80);
402
+ }
403
+ function aicoderManagerNoBlindLoopGate(app, job, evidence, now) {
404
+ return managerNoBlindLoopGateFromHistory(aicoderManagerFailureRecords(app, job, evidence), job.aicoderV6Budget
405
+ || job.aiCoderV6Budget
406
+ || job.aicoder_v6_budget
407
+ || job.ai_coder_v6_budget
408
+ || evidence.aicoderV6Budget
409
+ || evidence.aiCoderV6Budget
410
+ || evidence.aicoder_v6_budget
411
+ || evidence.ai_coder_v6_budget
412
+ || app.aicoderV6Budget
413
+ || app.aiCoderV6Budget
414
+ || app.aicoder_v6_budget
415
+ || app.ai_coder_v6_budget
416
+ || job.budget
417
+ || evidence.budget, now);
418
+ }
419
+ function managerNoBlindLoopMetadata(gate) {
420
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
421
+ if (!gate) {
422
+ return undefined;
423
+ }
424
+ return {
425
+ action: cleanText((_a = gate.metadata) === null || _a === void 0 ? void 0 : _a.action, 120),
426
+ status: gate.status,
427
+ failureClass: cleanText((_b = gate.metadata) === null || _b === void 0 ? void 0 : _b.failureClass, 120),
428
+ sameFailureCount: Number(((_c = gate.metadata) === null || _c === void 0 ? void 0 : _c.sameFailureCount) || 0),
429
+ pingPongCount: Number(((_d = gate.metadata) === null || _d === void 0 ? void 0 : _d.pingPongCount) || 0),
430
+ newEvidence: ((_e = gate.metadata) === null || _e === void 0 ? void 0 : _e.newEvidence) === true,
431
+ materialEvidence: ((_f = gate.metadata) === null || _f === void 0 ? void 0 : _f.materialEvidence) === true,
432
+ evidenceStrength: cleanText((_g = gate.metadata) === null || _g === void 0 ? void 0 : _g.evidenceStrength, 120),
433
+ loopBudgetShouldReset: ((_h = gate.metadata) === null || _h === void 0 ? void 0 : _h.loopBudgetShouldReset) === true,
434
+ dispatchAction: cleanText((_j = gate.metadata) === null || _j === void 0 ? void 0 : _j.dispatchAction, 160),
435
+ productRepairAllowed: ((_k = gate.metadata) === null || _k === void 0 ? void 0 : _k.productRepairAllowed) === true,
436
+ expensiveModelAllowed: ((_l = gate.metadata) === null || _l === void 0 ? void 0 : _l.expensiveModelAllowed) === true,
437
+ productRepairFailure: ((_m = gate.metadata) === null || _m === void 0 ? void 0 : _m.productRepairFailure) === true,
438
+ requiresNewEvidence: ((_o = gate.metadata) === null || _o === void 0 ? void 0 : _o.requiresNewEvidence) === true
439
+ };
440
+ }
274
441
  function hotfixEvidenceCandidates() {
275
- var e_5, _a;
442
+ var e_9, _a;
276
443
  var sources = [];
277
444
  for (var _i = 0; _i < arguments.length; _i++) {
278
445
  sources[_i] = arguments[_i];
@@ -280,7 +447,7 @@ function hotfixEvidenceCandidates() {
280
447
  var result = [];
281
448
  var seen = new Set();
282
449
  var pushCandidate = function (value) {
283
- var e_6, _a, e_7, _b;
450
+ var e_10, _a, e_11, _b;
284
451
  var _c, _d;
285
452
  if (Array.isArray(value)) {
286
453
  try {
@@ -289,12 +456,12 @@ function hotfixEvidenceCandidates() {
289
456
  pushCandidate(entry);
290
457
  }
291
458
  }
292
- catch (e_6_1) { e_6 = { error: e_6_1 }; }
459
+ catch (e_10_1) { e_10 = { error: e_10_1 }; }
293
460
  finally {
294
461
  try {
295
462
  if (value_1_1 && !value_1_1.done && (_a = value_1.return)) _a.call(value_1);
296
463
  }
297
- finally { if (e_6) throw e_6.error; }
464
+ finally { if (e_10) throw e_10.error; }
298
465
  }
299
466
  return;
300
467
  }
@@ -318,12 +485,12 @@ function hotfixEvidenceCandidates() {
318
485
  pushCandidate(nestedValue);
319
486
  }
320
487
  }
321
- catch (e_7_1) { e_7 = { error: e_7_1 }; }
488
+ catch (e_11_1) { e_11 = { error: e_11_1 }; }
322
489
  finally {
323
490
  try {
324
491
  if (nestedValues_1_1 && !nestedValues_1_1.done && (_b = nestedValues_1.return)) _b.call(nestedValues_1);
325
492
  }
326
- finally { if (e_7) throw e_7.error; }
493
+ finally { if (e_11) throw e_11.error; }
327
494
  }
328
495
  return;
329
496
  }
@@ -348,12 +515,12 @@ function hotfixEvidenceCandidates() {
348
515
  pushCandidate(source);
349
516
  }
350
517
  }
351
- catch (e_5_1) { e_5 = { error: e_5_1 }; }
518
+ catch (e_9_1) { e_9 = { error: e_9_1 }; }
352
519
  finally {
353
520
  try {
354
521
  if (sources_1_1 && !sources_1_1.done && (_a = sources_1.return)) _a.call(sources_1);
355
522
  }
356
- finally { if (e_5) throw e_5.error; }
523
+ finally { if (e_9) throw e_9.error; }
357
524
  }
358
525
  return result;
359
526
  }
@@ -444,7 +611,7 @@ function hotfixCommitProofGate(evidence, now) {
444
611
  };
445
612
  }
446
613
  function collectHotfixEvidenceEvents(sources, events, gates, now) {
447
- var e_8, _a;
614
+ var e_12, _a;
448
615
  var _b, _c;
449
616
  try {
450
617
  for (var _d = __values(hotfixEvidenceCandidates.apply(void 0, __spreadArray([], __read(sources), false))), _e = _d.next(); !_e.done; _e = _d.next()) {
@@ -491,16 +658,16 @@ function collectHotfixEvidenceEvents(sources, events, gates, now) {
491
658
  }
492
659
  }
493
660
  }
494
- catch (e_8_1) { e_8 = { error: e_8_1 }; }
661
+ catch (e_12_1) { e_12 = { error: e_12_1 }; }
495
662
  finally {
496
663
  try {
497
664
  if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
498
665
  }
499
- finally { if (e_8) throw e_8.error; }
666
+ finally { if (e_12) throw e_12.error; }
500
667
  }
501
668
  }
502
669
  function collectUsageEvents(entries, events) {
503
- var e_9, _a;
670
+ var e_13, _a;
504
671
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
505
672
  if (!entries.length) {
506
673
  return undefined;
@@ -531,17 +698,17 @@ function collectUsageEvents(entries, events) {
531
698
  });
532
699
  }
533
700
  }
534
- catch (e_9_1) { e_9 = { error: e_9_1 }; }
701
+ catch (e_13_1) { e_13 = { error: e_13_1 }; }
535
702
  finally {
536
703
  try {
537
704
  if (normalizedEntries_1_1 && !normalizedEntries_1_1.done && (_a = normalizedEntries_1.return)) _a.call(normalizedEntries_1);
538
705
  }
539
- finally { if (e_9) throw e_9.error; }
706
+ finally { if (e_13) throw e_13.error; }
540
707
  }
541
708
  return (0, ai_run_evidence_1.buildAIRunCost)(entries);
542
709
  }
543
710
  function collectCommitEvents(commits, events) {
544
- var e_10, _a;
711
+ var e_14, _a;
545
712
  try {
546
713
  for (var _b = __values(commits.slice(0, 80)), _c = _b.next(); !_c.done; _c = _b.next()) {
547
714
  var commit = _c.value;
@@ -557,12 +724,12 @@ function collectCommitEvents(commits, events) {
557
724
  });
558
725
  }
559
726
  }
560
- catch (e_10_1) { e_10 = { error: e_10_1 }; }
727
+ catch (e_14_1) { e_14 = { error: e_14_1 }; }
561
728
  finally {
562
729
  try {
563
730
  if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
564
731
  }
565
- finally { if (e_10) throw e_10.error; }
732
+ finally { if (e_14) throw e_14.error; }
566
733
  }
567
734
  }
568
735
  function statusFromBoolean(value, fallback) {
@@ -575,7 +742,7 @@ function statusFromBoolean(value, fallback) {
575
742
  return fallback;
576
743
  }
577
744
  function collectArtifacts(evidence) {
578
- var e_11, _a, e_12, _b, e_13, _c;
745
+ var e_15, _a, e_16, _b, e_17, _c;
579
746
  var artifacts = [];
580
747
  try {
581
748
  for (var _d = __values(asArray(evidence === null || evidence === void 0 ? void 0 : evidence.artifacts)), _e = _d.next(); !_e.done; _e = _d.next()) {
@@ -590,12 +757,12 @@ function collectArtifacts(evidence) {
590
757
  });
591
758
  }
592
759
  }
593
- catch (e_11_1) { e_11 = { error: e_11_1 }; }
760
+ catch (e_15_1) { e_15 = { error: e_15_1 }; }
594
761
  finally {
595
762
  try {
596
763
  if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
597
764
  }
598
- finally { if (e_11) throw e_11.error; }
765
+ finally { if (e_15) throw e_15.error; }
599
766
  }
600
767
  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));
601
768
  try {
@@ -616,12 +783,12 @@ function collectArtifacts(evidence) {
616
783
  }
617
784
  }
618
785
  }
619
- catch (e_12_1) { e_12 = { error: e_12_1 }; }
786
+ catch (e_16_1) { e_16 = { error: e_16_1 }; }
620
787
  finally {
621
788
  try {
622
789
  if (_g && !_g.done && (_b = _f.return)) _b.call(_f);
623
790
  }
624
- finally { if (e_12) throw e_12.error; }
791
+ finally { if (e_16) throw e_16.error; }
625
792
  }
626
793
  var artifactRefs = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(asArray(evidence === null || evidence === void 0 ? void 0 : evidence.artifactPaths)), false), __read(asArray(evidence === null || evidence === void 0 ? void 0 : evidence.artifact_paths)), false), __read(asArray(evidence === null || evidence === void 0 ? void 0 : evidence.runnerEvidenceArtifacts)), false), __read(asArray(evidence === null || evidence === void 0 ? void 0 : evidence.runner_evidence_artifacts)), false), __read(asArray(evidence === null || evidence === void 0 ? void 0 : evidence.supportQaArtifacts)), false), __read(asArray(evidence === null || evidence === void 0 ? void 0 : evidence.support_qa_artifacts)), false), __read(asArray(evidence === null || evidence === void 0 ? void 0 : evidence.qa_artifacts)), false);
627
794
  try {
@@ -642,17 +809,17 @@ function collectArtifacts(evidence) {
642
809
  }
643
810
  }
644
811
  }
645
- catch (e_13_1) { e_13 = { error: e_13_1 }; }
812
+ catch (e_17_1) { e_17 = { error: e_17_1 }; }
646
813
  finally {
647
814
  try {
648
815
  if (_j && !_j.done && (_c = _h.return)) _c.call(_h);
649
816
  }
650
- finally { if (e_13) throw e_13.error; }
817
+ finally { if (e_17) throw e_17.error; }
651
818
  }
652
819
  return artifacts;
653
820
  }
654
821
  function collectInfraChecks(evidence) {
655
- var e_14, _a;
822
+ var e_18, _a;
656
823
  var _b;
657
824
  var checks = [];
658
825
  try {
@@ -669,12 +836,12 @@ function collectInfraChecks(evidence) {
669
836
  });
670
837
  }
671
838
  }
672
- catch (e_14_1) { e_14 = { error: e_14_1 }; }
839
+ catch (e_18_1) { e_18 = { error: e_18_1 }; }
673
840
  finally {
674
841
  try {
675
842
  if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
676
843
  }
677
- finally { if (e_14) throw e_14.error; }
844
+ finally { if (e_18) throw e_18.error; }
678
845
  }
679
846
  if (evidence === null || evidence === void 0 ? void 0 : evidence.preflightStatus) {
680
847
  checks.push({
@@ -707,7 +874,7 @@ function collectCompileResult(evidence) {
707
874
  };
708
875
  }
709
876
  function collectRouteProbes(evidence) {
710
- var e_15, _a, e_16, _b;
877
+ var e_19, _a, e_20, _b;
711
878
  var probes = [];
712
879
  var rows = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(asArray(evidence === null || evidence === void 0 ? void 0 : evidence.routeProbes)), false), __read(asArray(evidence === null || evidence === void 0 ? void 0 : evidence.route_probes)), false), __read(asArray(evidence === null || evidence === void 0 ? void 0 : evidence.routes)), false), __read(asArray(evidence === null || evidence === void 0 ? void 0 : evidence.browserRoutes)), false), __read(asArray(evidence === null || evidence === void 0 ? void 0 : evidence.browser_routes)), false), __read(asArray(evidence === null || evidence === void 0 ? void 0 : evidence.workflowProbes)), false), __read(asArray(evidence === null || evidence === void 0 ? void 0 : evidence.workflow_probes)), false);
713
880
  var directProbe = plainObject((evidence === null || evidence === void 0 ? void 0 : evidence.routeProbe) || (evidence === null || evidence === void 0 ? void 0 : evidence.route_probe) || (evidence === null || evidence === void 0 ? void 0 : evidence.workflowProbe) || (evidence === null || evidence === void 0 ? void 0 : evidence.workflow_probe));
@@ -731,12 +898,12 @@ function collectRouteProbes(evidence) {
731
898
  });
732
899
  }
733
900
  }
734
- catch (e_15_1) { e_15 = { error: e_15_1 }; }
901
+ catch (e_19_1) { e_19 = { error: e_19_1 }; }
735
902
  finally {
736
903
  try {
737
904
  if (rows_1_1 && !rows_1_1.done && (_a = rows_1.return)) _a.call(rows_1);
738
905
  }
739
- finally { if (e_15) throw e_15.error; }
906
+ finally { if (e_19) throw e_19.error; }
740
907
  }
741
908
  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));
742
909
  try {
@@ -758,17 +925,17 @@ function collectRouteProbes(evidence) {
758
925
  }
759
926
  }
760
927
  }
761
- catch (e_16_1) { e_16 = { error: e_16_1 }; }
928
+ catch (e_20_1) { e_20 = { error: e_20_1 }; }
762
929
  finally {
763
930
  try {
764
931
  if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
765
932
  }
766
- finally { if (e_16) throw e_16.error; }
933
+ finally { if (e_20) throw e_20.error; }
767
934
  }
768
935
  return probes;
769
936
  }
770
937
  function collectBusinessAssertions(evidence) {
771
- var e_17, _a;
938
+ var e_21, _a;
772
939
  var assertions = [];
773
940
  var rows = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(asArray(evidence === null || evidence === void 0 ? void 0 : evidence.businessAssertions)), false), __read(asArray(evidence === null || evidence === void 0 ? void 0 : evidence.business_assertions)), false), __read(asArray(evidence === null || evidence === void 0 ? void 0 : evidence.workflowAssertions)), false), __read(asArray(evidence === null || evidence === void 0 ? void 0 : evidence.workflow_assertions)), false), __read(asArray(evidence === null || evidence === void 0 ? void 0 : evidence.assertions)), false), __read(asArray(evidence === null || evidence === void 0 ? void 0 : evidence.qaRows)), false), __read(asArray(evidence === null || evidence === void 0 ? void 0 : evidence.qa_rows)), false), __read(asArray(evidence === null || evidence === void 0 ? void 0 : evidence.rows)), false), __read(asArray(evidence === null || evidence === void 0 ? void 0 : evidence.supportQaAssertions)), false), __read(asArray(evidence === null || evidence === void 0 ? void 0 : evidence.support_qa_assertions)), false), __read(asArray(evidence === null || evidence === void 0 ? void 0 : evidence.aiQaBusinessAssertions)), false), __read(asArray(evidence === null || evidence === void 0 ? void 0 : evidence.ai_qa_business_assertions)), false);
774
941
  try {
@@ -791,12 +958,12 @@ function collectBusinessAssertions(evidence) {
791
958
  });
792
959
  }
793
960
  }
794
- catch (e_17_1) { e_17 = { error: e_17_1 }; }
961
+ catch (e_21_1) { e_21 = { error: e_21_1 }; }
795
962
  finally {
796
963
  try {
797
964
  if (rows_2_1 && !rows_2_1.done && (_a = rows_2.return)) _a.call(rows_2);
798
965
  }
799
- finally { if (e_17) throw e_17.error; }
966
+ finally { if (e_21) throw e_21.error; }
800
967
  }
801
968
  if (!assertions.length && (evidence === null || evidence === void 0 ? void 0 : evidence.qaRunOutcome) === 'business_assertion_passed') {
802
969
  assertions.push({
@@ -855,7 +1022,7 @@ function businessAssertionPassed(assertion) {
855
1022
  return /^(pass|passed|success|ok|done)$/i.test(cleanText(assertion.status, 40));
856
1023
  }
857
1024
  function supportAssertionMatchesDiagnosisProof(assertion, proofPlan) {
858
- var e_18, _a;
1025
+ var e_22, _a;
859
1026
  var metadata = assertion.metadata || {};
860
1027
  if (metadata.diagnosisProofPlanMatched === true || metadata.proofPlanMatched === true || metadata.supportDiagnosisProof === true) {
861
1028
  return true;
@@ -900,12 +1067,12 @@ function supportAssertionMatchesDiagnosisProof(assertion, proofPlan) {
900
1067
  }
901
1068
  }
902
1069
  }
903
- catch (e_18_1) { e_18 = { error: e_18_1 }; }
1070
+ catch (e_22_1) { e_22 = { error: e_22_1 }; }
904
1071
  finally {
905
1072
  try {
906
1073
  if (proofTokens_1_1 && !proofTokens_1_1.done && (_a = proofTokens_1.return)) _a.call(proofTokens_1);
907
1074
  }
908
- finally { if (e_18) throw e_18.error; }
1075
+ finally { if (e_22) throw e_22.error; }
909
1076
  }
910
1077
  return overlap >= Math.min(4, Math.max(3, Math.ceil(proofTokens.size * 0.45)));
911
1078
  }
@@ -1036,7 +1203,7 @@ function applySupportDiagnosisProofGate(qa, diagnosisGate, now) {
1036
1203
  ], false) });
1037
1204
  }
1038
1205
  function evidenceObject() {
1039
- var e_19, _a;
1206
+ var e_23, _a;
1040
1207
  var values = [];
1041
1208
  for (var _i = 0; _i < arguments.length; _i++) {
1042
1209
  values[_i] = arguments[_i];
@@ -1049,17 +1216,17 @@ function evidenceObject() {
1049
1216
  }
1050
1217
  }
1051
1218
  }
1052
- catch (e_19_1) { e_19 = { error: e_19_1 }; }
1219
+ catch (e_23_1) { e_23 = { error: e_23_1 }; }
1053
1220
  finally {
1054
1221
  try {
1055
1222
  if (values_1_1 && !values_1_1.done && (_a = values_1.return)) _a.call(values_1);
1056
1223
  }
1057
- finally { if (e_19) throw e_19.error; }
1224
+ finally { if (e_23) throw e_23.error; }
1058
1225
  }
1059
1226
  return {};
1060
1227
  }
1061
1228
  function mergeEvidenceRecords() {
1062
- var e_20, _a, e_21, _b;
1229
+ var e_24, _a, e_25, _b;
1063
1230
  var values = [];
1064
1231
  for (var _i = 0; _i < arguments.length; _i++) {
1065
1232
  values[_i] = arguments[_i];
@@ -1070,7 +1237,7 @@ function mergeEvidenceRecords() {
1070
1237
  var value = values_2_1.value;
1071
1238
  var source = plainObject(value);
1072
1239
  try {
1073
- for (var _c = (e_21 = void 0, __values(Object.entries(source))), _d = _c.next(); !_d.done; _d = _c.next()) {
1240
+ for (var _c = (e_25 = void 0, __values(Object.entries(source))), _d = _c.next(); !_d.done; _d = _c.next()) {
1074
1241
  var _e = __read(_d.value, 2), key = _e[0], entry = _e[1];
1075
1242
  if (entry === undefined || entry === null || entry === '') {
1076
1243
  continue;
@@ -1086,21 +1253,21 @@ function mergeEvidenceRecords() {
1086
1253
  merged[key] = entry;
1087
1254
  }
1088
1255
  }
1089
- catch (e_21_1) { e_21 = { error: e_21_1 }; }
1256
+ catch (e_25_1) { e_25 = { error: e_25_1 }; }
1090
1257
  finally {
1091
1258
  try {
1092
1259
  if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
1093
1260
  }
1094
- finally { if (e_21) throw e_21.error; }
1261
+ finally { if (e_25) throw e_25.error; }
1095
1262
  }
1096
1263
  }
1097
1264
  }
1098
- catch (e_20_1) { e_20 = { error: e_20_1 }; }
1265
+ catch (e_24_1) { e_24 = { error: e_24_1 }; }
1099
1266
  finally {
1100
1267
  try {
1101
1268
  if (values_2_1 && !values_2_1.done && (_a = values_2.return)) _a.call(values_2);
1102
1269
  }
1103
- finally { if (e_20) throw e_20.error; }
1270
+ finally { if (e_24) throw e_24.error; }
1104
1271
  }
1105
1272
  return merged;
1106
1273
  }
@@ -1217,7 +1384,7 @@ function supportCustomerReplyPolicyGate(policy, now) {
1217
1384
  };
1218
1385
  }
1219
1386
  function firstNonEmptyText(values, max) {
1220
- var e_22, _a;
1387
+ var e_26, _a;
1221
1388
  if (max === void 0) { max = 1000; }
1222
1389
  try {
1223
1390
  for (var values_3 = __values(values), values_3_1 = values_3.next(); !values_3_1.done; values_3_1 = values_3.next()) {
@@ -1228,12 +1395,12 @@ function firstNonEmptyText(values, max) {
1228
1395
  }
1229
1396
  }
1230
1397
  }
1231
- catch (e_22_1) { e_22 = { error: e_22_1 }; }
1398
+ catch (e_26_1) { e_26 = { error: e_26_1 }; }
1232
1399
  finally {
1233
1400
  try {
1234
1401
  if (values_3_1 && !values_3_1.done && (_a = values_3.return)) _a.call(values_3);
1235
1402
  }
1236
- finally { if (e_22) throw e_22.error; }
1403
+ finally { if (e_26) throw e_26.error; }
1237
1404
  }
1238
1405
  return undefined;
1239
1406
  }
@@ -1364,7 +1531,12 @@ function adapterStatusPassed(value) {
1364
1531
  return !!normalized && /(pass|passed|success|succeeded|ok|done|complete|completed|ready|saved|published|deployed)/i.test(normalized);
1365
1532
  }
1366
1533
  function applyAICoderWorkflowProofGate(qa, readiness, now) {
1367
- if (readiness.ready || readiness.status === 'release_blocked') {
1534
+ if (readiness.ready
1535
+ || readiness.status === 'release_blocked'
1536
+ || qa.outcome === 'infra_failed'
1537
+ || qa.outcome === 'compile_failed'
1538
+ || qa.outcome === 'route_failed'
1539
+ || qa.outcome === 'business_assertion_failed') {
1368
1540
  return qa;
1369
1541
  }
1370
1542
  var gate = aicoderWorkflowProofReadinessGate(readiness, now);
@@ -1468,7 +1640,7 @@ function assistantDateWindowObject(quality) {
1468
1640
  return Object.keys(dateWindow).length ? dateWindow : nestedWindow;
1469
1641
  }
1470
1642
  function collectMongoProjectionObjects(value, result) {
1471
- var e_23, _a;
1643
+ var e_27, _a;
1472
1644
  if (result === void 0) { result = []; }
1473
1645
  if (!value || typeof value !== 'object') {
1474
1646
  return result;
@@ -1480,12 +1652,12 @@ function collectMongoProjectionObjects(value, result) {
1480
1652
  collectMongoProjectionObjects(entry, result);
1481
1653
  }
1482
1654
  }
1483
- catch (e_23_1) { e_23 = { error: e_23_1 }; }
1655
+ catch (e_27_1) { e_27 = { error: e_27_1 }; }
1484
1656
  finally {
1485
1657
  try {
1486
1658
  if (value_2_1 && !value_2_1.done && (_a = value_2.return)) _a.call(value_2);
1487
1659
  }
1488
- finally { if (e_23) throw e_23.error; }
1660
+ finally { if (e_27) throw e_27.error; }
1489
1661
  }
1490
1662
  return result;
1491
1663
  }
@@ -1726,8 +1898,8 @@ function applyAssistantAnswerQualityGate(qa, decision, now) {
1726
1898
  ], false) });
1727
1899
  }
1728
1900
  function buildSupportAIRunFromEvidence(input) {
1729
- var e_24, _a, e_25, _b;
1730
- var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
1901
+ var e_28, _a, e_29, _b;
1902
+ var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
1731
1903
  var ticket = input.ticket || {};
1732
1904
  var job = input.job || {};
1733
1905
  var evidence = buildSupportQaEvidence(input);
@@ -1739,8 +1911,8 @@ function buildSupportAIRunFromEvidence(input) {
1739
1911
  addSourceId(sourceIds, 'jobId', job._id || job.id || job.jobId);
1740
1912
  addSourceId(sourceIds, 'buildPlanId', job.buildPlanId || ticket.buildPlanId);
1741
1913
  try {
1742
- for (var _2 = __values(asArray(input.taskEvents)), _3 = _2.next(); !_3.done; _3 = _2.next()) {
1743
- var event_1 = _3.value;
1914
+ for (var _s = __values(asArray(input.taskEvents)), _t = _s.next(); !_t.done; _t = _s.next()) {
1915
+ var event_1 = _t.value;
1744
1916
  pushEvent(events, {
1745
1917
  type: event_1.type === 'human_intervention' ? 'human_intervention' : 'log',
1746
1918
  category: cleanText(event_1.category || event_1.phase || event_1.type, 160),
@@ -1754,16 +1926,16 @@ function buildSupportAIRunFromEvidence(input) {
1754
1926
  });
1755
1927
  }
1756
1928
  }
1757
- catch (e_24_1) { e_24 = { error: e_24_1 }; }
1929
+ catch (e_28_1) { e_28 = { error: e_28_1 }; }
1758
1930
  finally {
1759
1931
  try {
1760
- if (_3 && !_3.done && (_a = _2.return)) _a.call(_2);
1932
+ if (_t && !_t.done && (_a = _s.return)) _a.call(_s);
1761
1933
  }
1762
- finally { if (e_24) throw e_24.error; }
1934
+ finally { if (e_28) throw e_28.error; }
1763
1935
  }
1764
1936
  try {
1765
- for (var _4 = __values(asArray(input.aiJobs)), _5 = _4.next(); !_5.done; _5 = _4.next()) {
1766
- var aiJob = _5.value;
1937
+ for (var _u = __values(asArray(input.aiJobs)), _v = _u.next(); !_v.done; _v = _u.next()) {
1938
+ var aiJob = _v.value;
1767
1939
  pushEvent(events, {
1768
1940
  type: aiJob.model ? 'model_call' : 'log',
1769
1941
  category: cleanText(aiJob.category || aiJob.phase || aiJob.runner, 160),
@@ -1778,12 +1950,12 @@ function buildSupportAIRunFromEvidence(input) {
1778
1950
  });
1779
1951
  }
1780
1952
  }
1781
- catch (e_25_1) { e_25 = { error: e_25_1 }; }
1953
+ catch (e_29_1) { e_29 = { error: e_29_1 }; }
1782
1954
  finally {
1783
1955
  try {
1784
- if (_5 && !_5.done && (_b = _4.return)) _b.call(_4);
1956
+ if (_v && !_v.done && (_b = _u.return)) _b.call(_u);
1785
1957
  }
1786
- finally { if (e_25) throw e_25.error; }
1958
+ finally { if (e_29) throw e_29.error; }
1787
1959
  }
1788
1960
  collectCommitEvents(asArray(input.commits), events);
1789
1961
  collectHotfixEvidenceEvents([job, ticket, evidence, input.qaEvidence], events, gates, input.now);
@@ -1882,33 +2054,21 @@ function buildSupportAIRunFromEvidence(input) {
1882
2054
  metadata: {
1883
2055
  versionCount: asArray(input.versions).length,
1884
2056
  buildPlanCount: asArray(input.buildPlans).length,
1885
- managerNoBlindLoopPolicy: noBlindLoopGate ? {
1886
- action: cleanText((_e = noBlindLoopGate.metadata) === null || _e === void 0 ? void 0 : _e.action, 120),
1887
- status: noBlindLoopGate.status,
1888
- failureClass: cleanText((_f = noBlindLoopGate.metadata) === null || _f === void 0 ? void 0 : _f.failureClass, 120),
1889
- sameFailureCount: Number(((_g = noBlindLoopGate.metadata) === null || _g === void 0 ? void 0 : _g.sameFailureCount) || 0),
1890
- pingPongCount: Number(((_h = noBlindLoopGate.metadata) === null || _h === void 0 ? void 0 : _h.pingPongCount) || 0),
1891
- newEvidence: ((_j = noBlindLoopGate.metadata) === null || _j === void 0 ? void 0 : _j.newEvidence) === true,
1892
- materialEvidence: ((_k = noBlindLoopGate.metadata) === null || _k === void 0 ? void 0 : _k.materialEvidence) === true,
1893
- evidenceStrength: cleanText((_l = noBlindLoopGate.metadata) === null || _l === void 0 ? void 0 : _l.evidenceStrength, 120),
1894
- loopBudgetShouldReset: ((_m = noBlindLoopGate.metadata) === null || _m === void 0 ? void 0 : _m.loopBudgetShouldReset) === true,
1895
- dispatchAction: cleanText((_o = noBlindLoopGate.metadata) === null || _o === void 0 ? void 0 : _o.dispatchAction, 160),
1896
- requiresNewEvidence: ((_p = noBlindLoopGate.metadata) === null || _p === void 0 ? void 0 : _p.requiresNewEvidence) === true
1897
- } : undefined,
2057
+ managerNoBlindLoopPolicy: managerNoBlindLoopMetadata(noBlindLoopGate),
1898
2058
  rootCauseEntryContract: Object.keys(rootCauseEntryContract).length ? {
1899
2059
  contractId: cleanText(rootCauseEntryContract.contract_id || rootCauseEntryContract.contractId, 160),
1900
2060
  version: cleanText(rootCauseEntryContract.version, 120),
1901
2061
  status: cleanText(rootCauseEntryContract.status, 120),
1902
2062
  issueClassProbeCount: asArray(rootCauseEntryContract.issue_class_probes || rootCauseEntryContract.issueClassProbes).length,
1903
- ownerFileMax: Number(((_q = rootCauseEntryContract.owner_file_policy) === null || _q === void 0 ? void 0 : _q.max_files) || ((_r = rootCauseEntryContract.ownerFilePolicy) === null || _r === void 0 ? void 0 : _r.maxFiles) || 0) || 0,
1904
- requiresBusinessAssertion: ((_s = rootCauseEntryContract.business_proof_policy) === null || _s === void 0 ? void 0 : _s.requires_aiqa_business_assertion) === true
1905
- || ((_t = rootCauseEntryContract.businessProofPolicy) === null || _t === void 0 ? void 0 : _t.requiresAiqaBusinessAssertion) === true
2063
+ ownerFileMax: Number(((_e = rootCauseEntryContract.owner_file_policy) === null || _e === void 0 ? void 0 : _e.max_files) || ((_f = rootCauseEntryContract.ownerFilePolicy) === null || _f === void 0 ? void 0 : _f.maxFiles) || 0) || 0,
2064
+ requiresBusinessAssertion: ((_g = rootCauseEntryContract.business_proof_policy) === null || _g === void 0 ? void 0 : _g.requires_aiqa_business_assertion) === true
2065
+ || ((_h = rootCauseEntryContract.businessProofPolicy) === null || _h === void 0 ? void 0 : _h.requiresAiqaBusinessAssertion) === true
1906
2066
  } : undefined,
1907
2067
  diagnosis: Object.keys(diagnosisGate).length ? {
1908
2068
  status: cleanText(diagnosisGate.status, 80),
1909
2069
  issueClass: diagnosisIssueClass,
1910
2070
  ownerFiles: diagnosisOwnerFiles,
1911
- acceptedHypothesis: cleanText(((_u = diagnosisGate.accepted_hypothesis) === null || _u === void 0 ? void 0 : _u.statement) || ((_v = diagnosisGate.acceptedHypothesis) === null || _v === void 0 ? void 0 : _v.statement), 1000),
2071
+ acceptedHypothesis: cleanText(((_j = diagnosisGate.accepted_hypothesis) === null || _j === void 0 ? void 0 : _j.statement) || ((_k = diagnosisGate.acceptedHypothesis) === null || _k === void 0 ? void 0 : _k.statement), 1000),
1912
2072
  proofPlan: diagnosisGate.proof_plan || diagnosisGate.proofPlan
1913
2073
  } : undefined,
1914
2074
  businessProofReadiness: Object.keys(businessProofReadiness).length ? {
@@ -1923,18 +2083,18 @@ function buildSupportAIRunFromEvidence(input) {
1923
2083
  canDraftCustomerReply: customerReplyPolicy.canDraftCustomerReply === true || customerReplyPolicy.can_draft_customer_reply === true,
1924
2084
  canSendCustomerReply: customerReplyPolicy.canSendCustomerReply === true || customerReplyPolicy.can_send_customer_reply === true,
1925
2085
  reason: cleanText(customerReplyPolicy.reason, 1000),
1926
- reviewType: cleanText(((_w = customerReplyPolicy.humanReviewPacket) === null || _w === void 0 ? void 0 : _w.reviewType)
1927
- || ((_x = customerReplyPolicy.human_review_packet) === null || _x === void 0 ? void 0 : _x.review_type)
1928
- || ((_y = customerReplyPolicy.human_review_packet) === null || _y === void 0 ? void 0 : _y.reviewType), 160),
1929
- primaryAction: cleanText(((_z = customerReplyPolicy.humanReviewPacket) === null || _z === void 0 ? void 0 : _z.primaryAction)
1930
- || ((_0 = customerReplyPolicy.human_review_packet) === null || _0 === void 0 ? void 0 : _0.primary_action)
1931
- || ((_1 = customerReplyPolicy.human_review_packet) === null || _1 === void 0 ? void 0 : _1.primaryAction), 160)
2086
+ reviewType: cleanText(((_l = customerReplyPolicy.humanReviewPacket) === null || _l === void 0 ? void 0 : _l.reviewType)
2087
+ || ((_m = customerReplyPolicy.human_review_packet) === null || _m === void 0 ? void 0 : _m.review_type)
2088
+ || ((_o = customerReplyPolicy.human_review_packet) === null || _o === void 0 ? void 0 : _o.reviewType), 160),
2089
+ primaryAction: cleanText(((_p = customerReplyPolicy.humanReviewPacket) === null || _p === void 0 ? void 0 : _p.primaryAction)
2090
+ || ((_q = customerReplyPolicy.human_review_packet) === null || _q === void 0 ? void 0 : _q.primary_action)
2091
+ || ((_r = customerReplyPolicy.human_review_packet) === null || _r === void 0 ? void 0 : _r.primaryAction), 160)
1932
2092
  } : undefined
1933
2093
  }
1934
2094
  });
1935
2095
  }
1936
2096
  function buildAICoderAIRunFromEvidence(input) {
1937
- var e_26, _a;
2097
+ var e_30, _a;
1938
2098
  var _b, _c, _d, _e, _f, _g, _h;
1939
2099
  var app = input.app || {};
1940
2100
  var job = input.job || {};
@@ -1962,15 +2122,27 @@ function buildAICoderAIRunFromEvidence(input) {
1962
2122
  });
1963
2123
  }
1964
2124
  }
1965
- catch (e_26_1) { e_26 = { error: e_26_1 }; }
2125
+ catch (e_30_1) { e_30 = { error: e_30_1 }; }
1966
2126
  finally {
1967
2127
  try {
1968
2128
  if (_k && !_k.done && (_a = _j.return)) _a.call(_j);
1969
2129
  }
1970
- finally { if (e_26) throw e_26.error; }
2130
+ finally { if (e_30) throw e_30.error; }
1971
2131
  }
1972
2132
  collectCommitEvents(asArray(input.commits), events);
1973
2133
  collectHotfixEvidenceEvents([job, app, evidence, input.qaEvidence], events, gates, input.now);
2134
+ var noBlindLoopGate = aicoderManagerNoBlindLoopGate(app, job, evidence, input.now);
2135
+ if (noBlindLoopGate) {
2136
+ gates.push(noBlindLoopGate);
2137
+ pushEvent(events, {
2138
+ type: 'log',
2139
+ category: 'manager_no_blind_loop_policy',
2140
+ message: noBlindLoopGate.reason,
2141
+ artifactPaths: noBlindLoopGate.evidenceRefs,
2142
+ recordedAt: noBlindLoopGate.recordedAt,
2143
+ metadata: noBlindLoopGate.metadata
2144
+ });
2145
+ }
1974
2146
  var cost = collectUsageEvents(asArray(input.usageLedger), events);
1975
2147
  var scorecardPassed = evidence.scorecardPassed === true
1976
2148
  || evidence.scorecardStatus === 'pass'
@@ -2051,6 +2223,7 @@ function buildAICoderAIRunFromEvidence(input) {
2051
2223
  domain: app.domain || app.customDomain || job.domain,
2052
2224
  wowScore: (_g = evidence.wowScore) !== null && _g !== void 0 ? _g : job.wowScore,
2053
2225
  score: (_h = evidence.score) !== null && _h !== void 0 ? _h : evidence.qualityScore,
2226
+ managerNoBlindLoopPolicy: managerNoBlindLoopMetadata(noBlindLoopGate),
2054
2227
  workflowProofReadiness: {
2055
2228
  ready: workflowReadiness.ready,
2056
2229
  status: workflowReadiness.status,
@@ -2070,7 +2243,7 @@ function buildAICoderAIRunFromEvidence(input) {
2070
2243
  });
2071
2244
  }
2072
2245
  function buildAssistantAIRunFromEvidence(input) {
2073
- var e_27, _a, e_28, _b, e_29, _c;
2246
+ var e_31, _a, e_32, _b, e_33, _c;
2074
2247
  var _d, _e, _f, _g;
2075
2248
  var conversation = input.conversation || {};
2076
2249
  var events = [];
@@ -2096,12 +2269,12 @@ function buildAssistantAIRunFromEvidence(input) {
2096
2269
  });
2097
2270
  }
2098
2271
  }
2099
- catch (e_27_1) { e_27 = { error: e_27_1 }; }
2272
+ catch (e_31_1) { e_31 = { error: e_31_1 }; }
2100
2273
  finally {
2101
2274
  try {
2102
2275
  if (_j && !_j.done && (_a = _h.return)) _a.call(_h);
2103
2276
  }
2104
- finally { if (e_27) throw e_27.error; }
2277
+ finally { if (e_31) throw e_31.error; }
2105
2278
  }
2106
2279
  try {
2107
2280
  for (var _k = __values(asArray(input.issueReports)), _l = _k.next(); !_l.done; _l = _k.next()) {
@@ -2119,12 +2292,12 @@ function buildAssistantAIRunFromEvidence(input) {
2119
2292
  });
2120
2293
  }
2121
2294
  }
2122
- catch (e_28_1) { e_28 = { error: e_28_1 }; }
2295
+ catch (e_32_1) { e_32 = { error: e_32_1 }; }
2123
2296
  finally {
2124
2297
  try {
2125
2298
  if (_l && !_l.done && (_b = _k.return)) _b.call(_k);
2126
2299
  }
2127
- finally { if (e_28) throw e_28.error; }
2300
+ finally { if (e_32) throw e_32.error; }
2128
2301
  }
2129
2302
  var cost = collectUsageEvents(asArray(input.usageLedger), events);
2130
2303
  var answerQuality = assistantQualityObject(input);
@@ -2156,12 +2329,12 @@ function buildAssistantAIRunFromEvidence(input) {
2156
2329
  });
2157
2330
  }
2158
2331
  }
2159
- catch (e_29_1) { e_29 = { error: e_29_1 }; }
2332
+ catch (e_33_1) { e_33 = { error: e_33_1 }; }
2160
2333
  finally {
2161
2334
  try {
2162
2335
  if (_o && !_o.done && (_c = _m.return)) _c.call(_m);
2163
2336
  }
2164
- finally { if (e_29) throw e_29.error; }
2337
+ finally { if (e_33) throw e_33.error; }
2165
2338
  }
2166
2339
  var answerQualityDecision = evaluateAssistantAnswerQuality({
2167
2340
  answerQuality: answerQuality,