@resolveio/server-lib 22.3.191 → 22.3.193

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.
@@ -612,12 +612,166 @@ function hotfixCommitProofGate(evidence, now) {
612
612
  }
613
613
  };
614
614
  }
615
- function collectHotfixEvidenceEvents(sources, events, gates, now) {
615
+ function hotfixDurabilityContractCandidates() {
616
616
  var e_12, _a;
617
- var _b, _c;
617
+ var sources = [];
618
+ for (var _i = 0; _i < arguments.length; _i++) {
619
+ sources[_i] = arguments[_i];
620
+ }
621
+ var result = [];
622
+ var seen = new Set();
623
+ var pushCandidate = function (value) {
624
+ var e_13, _a, e_14, _b;
625
+ var _c, _d;
626
+ if (Array.isArray(value)) {
627
+ try {
628
+ for (var value_2 = __values(value), value_2_1 = value_2.next(); !value_2_1.done; value_2_1 = value_2.next()) {
629
+ var entry = value_2_1.value;
630
+ pushCandidate(entry);
631
+ }
632
+ }
633
+ catch (e_13_1) { e_13 = { error: e_13_1 }; }
634
+ finally {
635
+ try {
636
+ if (value_2_1 && !value_2_1.done && (_a = value_2.return)) _a.call(value_2);
637
+ }
638
+ finally { if (e_13) throw e_13.error; }
639
+ }
640
+ return;
641
+ }
642
+ if (!value || typeof value !== 'object') {
643
+ return;
644
+ }
645
+ var nestedValues = [
646
+ value.hotfixDurabilityContract,
647
+ value.hotfix_durability_contract,
648
+ value.supportManagerHotfixDurabilityContract,
649
+ value.support_manager_hotfix_durability_contract,
650
+ value.managerRecoveryHotfixDurability,
651
+ value.manager_recovery_hotfix_durability,
652
+ (_c = value.supportV5RecoveryDirective) === null || _c === void 0 ? void 0 : _c.hotfixDurabilityContract,
653
+ (_d = value.supportV5RecoveryDirective) === null || _d === void 0 ? void 0 : _d.hotfix_durability_contract
654
+ ].filter(Boolean);
655
+ if (nestedValues.length) {
656
+ try {
657
+ for (var nestedValues_2 = __values(nestedValues), nestedValues_2_1 = nestedValues_2.next(); !nestedValues_2_1.done; nestedValues_2_1 = nestedValues_2.next()) {
658
+ var nestedValue = nestedValues_2_1.value;
659
+ pushCandidate(nestedValue);
660
+ }
661
+ }
662
+ catch (e_14_1) { e_14 = { error: e_14_1 }; }
663
+ finally {
664
+ try {
665
+ if (nestedValues_2_1 && !nestedValues_2_1.done && (_b = nestedValues_2.return)) _b.call(nestedValues_2);
666
+ }
667
+ finally { if (e_14) throw e_14.error; }
668
+ }
669
+ }
670
+ var required = value.required === true || value.liveHotfixBlockedUntilCommit === true || value.live_hotfix_blocked_until_commit === true || value.commitProofPassed === true || value.commit_proof_passed === true;
671
+ if (!required) {
672
+ return;
673
+ }
674
+ var key = cleanText(value.contractId || value.contract_id || JSON.stringify({
675
+ status: value.status,
676
+ sha: value.sourceCommitSha || value.source_commit_sha,
677
+ url: value.githubCommitUrl || value.github_commit_url
678
+ }), 500);
679
+ if (seen.has(key)) {
680
+ return;
681
+ }
682
+ seen.add(key);
683
+ result.push(value);
684
+ };
685
+ try {
686
+ for (var sources_2 = __values(sources), sources_2_1 = sources_2.next(); !sources_2_1.done; sources_2_1 = sources_2.next()) {
687
+ var source = sources_2_1.value;
688
+ pushCandidate(source);
689
+ }
690
+ }
691
+ catch (e_12_1) { e_12 = { error: e_12_1 }; }
692
+ finally {
693
+ try {
694
+ if (sources_2_1 && !sources_2_1.done && (_a = sources_2.return)) _a.call(sources_2);
695
+ }
696
+ finally { if (e_12) throw e_12.error; }
697
+ }
698
+ return result;
699
+ }
700
+ function hotfixDurabilityContractGate(contractValue, now) {
701
+ var contract = (0, ai_runner_manager_policy_1.buildResolveIOAIManagerHotfixDurabilityContract)({
702
+ existing: contractValue,
703
+ evidence: contractValue.evidence || contractValue.hotfixEvidence || contractValue.hotfix_evidence,
704
+ action: contractValue.action,
705
+ reason: contractValue.reason,
706
+ now: now
707
+ });
708
+ if (!contract.required) {
709
+ return undefined;
710
+ }
711
+ var status = contract.liveHotfixBlockedUntilCommit
712
+ ? 'blocked'
713
+ : contract.status === 'ready_for_continuation' || contract.status === 'ready_for_release_gate'
714
+ ? 'pass'
715
+ : 'warn';
716
+ return {
717
+ key: 'hotfix_durability_contract',
718
+ label: 'Hotfix durability contract',
719
+ status: status,
720
+ reason: contract.liveHotfixBlockedUntilCommit
721
+ ? "Manager hotfix is blocked until GitHub commit proof is recorded: ".concat(contract.missingCommitProofFields.join(', ') || 'sourceCommitSha, githubCommitUrl, gitCommitStatus=passed, gitPushStatus=passed')
722
+ : "Manager hotfix durability contract is ".concat(contract.status, "."),
723
+ evidenceRefs: cleanStringList([contract.githubCommitUrl], 1, 500),
724
+ recordedAt: isoNow(now || contract.updatedAt),
725
+ metadata: {
726
+ contractId: contract.contractId,
727
+ status: contract.status,
728
+ nextSafeAction: contract.nextSafeAction,
729
+ canPrepareHotfixPatch: contract.canPrepareHotfixPatch,
730
+ canHotfixBackend: contract.canHotfixBackend,
731
+ liveHotfixBlockedUntilCommit: contract.liveHotfixBlockedUntilCommit,
732
+ commitProofPassed: contract.commitProofPassed,
733
+ commitProofStatus: contract.commitProofStatus,
734
+ missingCommitProofFields: contract.missingCommitProofFields,
735
+ sourceCommitSha: contract.sourceCommitSha,
736
+ githubCommitUrl: contract.githubCommitUrl,
737
+ gitCommitStatus: contract.gitCommitStatus,
738
+ gitPushStatus: contract.gitPushStatus,
739
+ phaseOrder: contract.phaseOrder,
740
+ requiredFields: contract.requiredFields,
741
+ forbiddenActions: contract.forbiddenActions
742
+ }
743
+ };
744
+ }
745
+ function collectHotfixEvidenceEvents(sources, events, gates, now) {
746
+ var e_15, _a, e_16, _b;
747
+ var _c, _d;
748
+ try {
749
+ for (var _e = __values(hotfixDurabilityContractCandidates.apply(void 0, __spreadArray([], __read(sources), false))), _f = _e.next(); !_f.done; _f = _e.next()) {
750
+ var contract = _f.value;
751
+ var gate = hotfixDurabilityContractGate(contract, now);
752
+ if (gate) {
753
+ gates.push(gate);
754
+ pushEvent(events, {
755
+ type: 'log',
756
+ category: 'hotfix_durability_contract',
757
+ message: gate.reason,
758
+ artifactPaths: gate.evidenceRefs,
759
+ recordedAt: gate.recordedAt,
760
+ metadata: gate.metadata
761
+ });
762
+ }
763
+ }
764
+ }
765
+ catch (e_15_1) { e_15 = { error: e_15_1 }; }
766
+ finally {
767
+ try {
768
+ if (_f && !_f.done && (_a = _e.return)) _a.call(_e);
769
+ }
770
+ finally { if (e_15) throw e_15.error; }
771
+ }
618
772
  try {
619
- for (var _d = __values(hotfixEvidenceCandidates.apply(void 0, __spreadArray([], __read(sources), false))), _e = _d.next(); !_e.done; _e = _d.next()) {
620
- var evidence = _e.value;
773
+ for (var _g = __values(hotfixEvidenceCandidates.apply(void 0, __spreadArray([], __read(sources), false))), _h = _g.next(); !_h.done; _h = _g.next()) {
774
+ var evidence = _h.value;
621
775
  var validation = (0, ai_runner_manager_policy_1.validateResolveIOAIManagerHotfixEvidence)(evidence);
622
776
  if (!validation.normalized && validation.status === 'missing') {
623
777
  continue;
@@ -630,7 +784,7 @@ function collectHotfixEvidenceEvents(sources, events, gates, now) {
630
784
  ? "Hotfix evidence recorded for ".concat(validation.channel, ".")
631
785
  : "Incomplete hotfix evidence for ".concat(validation.channel || 'unknown channel', "."),
632
786
  artifactPaths: artifactPaths,
633
- recordedAt: ((_b = validation.normalized) === null || _b === void 0 ? void 0 : _b.recordedAt) || eventDate(evidence),
787
+ recordedAt: ((_c = validation.normalized) === null || _c === void 0 ? void 0 : _c.recordedAt) || eventDate(evidence),
634
788
  metadata: {
635
789
  status: validation.status,
636
790
  nextAction: validation.nextAction,
@@ -639,7 +793,7 @@ function collectHotfixEvidenceEvents(sources, events, gates, now) {
639
793
  hotfixSatisfied: validation.hotfixSatisfied,
640
794
  blockers: validation.blockers,
641
795
  githubCommitGuard: validation.githubCommitGuard,
642
- target: (_c = validation.normalized) === null || _c === void 0 ? void 0 : _c.target
796
+ target: (_d = validation.normalized) === null || _d === void 0 ? void 0 : _d.target
643
797
  }
644
798
  });
645
799
  var gate = hotfixEvidenceGate(evidence, now);
@@ -660,46 +814,53 @@ function collectHotfixEvidenceEvents(sources, events, gates, now) {
660
814
  }
661
815
  }
662
816
  }
663
- catch (e_12_1) { e_12 = { error: e_12_1 }; }
817
+ catch (e_16_1) { e_16 = { error: e_16_1 }; }
664
818
  finally {
665
819
  try {
666
- if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
820
+ if (_h && !_h.done && (_b = _g.return)) _b.call(_g);
667
821
  }
668
- finally { if (e_12) throw e_12.error; }
822
+ finally { if (e_16) throw e_16.error; }
669
823
  }
670
824
  }
671
825
  function hotfixDurabilityMetadata(gates) {
672
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
826
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
673
827
  var hotfixGate = gates.find(function (gate) { return gate.key === 'hotfix_evidence'; });
674
828
  var commitGate = gates.find(function (gate) { return gate.key === 'hotfix_commit_proof'; });
675
- if (!hotfixGate && !commitGate) {
829
+ var durabilityGate = gates.find(function (gate) { return gate.key === 'hotfix_durability_contract'; });
830
+ if (!hotfixGate && !commitGate && !durabilityGate) {
676
831
  return undefined;
677
832
  }
678
- var commitBlocked = !!commitGate && (commitGate.status === 'blocked' || commitGate.status === 'fail');
833
+ var commitBlocked = (!!commitGate && (commitGate.status === 'blocked' || commitGate.status === 'fail'))
834
+ || ((_a = durabilityGate === null || durabilityGate === void 0 ? void 0 : durabilityGate.metadata) === null || _a === void 0 ? void 0 : _a.liveHotfixBlockedUntilCommit) === true;
679
835
  return {
836
+ durabilityStatus: cleanText((_b = durabilityGate === null || durabilityGate === void 0 ? void 0 : durabilityGate.metadata) === null || _b === void 0 ? void 0 : _b.status, 80),
837
+ durabilityGateStatus: cleanText(durabilityGate === null || durabilityGate === void 0 ? void 0 : durabilityGate.status, 80),
838
+ canPrepareHotfixPatch: ((_c = durabilityGate === null || durabilityGate === void 0 ? void 0 : durabilityGate.metadata) === null || _c === void 0 ? void 0 : _c.canPrepareHotfixPatch) === true,
839
+ canHotfixBackend: ((_d = durabilityGate === null || durabilityGate === void 0 ? void 0 : durabilityGate.metadata) === null || _d === void 0 ? void 0 : _d.canHotfixBackend) === true,
840
+ liveHotfixBlockedUntilCommit: ((_e = durabilityGate === null || durabilityGate === void 0 ? void 0 : durabilityGate.metadata) === null || _e === void 0 ? void 0 : _e.liveHotfixBlockedUntilCommit) === true,
680
841
  hotfixEvidenceStatus: cleanText(hotfixGate === null || hotfixGate === void 0 ? void 0 : hotfixGate.status, 80),
681
- hotfixSatisfied: ((_a = hotfixGate === null || hotfixGate === void 0 ? void 0 : hotfixGate.metadata) === null || _a === void 0 ? void 0 : _a.hotfixSatisfied) === true,
682
- fullDeployBlocked: ((_b = hotfixGate === null || hotfixGate === void 0 ? void 0 : hotfixGate.metadata) === null || _b === void 0 ? void 0 : _b.fullDeployBlocked) === true,
683
- fullDeployAllowed: ((_c = hotfixGate === null || hotfixGate === void 0 ? void 0 : hotfixGate.metadata) === null || _c === void 0 ? void 0 : _c.fullDeployAllowed) === true,
684
- commitProofRequired: !!commitGate,
685
- commitProofStatus: cleanText(commitGate === null || commitGate === void 0 ? void 0 : commitGate.status, 80),
686
- commitProofPassed: ((_d = commitGate === null || commitGate === void 0 ? void 0 : commitGate.metadata) === null || _d === void 0 ? void 0 : _d.passed) === true,
842
+ hotfixSatisfied: ((_f = hotfixGate === null || hotfixGate === void 0 ? void 0 : hotfixGate.metadata) === null || _f === void 0 ? void 0 : _f.hotfixSatisfied) === true,
843
+ fullDeployBlocked: ((_g = hotfixGate === null || hotfixGate === void 0 ? void 0 : hotfixGate.metadata) === null || _g === void 0 ? void 0 : _g.fullDeployBlocked) === true,
844
+ fullDeployAllowed: ((_h = hotfixGate === null || hotfixGate === void 0 ? void 0 : hotfixGate.metadata) === null || _h === void 0 ? void 0 : _h.fullDeployAllowed) === true,
845
+ commitProofRequired: !!commitGate || !!durabilityGate,
846
+ commitProofStatus: cleanText((commitGate === null || commitGate === void 0 ? void 0 : commitGate.status) || ((_j = durabilityGate === null || durabilityGate === void 0 ? void 0 : durabilityGate.metadata) === null || _j === void 0 ? void 0 : _j.commitProofStatus), 80),
847
+ commitProofPassed: ((_k = commitGate === null || commitGate === void 0 ? void 0 : commitGate.metadata) === null || _k === void 0 ? void 0 : _k.passed) === true || ((_l = durabilityGate === null || durabilityGate === void 0 ? void 0 : durabilityGate.metadata) === null || _l === void 0 ? void 0 : _l.commitProofPassed) === true,
687
848
  commitBlocked: commitBlocked,
688
- channel: cleanText(((_e = commitGate === null || commitGate === void 0 ? void 0 : commitGate.metadata) === null || _e === void 0 ? void 0 : _e.channel) || ((_f = hotfixGate === null || hotfixGate === void 0 ? void 0 : hotfixGate.metadata) === null || _f === void 0 ? void 0 : _f.channel), 120),
689
- sourceCommitSha: cleanText((_g = commitGate === null || commitGate === void 0 ? void 0 : commitGate.metadata) === null || _g === void 0 ? void 0 : _g.sourceCommitSha, 200),
690
- githubCommitUrl: cleanText((_h = commitGate === null || commitGate === void 0 ? void 0 : commitGate.metadata) === null || _h === void 0 ? void 0 : _h.githubCommitUrl, 500),
691
- gitCommitStatus: cleanText((_j = commitGate === null || commitGate === void 0 ? void 0 : commitGate.metadata) === null || _j === void 0 ? void 0 : _j.gitCommitStatus, 120),
692
- gitPushStatus: cleanText((_k = commitGate === null || commitGate === void 0 ? void 0 : commitGate.metadata) === null || _k === void 0 ? void 0 : _k.gitPushStatus, 120),
693
- blockers: cleanStringList(__spreadArray(__spreadArray([], __read(asArray((_l = commitGate === null || commitGate === void 0 ? void 0 : commitGate.metadata) === null || _l === void 0 ? void 0 : _l.blockers)), false), __read(asArray((_m = hotfixGate === null || hotfixGate === void 0 ? void 0 : hotfixGate.metadata) === null || _m === void 0 ? void 0 : _m.blockers)), false), 20, 500),
694
- requiredEvidence: cleanStringList((_o = commitGate === null || commitGate === void 0 ? void 0 : commitGate.metadata) === null || _o === void 0 ? void 0 : _o.requiredEvidence, 20, 500),
695
- nextCommands: cleanStringList((_p = commitGate === null || commitGate === void 0 ? void 0 : commitGate.metadata) === null || _p === void 0 ? void 0 : _p.nextCommands, 20, 240),
849
+ channel: cleanText(((_m = commitGate === null || commitGate === void 0 ? void 0 : commitGate.metadata) === null || _m === void 0 ? void 0 : _m.channel) || ((_o = hotfixGate === null || hotfixGate === void 0 ? void 0 : hotfixGate.metadata) === null || _o === void 0 ? void 0 : _o.channel), 120),
850
+ sourceCommitSha: cleanText(((_p = commitGate === null || commitGate === void 0 ? void 0 : commitGate.metadata) === null || _p === void 0 ? void 0 : _p.sourceCommitSha) || ((_q = durabilityGate === null || durabilityGate === void 0 ? void 0 : durabilityGate.metadata) === null || _q === void 0 ? void 0 : _q.sourceCommitSha), 200),
851
+ githubCommitUrl: cleanText(((_r = commitGate === null || commitGate === void 0 ? void 0 : commitGate.metadata) === null || _r === void 0 ? void 0 : _r.githubCommitUrl) || ((_s = durabilityGate === null || durabilityGate === void 0 ? void 0 : durabilityGate.metadata) === null || _s === void 0 ? void 0 : _s.githubCommitUrl), 500),
852
+ gitCommitStatus: cleanText(((_t = commitGate === null || commitGate === void 0 ? void 0 : commitGate.metadata) === null || _t === void 0 ? void 0 : _t.gitCommitStatus) || ((_u = durabilityGate === null || durabilityGate === void 0 ? void 0 : durabilityGate.metadata) === null || _u === void 0 ? void 0 : _u.gitCommitStatus), 120),
853
+ gitPushStatus: cleanText(((_v = commitGate === null || commitGate === void 0 ? void 0 : commitGate.metadata) === null || _v === void 0 ? void 0 : _v.gitPushStatus) || ((_w = durabilityGate === null || durabilityGate === void 0 ? void 0 : durabilityGate.metadata) === null || _w === void 0 ? void 0 : _w.gitPushStatus), 120),
854
+ blockers: cleanStringList(__spreadArray(__spreadArray(__spreadArray([], __read(asArray((_x = durabilityGate === null || durabilityGate === void 0 ? void 0 : durabilityGate.metadata) === null || _x === void 0 ? void 0 : _x.missingCommitProofFields)), false), __read(asArray((_y = commitGate === null || commitGate === void 0 ? void 0 : commitGate.metadata) === null || _y === void 0 ? void 0 : _y.blockers)), false), __read(asArray((_z = hotfixGate === null || hotfixGate === void 0 ? void 0 : hotfixGate.metadata) === null || _z === void 0 ? void 0 : _z.blockers)), false), 20, 500),
855
+ requiredEvidence: cleanStringList(((_0 = commitGate === null || commitGate === void 0 ? void 0 : commitGate.metadata) === null || _0 === void 0 ? void 0 : _0.requiredEvidence) || ((_1 = durabilityGate === null || durabilityGate === void 0 ? void 0 : durabilityGate.metadata) === null || _1 === void 0 ? void 0 : _1.requiredFields), 20, 500),
856
+ nextCommands: cleanStringList((_2 = commitGate === null || commitGate === void 0 ? void 0 : commitGate.metadata) === null || _2 === void 0 ? void 0 : _2.nextCommands, 20, 240),
696
857
  nextAction: commitBlocked
697
- ? 'Commit and push the hotfix to GitHub, record sourceCommitSha/githubCommitUrl/gitCommitStatus/gitPushStatus, then rerun the smallest verification gate.'
698
- : cleanText((_q = hotfixGate === null || hotfixGate === void 0 ? void 0 : hotfixGate.metadata) === null || _q === void 0 ? void 0 : _q.nextAction, 1000)
858
+ ? cleanText((_3 = durabilityGate === null || durabilityGate === void 0 ? void 0 : durabilityGate.metadata) === null || _3 === void 0 ? void 0 : _3.nextSafeAction, 200) || 'Commit and push the hotfix to GitHub, record sourceCommitSha/githubCommitUrl/gitCommitStatus/gitPushStatus, then rerun the smallest verification gate.'
859
+ : cleanText((_4 = hotfixGate === null || hotfixGate === void 0 ? void 0 : hotfixGate.metadata) === null || _4 === void 0 ? void 0 : _4.nextAction, 1000)
699
860
  };
700
861
  }
701
862
  function collectUsageEvents(entries, events) {
702
- var e_13, _a;
863
+ var e_17, _a;
703
864
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
704
865
  if (!entries.length) {
705
866
  return undefined;
@@ -730,17 +891,17 @@ function collectUsageEvents(entries, events) {
730
891
  });
731
892
  }
732
893
  }
733
- catch (e_13_1) { e_13 = { error: e_13_1 }; }
894
+ catch (e_17_1) { e_17 = { error: e_17_1 }; }
734
895
  finally {
735
896
  try {
736
897
  if (normalizedEntries_1_1 && !normalizedEntries_1_1.done && (_a = normalizedEntries_1.return)) _a.call(normalizedEntries_1);
737
898
  }
738
- finally { if (e_13) throw e_13.error; }
899
+ finally { if (e_17) throw e_17.error; }
739
900
  }
740
901
  return (0, ai_run_evidence_1.buildAIRunCost)(entries);
741
902
  }
742
903
  function collectCommitEvents(commits, events) {
743
- var e_14, _a;
904
+ var e_18, _a;
744
905
  try {
745
906
  for (var _b = __values(commits.slice(0, 80)), _c = _b.next(); !_c.done; _c = _b.next()) {
746
907
  var commit = _c.value;
@@ -756,12 +917,12 @@ function collectCommitEvents(commits, events) {
756
917
  });
757
918
  }
758
919
  }
759
- catch (e_14_1) { e_14 = { error: e_14_1 }; }
920
+ catch (e_18_1) { e_18 = { error: e_18_1 }; }
760
921
  finally {
761
922
  try {
762
923
  if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
763
924
  }
764
- finally { if (e_14) throw e_14.error; }
925
+ finally { if (e_18) throw e_18.error; }
765
926
  }
766
927
  }
767
928
  function statusFromBoolean(value, fallback) {
@@ -774,7 +935,7 @@ function statusFromBoolean(value, fallback) {
774
935
  return fallback;
775
936
  }
776
937
  function collectArtifacts(evidence) {
777
- var e_15, _a, e_16, _b, e_17, _c;
938
+ var e_19, _a, e_20, _b, e_21, _c;
778
939
  var artifacts = [];
779
940
  try {
780
941
  for (var _d = __values(asArray(evidence === null || evidence === void 0 ? void 0 : evidence.artifacts)), _e = _d.next(); !_e.done; _e = _d.next()) {
@@ -789,12 +950,12 @@ function collectArtifacts(evidence) {
789
950
  });
790
951
  }
791
952
  }
792
- catch (e_15_1) { e_15 = { error: e_15_1 }; }
953
+ catch (e_19_1) { e_19 = { error: e_19_1 }; }
793
954
  finally {
794
955
  try {
795
956
  if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
796
957
  }
797
- finally { if (e_15) throw e_15.error; }
958
+ finally { if (e_19) throw e_19.error; }
798
959
  }
799
960
  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));
800
961
  try {
@@ -815,12 +976,12 @@ function collectArtifacts(evidence) {
815
976
  }
816
977
  }
817
978
  }
818
- catch (e_16_1) { e_16 = { error: e_16_1 }; }
979
+ catch (e_20_1) { e_20 = { error: e_20_1 }; }
819
980
  finally {
820
981
  try {
821
982
  if (_g && !_g.done && (_b = _f.return)) _b.call(_f);
822
983
  }
823
- finally { if (e_16) throw e_16.error; }
984
+ finally { if (e_20) throw e_20.error; }
824
985
  }
825
986
  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);
826
987
  try {
@@ -841,17 +1002,17 @@ function collectArtifacts(evidence) {
841
1002
  }
842
1003
  }
843
1004
  }
844
- catch (e_17_1) { e_17 = { error: e_17_1 }; }
1005
+ catch (e_21_1) { e_21 = { error: e_21_1 }; }
845
1006
  finally {
846
1007
  try {
847
1008
  if (_j && !_j.done && (_c = _h.return)) _c.call(_h);
848
1009
  }
849
- finally { if (e_17) throw e_17.error; }
1010
+ finally { if (e_21) throw e_21.error; }
850
1011
  }
851
1012
  return artifacts;
852
1013
  }
853
1014
  function collectInfraChecks(evidence) {
854
- var e_18, _a;
1015
+ var e_22, _a;
855
1016
  var _b;
856
1017
  var checks = [];
857
1018
  try {
@@ -868,12 +1029,12 @@ function collectInfraChecks(evidence) {
868
1029
  });
869
1030
  }
870
1031
  }
871
- catch (e_18_1) { e_18 = { error: e_18_1 }; }
1032
+ catch (e_22_1) { e_22 = { error: e_22_1 }; }
872
1033
  finally {
873
1034
  try {
874
1035
  if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
875
1036
  }
876
- finally { if (e_18) throw e_18.error; }
1037
+ finally { if (e_22) throw e_22.error; }
877
1038
  }
878
1039
  if (evidence === null || evidence === void 0 ? void 0 : evidence.preflightStatus) {
879
1040
  checks.push({
@@ -906,7 +1067,7 @@ function collectCompileResult(evidence) {
906
1067
  };
907
1068
  }
908
1069
  function collectRouteProbes(evidence) {
909
- var e_19, _a, e_20, _b;
1070
+ var e_23, _a, e_24, _b;
910
1071
  var probes = [];
911
1072
  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);
912
1073
  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));
@@ -930,12 +1091,12 @@ function collectRouteProbes(evidence) {
930
1091
  });
931
1092
  }
932
1093
  }
933
- catch (e_19_1) { e_19 = { error: e_19_1 }; }
1094
+ catch (e_23_1) { e_23 = { error: e_23_1 }; }
934
1095
  finally {
935
1096
  try {
936
1097
  if (rows_1_1 && !rows_1_1.done && (_a = rows_1.return)) _a.call(rows_1);
937
1098
  }
938
- finally { if (e_19) throw e_19.error; }
1099
+ finally { if (e_23) throw e_23.error; }
939
1100
  }
940
1101
  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));
941
1102
  try {
@@ -957,17 +1118,17 @@ function collectRouteProbes(evidence) {
957
1118
  }
958
1119
  }
959
1120
  }
960
- catch (e_20_1) { e_20 = { error: e_20_1 }; }
1121
+ catch (e_24_1) { e_24 = { error: e_24_1 }; }
961
1122
  finally {
962
1123
  try {
963
1124
  if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
964
1125
  }
965
- finally { if (e_20) throw e_20.error; }
1126
+ finally { if (e_24) throw e_24.error; }
966
1127
  }
967
1128
  return probes;
968
1129
  }
969
1130
  function collectBusinessAssertions(evidence) {
970
- var e_21, _a;
1131
+ var e_25, _a;
971
1132
  var assertions = [];
972
1133
  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);
973
1134
  try {
@@ -990,12 +1151,12 @@ function collectBusinessAssertions(evidence) {
990
1151
  });
991
1152
  }
992
1153
  }
993
- catch (e_21_1) { e_21 = { error: e_21_1 }; }
1154
+ catch (e_25_1) { e_25 = { error: e_25_1 }; }
994
1155
  finally {
995
1156
  try {
996
1157
  if (rows_2_1 && !rows_2_1.done && (_a = rows_2.return)) _a.call(rows_2);
997
1158
  }
998
- finally { if (e_21) throw e_21.error; }
1159
+ finally { if (e_25) throw e_25.error; }
999
1160
  }
1000
1161
  if (!assertions.length && (evidence === null || evidence === void 0 ? void 0 : evidence.qaRunOutcome) === 'business_assertion_passed') {
1001
1162
  assertions.push({
@@ -1054,7 +1215,7 @@ function businessAssertionPassed(assertion) {
1054
1215
  return /^(pass|passed|success|ok|done)$/i.test(cleanText(assertion.status, 40));
1055
1216
  }
1056
1217
  function supportAssertionMatchesDiagnosisProof(assertion, proofPlan) {
1057
- var e_22, _a;
1218
+ var e_26, _a;
1058
1219
  var metadata = assertion.metadata || {};
1059
1220
  if (metadata.diagnosisProofPlanMatched === true || metadata.proofPlanMatched === true || metadata.supportDiagnosisProof === true) {
1060
1221
  return true;
@@ -1099,12 +1260,12 @@ function supportAssertionMatchesDiagnosisProof(assertion, proofPlan) {
1099
1260
  }
1100
1261
  }
1101
1262
  }
1102
- catch (e_22_1) { e_22 = { error: e_22_1 }; }
1263
+ catch (e_26_1) { e_26 = { error: e_26_1 }; }
1103
1264
  finally {
1104
1265
  try {
1105
1266
  if (proofTokens_1_1 && !proofTokens_1_1.done && (_a = proofTokens_1.return)) _a.call(proofTokens_1);
1106
1267
  }
1107
- finally { if (e_22) throw e_22.error; }
1268
+ finally { if (e_26) throw e_26.error; }
1108
1269
  }
1109
1270
  return overlap >= Math.min(4, Math.max(3, Math.ceil(proofTokens.size * 0.45)));
1110
1271
  }
@@ -1352,8 +1513,43 @@ function supportDiagnosisBeforeRepairGate(diagnosisGate, repairEvidence, now) {
1352
1513
  }
1353
1514
  };
1354
1515
  }
1516
+ function supportOwnerFileScopeGate(diagnosisGate, repairEvidence, now) {
1517
+ if (!repairEvidence.attempted) {
1518
+ return undefined;
1519
+ }
1520
+ var validation = (0, support_runner_v5_1.validateResolveIOSupportDiagnosisGate)(diagnosisGate);
1521
+ if (!validation.valid || !validation.normalized) {
1522
+ return undefined;
1523
+ }
1524
+ var outsideOwnerFiles = (0, support_runner_v5_1.changedFilesOutsideResolveIOSupportDiagnosisOwnerFiles)(validation.normalized, repairEvidence.changedFiles, { allowTests: true });
1525
+ var status = outsideOwnerFiles.length ? 'blocked' : 'pass';
1526
+ return {
1527
+ key: 'support_owner_file_scope',
1528
+ label: 'Support owner-file scope',
1529
+ status: status,
1530
+ reason: outsideOwnerFiles.length
1531
+ ? "Support repair changed files outside diagnosis owner_files; revise diagnosis with new evidence before broadening edits: ".concat(outsideOwnerFiles.join(', '))
1532
+ : 'Support repair stayed within diagnosis owner_files; test-only changes are allowed as supporting evidence.',
1533
+ evidenceRefs: outsideOwnerFiles.length ? outsideOwnerFiles : repairEvidence.changedFiles,
1534
+ recordedAt: isoNow(now),
1535
+ metadata: {
1536
+ repairAttempted: true,
1537
+ diagnosisValid: true,
1538
+ issueClass: validation.normalized.issue_class,
1539
+ ownerFiles: validation.normalized.owner_files,
1540
+ changedFiles: repairEvidence.changedFiles,
1541
+ outsideOwnerFiles: outsideOwnerFiles,
1542
+ allowedTestFilesOutsideOwnerScope: true,
1543
+ productRepairAllowed: outsideOwnerFiles.length === 0,
1544
+ allowedDispatchAction: outsideOwnerFiles.length ? 'run_read_only_diagnosis' : 'run_business_proof_qa',
1545
+ requiredEvidence: outsideOwnerFiles.length
1546
+ ? ['revised SupportDiagnosisGate with evidence for each new owner file', 'updated failing_path and proof_plan matching broadened scope']
1547
+ : ['compile/unit proof', 'AIQaBusinessAssertion mapped to diagnosis proof_plan']
1548
+ }
1549
+ };
1550
+ }
1355
1551
  function evidenceObject() {
1356
- var e_23, _a;
1552
+ var e_27, _a;
1357
1553
  var values = [];
1358
1554
  for (var _i = 0; _i < arguments.length; _i++) {
1359
1555
  values[_i] = arguments[_i];
@@ -1366,17 +1562,17 @@ function evidenceObject() {
1366
1562
  }
1367
1563
  }
1368
1564
  }
1369
- catch (e_23_1) { e_23 = { error: e_23_1 }; }
1565
+ catch (e_27_1) { e_27 = { error: e_27_1 }; }
1370
1566
  finally {
1371
1567
  try {
1372
1568
  if (values_1_1 && !values_1_1.done && (_a = values_1.return)) _a.call(values_1);
1373
1569
  }
1374
- finally { if (e_23) throw e_23.error; }
1570
+ finally { if (e_27) throw e_27.error; }
1375
1571
  }
1376
1572
  return {};
1377
1573
  }
1378
1574
  function mergeEvidenceRecords() {
1379
- var e_24, _a, e_25, _b;
1575
+ var e_28, _a, e_29, _b;
1380
1576
  var values = [];
1381
1577
  for (var _i = 0; _i < arguments.length; _i++) {
1382
1578
  values[_i] = arguments[_i];
@@ -1387,7 +1583,7 @@ function mergeEvidenceRecords() {
1387
1583
  var value = values_2_1.value;
1388
1584
  var source = plainObject(value);
1389
1585
  try {
1390
- for (var _c = (e_25 = void 0, __values(Object.entries(source))), _d = _c.next(); !_d.done; _d = _c.next()) {
1586
+ for (var _c = (e_29 = void 0, __values(Object.entries(source))), _d = _c.next(); !_d.done; _d = _c.next()) {
1391
1587
  var _e = __read(_d.value, 2), key = _e[0], entry = _e[1];
1392
1588
  if (entry === undefined || entry === null || entry === '') {
1393
1589
  continue;
@@ -1403,21 +1599,21 @@ function mergeEvidenceRecords() {
1403
1599
  merged[key] = entry;
1404
1600
  }
1405
1601
  }
1406
- catch (e_25_1) { e_25 = { error: e_25_1 }; }
1602
+ catch (e_29_1) { e_29 = { error: e_29_1 }; }
1407
1603
  finally {
1408
1604
  try {
1409
1605
  if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
1410
1606
  }
1411
- finally { if (e_25) throw e_25.error; }
1607
+ finally { if (e_29) throw e_29.error; }
1412
1608
  }
1413
1609
  }
1414
1610
  }
1415
- catch (e_24_1) { e_24 = { error: e_24_1 }; }
1611
+ catch (e_28_1) { e_28 = { error: e_28_1 }; }
1416
1612
  finally {
1417
1613
  try {
1418
1614
  if (values_2_1 && !values_2_1.done && (_a = values_2.return)) _a.call(values_2);
1419
1615
  }
1420
- finally { if (e_24) throw e_24.error; }
1616
+ finally { if (e_28) throw e_28.error; }
1421
1617
  }
1422
1618
  return merged;
1423
1619
  }
@@ -1978,7 +2174,7 @@ function supportIssueClassProbePlanGate(plan, diagnosisGate, now, required) {
1978
2174
  };
1979
2175
  }
1980
2176
  function firstNonEmptyText(values, max) {
1981
- var e_26, _a;
2177
+ var e_30, _a;
1982
2178
  if (max === void 0) { max = 1000; }
1983
2179
  try {
1984
2180
  for (var values_3 = __values(values), values_3_1 = values_3.next(); !values_3_1.done; values_3_1 = values_3.next()) {
@@ -1989,12 +2185,12 @@ function firstNonEmptyText(values, max) {
1989
2185
  }
1990
2186
  }
1991
2187
  }
1992
- catch (e_26_1) { e_26 = { error: e_26_1 }; }
2188
+ catch (e_30_1) { e_30 = { error: e_30_1 }; }
1993
2189
  finally {
1994
2190
  try {
1995
2191
  if (values_3_1 && !values_3_1.done && (_a = values_3.return)) _a.call(values_3);
1996
2192
  }
1997
- finally { if (e_26) throw e_26.error; }
2193
+ finally { if (e_30) throw e_30.error; }
1998
2194
  }
1999
2195
  return undefined;
2000
2196
  }
@@ -2487,24 +2683,24 @@ function assistantDateWindowObject(quality) {
2487
2683
  return Object.keys(dateWindow).length ? dateWindow : nestedWindow;
2488
2684
  }
2489
2685
  function collectMongoProjectionObjects(value, result) {
2490
- var e_27, _a;
2686
+ var e_31, _a;
2491
2687
  if (result === void 0) { result = []; }
2492
2688
  if (!value || typeof value !== 'object') {
2493
2689
  return result;
2494
2690
  }
2495
2691
  if (Array.isArray(value)) {
2496
2692
  try {
2497
- for (var value_2 = __values(value), value_2_1 = value_2.next(); !value_2_1.done; value_2_1 = value_2.next()) {
2498
- var entry = value_2_1.value;
2693
+ for (var value_3 = __values(value), value_3_1 = value_3.next(); !value_3_1.done; value_3_1 = value_3.next()) {
2694
+ var entry = value_3_1.value;
2499
2695
  collectMongoProjectionObjects(entry, result);
2500
2696
  }
2501
2697
  }
2502
- catch (e_27_1) { e_27 = { error: e_27_1 }; }
2698
+ catch (e_31_1) { e_31 = { error: e_31_1 }; }
2503
2699
  finally {
2504
2700
  try {
2505
- if (value_2_1 && !value_2_1.done && (_a = value_2.return)) _a.call(value_2);
2701
+ if (value_3_1 && !value_3_1.done && (_a = value_3.return)) _a.call(value_3);
2506
2702
  }
2507
- finally { if (e_27) throw e_27.error; }
2703
+ finally { if (e_31) throw e_31.error; }
2508
2704
  }
2509
2705
  return result;
2510
2706
  }
@@ -2924,8 +3120,8 @@ function applyAssistantAnswerQualityGate(qa, decision, now) {
2924
3120
  ], false) });
2925
3121
  }
2926
3122
  function buildSupportAIRunFromEvidence(input) {
2927
- var e_28, _a, e_29, _b;
2928
- 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, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44;
3123
+ var e_32, _a, e_33, _b;
3124
+ 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, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51;
2929
3125
  var ticket = input.ticket || {};
2930
3126
  var job = input.job || {};
2931
3127
  var evidence = buildSupportQaEvidence(input);
@@ -2937,8 +3133,8 @@ function buildSupportAIRunFromEvidence(input) {
2937
3133
  addSourceId(sourceIds, 'jobId', job._id || job.id || job.jobId);
2938
3134
  addSourceId(sourceIds, 'buildPlanId', job.buildPlanId || ticket.buildPlanId);
2939
3135
  try {
2940
- for (var _45 = __values(asArray(input.taskEvents)), _46 = _45.next(); !_46.done; _46 = _45.next()) {
2941
- var event_1 = _46.value;
3136
+ for (var _52 = __values(asArray(input.taskEvents)), _53 = _52.next(); !_53.done; _53 = _52.next()) {
3137
+ var event_1 = _53.value;
2942
3138
  pushEvent(events, {
2943
3139
  type: event_1.type === 'human_intervention' ? 'human_intervention' : 'log',
2944
3140
  category: cleanText(event_1.category || event_1.phase || event_1.type, 160),
@@ -2952,16 +3148,16 @@ function buildSupportAIRunFromEvidence(input) {
2952
3148
  });
2953
3149
  }
2954
3150
  }
2955
- catch (e_28_1) { e_28 = { error: e_28_1 }; }
3151
+ catch (e_32_1) { e_32 = { error: e_32_1 }; }
2956
3152
  finally {
2957
3153
  try {
2958
- if (_46 && !_46.done && (_a = _45.return)) _a.call(_45);
3154
+ if (_53 && !_53.done && (_a = _52.return)) _a.call(_52);
2959
3155
  }
2960
- finally { if (e_28) throw e_28.error; }
3156
+ finally { if (e_32) throw e_32.error; }
2961
3157
  }
2962
3158
  try {
2963
- for (var _47 = __values(asArray(input.aiJobs)), _48 = _47.next(); !_48.done; _48 = _47.next()) {
2964
- var aiJob = _48.value;
3159
+ for (var _54 = __values(asArray(input.aiJobs)), _55 = _54.next(); !_55.done; _55 = _54.next()) {
3160
+ var aiJob = _55.value;
2965
3161
  pushEvent(events, {
2966
3162
  type: aiJob.model ? 'model_call' : 'log',
2967
3163
  category: cleanText(aiJob.category || aiJob.phase || aiJob.runner, 160),
@@ -2976,12 +3172,12 @@ function buildSupportAIRunFromEvidence(input) {
2976
3172
  });
2977
3173
  }
2978
3174
  }
2979
- catch (e_29_1) { e_29 = { error: e_29_1 }; }
3175
+ catch (e_33_1) { e_33 = { error: e_33_1 }; }
2980
3176
  finally {
2981
3177
  try {
2982
- if (_48 && !_48.done && (_b = _47.return)) _b.call(_47);
3178
+ if (_55 && !_55.done && (_b = _54.return)) _b.call(_54);
2983
3179
  }
2984
- finally { if (e_29) throw e_29.error; }
3180
+ finally { if (e_33) throw e_33.error; }
2985
3181
  }
2986
3182
  collectCommitEvents(asArray(input.commits), events);
2987
3183
  collectHotfixEvidenceEvents([job, ticket, evidence, input.qaEvidence], events, gates, input.now);
@@ -3131,6 +3327,18 @@ function buildSupportAIRunFromEvidence(input) {
3131
3327
  metadata: diagnosisBeforeRepairGate.metadata
3132
3328
  });
3133
3329
  }
3330
+ var ownerFileScopeGate = supportOwnerFileScopeGate(diagnosisGate, productRepairEvidence, input.now);
3331
+ if (ownerFileScopeGate) {
3332
+ gates.push(ownerFileScopeGate);
3333
+ pushEvent(events, {
3334
+ type: 'log',
3335
+ category: 'support_owner_file_scope',
3336
+ message: ownerFileScopeGate.reason,
3337
+ artifactPaths: ownerFileScopeGate.evidenceRefs,
3338
+ recordedAt: ownerFileScopeGate.recordedAt,
3339
+ metadata: ownerFileScopeGate.metadata
3340
+ });
3341
+ }
3134
3342
  var qa = applySupportDiagnosisProofGate(buildQaFromEvidence(evidence, input.now), diagnosisGate, input.now);
3135
3343
  var diagnosisOwnerFiles = asArray(diagnosisGate.owner_files || diagnosisGate.ownerFiles);
3136
3344
  var diagnosisIssueClass = cleanText(diagnosisGate.issue_class || diagnosisGate.issueClass, 120);
@@ -3183,51 +3391,61 @@ function buildSupportAIRunFromEvidence(input) {
3183
3391
  productRepairAllowed: ((_l = diagnosisBeforeRepairGate.metadata) === null || _l === void 0 ? void 0 : _l.productRepairAllowed) === true,
3184
3392
  blockers: cleanStringList((_m = diagnosisBeforeRepairGate.metadata) === null || _m === void 0 ? void 0 : _m.blockers, 20, 500)
3185
3393
  } : undefined,
3394
+ ownerFileScope: ownerFileScopeGate ? {
3395
+ status: ownerFileScopeGate.status,
3396
+ productRepairAllowed: ((_o = ownerFileScopeGate.metadata) === null || _o === void 0 ? void 0 : _o.productRepairAllowed) === true,
3397
+ allowedDispatchAction: cleanText((_p = ownerFileScopeGate.metadata) === null || _p === void 0 ? void 0 : _p.allowedDispatchAction, 160),
3398
+ ownerFiles: cleanStringList((_q = ownerFileScopeGate.metadata) === null || _q === void 0 ? void 0 : _q.ownerFiles, 40, 500),
3399
+ changedFiles: cleanStringList((_r = ownerFileScopeGate.metadata) === null || _r === void 0 ? void 0 : _r.changedFiles, 60, 500),
3400
+ outsideOwnerFiles: cleanStringList((_s = ownerFileScopeGate.metadata) === null || _s === void 0 ? void 0 : _s.outsideOwnerFiles, 40, 500),
3401
+ allowedTestFilesOutsideOwnerScope: ((_t = ownerFileScopeGate.metadata) === null || _t === void 0 ? void 0 : _t.allowedTestFilesOutsideOwnerScope) === true,
3402
+ requiredEvidence: cleanStringList((_u = ownerFileScopeGate.metadata) === null || _u === void 0 ? void 0 : _u.requiredEvidence, 20, 500)
3403
+ } : undefined,
3186
3404
  rootCauseEntryContract: Object.keys(rootCauseEntryContract).length ? {
3187
3405
  contractId: cleanText(rootCauseEntryContract.contract_id || rootCauseEntryContract.contractId, 160),
3188
3406
  version: cleanText(rootCauseEntryContract.version, 120),
3189
3407
  status: cleanText(rootCauseEntryContract.status, 120),
3190
3408
  issueClassProbeCount: asArray(rootCauseEntryContract.issue_class_probes || rootCauseEntryContract.issueClassProbes).length,
3191
- ownerFileMax: Number(((_o = rootCauseEntryContract.owner_file_policy) === null || _o === void 0 ? void 0 : _o.max_files) || ((_p = rootCauseEntryContract.ownerFilePolicy) === null || _p === void 0 ? void 0 : _p.maxFiles) || 0) || 0,
3192
- requiresBusinessAssertion: ((_q = rootCauseEntryContract.business_proof_policy) === null || _q === void 0 ? void 0 : _q.requires_aiqa_business_assertion) === true
3193
- || ((_r = rootCauseEntryContract.businessProofPolicy) === null || _r === void 0 ? void 0 : _r.requiresAiqaBusinessAssertion) === true
3409
+ ownerFileMax: Number(((_v = rootCauseEntryContract.owner_file_policy) === null || _v === void 0 ? void 0 : _v.max_files) || ((_w = rootCauseEntryContract.ownerFilePolicy) === null || _w === void 0 ? void 0 : _w.maxFiles) || 0) || 0,
3410
+ requiresBusinessAssertion: ((_x = rootCauseEntryContract.business_proof_policy) === null || _x === void 0 ? void 0 : _x.requires_aiqa_business_assertion) === true
3411
+ || ((_y = rootCauseEntryContract.businessProofPolicy) === null || _y === void 0 ? void 0 : _y.requiresAiqaBusinessAssertion) === true
3194
3412
  } : undefined,
3195
3413
  diagnosis: Object.keys(diagnosisGate).length ? {
3196
3414
  status: cleanText(diagnosisGate.status, 80),
3197
3415
  issueClass: diagnosisIssueClass,
3198
3416
  ownerFiles: diagnosisOwnerFiles,
3199
- acceptedHypothesis: cleanText(((_s = diagnosisGate.accepted_hypothesis) === null || _s === void 0 ? void 0 : _s.statement) || ((_t = diagnosisGate.acceptedHypothesis) === null || _t === void 0 ? void 0 : _t.statement), 1000),
3417
+ acceptedHypothesis: cleanText(((_z = diagnosisGate.accepted_hypothesis) === null || _z === void 0 ? void 0 : _z.statement) || ((_0 = diagnosisGate.acceptedHypothesis) === null || _0 === void 0 ? void 0 : _0.statement), 1000),
3200
3418
  proofPlan: diagnosisGate.proof_plan || diagnosisGate.proofPlan
3201
3419
  } : undefined,
3202
3420
  diagnosisEvidencePack: diagnosisEvidencePackGate ? {
3203
- status: cleanText((_u = diagnosisEvidencePackGate.metadata) === null || _u === void 0 ? void 0 : _u.status, 120),
3421
+ status: cleanText((_1 = diagnosisEvidencePackGate.metadata) === null || _1 === void 0 ? void 0 : _1.status, 120),
3204
3422
  gateStatus: diagnosisEvidencePackGate.status,
3205
- packId: cleanText((_v = diagnosisEvidencePackGate.metadata) === null || _v === void 0 ? void 0 : _v.packId, 180),
3206
- readOnly: ((_w = diagnosisEvidencePackGate.metadata) === null || _w === void 0 ? void 0 : _w.readOnly) !== false,
3207
- sourceEditsAllowed: ((_x = diagnosisEvidencePackGate.metadata) === null || _x === void 0 ? void 0 : _x.sourceEditsAllowed) === true,
3208
- requiredOutputKey: cleanText((_y = diagnosisEvidencePackGate.metadata) === null || _y === void 0 ? void 0 : _y.requiredOutputKey, 120),
3209
- diagnosisValid: ((_z = diagnosisEvidencePackGate.metadata) === null || _z === void 0 ? void 0 : _z.diagnosisValid) === true,
3210
- issueClassHint: cleanText((_0 = diagnosisEvidencePackGate.metadata) === null || _0 === void 0 ? void 0 : _0.issueClassHint, 120),
3211
- ownerFileHints: cleanStringList((_1 = diagnosisEvidencePackGate.metadata) === null || _1 === void 0 ? void 0 : _1.ownerFileHints, 20, 500),
3212
- similarHintCount: Number(((_2 = diagnosisEvidencePackGate.metadata) === null || _2 === void 0 ? void 0 : _2.similarHintCount) || 0),
3213
- similarHintsAdvisoryOnly: ((_3 = diagnosisEvidencePackGate.metadata) === null || _3 === void 0 ? void 0 : _3.similarHintsAdvisoryOnly) === true,
3214
- issueClassProbeCount: Number(((_4 = diagnosisEvidencePackGate.metadata) === null || _4 === void 0 ? void 0 : _4.issueClassProbeCount) || 0),
3215
- validationBlockers: cleanStringList((_5 = diagnosisEvidencePackGate.metadata) === null || _5 === void 0 ? void 0 : _5.validationBlockers, 20, 500)
3423
+ packId: cleanText((_2 = diagnosisEvidencePackGate.metadata) === null || _2 === void 0 ? void 0 : _2.packId, 180),
3424
+ readOnly: ((_3 = diagnosisEvidencePackGate.metadata) === null || _3 === void 0 ? void 0 : _3.readOnly) !== false,
3425
+ sourceEditsAllowed: ((_4 = diagnosisEvidencePackGate.metadata) === null || _4 === void 0 ? void 0 : _4.sourceEditsAllowed) === true,
3426
+ requiredOutputKey: cleanText((_5 = diagnosisEvidencePackGate.metadata) === null || _5 === void 0 ? void 0 : _5.requiredOutputKey, 120),
3427
+ diagnosisValid: ((_6 = diagnosisEvidencePackGate.metadata) === null || _6 === void 0 ? void 0 : _6.diagnosisValid) === true,
3428
+ issueClassHint: cleanText((_7 = diagnosisEvidencePackGate.metadata) === null || _7 === void 0 ? void 0 : _7.issueClassHint, 120),
3429
+ ownerFileHints: cleanStringList((_8 = diagnosisEvidencePackGate.metadata) === null || _8 === void 0 ? void 0 : _8.ownerFileHints, 20, 500),
3430
+ similarHintCount: Number(((_9 = diagnosisEvidencePackGate.metadata) === null || _9 === void 0 ? void 0 : _9.similarHintCount) || 0),
3431
+ similarHintsAdvisoryOnly: ((_10 = diagnosisEvidencePackGate.metadata) === null || _10 === void 0 ? void 0 : _10.similarHintsAdvisoryOnly) === true,
3432
+ issueClassProbeCount: Number(((_11 = diagnosisEvidencePackGate.metadata) === null || _11 === void 0 ? void 0 : _11.issueClassProbeCount) || 0),
3433
+ validationBlockers: cleanStringList((_12 = diagnosisEvidencePackGate.metadata) === null || _12 === void 0 ? void 0 : _12.validationBlockers, 20, 500)
3216
3434
  } : undefined,
3217
3435
  issueClassProbePlan: issueClassProbePlanGate ? {
3218
- status: cleanText((_6 = issueClassProbePlanGate.metadata) === null || _6 === void 0 ? void 0 : _6.status, 120),
3436
+ status: cleanText((_13 = issueClassProbePlanGate.metadata) === null || _13 === void 0 ? void 0 : _13.status, 120),
3219
3437
  gateStatus: issueClassProbePlanGate.status,
3220
- planId: cleanText((_7 = issueClassProbePlanGate.metadata) === null || _7 === void 0 ? void 0 : _7.planId, 180),
3221
- issueClass: cleanText((_8 = issueClassProbePlanGate.metadata) === null || _8 === void 0 ? void 0 : _8.issueClass, 120),
3222
- diagnosisValid: ((_9 = issueClassProbePlanGate.metadata) === null || _9 === void 0 ? void 0 : _9.diagnosisValid) === true,
3223
- issueClassProbePlanReady: ((_10 = issueClassProbePlanGate.metadata) === null || _10 === void 0 ? void 0 : _10.issueClassProbePlanReady) === true,
3224
- activeRoute: cleanText((_11 = issueClassProbePlanGate.metadata) === null || _11 === void 0 ? void 0 : _11.activeRoute, 500),
3225
- action: cleanText((_12 = issueClassProbePlanGate.metadata) === null || _12 === void 0 ? void 0 : _12.action, 1000),
3226
- expectedBusinessProof: cleanText((_13 = issueClassProbePlanGate.metadata) === null || _13 === void 0 ? void 0 : _13.expectedBusinessProof, 1200),
3227
- acceptanceGate: cleanText((_14 = issueClassProbePlanGate.metadata) === null || _14 === void 0 ? void 0 : _14.acceptanceGate, 120),
3228
- requiredArtifacts: cleanStringList((_15 = issueClassProbePlanGate.metadata) === null || _15 === void 0 ? void 0 : _15.requiredArtifacts, 20, 500),
3229
- falsePassBlockers: cleanStringList((_16 = issueClassProbePlanGate.metadata) === null || _16 === void 0 ? void 0 : _16.falsePassBlockers, 20, 500),
3230
- blockers: cleanStringList((_17 = issueClassProbePlanGate.metadata) === null || _17 === void 0 ? void 0 : _17.blockers, 20, 500)
3438
+ planId: cleanText((_14 = issueClassProbePlanGate.metadata) === null || _14 === void 0 ? void 0 : _14.planId, 180),
3439
+ issueClass: cleanText((_15 = issueClassProbePlanGate.metadata) === null || _15 === void 0 ? void 0 : _15.issueClass, 120),
3440
+ diagnosisValid: ((_16 = issueClassProbePlanGate.metadata) === null || _16 === void 0 ? void 0 : _16.diagnosisValid) === true,
3441
+ issueClassProbePlanReady: ((_17 = issueClassProbePlanGate.metadata) === null || _17 === void 0 ? void 0 : _17.issueClassProbePlanReady) === true,
3442
+ activeRoute: cleanText((_18 = issueClassProbePlanGate.metadata) === null || _18 === void 0 ? void 0 : _18.activeRoute, 500),
3443
+ action: cleanText((_19 = issueClassProbePlanGate.metadata) === null || _19 === void 0 ? void 0 : _19.action, 1000),
3444
+ expectedBusinessProof: cleanText((_20 = issueClassProbePlanGate.metadata) === null || _20 === void 0 ? void 0 : _20.expectedBusinessProof, 1200),
3445
+ acceptanceGate: cleanText((_21 = issueClassProbePlanGate.metadata) === null || _21 === void 0 ? void 0 : _21.acceptanceGate, 120),
3446
+ requiredArtifacts: cleanStringList((_22 = issueClassProbePlanGate.metadata) === null || _22 === void 0 ? void 0 : _22.requiredArtifacts, 20, 500),
3447
+ falsePassBlockers: cleanStringList((_23 = issueClassProbePlanGate.metadata) === null || _23 === void 0 ? void 0 : _23.falsePassBlockers, 20, 500),
3448
+ blockers: cleanStringList((_24 = issueClassProbePlanGate.metadata) === null || _24 === void 0 ? void 0 : _24.blockers, 20, 500)
3231
3449
  } : undefined,
3232
3450
  businessProofReadiness: Object.keys(businessProofReadiness).length ? {
3233
3451
  ready: businessProofReadiness.ready === true,
@@ -3237,19 +3455,19 @@ function buildSupportAIRunFromEvidence(input) {
3237
3455
  } : undefined,
3238
3456
  nextActionContract: nextActionContractGate ? {
3239
3457
  status: nextActionContractGate.status,
3240
- action: cleanText((_18 = nextActionContractGate.metadata) === null || _18 === void 0 ? void 0 : _18.action, 160),
3241
- primaryCommand: cleanText((_19 = nextActionContractGate.metadata) === null || _19 === void 0 ? void 0 : _19.primaryCommand, 240),
3242
- safeToAutoRun: ((_20 = nextActionContractGate.metadata) === null || _20 === void 0 ? void 0 : _20.safeToAutoRun) === true,
3243
- canRunWithoutCodexMonitor: ((_21 = nextActionContractGate.metadata) === null || _21 === void 0 ? void 0 : _21.canRunWithoutCodexMonitor) === true,
3244
- codexFallbackRequired: ((_22 = nextActionContractGate.metadata) === null || _22 === void 0 ? void 0 : _22.codexFallbackRequired) === true,
3245
- requiresHumanApproval: ((_23 = nextActionContractGate.metadata) === null || _23 === void 0 ? void 0 : _23.requiresHumanApproval) === true,
3246
- rootCauseFirstSatisfied: ((_24 = nextActionContractGate.metadata) === null || _24 === void 0 ? void 0 : _24.rootCauseFirstSatisfied) === true,
3247
- hotfixCommitRequired: ((_25 = nextActionContractGate.metadata) === null || _25 === void 0 ? void 0 : _25.hotfixCommitRequired) === true,
3248
- liveHotfixBlockedUntilCommit: ((_26 = nextActionContractGate.metadata) === null || _26 === void 0 ? void 0 : _26.liveHotfixBlockedUntilCommit) === true,
3249
- failureClass: cleanText((_27 = nextActionContractGate.metadata) === null || _27 === void 0 ? void 0 : _27.failureClass, 120),
3250
- evidenceFreshnessStatus: cleanText((_28 = nextActionContractGate.metadata) === null || _28 === void 0 ? void 0 : _28.evidenceFreshnessStatus, 120),
3251
- sameFailureCount: Number(((_29 = nextActionContractGate.metadata) === null || _29 === void 0 ? void 0 : _29.sameFailureCount) || 0),
3252
- blockers: cleanStringList((_30 = nextActionContractGate.metadata) === null || _30 === void 0 ? void 0 : _30.blockers, 20, 500)
3458
+ action: cleanText((_25 = nextActionContractGate.metadata) === null || _25 === void 0 ? void 0 : _25.action, 160),
3459
+ primaryCommand: cleanText((_26 = nextActionContractGate.metadata) === null || _26 === void 0 ? void 0 : _26.primaryCommand, 240),
3460
+ safeToAutoRun: ((_27 = nextActionContractGate.metadata) === null || _27 === void 0 ? void 0 : _27.safeToAutoRun) === true,
3461
+ canRunWithoutCodexMonitor: ((_28 = nextActionContractGate.metadata) === null || _28 === void 0 ? void 0 : _28.canRunWithoutCodexMonitor) === true,
3462
+ codexFallbackRequired: ((_29 = nextActionContractGate.metadata) === null || _29 === void 0 ? void 0 : _29.codexFallbackRequired) === true,
3463
+ requiresHumanApproval: ((_30 = nextActionContractGate.metadata) === null || _30 === void 0 ? void 0 : _30.requiresHumanApproval) === true,
3464
+ rootCauseFirstSatisfied: ((_31 = nextActionContractGate.metadata) === null || _31 === void 0 ? void 0 : _31.rootCauseFirstSatisfied) === true,
3465
+ hotfixCommitRequired: ((_32 = nextActionContractGate.metadata) === null || _32 === void 0 ? void 0 : _32.hotfixCommitRequired) === true,
3466
+ liveHotfixBlockedUntilCommit: ((_33 = nextActionContractGate.metadata) === null || _33 === void 0 ? void 0 : _33.liveHotfixBlockedUntilCommit) === true,
3467
+ failureClass: cleanText((_34 = nextActionContractGate.metadata) === null || _34 === void 0 ? void 0 : _34.failureClass, 120),
3468
+ evidenceFreshnessStatus: cleanText((_35 = nextActionContractGate.metadata) === null || _35 === void 0 ? void 0 : _35.evidenceFreshnessStatus, 120),
3469
+ sameFailureCount: Number(((_36 = nextActionContractGate.metadata) === null || _36 === void 0 ? void 0 : _36.sameFailureCount) || 0),
3470
+ blockers: cleanStringList((_37 = nextActionContractGate.metadata) === null || _37 === void 0 ? void 0 : _37.blockers, 20, 500)
3253
3471
  } : undefined,
3254
3472
  customerReplyPolicy: Object.keys(customerReplyPolicy).length ? {
3255
3473
  action: cleanText(customerReplyPolicy.action, 120),
@@ -3257,24 +3475,24 @@ function buildSupportAIRunFromEvidence(input) {
3257
3475
  canDraftCustomerReply: customerReplyPolicy.canDraftCustomerReply === true || customerReplyPolicy.can_draft_customer_reply === true,
3258
3476
  canSendCustomerReply: customerReplyPolicy.canSendCustomerReply === true || customerReplyPolicy.can_send_customer_reply === true,
3259
3477
  reason: cleanText(customerReplyPolicy.reason, 1000),
3260
- reviewType: cleanText(((_31 = customerReplyPolicy.humanReviewPacket) === null || _31 === void 0 ? void 0 : _31.reviewType)
3261
- || ((_32 = customerReplyPolicy.human_review_packet) === null || _32 === void 0 ? void 0 : _32.review_type)
3262
- || ((_33 = customerReplyPolicy.human_review_packet) === null || _33 === void 0 ? void 0 : _33.reviewType), 160),
3263
- primaryAction: cleanText(((_34 = customerReplyPolicy.humanReviewPacket) === null || _34 === void 0 ? void 0 : _34.primaryAction)
3264
- || ((_35 = customerReplyPolicy.human_review_packet) === null || _35 === void 0 ? void 0 : _35.primary_action)
3265
- || ((_36 = customerReplyPolicy.human_review_packet) === null || _36 === void 0 ? void 0 : _36.primaryAction), 160),
3478
+ reviewType: cleanText(((_38 = customerReplyPolicy.humanReviewPacket) === null || _38 === void 0 ? void 0 : _38.reviewType)
3479
+ || ((_39 = customerReplyPolicy.human_review_packet) === null || _39 === void 0 ? void 0 : _39.review_type)
3480
+ || ((_40 = customerReplyPolicy.human_review_packet) === null || _40 === void 0 ? void 0 : _40.reviewType), 160),
3481
+ primaryAction: cleanText(((_41 = customerReplyPolicy.humanReviewPacket) === null || _41 === void 0 ? void 0 : _41.primaryAction)
3482
+ || ((_42 = customerReplyPolicy.human_review_packet) === null || _42 === void 0 ? void 0 : _42.primary_action)
3483
+ || ((_43 = customerReplyPolicy.human_review_packet) === null || _43 === void 0 ? void 0 : _43.primaryAction), 160),
3266
3484
  clarificationContract: customerReplyPolicy.clarificationContract || customerReplyPolicy.clarification_contract ? {
3267
- status: cleanText(((_37 = customerReplyPolicy.clarificationContract) === null || _37 === void 0 ? void 0 : _37.status) || ((_38 = customerReplyPolicy.clarification_contract) === null || _38 === void 0 ? void 0 : _38.status), 120),
3268
- missingField: cleanText(((_39 = customerReplyPolicy.clarificationContract) === null || _39 === void 0 ? void 0 : _39.missingField) || ((_40 = customerReplyPolicy.clarification_contract) === null || _40 === void 0 ? void 0 : _40.missing_field), 120),
3269
- oneQuestionOnly: ((_41 = customerReplyPolicy.clarificationContract) === null || _41 === void 0 ? void 0 : _41.oneQuestionOnly) === true || ((_42 = customerReplyPolicy.clarification_contract) === null || _42 === void 0 ? void 0 : _42.one_question_only) === true,
3270
- parksTicketUntilCustomerReply: ((_43 = customerReplyPolicy.clarificationContract) === null || _43 === void 0 ? void 0 : _43.parksTicketUntilCustomerReply) === true || ((_44 = customerReplyPolicy.clarification_contract) === null || _44 === void 0 ? void 0 : _44.parks_ticket_until_customer_reply) === true
3485
+ status: cleanText(((_44 = customerReplyPolicy.clarificationContract) === null || _44 === void 0 ? void 0 : _44.status) || ((_45 = customerReplyPolicy.clarification_contract) === null || _45 === void 0 ? void 0 : _45.status), 120),
3486
+ missingField: cleanText(((_46 = customerReplyPolicy.clarificationContract) === null || _46 === void 0 ? void 0 : _46.missingField) || ((_47 = customerReplyPolicy.clarification_contract) === null || _47 === void 0 ? void 0 : _47.missing_field), 120),
3487
+ oneQuestionOnly: ((_48 = customerReplyPolicy.clarificationContract) === null || _48 === void 0 ? void 0 : _48.oneQuestionOnly) === true || ((_49 = customerReplyPolicy.clarification_contract) === null || _49 === void 0 ? void 0 : _49.one_question_only) === true,
3488
+ parksTicketUntilCustomerReply: ((_50 = customerReplyPolicy.clarificationContract) === null || _50 === void 0 ? void 0 : _50.parksTicketUntilCustomerReply) === true || ((_51 = customerReplyPolicy.clarification_contract) === null || _51 === void 0 ? void 0 : _51.parks_ticket_until_customer_reply) === true
3271
3489
  } : undefined
3272
3490
  } : undefined
3273
3491
  }
3274
3492
  });
3275
3493
  }
3276
3494
  function buildAICoderAIRunFromEvidence(input) {
3277
- var e_30, _a;
3495
+ var e_34, _a;
3278
3496
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28;
3279
3497
  var app = input.app || {};
3280
3498
  var job = input.job || {};
@@ -3302,12 +3520,12 @@ function buildAICoderAIRunFromEvidence(input) {
3302
3520
  });
3303
3521
  }
3304
3522
  }
3305
- catch (e_30_1) { e_30 = { error: e_30_1 }; }
3523
+ catch (e_34_1) { e_34 = { error: e_34_1 }; }
3306
3524
  finally {
3307
3525
  try {
3308
3526
  if (_30 && !_30.done && (_a = _29.return)) _a.call(_29);
3309
3527
  }
3310
- finally { if (e_30) throw e_30.error; }
3528
+ finally { if (e_34) throw e_34.error; }
3311
3529
  }
3312
3530
  collectCommitEvents(asArray(input.commits), events);
3313
3531
  collectHotfixEvidenceEvents([job, app, evidence, input.qaEvidence], events, gates, input.now);
@@ -3515,7 +3733,7 @@ function buildAICoderAIRunFromEvidence(input) {
3515
3733
  });
3516
3734
  }
3517
3735
  function buildAssistantAIRunFromEvidence(input) {
3518
- var e_31, _a, e_32, _b, e_33, _c;
3736
+ var e_35, _a, e_36, _b, e_37, _c;
3519
3737
  var _d, _e, _f, _g;
3520
3738
  var conversation = input.conversation || {};
3521
3739
  var events = [];
@@ -3541,12 +3759,12 @@ function buildAssistantAIRunFromEvidence(input) {
3541
3759
  });
3542
3760
  }
3543
3761
  }
3544
- catch (e_31_1) { e_31 = { error: e_31_1 }; }
3762
+ catch (e_35_1) { e_35 = { error: e_35_1 }; }
3545
3763
  finally {
3546
3764
  try {
3547
3765
  if (_j && !_j.done && (_a = _h.return)) _a.call(_h);
3548
3766
  }
3549
- finally { if (e_31) throw e_31.error; }
3767
+ finally { if (e_35) throw e_35.error; }
3550
3768
  }
3551
3769
  try {
3552
3770
  for (var _k = __values(asArray(input.issueReports)), _l = _k.next(); !_l.done; _l = _k.next()) {
@@ -3564,12 +3782,12 @@ function buildAssistantAIRunFromEvidence(input) {
3564
3782
  });
3565
3783
  }
3566
3784
  }
3567
- catch (e_32_1) { e_32 = { error: e_32_1 }; }
3785
+ catch (e_36_1) { e_36 = { error: e_36_1 }; }
3568
3786
  finally {
3569
3787
  try {
3570
3788
  if (_l && !_l.done && (_b = _k.return)) _b.call(_k);
3571
3789
  }
3572
- finally { if (e_32) throw e_32.error; }
3790
+ finally { if (e_36) throw e_36.error; }
3573
3791
  }
3574
3792
  var cost = collectUsageEvents(asArray(input.usageLedger), events);
3575
3793
  var answerQuality = assistantQualityObject(input);
@@ -3601,12 +3819,12 @@ function buildAssistantAIRunFromEvidence(input) {
3601
3819
  });
3602
3820
  }
3603
3821
  }
3604
- catch (e_33_1) { e_33 = { error: e_33_1 }; }
3822
+ catch (e_37_1) { e_37 = { error: e_37_1 }; }
3605
3823
  finally {
3606
3824
  try {
3607
3825
  if (_o && !_o.done && (_c = _m.return)) _c.call(_m);
3608
3826
  }
3609
- finally { if (e_33) throw e_33.error; }
3827
+ finally { if (e_37) throw e_37.error; }
3610
3828
  }
3611
3829
  var answerQualityDecision = evaluateAssistantAnswerQuality({
3612
3830
  answerQuality: answerQuality,