@resolveio/server-lib 22.3.194 → 22.3.196

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@resolveio/server-lib",
3
- "version": "22.3.194",
3
+ "version": "22.3.196",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "package": "./build_package.sh",
@@ -272,6 +272,57 @@ function managerNoBlindLoopGateFromHistory(history, budgetSource, now) {
272
272
  }
273
273
  };
274
274
  }
275
+ function managerRecoveryExecutionProofGate(proof, now) {
276
+ if (!proof || !Object.keys(proof).length) {
277
+ return undefined;
278
+ }
279
+ var validation = (0, ai_runner_manager_policy_1.validateResolveIOAIManagerRecoveryExecutionProofContract)(proof);
280
+ var normalized = validation.normalized;
281
+ var statusText = cleanText(normalized.status, 120);
282
+ var gateStatus = validation.valid && normalized.canContinueRun === true && statusText === 'proof_ready'
283
+ ? 'pass'
284
+ : statusText === 'manual_handoff'
285
+ ? 'warn'
286
+ : 'blocked';
287
+ return {
288
+ key: 'manager_recovery_execution_proof',
289
+ label: 'Manager recovery execution proof',
290
+ status: gateStatus,
291
+ reason: normalized.blockers[0] || validation.blockers[0] || statusText || 'Manager recovery execution proof recorded.',
292
+ evidenceRefs: normalized.artifactPaths,
293
+ recordedAt: isoNow(now || normalized.createdAt),
294
+ metadata: {
295
+ contractId: normalized.contractId,
296
+ directiveId: normalized.directiveId,
297
+ surface: normalized.surface,
298
+ dispatchAction: normalized.dispatchAction,
299
+ phase: normalized.phase,
300
+ status: statusText,
301
+ canContinueRun: normalized.canContinueRun,
302
+ canRunProductRepair: normalized.canRunProductRepair,
303
+ canRunExpensiveModel: normalized.canRunExpensiveModel,
304
+ canResetLoopBudget: normalized.canResetLoopBudget,
305
+ proofRequiredBeforeContinuation: normalized.proofRequiredBeforeContinuation,
306
+ requiresNewEvidence: normalized.requiresNewEvidence,
307
+ newEvidence: normalized.newEvidence,
308
+ materialEvidence: normalized.materialEvidence,
309
+ evidenceStrength: normalized.evidenceStrength,
310
+ evidenceSignals: normalized.evidenceSignals,
311
+ startingFailureClass: normalized.startingFailureClass,
312
+ startingBlockerFingerprint: normalized.startingBlockerFingerprint,
313
+ startingEvidenceHash: normalized.startingEvidenceHash,
314
+ latestFailureClass: normalized.latestFailureClass,
315
+ latestBlockerFingerprint: normalized.latestBlockerFingerprint,
316
+ latestEvidenceHash: normalized.latestEvidenceHash,
317
+ requiredEvidence: normalized.requiredEvidence,
318
+ missingEvidence: normalized.missingEvidence,
319
+ changedFiles: normalized.changedFiles,
320
+ blockers: Array.from(new Set(__spreadArray(__spreadArray([], __read(normalized.blockers), false), __read(validation.blockers), false))),
321
+ nextAllowedAction: normalized.nextAllowedAction,
322
+ forbiddenActions: normalized.forbiddenActions
323
+ }
324
+ };
325
+ }
275
326
  function supportManagerNoBlindLoopGate(job, evidence, now) {
276
327
  return managerNoBlindLoopGateFromHistory(supportManagerFailureRecords(job, evidence), job.supportV5Budget || job.support_v5_budget || evidence.supportV5Budget || evidence.support_v5_budget, now);
277
328
  }
@@ -600,6 +651,9 @@ function hotfixCommitProofGate(evidence, now) {
600
651
  channel: guard.channel || validation.channel,
601
652
  status: guard.status,
602
653
  passed: guard.passed,
654
+ commitFirstProtocol: guard.required ? 'commit_first_hotfix' : 'not_required',
655
+ commitFirstProtocolSatisfied: guard.required ? guard.passed === true : true,
656
+ liveHotfixBlockedUntilCommit: guard.required === true && guard.passed !== true,
603
657
  managerMustCommitBeforeHotfix: guard.managerMustCommitBeforeHotfix,
604
658
  sourceCommitSha: guard.sourceCommitSha,
605
659
  githubCommitUrl: guard.githubCommitUrl,
@@ -729,6 +783,11 @@ function hotfixDurabilityContractGate(contractValue, now) {
729
783
  canPrepareHotfixPatch: contract.canPrepareHotfixPatch,
730
784
  canHotfixBackend: contract.canHotfixBackend,
731
785
  liveHotfixBlockedUntilCommit: contract.liveHotfixBlockedUntilCommit,
786
+ durabilityProtocol: contract.durabilityProtocol,
787
+ commitFirstProtocolRequired: contract.commitFirstProtocolRequired,
788
+ commitFirstProtocolSatisfied: contract.commitFirstProtocolSatisfied,
789
+ liveHotfixAllowed: contract.liveHotfixAllowed,
790
+ managerContinuationAllowed: contract.managerContinuationAllowed,
732
791
  commitProofPassed: contract.commitProofPassed,
733
792
  commitProofStatus: contract.commitProofStatus,
734
793
  missingCommitProofFields: contract.missingCommitProofFields,
@@ -823,7 +882,7 @@ function collectHotfixEvidenceEvents(sources, events, gates, now) {
823
882
  }
824
883
  }
825
884
  function hotfixDurabilityMetadata(gates) {
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;
885
+ 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, _5, _6, _7, _8, _9, _10, _11, _12;
827
886
  var hotfixGate = gates.find(function (gate) { return gate.key === 'hotfix_evidence'; });
828
887
  var commitGate = gates.find(function (gate) { return gate.key === 'hotfix_commit_proof'; });
829
888
  var durabilityGate = gates.find(function (gate) { return gate.key === 'hotfix_durability_contract'; });
@@ -838,25 +897,30 @@ function hotfixDurabilityMetadata(gates) {
838
897
  canPrepareHotfixPatch: ((_c = durabilityGate === null || durabilityGate === void 0 ? void 0 : durabilityGate.metadata) === null || _c === void 0 ? void 0 : _c.canPrepareHotfixPatch) === true,
839
898
  canHotfixBackend: ((_d = durabilityGate === null || durabilityGate === void 0 ? void 0 : durabilityGate.metadata) === null || _d === void 0 ? void 0 : _d.canHotfixBackend) === true,
840
899
  liveHotfixBlockedUntilCommit: ((_e = durabilityGate === null || durabilityGate === void 0 ? void 0 : durabilityGate.metadata) === null || _e === void 0 ? void 0 : _e.liveHotfixBlockedUntilCommit) === true,
900
+ durabilityProtocol: cleanText((_f = durabilityGate === null || durabilityGate === void 0 ? void 0 : durabilityGate.metadata) === null || _f === void 0 ? void 0 : _f.durabilityProtocol, 120),
901
+ commitFirstProtocolRequired: ((_g = durabilityGate === null || durabilityGate === void 0 ? void 0 : durabilityGate.metadata) === null || _g === void 0 ? void 0 : _g.commitFirstProtocolRequired) === true,
902
+ commitFirstProtocolSatisfied: ((_h = durabilityGate === null || durabilityGate === void 0 ? void 0 : durabilityGate.metadata) === null || _h === void 0 ? void 0 : _h.commitFirstProtocolSatisfied) === true || ((_j = commitGate === null || commitGate === void 0 ? void 0 : commitGate.metadata) === null || _j === void 0 ? void 0 : _j.commitFirstProtocolSatisfied) === true,
903
+ liveHotfixAllowed: ((_k = durabilityGate === null || durabilityGate === void 0 ? void 0 : durabilityGate.metadata) === null || _k === void 0 ? void 0 : _k.liveHotfixAllowed) === true || (((_l = hotfixGate === null || hotfixGate === void 0 ? void 0 : hotfixGate.metadata) === null || _l === void 0 ? void 0 : _l.hotfixSatisfied) === true && ((_m = commitGate === null || commitGate === void 0 ? void 0 : commitGate.metadata) === null || _m === void 0 ? void 0 : _m.commitFirstProtocolSatisfied) === true),
904
+ managerContinuationAllowed: ((_o = durabilityGate === null || durabilityGate === void 0 ? void 0 : durabilityGate.metadata) === null || _o === void 0 ? void 0 : _o.managerContinuationAllowed) === true,
841
905
  hotfixEvidenceStatus: cleanText(hotfixGate === null || hotfixGate === void 0 ? void 0 : hotfixGate.status, 80),
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,
906
+ hotfixSatisfied: ((_p = hotfixGate === null || hotfixGate === void 0 ? void 0 : hotfixGate.metadata) === null || _p === void 0 ? void 0 : _p.hotfixSatisfied) === true,
907
+ fullDeployBlocked: ((_q = hotfixGate === null || hotfixGate === void 0 ? void 0 : hotfixGate.metadata) === null || _q === void 0 ? void 0 : _q.fullDeployBlocked) === true,
908
+ fullDeployAllowed: ((_r = hotfixGate === null || hotfixGate === void 0 ? void 0 : hotfixGate.metadata) === null || _r === void 0 ? void 0 : _r.fullDeployAllowed) === true,
845
909
  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,
910
+ commitProofStatus: cleanText((commitGate === null || commitGate === void 0 ? void 0 : commitGate.status) || ((_s = durabilityGate === null || durabilityGate === void 0 ? void 0 : durabilityGate.metadata) === null || _s === void 0 ? void 0 : _s.commitProofStatus), 80),
911
+ commitProofPassed: ((_t = commitGate === null || commitGate === void 0 ? void 0 : commitGate.metadata) === null || _t === void 0 ? void 0 : _t.passed) === true || ((_u = durabilityGate === null || durabilityGate === void 0 ? void 0 : durabilityGate.metadata) === null || _u === void 0 ? void 0 : _u.commitProofPassed) === true,
848
912
  commitBlocked: commitBlocked,
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),
913
+ channel: cleanText(((_v = commitGate === null || commitGate === void 0 ? void 0 : commitGate.metadata) === null || _v === void 0 ? void 0 : _v.channel) || ((_w = hotfixGate === null || hotfixGate === void 0 ? void 0 : hotfixGate.metadata) === null || _w === void 0 ? void 0 : _w.channel), 120),
914
+ sourceCommitSha: cleanText(((_x = commitGate === null || commitGate === void 0 ? void 0 : commitGate.metadata) === null || _x === void 0 ? void 0 : _x.sourceCommitSha) || ((_y = durabilityGate === null || durabilityGate === void 0 ? void 0 : durabilityGate.metadata) === null || _y === void 0 ? void 0 : _y.sourceCommitSha), 200),
915
+ githubCommitUrl: cleanText(((_z = commitGate === null || commitGate === void 0 ? void 0 : commitGate.metadata) === null || _z === void 0 ? void 0 : _z.githubCommitUrl) || ((_0 = durabilityGate === null || durabilityGate === void 0 ? void 0 : durabilityGate.metadata) === null || _0 === void 0 ? void 0 : _0.githubCommitUrl), 500),
916
+ gitCommitStatus: cleanText(((_1 = commitGate === null || commitGate === void 0 ? void 0 : commitGate.metadata) === null || _1 === void 0 ? void 0 : _1.gitCommitStatus) || ((_2 = durabilityGate === null || durabilityGate === void 0 ? void 0 : durabilityGate.metadata) === null || _2 === void 0 ? void 0 : _2.gitCommitStatus), 120),
917
+ gitPushStatus: cleanText(((_3 = commitGate === null || commitGate === void 0 ? void 0 : commitGate.metadata) === null || _3 === void 0 ? void 0 : _3.gitPushStatus) || ((_4 = durabilityGate === null || durabilityGate === void 0 ? void 0 : durabilityGate.metadata) === null || _4 === void 0 ? void 0 : _4.gitPushStatus), 120),
918
+ blockers: cleanStringList(__spreadArray(__spreadArray(__spreadArray([], __read(asArray((_5 = durabilityGate === null || durabilityGate === void 0 ? void 0 : durabilityGate.metadata) === null || _5 === void 0 ? void 0 : _5.missingCommitProofFields)), false), __read(asArray((_6 = commitGate === null || commitGate === void 0 ? void 0 : commitGate.metadata) === null || _6 === void 0 ? void 0 : _6.blockers)), false), __read(asArray((_7 = hotfixGate === null || hotfixGate === void 0 ? void 0 : hotfixGate.metadata) === null || _7 === void 0 ? void 0 : _7.blockers)), false), 20, 500),
919
+ requiredEvidence: cleanStringList(((_8 = commitGate === null || commitGate === void 0 ? void 0 : commitGate.metadata) === null || _8 === void 0 ? void 0 : _8.requiredEvidence) || ((_9 = durabilityGate === null || durabilityGate === void 0 ? void 0 : durabilityGate.metadata) === null || _9 === void 0 ? void 0 : _9.requiredFields), 20, 500),
920
+ nextCommands: cleanStringList((_10 = commitGate === null || commitGate === void 0 ? void 0 : commitGate.metadata) === null || _10 === void 0 ? void 0 : _10.nextCommands, 20, 240),
857
921
  nextAction: commitBlocked
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)
922
+ ? cleanText((_11 = durabilityGate === null || durabilityGate === void 0 ? void 0 : durabilityGate.metadata) === null || _11 === void 0 ? void 0 : _11.nextSafeAction, 200) || 'Commit and push the hotfix to GitHub, record sourceCommitSha/githubCommitUrl/gitCommitStatus/gitPushStatus, then rerun the smallest verification gate.'
923
+ : cleanText((_12 = hotfixGate === null || hotfixGate === void 0 ? void 0 : hotfixGate.metadata) === null || _12 === void 0 ? void 0 : _12.nextAction, 1000)
860
924
  };
861
925
  }
862
926
  function collectUsageEvents(entries, events) {
@@ -1622,6 +1686,8 @@ function buildSupportQaEvidence(input) {
1622
1686
  var ticket = input.ticket || {};
1623
1687
  var qaCursor = plainObject(job.supportQaValidationCursor || job.support_qa_validation_cursor);
1624
1688
  var autonomousDecision = plainObject(job.supportV5AutonomousDecision || job.support_v5_autonomous_decision);
1689
+ var ticketAutomation = plainObject(ticket.automation);
1690
+ var ticketManager = plainObject(ticketAutomation.manager || ticket.manager);
1625
1691
  var preflightGate = supportPreflightGateObject(ticket, job, __assign(__assign({}, plainObject(input.qaEvidence)), { supportV5AutonomousDecision: autonomousDecision }));
1626
1692
  var businessProofReadiness = plainObject(autonomousDecision.businessProofReadiness
1627
1693
  || autonomousDecision.business_proof_readiness
@@ -1637,6 +1703,14 @@ function buildSupportQaEvidence(input) {
1637
1703
  || customerReplyPolicy.readiness_contract
1638
1704
  || job.customerReplyReadiness
1639
1705
  || job.customer_reply_readiness);
1706
+ var managerRecoveryExecutionProof = plainObject(job.managerRecoveryExecutionProof
1707
+ || job.manager_recovery_execution_proof
1708
+ || job.supportManagerRecoveryExecutionProof
1709
+ || job.support_manager_recovery_execution_proof
1710
+ || autonomousDecision.recoveryExecutionProof
1711
+ || autonomousDecision.recovery_execution_proof
1712
+ || ticketManager.last_recovery_execution_proof
1713
+ || ticketManager.recovery_execution_proof);
1640
1714
  var humanReviewPacket = plainObject(autonomousDecision.humanReviewPacket
1641
1715
  || autonomousDecision.human_review_packet
1642
1716
  || customerReplyPolicy.humanReviewPacket
@@ -1660,6 +1734,9 @@ function buildSupportQaEvidence(input) {
1660
1734
  if (Object.keys(customerReplyReadiness).length) {
1661
1735
  evidence.customerReplyReadiness = customerReplyReadiness;
1662
1736
  }
1737
+ if (Object.keys(managerRecoveryExecutionProof).length) {
1738
+ evidence.managerRecoveryExecutionProof = managerRecoveryExecutionProof;
1739
+ }
1663
1740
  if (Object.keys(preflightGate).length) {
1664
1741
  evidence.supportV5PreflightGate = preflightGate;
1665
1742
  applySupportPreflightGateToQaEvidence(evidence, preflightGate);
@@ -2407,6 +2484,8 @@ function aicoderJourneyContractGate(validation, evidence, now) {
2407
2484
  valid: validation.valid,
2408
2485
  primaryWorkflowId: cleanText(validation.primaryWorkflowId, 200),
2409
2486
  workflowQaRowCount: validation.workflowQaRows.length,
2487
+ workflowQaCoverageTags: cleanStringList(validation.workflowQaRows.flatMap(function (row) { return asArray(row.coverageTags || row.coverage_tags); }), 80, 120),
2488
+ workflowQaProofKinds: cleanStringList(validation.workflowQaRows.map(function (row) { return row.proofKind || row.proof_kind; }), 80, 120),
2410
2489
  errorCount: errorIssues.length,
2411
2490
  warningCount: warningIssues.length,
2412
2491
  issueCodes: cleanStringList(validation.issues.map(function (issue) { return issue.code; }), 40, 120),
@@ -3171,7 +3250,7 @@ function applyAssistantAnswerQualityGate(qa, decision, now) {
3171
3250
  }
3172
3251
  function buildSupportAIRunFromEvidence(input) {
3173
3252
  var e_32, _a, e_33, _b;
3174
- 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, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61;
3253
+ 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, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72;
3175
3254
  var ticket = input.ticket || {};
3176
3255
  var job = input.job || {};
3177
3256
  var evidence = buildSupportQaEvidence(input);
@@ -3183,8 +3262,8 @@ function buildSupportAIRunFromEvidence(input) {
3183
3262
  addSourceId(sourceIds, 'jobId', job._id || job.id || job.jobId);
3184
3263
  addSourceId(sourceIds, 'buildPlanId', job.buildPlanId || ticket.buildPlanId);
3185
3264
  try {
3186
- for (var _62 = __values(asArray(input.taskEvents)), _63 = _62.next(); !_63.done; _63 = _62.next()) {
3187
- var event_1 = _63.value;
3265
+ for (var _73 = __values(asArray(input.taskEvents)), _74 = _73.next(); !_74.done; _74 = _73.next()) {
3266
+ var event_1 = _74.value;
3188
3267
  pushEvent(events, {
3189
3268
  type: event_1.type === 'human_intervention' ? 'human_intervention' : 'log',
3190
3269
  category: cleanText(event_1.category || event_1.phase || event_1.type, 160),
@@ -3201,13 +3280,13 @@ function buildSupportAIRunFromEvidence(input) {
3201
3280
  catch (e_32_1) { e_32 = { error: e_32_1 }; }
3202
3281
  finally {
3203
3282
  try {
3204
- if (_63 && !_63.done && (_a = _62.return)) _a.call(_62);
3283
+ if (_74 && !_74.done && (_a = _73.return)) _a.call(_73);
3205
3284
  }
3206
3285
  finally { if (e_32) throw e_32.error; }
3207
3286
  }
3208
3287
  try {
3209
- for (var _64 = __values(asArray(input.aiJobs)), _65 = _64.next(); !_65.done; _65 = _64.next()) {
3210
- var aiJob = _65.value;
3288
+ for (var _75 = __values(asArray(input.aiJobs)), _76 = _75.next(); !_76.done; _76 = _75.next()) {
3289
+ var aiJob = _76.value;
3211
3290
  pushEvent(events, {
3212
3291
  type: aiJob.model ? 'model_call' : 'log',
3213
3292
  category: cleanText(aiJob.category || aiJob.phase || aiJob.runner, 160),
@@ -3225,7 +3304,7 @@ function buildSupportAIRunFromEvidence(input) {
3225
3304
  catch (e_33_1) { e_33 = { error: e_33_1 }; }
3226
3305
  finally {
3227
3306
  try {
3228
- if (_65 && !_65.done && (_b = _64.return)) _b.call(_64);
3307
+ if (_76 && !_76.done && (_b = _75.return)) _b.call(_75);
3229
3308
  }
3230
3309
  finally { if (e_33) throw e_33.error; }
3231
3310
  }
@@ -3299,6 +3378,19 @@ function buildSupportAIRunFromEvidence(input) {
3299
3378
  metadata: nextActionContractGate.metadata
3300
3379
  });
3301
3380
  }
3381
+ var managerRecoveryExecutionProof = plainObject(evidence.managerRecoveryExecutionProof || evidence.manager_recovery_execution_proof);
3382
+ var recoveryExecutionProofGate = managerRecoveryExecutionProofGate(managerRecoveryExecutionProof, input.now);
3383
+ if (recoveryExecutionProofGate) {
3384
+ gates.push(recoveryExecutionProofGate);
3385
+ pushEvent(events, {
3386
+ type: 'log',
3387
+ category: 'manager_recovery_execution_proof',
3388
+ message: recoveryExecutionProofGate.reason,
3389
+ artifactPaths: recoveryExecutionProofGate.evidenceRefs,
3390
+ recordedAt: recoveryExecutionProofGate.recordedAt,
3391
+ metadata: recoveryExecutionProofGate.metadata
3392
+ });
3393
+ }
3302
3394
  var ticketAutomation = plainObject(ticket.automation);
3303
3395
  var ticketManagerState = plainObject(ticketAutomation.manager || ticket.manager);
3304
3396
  var rootCauseEntryContract = evidenceObject(job.supportRootCauseEntryContract, job.support_root_cause_entry_contract, job.rootCauseEntryContract, ticket.supportRootCauseEntryContract, ticket.rootCauseEntryContract, ticketManagerState.root_cause_entry_contract, ticketManagerState.rootCauseEntryContract, evidence.rootCauseEntryContract, evidence.root_cause_entry_contract);
@@ -3535,44 +3627,58 @@ function buildSupportAIRunFromEvidence(input) {
3535
3627
  sameFailureCount: Number(((_36 = nextActionContractGate.metadata) === null || _36 === void 0 ? void 0 : _36.sameFailureCount) || 0),
3536
3628
  blockers: cleanStringList((_37 = nextActionContractGate.metadata) === null || _37 === void 0 ? void 0 : _37.blockers, 20, 500)
3537
3629
  } : undefined,
3630
+ managerRecoveryExecutionProof: recoveryExecutionProofGate ? {
3631
+ status: cleanText((_38 = recoveryExecutionProofGate.metadata) === null || _38 === void 0 ? void 0 : _38.status, 120),
3632
+ gateStatus: recoveryExecutionProofGate.status,
3633
+ canContinueRun: ((_39 = recoveryExecutionProofGate.metadata) === null || _39 === void 0 ? void 0 : _39.canContinueRun) === true,
3634
+ canRunProductRepair: ((_40 = recoveryExecutionProofGate.metadata) === null || _40 === void 0 ? void 0 : _40.canRunProductRepair) === true,
3635
+ canRunExpensiveModel: ((_41 = recoveryExecutionProofGate.metadata) === null || _41 === void 0 ? void 0 : _41.canRunExpensiveModel) === true,
3636
+ canResetLoopBudget: ((_42 = recoveryExecutionProofGate.metadata) === null || _42 === void 0 ? void 0 : _42.canResetLoopBudget) === true,
3637
+ newEvidence: ((_43 = recoveryExecutionProofGate.metadata) === null || _43 === void 0 ? void 0 : _43.newEvidence) === true,
3638
+ materialEvidence: ((_44 = recoveryExecutionProofGate.metadata) === null || _44 === void 0 ? void 0 : _44.materialEvidence) === true,
3639
+ evidenceStrength: cleanText((_45 = recoveryExecutionProofGate.metadata) === null || _45 === void 0 ? void 0 : _45.evidenceStrength, 120),
3640
+ nextAllowedAction: cleanText((_46 = recoveryExecutionProofGate.metadata) === null || _46 === void 0 ? void 0 : _46.nextAllowedAction, 180),
3641
+ missingEvidence: cleanStringList((_47 = recoveryExecutionProofGate.metadata) === null || _47 === void 0 ? void 0 : _47.missingEvidence, 20, 500),
3642
+ blockers: cleanStringList((_48 = recoveryExecutionProofGate.metadata) === null || _48 === void 0 ? void 0 : _48.blockers, 20, 500)
3643
+ } : undefined,
3538
3644
  customerReplyPolicy: Object.keys(customerReplyPolicy).length ? {
3539
3645
  action: cleanText(customerReplyPolicy.action, 120),
3540
3646
  safety: cleanText(customerReplyPolicy.safety, 120),
3541
3647
  canDraftCustomerReply: customerReplyPolicy.canDraftCustomerReply === true || customerReplyPolicy.can_draft_customer_reply === true,
3542
3648
  canSendCustomerReply: customerReplyPolicy.canSendCustomerReply === true || customerReplyPolicy.can_send_customer_reply === true,
3543
3649
  reason: cleanText(customerReplyPolicy.reason, 1000),
3544
- reviewType: cleanText(((_38 = customerReplyPolicy.humanReviewPacket) === null || _38 === void 0 ? void 0 : _38.reviewType)
3545
- || ((_39 = customerReplyPolicy.human_review_packet) === null || _39 === void 0 ? void 0 : _39.review_type)
3546
- || ((_40 = customerReplyPolicy.human_review_packet) === null || _40 === void 0 ? void 0 : _40.reviewType), 160),
3547
- primaryAction: cleanText(((_41 = customerReplyPolicy.humanReviewPacket) === null || _41 === void 0 ? void 0 : _41.primaryAction)
3548
- || ((_42 = customerReplyPolicy.human_review_packet) === null || _42 === void 0 ? void 0 : _42.primary_action)
3549
- || ((_43 = customerReplyPolicy.human_review_packet) === null || _43 === void 0 ? void 0 : _43.primaryAction), 160),
3650
+ reviewType: cleanText(((_49 = customerReplyPolicy.humanReviewPacket) === null || _49 === void 0 ? void 0 : _49.reviewType)
3651
+ || ((_50 = customerReplyPolicy.human_review_packet) === null || _50 === void 0 ? void 0 : _50.review_type)
3652
+ || ((_51 = customerReplyPolicy.human_review_packet) === null || _51 === void 0 ? void 0 : _51.reviewType), 160),
3653
+ primaryAction: cleanText(((_52 = customerReplyPolicy.humanReviewPacket) === null || _52 === void 0 ? void 0 : _52.primaryAction)
3654
+ || ((_53 = customerReplyPolicy.human_review_packet) === null || _53 === void 0 ? void 0 : _53.primary_action)
3655
+ || ((_54 = customerReplyPolicy.human_review_packet) === null || _54 === void 0 ? void 0 : _54.primaryAction), 160),
3550
3656
  clarificationContract: customerReplyPolicy.clarificationContract || customerReplyPolicy.clarification_contract ? {
3551
- 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),
3552
- 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),
3553
- 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,
3554
- 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
3657
+ status: cleanText(((_55 = customerReplyPolicy.clarificationContract) === null || _55 === void 0 ? void 0 : _55.status) || ((_56 = customerReplyPolicy.clarification_contract) === null || _56 === void 0 ? void 0 : _56.status), 120),
3658
+ missingField: cleanText(((_57 = customerReplyPolicy.clarificationContract) === null || _57 === void 0 ? void 0 : _57.missingField) || ((_58 = customerReplyPolicy.clarification_contract) === null || _58 === void 0 ? void 0 : _58.missing_field), 120),
3659
+ oneQuestionOnly: ((_59 = customerReplyPolicy.clarificationContract) === null || _59 === void 0 ? void 0 : _59.oneQuestionOnly) === true || ((_60 = customerReplyPolicy.clarification_contract) === null || _60 === void 0 ? void 0 : _60.one_question_only) === true,
3660
+ parksTicketUntilCustomerReply: ((_61 = customerReplyPolicy.clarificationContract) === null || _61 === void 0 ? void 0 : _61.parksTicketUntilCustomerReply) === true || ((_62 = customerReplyPolicy.clarification_contract) === null || _62 === void 0 ? void 0 : _62.parks_ticket_until_customer_reply) === true
3555
3661
  } : undefined
3556
3662
  } : undefined,
3557
3663
  customerReplyReadiness: customerReplyReadinessGate ? {
3558
- status: cleanText((_52 = customerReplyReadinessGate.metadata) === null || _52 === void 0 ? void 0 : _52.status, 120),
3664
+ status: cleanText((_63 = customerReplyReadinessGate.metadata) === null || _63 === void 0 ? void 0 : _63.status, 120),
3559
3665
  gateStatus: customerReplyReadinessGate.status,
3560
- primaryCommand: cleanText((_53 = customerReplyReadinessGate.metadata) === null || _53 === void 0 ? void 0 : _53.primaryCommand, 180),
3561
- policyAction: cleanText((_54 = customerReplyReadinessGate.metadata) === null || _54 === void 0 ? void 0 : _54.policyAction, 120),
3562
- canDraftCustomerReply: ((_55 = customerReplyReadinessGate.metadata) === null || _55 === void 0 ? void 0 : _55.canDraftCustomerReply) === true,
3563
- canSendCustomerReply: ((_56 = customerReplyReadinessGate.metadata) === null || _56 === void 0 ? void 0 : _56.canSendCustomerReply) === true,
3564
- requiresHumanApproval: ((_57 = customerReplyReadinessGate.metadata) === null || _57 === void 0 ? void 0 : _57.requiresHumanApproval) === true,
3565
- proofBacked: ((_58 = customerReplyReadinessGate.metadata) === null || _58 === void 0 ? void 0 : _58.proofBacked) === true,
3566
- businessProofReady: ((_59 = customerReplyReadinessGate.metadata) === null || _59 === void 0 ? void 0 : _59.businessProofReady) === true,
3567
- releaseReady: ((_60 = customerReplyReadinessGate.metadata) === null || _60 === void 0 ? void 0 : _60.releaseReady) === true,
3568
- blockers: cleanStringList((_61 = customerReplyReadinessGate.metadata) === null || _61 === void 0 ? void 0 : _61.blockers, 20, 500)
3666
+ primaryCommand: cleanText((_64 = customerReplyReadinessGate.metadata) === null || _64 === void 0 ? void 0 : _64.primaryCommand, 180),
3667
+ policyAction: cleanText((_65 = customerReplyReadinessGate.metadata) === null || _65 === void 0 ? void 0 : _65.policyAction, 120),
3668
+ canDraftCustomerReply: ((_66 = customerReplyReadinessGate.metadata) === null || _66 === void 0 ? void 0 : _66.canDraftCustomerReply) === true,
3669
+ canSendCustomerReply: ((_67 = customerReplyReadinessGate.metadata) === null || _67 === void 0 ? void 0 : _67.canSendCustomerReply) === true,
3670
+ requiresHumanApproval: ((_68 = customerReplyReadinessGate.metadata) === null || _68 === void 0 ? void 0 : _68.requiresHumanApproval) === true,
3671
+ proofBacked: ((_69 = customerReplyReadinessGate.metadata) === null || _69 === void 0 ? void 0 : _69.proofBacked) === true,
3672
+ businessProofReady: ((_70 = customerReplyReadinessGate.metadata) === null || _70 === void 0 ? void 0 : _70.businessProofReady) === true,
3673
+ releaseReady: ((_71 = customerReplyReadinessGate.metadata) === null || _71 === void 0 ? void 0 : _71.releaseReady) === true,
3674
+ blockers: cleanStringList((_72 = customerReplyReadinessGate.metadata) === null || _72 === void 0 ? void 0 : _72.blockers, 20, 500)
3569
3675
  } : undefined
3570
3676
  }
3571
3677
  });
3572
3678
  }
3573
3679
  function buildAICoderAIRunFromEvidence(input) {
3574
3680
  var e_34, _a;
3575
- 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;
3681
+ 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, _29, _30;
3576
3682
  var app = input.app || {};
3577
3683
  var job = input.job || {};
3578
3684
  var evidence = buildAICoderQaEvidence(input);
@@ -3583,8 +3689,8 @@ function buildAICoderAIRunFromEvidence(input) {
3583
3689
  addSourceId(sourceIds, 'jobId', job._id || job.id || job.jobId);
3584
3690
  addSourceId(sourceIds, 'domain', app.domain || app.customDomain || job.domain);
3585
3691
  try {
3586
- for (var _29 = __values(asArray(input.logs)), _30 = _29.next(); !_30.done; _30 = _29.next()) {
3587
- var log = _30.value;
3692
+ for (var _31 = __values(asArray(input.logs)), _32 = _31.next(); !_32.done; _32 = _31.next()) {
3693
+ var log = _32.value;
3588
3694
  pushEvent(events, {
3589
3695
  type: log.type === 'scorecard' ? 'scorecard' : 'log',
3590
3696
  category: cleanText(log.category || log.phase || log.level, 160),
@@ -3602,7 +3708,7 @@ function buildAICoderAIRunFromEvidence(input) {
3602
3708
  catch (e_34_1) { e_34 = { error: e_34_1 }; }
3603
3709
  finally {
3604
3710
  try {
3605
- if (_30 && !_30.done && (_a = _29.return)) _a.call(_29);
3711
+ if (_32 && !_32.done && (_a = _31.return)) _a.call(_31);
3606
3712
  }
3607
3713
  finally { if (e_34) throw e_34.error; }
3608
3714
  }
@@ -3745,14 +3851,16 @@ function buildAICoderAIRunFromEvidence(input) {
3745
3851
  path: cleanText((_k = journeyContractGate.metadata) === null || _k === void 0 ? void 0 : _k.path, 500),
3746
3852
  primaryWorkflowId: cleanText((_l = journeyContractGate.metadata) === null || _l === void 0 ? void 0 : _l.primaryWorkflowId, 200),
3747
3853
  workflowQaRowCount: Number(((_m = journeyContractGate.metadata) === null || _m === void 0 ? void 0 : _m.workflowQaRowCount) || 0),
3748
- errorCount: Number(((_o = journeyContractGate.metadata) === null || _o === void 0 ? void 0 : _o.errorCount) || 0),
3749
- warningCount: Number(((_p = journeyContractGate.metadata) === null || _p === void 0 ? void 0 : _p.warningCount) || 0),
3750
- issueCodes: cleanStringList((_q = journeyContractGate.metadata) === null || _q === void 0 ? void 0 : _q.issueCodes, 40, 120),
3751
- blocksBuildUntilValid: ((_r = journeyContractGate.metadata) === null || _r === void 0 ? void 0 : _r.blocksBuildUntilValid) === true,
3752
- blocksWorkflowQaUntilValid: ((_s = journeyContractGate.metadata) === null || _s === void 0 ? void 0 : _s.blocksWorkflowQaUntilValid) === true,
3753
- blocksWowUiUntilWorkflowProof: ((_t = journeyContractGate.metadata) === null || _t === void 0 ? void 0 : _t.blocksWowUiUntilWorkflowProof) === true,
3754
- blocksPublishUntilWorkflowProof: ((_u = journeyContractGate.metadata) === null || _u === void 0 ? void 0 : _u.blocksPublishUntilWorkflowProof) === true,
3755
- nextAction: cleanText((_v = journeyContractGate.metadata) === null || _v === void 0 ? void 0 : _v.nextAction, 1000)
3854
+ workflowQaCoverageTags: cleanStringList((_o = journeyContractGate.metadata) === null || _o === void 0 ? void 0 : _o.workflowQaCoverageTags, 80, 120),
3855
+ workflowQaProofKinds: cleanStringList((_p = journeyContractGate.metadata) === null || _p === void 0 ? void 0 : _p.workflowQaProofKinds, 80, 120),
3856
+ errorCount: Number(((_q = journeyContractGate.metadata) === null || _q === void 0 ? void 0 : _q.errorCount) || 0),
3857
+ warningCount: Number(((_r = journeyContractGate.metadata) === null || _r === void 0 ? void 0 : _r.warningCount) || 0),
3858
+ issueCodes: cleanStringList((_s = journeyContractGate.metadata) === null || _s === void 0 ? void 0 : _s.issueCodes, 40, 120),
3859
+ blocksBuildUntilValid: ((_t = journeyContractGate.metadata) === null || _t === void 0 ? void 0 : _t.blocksBuildUntilValid) === true,
3860
+ blocksWorkflowQaUntilValid: ((_u = journeyContractGate.metadata) === null || _u === void 0 ? void 0 : _u.blocksWorkflowQaUntilValid) === true,
3861
+ blocksWowUiUntilWorkflowProof: ((_v = journeyContractGate.metadata) === null || _v === void 0 ? void 0 : _v.blocksWowUiUntilWorkflowProof) === true,
3862
+ blocksPublishUntilWorkflowProof: ((_w = journeyContractGate.metadata) === null || _w === void 0 ? void 0 : _w.blocksPublishUntilWorkflowProof) === true,
3863
+ nextAction: cleanText((_x = journeyContractGate.metadata) === null || _x === void 0 ? void 0 : _x.nextAction, 1000)
3756
3864
  },
3757
3865
  workflowProofReadiness: {
3758
3866
  ready: workflowReadiness.ready,
@@ -3770,43 +3878,43 @@ function buildAICoderAIRunFromEvidence(input) {
3770
3878
  proofFreshness: workflowReadiness.proofFreshness
3771
3879
  },
3772
3880
  workflowProofCheckpoint: workflowProofCheckpointGate ? {
3773
- status: cleanText((_w = workflowProofCheckpointGate.metadata) === null || _w === void 0 ? void 0 : _w.status, 120),
3881
+ status: cleanText((_y = workflowProofCheckpointGate.metadata) === null || _y === void 0 ? void 0 : _y.status, 120),
3774
3882
  gateStatus: workflowProofCheckpointGate.status,
3775
- readinessStatus: cleanText((_x = workflowProofCheckpointGate.metadata) === null || _x === void 0 ? void 0 : _x.readinessStatus, 120),
3776
- nextGate: cleanText((_y = workflowProofCheckpointGate.metadata) === null || _y === void 0 ? void 0 : _y.nextGate, 120),
3777
- nextAction: cleanText((_z = workflowProofCheckpointGate.metadata) === null || _z === void 0 ? void 0 : _z.nextAction, 1000),
3778
- blocksProductRepairUntilJourneyContract: ((_0 = workflowProofCheckpointGate.metadata) === null || _0 === void 0 ? void 0 : _0.blocksProductRepairUntilJourneyContract) === true,
3779
- blocksPublishUntilWorkflowProof: ((_1 = workflowProofCheckpointGate.metadata) === null || _1 === void 0 ? void 0 : _1.blocksPublishUntilWorkflowProof) === true,
3780
- blocksPublishUntilReleaseGate: ((_2 = workflowProofCheckpointGate.metadata) === null || _2 === void 0 ? void 0 : _2.blocksPublishUntilReleaseGate) === true,
3781
- blocksWowUiUntilWorkflowProof: ((_3 = workflowProofCheckpointGate.metadata) === null || _3 === void 0 ? void 0 : _3.blocksWowUiUntilWorkflowProof) === true,
3782
- workflowProofFingerprint: cleanText((_4 = workflowProofCheckpointGate.metadata) === null || _4 === void 0 ? void 0 : _4.workflowProofFingerprint, 200),
3783
- artifactFingerprint: cleanText((_5 = workflowProofCheckpointGate.metadata) === null || _5 === void 0 ? void 0 : _5.artifactFingerprint, 200),
3784
- blockers: cleanStringList((_6 = workflowProofCheckpointGate.metadata) === null || _6 === void 0 ? void 0 : _6.blockers, 20, 500)
3883
+ readinessStatus: cleanText((_z = workflowProofCheckpointGate.metadata) === null || _z === void 0 ? void 0 : _z.readinessStatus, 120),
3884
+ nextGate: cleanText((_0 = workflowProofCheckpointGate.metadata) === null || _0 === void 0 ? void 0 : _0.nextGate, 120),
3885
+ nextAction: cleanText((_1 = workflowProofCheckpointGate.metadata) === null || _1 === void 0 ? void 0 : _1.nextAction, 1000),
3886
+ blocksProductRepairUntilJourneyContract: ((_2 = workflowProofCheckpointGate.metadata) === null || _2 === void 0 ? void 0 : _2.blocksProductRepairUntilJourneyContract) === true,
3887
+ blocksPublishUntilWorkflowProof: ((_3 = workflowProofCheckpointGate.metadata) === null || _3 === void 0 ? void 0 : _3.blocksPublishUntilWorkflowProof) === true,
3888
+ blocksPublishUntilReleaseGate: ((_4 = workflowProofCheckpointGate.metadata) === null || _4 === void 0 ? void 0 : _4.blocksPublishUntilReleaseGate) === true,
3889
+ blocksWowUiUntilWorkflowProof: ((_5 = workflowProofCheckpointGate.metadata) === null || _5 === void 0 ? void 0 : _5.blocksWowUiUntilWorkflowProof) === true,
3890
+ workflowProofFingerprint: cleanText((_6 = workflowProofCheckpointGate.metadata) === null || _6 === void 0 ? void 0 : _6.workflowProofFingerprint, 200),
3891
+ artifactFingerprint: cleanText((_7 = workflowProofCheckpointGate.metadata) === null || _7 === void 0 ? void 0 : _7.artifactFingerprint, 200),
3892
+ blockers: cleanStringList((_8 = workflowProofCheckpointGate.metadata) === null || _8 === void 0 ? void 0 : _8.blockers, 20, 500)
3785
3893
  } : undefined,
3786
3894
  nextActionContract: nextActionContractGate ? {
3787
3895
  gateStatus: nextActionContractGate.status,
3788
- contractId: cleanText((_7 = nextActionContractGate.metadata) === null || _7 === void 0 ? void 0 : _7.contractId, 200),
3789
- action: cleanText((_8 = nextActionContractGate.metadata) === null || _8 === void 0 ? void 0 : _8.action, 120),
3790
- label: cleanText((_9 = nextActionContractGate.metadata) === null || _9 === void 0 ? void 0 : _9.label, 200),
3791
- primaryCommand: cleanText((_10 = nextActionContractGate.metadata) === null || _10 === void 0 ? void 0 : _10.primaryCommand, 200),
3792
- lane: cleanText((_11 = nextActionContractGate.metadata) === null || _11 === void 0 ? void 0 : _11.lane, 120),
3793
- stepType: cleanText((_12 = nextActionContractGate.metadata) === null || _12 === void 0 ? void 0 : _12.stepType, 120),
3794
- safeToAutoRun: ((_13 = nextActionContractGate.metadata) === null || _13 === void 0 ? void 0 : _13.safeToAutoRun) === true,
3795
- requiresHumanApproval: ((_14 = nextActionContractGate.metadata) === null || _14 === void 0 ? void 0 : _14.requiresHumanApproval) === true,
3796
- canRunWithoutCodexMonitor: ((_15 = nextActionContractGate.metadata) === null || _15 === void 0 ? void 0 : _15.canRunWithoutCodexMonitor) === true,
3797
- codexFallbackRequired: ((_16 = nextActionContractGate.metadata) === null || _16 === void 0 ? void 0 : _16.codexFallbackRequired) === true,
3798
- costRisk: cleanText((_17 = nextActionContractGate.metadata) === null || _17 === void 0 ? void 0 : _17.costRisk, 120),
3799
- workflowFirstSatisfied: ((_18 = nextActionContractGate.metadata) === null || _18 === void 0 ? void 0 : _18.workflowFirstSatisfied) === true,
3800
- hotfixCommitRequired: ((_19 = nextActionContractGate.metadata) === null || _19 === void 0 ? void 0 : _19.hotfixCommitRequired) === true,
3801
- liveHotfixBlockedUntilCommit: ((_20 = nextActionContractGate.metadata) === null || _20 === void 0 ? void 0 : _20.liveHotfixBlockedUntilCommit) === true,
3802
- decisionBasis: plainObject((_21 = nextActionContractGate.metadata) === null || _21 === void 0 ? void 0 : _21.decisionBasis),
3803
- preconditions: cleanStringList((_22 = nextActionContractGate.metadata) === null || _22 === void 0 ? void 0 : _22.preconditions, 20, 500),
3804
- successEvidence: cleanStringList((_23 = nextActionContractGate.metadata) === null || _23 === void 0 ? void 0 : _23.successEvidence, 20, 500),
3805
- requiredHotfixCommitProof: cleanStringList((_24 = nextActionContractGate.metadata) === null || _24 === void 0 ? void 0 : _24.requiredHotfixCommitProof, 20, 240),
3806
- stopConditions: cleanStringList((_25 = nextActionContractGate.metadata) === null || _25 === void 0 ? void 0 : _25.stopConditions, 20, 500),
3807
- forbiddenActions: cleanStringList((_26 = nextActionContractGate.metadata) === null || _26 === void 0 ? void 0 : _26.forbiddenActions, 20, 500),
3808
- nextCommands: cleanStringList((_27 = nextActionContractGate.metadata) === null || _27 === void 0 ? void 0 : _27.nextCommands, 20, 240),
3809
- blockers: cleanStringList((_28 = nextActionContractGate.metadata) === null || _28 === void 0 ? void 0 : _28.blockers, 20, 500)
3896
+ contractId: cleanText((_9 = nextActionContractGate.metadata) === null || _9 === void 0 ? void 0 : _9.contractId, 200),
3897
+ action: cleanText((_10 = nextActionContractGate.metadata) === null || _10 === void 0 ? void 0 : _10.action, 120),
3898
+ label: cleanText((_11 = nextActionContractGate.metadata) === null || _11 === void 0 ? void 0 : _11.label, 200),
3899
+ primaryCommand: cleanText((_12 = nextActionContractGate.metadata) === null || _12 === void 0 ? void 0 : _12.primaryCommand, 200),
3900
+ lane: cleanText((_13 = nextActionContractGate.metadata) === null || _13 === void 0 ? void 0 : _13.lane, 120),
3901
+ stepType: cleanText((_14 = nextActionContractGate.metadata) === null || _14 === void 0 ? void 0 : _14.stepType, 120),
3902
+ safeToAutoRun: ((_15 = nextActionContractGate.metadata) === null || _15 === void 0 ? void 0 : _15.safeToAutoRun) === true,
3903
+ requiresHumanApproval: ((_16 = nextActionContractGate.metadata) === null || _16 === void 0 ? void 0 : _16.requiresHumanApproval) === true,
3904
+ canRunWithoutCodexMonitor: ((_17 = nextActionContractGate.metadata) === null || _17 === void 0 ? void 0 : _17.canRunWithoutCodexMonitor) === true,
3905
+ codexFallbackRequired: ((_18 = nextActionContractGate.metadata) === null || _18 === void 0 ? void 0 : _18.codexFallbackRequired) === true,
3906
+ costRisk: cleanText((_19 = nextActionContractGate.metadata) === null || _19 === void 0 ? void 0 : _19.costRisk, 120),
3907
+ workflowFirstSatisfied: ((_20 = nextActionContractGate.metadata) === null || _20 === void 0 ? void 0 : _20.workflowFirstSatisfied) === true,
3908
+ hotfixCommitRequired: ((_21 = nextActionContractGate.metadata) === null || _21 === void 0 ? void 0 : _21.hotfixCommitRequired) === true,
3909
+ liveHotfixBlockedUntilCommit: ((_22 = nextActionContractGate.metadata) === null || _22 === void 0 ? void 0 : _22.liveHotfixBlockedUntilCommit) === true,
3910
+ decisionBasis: plainObject((_23 = nextActionContractGate.metadata) === null || _23 === void 0 ? void 0 : _23.decisionBasis),
3911
+ preconditions: cleanStringList((_24 = nextActionContractGate.metadata) === null || _24 === void 0 ? void 0 : _24.preconditions, 20, 500),
3912
+ successEvidence: cleanStringList((_25 = nextActionContractGate.metadata) === null || _25 === void 0 ? void 0 : _25.successEvidence, 20, 500),
3913
+ requiredHotfixCommitProof: cleanStringList((_26 = nextActionContractGate.metadata) === null || _26 === void 0 ? void 0 : _26.requiredHotfixCommitProof, 20, 240),
3914
+ stopConditions: cleanStringList((_27 = nextActionContractGate.metadata) === null || _27 === void 0 ? void 0 : _27.stopConditions, 20, 500),
3915
+ forbiddenActions: cleanStringList((_28 = nextActionContractGate.metadata) === null || _28 === void 0 ? void 0 : _28.forbiddenActions, 20, 500),
3916
+ nextCommands: cleanStringList((_29 = nextActionContractGate.metadata) === null || _29 === void 0 ? void 0 : _29.nextCommands, 20, 240),
3917
+ blockers: cleanStringList((_30 = nextActionContractGate.metadata) === null || _30 === void 0 ? void 0 : _30.blockers, 20, 500)
3810
3918
  } : undefined
3811
3919
  }
3812
3920
  });