@resolveio/server-lib 22.3.185 → 22.3.186
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
|
@@ -1425,6 +1425,7 @@ function buildSupportQaEvidence(input) {
|
|
|
1425
1425
|
var ticket = input.ticket || {};
|
|
1426
1426
|
var qaCursor = plainObject(job.supportQaValidationCursor || job.support_qa_validation_cursor);
|
|
1427
1427
|
var autonomousDecision = plainObject(job.supportV5AutonomousDecision || job.support_v5_autonomous_decision);
|
|
1428
|
+
var preflightGate = supportPreflightGateObject(ticket, job, __assign(__assign({}, plainObject(input.qaEvidence)), { supportV5AutonomousDecision: autonomousDecision }));
|
|
1428
1429
|
var businessProofReadiness = plainObject(autonomousDecision.businessProofReadiness
|
|
1429
1430
|
|| autonomousDecision.business_proof_readiness
|
|
1430
1431
|
|| job.businessProofReadiness
|
|
@@ -1453,8 +1454,141 @@ function buildSupportQaEvidence(input) {
|
|
|
1453
1454
|
else if (Object.keys(humanReviewPacket).length) {
|
|
1454
1455
|
evidence.customerReplyPolicy = { humanReviewPacket: humanReviewPacket };
|
|
1455
1456
|
}
|
|
1457
|
+
if (Object.keys(preflightGate).length) {
|
|
1458
|
+
evidence.supportV5PreflightGate = preflightGate;
|
|
1459
|
+
applySupportPreflightGateToQaEvidence(evidence, preflightGate);
|
|
1460
|
+
}
|
|
1456
1461
|
return evidence;
|
|
1457
1462
|
}
|
|
1463
|
+
function supportPreflightGateObject(ticket, job, evidence) {
|
|
1464
|
+
var _a, _b;
|
|
1465
|
+
var autonomousDecision = plainObject(job.supportV5AutonomousDecision
|
|
1466
|
+
|| job.support_v5_autonomous_decision
|
|
1467
|
+
|| evidence.supportV5AutonomousDecision
|
|
1468
|
+
|| evidence.support_v5_autonomous_decision
|
|
1469
|
+
|| ticket.supportV5AutonomousDecision
|
|
1470
|
+
|| ticket.support_v5_autonomous_decision);
|
|
1471
|
+
var ticketAutomation = plainObject(ticket.automation);
|
|
1472
|
+
var ticketManager = plainObject(ticketAutomation.manager || ticket.manager);
|
|
1473
|
+
return evidenceObject(job.supportV5PreflightGate, job.support_v5_preflight_gate, job.preflightGate, job.preflight_gate, evidence.supportV5PreflightGate, evidence.support_v5_preflight_gate, evidence.preflightGate, evidence.preflight_gate, autonomousDecision.preflightGate, autonomousDecision.preflight_gate, (_a = autonomousDecision.rootCauseReadiness) === null || _a === void 0 ? void 0 : _a.preflightGate, (_b = autonomousDecision.root_cause_readiness) === null || _b === void 0 ? void 0 : _b.preflight_gate, ticket.supportV5PreflightGate, ticket.support_v5_preflight_gate, ticketManager.supportV5PreflightGate, ticketManager.support_v5_preflight_gate, ticketManager.preflightGate, ticketManager.preflight_gate);
|
|
1474
|
+
}
|
|
1475
|
+
function supportPreflightStatus(value) {
|
|
1476
|
+
return cleanText(value, 120).toLowerCase();
|
|
1477
|
+
}
|
|
1478
|
+
function supportPreflightFailedChecks(preflightGate) {
|
|
1479
|
+
var failed = __spreadArray(__spreadArray([], __read(asArray(preflightGate.failedChecks || preflightGate.failed_checks)), false), __read(asArray(preflightGate.checks).filter(function (check) {
|
|
1480
|
+
var status = supportPreflightStatus(check.status || check.state || check.outcome);
|
|
1481
|
+
return /fail|failed|blocked|missing|error/.test(status);
|
|
1482
|
+
})), false);
|
|
1483
|
+
var seen = new Set();
|
|
1484
|
+
return failed.filter(function (check) {
|
|
1485
|
+
var key = "".concat(cleanText(check.name || check.check || check.key, 160), ":").concat(cleanText(check.summary || check.message || check.error || check.reason, 500));
|
|
1486
|
+
if (seen.has(key)) {
|
|
1487
|
+
return false;
|
|
1488
|
+
}
|
|
1489
|
+
seen.add(key);
|
|
1490
|
+
return true;
|
|
1491
|
+
});
|
|
1492
|
+
}
|
|
1493
|
+
function supportPreflightArtifactPaths(preflightGate, checks) {
|
|
1494
|
+
return Array.from(new Set(__spreadArray(__spreadArray(__spreadArray([], __read(cleanStringList(preflightGate.artifactPaths || preflightGate.artifact_paths, 60, 500)), false), __read(checks.flatMap(function (check) { return cleanStringList(check.artifactPaths || check.artifact_paths || check.artifacts, 20, 500); })), false), __read(checks.map(function (check) { return cleanText(check.artifactPath || check.artifact_path || check.path || check.file, 500); }).filter(Boolean)), false))).slice(0, 80);
|
|
1495
|
+
}
|
|
1496
|
+
function supportPreflightCheckMessage(check) {
|
|
1497
|
+
return cleanText(check.summary || check.message || check.error || check.reason || check.status, 1000);
|
|
1498
|
+
}
|
|
1499
|
+
function applySupportPreflightGateToQaEvidence(evidence, preflightGate) {
|
|
1500
|
+
var _a;
|
|
1501
|
+
var status = supportPreflightStatus(preflightGate.status);
|
|
1502
|
+
var failureClass = supportPreflightStatus(preflightGate.failureClass || preflightGate.failure_class);
|
|
1503
|
+
var failedChecks = supportPreflightFailedChecks(preflightGate);
|
|
1504
|
+
var artifactPaths = supportPreflightArtifactPaths(preflightGate, failedChecks);
|
|
1505
|
+
var compileResult = plainObject(preflightGate.compileResult || preflightGate.compile_result);
|
|
1506
|
+
var compileFailed = status === 'compile_failed'
|
|
1507
|
+
|| failureClass === 'compile'
|
|
1508
|
+
|| cleanText(compileResult.failureClass || compileResult.failure_class, 120).toLowerCase() === 'compile'
|
|
1509
|
+
|| failedChecks.some(function (check) {
|
|
1510
|
+
var name = supportPreflightStatus(check.name || check.check || check.key);
|
|
1511
|
+
var checkClass = supportPreflightStatus(check.failureClass || check.failure_class);
|
|
1512
|
+
return name === 'compile' || checkClass === 'compile';
|
|
1513
|
+
});
|
|
1514
|
+
if (compileFailed) {
|
|
1515
|
+
var compileCheck = Object.keys(compileResult).length ? compileResult : failedChecks[0] || {};
|
|
1516
|
+
evidence.compile = __assign(__assign({}, plainObject(evidence.compile || evidence.build || evidence.buildResult || evidence.build_result)), { status: cleanText(compileCheck.status || preflightGate.status || 'fail', 80) || 'fail', command: cleanText(compileCheck.command || preflightGate.command || preflightGate.nextCommand || preflightGate.next_command, 500), artifactPath: artifactPaths[0] || cleanText(compileCheck.artifactPath || compileCheck.artifact_path || compileCheck.path, 500), message: supportPreflightCheckMessage(compileCheck) || cleanText(preflightGate.reason || ((_a = preflightGate.blockers) === null || _a === void 0 ? void 0 : _a[0]) || 'Support compile preflight failed before browser QA.', 1000), metadata: {
|
|
1517
|
+
source: 'supportV5PreflightGate',
|
|
1518
|
+
preflightStatus: status,
|
|
1519
|
+
preflightEvidenceHash: cleanText(preflightGate.evidenceHash || preflightGate.evidence_hash, 200),
|
|
1520
|
+
nextCommand: cleanText(preflightGate.nextCommand || preflightGate.next_command, 180)
|
|
1521
|
+
} });
|
|
1522
|
+
return;
|
|
1523
|
+
}
|
|
1524
|
+
var blocksRepair = preflightGate.blocksProductRepair === true || preflightGate.blocks_product_repair === true || /infra_failed|blocked|missing/.test(status);
|
|
1525
|
+
var checks = failedChecks.length
|
|
1526
|
+
? failedChecks
|
|
1527
|
+
: Object.keys(preflightGate).length && (blocksRepair || status === 'passed')
|
|
1528
|
+
? [{
|
|
1529
|
+
name: 'support_preflight',
|
|
1530
|
+
status: status === 'passed' ? 'pass' : 'blocked',
|
|
1531
|
+
summary: cleanStringList(preflightGate.blockers, 4, 500).join('; ') || cleanText(preflightGate.reason || preflightGate.status, 1000),
|
|
1532
|
+
artifactPaths: artifactPaths
|
|
1533
|
+
}]
|
|
1534
|
+
: [];
|
|
1535
|
+
if (!checks.length) {
|
|
1536
|
+
return;
|
|
1537
|
+
}
|
|
1538
|
+
evidence.infraChecks = __spreadArray(__spreadArray([], __read(asArray(evidence.infraChecks)), false), __read(checks.map(function (check) { return ({
|
|
1539
|
+
name: cleanText(check.name || check.check || check.key, 160) || 'support_preflight',
|
|
1540
|
+
status: cleanText(check.status || check.state || check.outcome || (status === 'passed' ? 'pass' : 'blocked'), 80),
|
|
1541
|
+
message: supportPreflightCheckMessage(check) || cleanStringList(preflightGate.blockers, 3, 500).join('; '),
|
|
1542
|
+
path: cleanText(check.path || check.artifactPath || check.artifact_path, 500) || artifactPaths[0],
|
|
1543
|
+
metadata: {
|
|
1544
|
+
source: 'supportV5PreflightGate',
|
|
1545
|
+
preflightStatus: status,
|
|
1546
|
+
preflightFailureClass: failureClass,
|
|
1547
|
+
preflightEvidenceHash: cleanText(preflightGate.evidenceHash || preflightGate.evidence_hash, 200),
|
|
1548
|
+
nextCommand: cleanText(preflightGate.nextCommand || preflightGate.next_command, 180)
|
|
1549
|
+
}
|
|
1550
|
+
}); })), false);
|
|
1551
|
+
}
|
|
1552
|
+
function supportPreflightGateResult(preflightGate, now) {
|
|
1553
|
+
if (!preflightGate || !Object.keys(preflightGate).length) {
|
|
1554
|
+
return undefined;
|
|
1555
|
+
}
|
|
1556
|
+
var statusText = supportPreflightStatus(preflightGate.status);
|
|
1557
|
+
var ready = preflightGate.ready === true;
|
|
1558
|
+
var blocksProductRepair = preflightGate.blocksProductRepair === true || preflightGate.blocks_product_repair === true;
|
|
1559
|
+
var failedChecks = supportPreflightFailedChecks(preflightGate);
|
|
1560
|
+
var artifactPaths = supportPreflightArtifactPaths(preflightGate, failedChecks);
|
|
1561
|
+
var gateStatus = ready || statusText === 'passed'
|
|
1562
|
+
? 'pass'
|
|
1563
|
+
: /compile_failed|infra_failed|fail|failed/.test(statusText)
|
|
1564
|
+
? 'fail'
|
|
1565
|
+
: blocksProductRepair || /missing|blocked/.test(statusText)
|
|
1566
|
+
? 'blocked'
|
|
1567
|
+
: 'warn';
|
|
1568
|
+
var blockers = cleanStringList(preflightGate.blockers, 20, 500);
|
|
1569
|
+
return {
|
|
1570
|
+
key: 'support_preflight_gate',
|
|
1571
|
+
label: 'Support preflight gate',
|
|
1572
|
+
status: gateStatus,
|
|
1573
|
+
reason: gateStatus === 'pass'
|
|
1574
|
+
? 'Support deterministic preflight passed before product-code repair.'
|
|
1575
|
+
: cleanText(blockers.join('; ') || preflightGate.reason || "Support deterministic preflight is ".concat(statusText || 'not ready', " before product-code repair."), 1200),
|
|
1576
|
+
evidenceRefs: artifactPaths,
|
|
1577
|
+
recordedAt: isoNow(now || preflightGate.recordedAt || preflightGate.recorded_at),
|
|
1578
|
+
metadata: {
|
|
1579
|
+
ready: ready,
|
|
1580
|
+
required: preflightGate.required === true,
|
|
1581
|
+
status: statusText,
|
|
1582
|
+
failureClass: cleanText(preflightGate.failureClass || preflightGate.failure_class, 120),
|
|
1583
|
+
nextCommand: cleanText(preflightGate.nextCommand || preflightGate.next_command, 180),
|
|
1584
|
+
blocksProductRepair: blocksProductRepair,
|
|
1585
|
+
blocksModelRepair: preflightGate.blocksModelRepair === true || preflightGate.blocks_model_repair === true,
|
|
1586
|
+
failedChecks: failedChecks.map(function (check) { return cleanText(check.name || check.check || check.key, 160); }).filter(Boolean),
|
|
1587
|
+
requiredEvidence: cleanStringList(preflightGate.requiredEvidence || preflightGate.required_evidence, 20, 500),
|
|
1588
|
+
evidenceHash: cleanText(preflightGate.evidenceHash || preflightGate.evidence_hash, 200)
|
|
1589
|
+
}
|
|
1590
|
+
};
|
|
1591
|
+
}
|
|
1458
1592
|
function supportBusinessProofReadinessGate(readiness, now) {
|
|
1459
1593
|
if (!readiness || !Object.keys(readiness).length) {
|
|
1460
1594
|
return undefined;
|
|
@@ -1582,7 +1716,7 @@ function supportNextActionContractRequired(ticket, job, evidence) {
|
|
|
1582
1716
|
|| !!ticketManager.last_watchdog_decision;
|
|
1583
1717
|
}
|
|
1584
1718
|
function supportNextActionContractMetadata(contract) {
|
|
1585
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
1719
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
1586
1720
|
var decisionBasis = plainObject(contract.decisionBasis || contract.decision_basis);
|
|
1587
1721
|
var costRisk = plainObject(contract.costRisk || contract.cost_risk);
|
|
1588
1722
|
var source = {
|
|
@@ -1621,8 +1755,12 @@ function supportNextActionContractMetadata(contract) {
|
|
|
1621
1755
|
blockerFingerprint: cleanText(decisionBasis.blockerFingerprint || decisionBasis.blocker_fingerprint, 200),
|
|
1622
1756
|
evidenceHash: cleanText(decisionBasis.evidenceHash || decisionBasis.evidence_hash, 200),
|
|
1623
1757
|
sameFailureCount: numberValue((_o = decisionBasis.sameFailureCount) !== null && _o !== void 0 ? _o : decisionBasis.same_failure_count),
|
|
1624
|
-
|
|
1625
|
-
|
|
1758
|
+
preflightReady: booleanFlag((_p = decisionBasis.preflightReady) !== null && _p !== void 0 ? _p : decisionBasis.preflight_ready),
|
|
1759
|
+
preflightStatus: cleanText(decisionBasis.preflightStatus || decisionBasis.preflight_status, 120),
|
|
1760
|
+
preflightFailureClass: cleanText(decisionBasis.preflightFailureClass || decisionBasis.preflight_failure_class, 120),
|
|
1761
|
+
preflightEvidenceHash: cleanText(decisionBasis.preflightEvidenceHash || decisionBasis.preflight_evidence_hash, 200),
|
|
1762
|
+
hotfixCommitRequired: booleanFlag((_s = (_r = (_q = decisionBasis.hotfixCommitRequired) !== null && _q !== void 0 ? _q : decisionBasis.hotfix_commit_required) !== null && _r !== void 0 ? _r : contract.hotfixCommitRequired) !== null && _s !== void 0 ? _s : contract.hotfix_commit_required),
|
|
1763
|
+
liveHotfixBlockedUntilCommit: booleanFlag((_v = (_u = (_t = decisionBasis.liveHotfixBlockedUntilCommit) !== null && _t !== void 0 ? _t : decisionBasis.live_hotfix_blocked_until_commit) !== null && _u !== void 0 ? _u : contract.liveHotfixBlockedUntilCommit) !== null && _v !== void 0 ? _v : contract.live_hotfix_blocked_until_commit)
|
|
1626
1764
|
};
|
|
1627
1765
|
return source;
|
|
1628
1766
|
}
|
|
@@ -2520,7 +2658,7 @@ function applyAssistantAnswerQualityGate(qa, decision, now) {
|
|
|
2520
2658
|
}
|
|
2521
2659
|
function buildSupportAIRunFromEvidence(input) {
|
|
2522
2660
|
var e_28, _a, e_29, _b;
|
|
2523
|
-
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;
|
|
2661
|
+
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;
|
|
2524
2662
|
var ticket = input.ticket || {};
|
|
2525
2663
|
var job = input.job || {};
|
|
2526
2664
|
var evidence = buildSupportQaEvidence(input);
|
|
@@ -2532,8 +2670,8 @@ function buildSupportAIRunFromEvidence(input) {
|
|
|
2532
2670
|
addSourceId(sourceIds, 'jobId', job._id || job.id || job.jobId);
|
|
2533
2671
|
addSourceId(sourceIds, 'buildPlanId', job.buildPlanId || ticket.buildPlanId);
|
|
2534
2672
|
try {
|
|
2535
|
-
for (var
|
|
2536
|
-
var event_1 =
|
|
2673
|
+
for (var _37 = __values(asArray(input.taskEvents)), _38 = _37.next(); !_38.done; _38 = _37.next()) {
|
|
2674
|
+
var event_1 = _38.value;
|
|
2537
2675
|
pushEvent(events, {
|
|
2538
2676
|
type: event_1.type === 'human_intervention' ? 'human_intervention' : 'log',
|
|
2539
2677
|
category: cleanText(event_1.category || event_1.phase || event_1.type, 160),
|
|
@@ -2550,13 +2688,13 @@ function buildSupportAIRunFromEvidence(input) {
|
|
|
2550
2688
|
catch (e_28_1) { e_28 = { error: e_28_1 }; }
|
|
2551
2689
|
finally {
|
|
2552
2690
|
try {
|
|
2553
|
-
if (
|
|
2691
|
+
if (_38 && !_38.done && (_a = _37.return)) _a.call(_37);
|
|
2554
2692
|
}
|
|
2555
2693
|
finally { if (e_28) throw e_28.error; }
|
|
2556
2694
|
}
|
|
2557
2695
|
try {
|
|
2558
|
-
for (var
|
|
2559
|
-
var aiJob =
|
|
2696
|
+
for (var _39 = __values(asArray(input.aiJobs)), _40 = _39.next(); !_40.done; _40 = _39.next()) {
|
|
2697
|
+
var aiJob = _40.value;
|
|
2560
2698
|
pushEvent(events, {
|
|
2561
2699
|
type: aiJob.model ? 'model_call' : 'log',
|
|
2562
2700
|
category: cleanText(aiJob.category || aiJob.phase || aiJob.runner, 160),
|
|
@@ -2574,7 +2712,7 @@ function buildSupportAIRunFromEvidence(input) {
|
|
|
2574
2712
|
catch (e_29_1) { e_29 = { error: e_29_1 }; }
|
|
2575
2713
|
finally {
|
|
2576
2714
|
try {
|
|
2577
|
-
if (
|
|
2715
|
+
if (_40 && !_40.done && (_b = _39.return)) _b.call(_39);
|
|
2578
2716
|
}
|
|
2579
2717
|
finally { if (e_29) throw e_29.error; }
|
|
2580
2718
|
}
|
|
@@ -2648,6 +2786,19 @@ function buildSupportAIRunFromEvidence(input) {
|
|
|
2648
2786
|
});
|
|
2649
2787
|
}
|
|
2650
2788
|
var cost = collectUsageEvents(asArray(input.usageLedger), events);
|
|
2789
|
+
var preflightGateSource = supportPreflightGateObject(ticket, job, evidence);
|
|
2790
|
+
var preflightGate = supportPreflightGateResult(preflightGateSource, input.now);
|
|
2791
|
+
if (preflightGate) {
|
|
2792
|
+
gates.push(preflightGate);
|
|
2793
|
+
pushEvent(events, {
|
|
2794
|
+
type: ((_c = preflightGate.metadata) === null || _c === void 0 ? void 0 : _c.failureClass) === 'compile' || preflightGateSource.status === 'compile_failed' ? 'qa_compile' : 'qa_infra',
|
|
2795
|
+
category: 'support_preflight_gate',
|
|
2796
|
+
message: preflightGate.reason,
|
|
2797
|
+
artifactPaths: preflightGate.evidenceRefs,
|
|
2798
|
+
recordedAt: preflightGate.recordedAt,
|
|
2799
|
+
metadata: preflightGate.metadata
|
|
2800
|
+
});
|
|
2801
|
+
}
|
|
2651
2802
|
var diagnosisGate = evidenceObject(job.supportV5DiagnosisGate, job.support_v5_diagnosis_gate, job.diagnosisGate, ticket.supportV5DiagnosisGate, ticket.diagnosisGate, evidence.diagnosisGate, evidence.supportV5DiagnosisGate);
|
|
2652
2803
|
var diagnosisEvidencePackSource = supportDiagnosisEvidencePackObject(ticket, job, evidence);
|
|
2653
2804
|
var similarFixHints = supportSimilarFixHintsObject(ticket, job, evidence);
|
|
@@ -2720,7 +2871,7 @@ function buildSupportAIRunFromEvidence(input) {
|
|
|
2720
2871
|
pushEvent(events, {
|
|
2721
2872
|
type: 'log',
|
|
2722
2873
|
category: 'diagnosis_gate',
|
|
2723
|
-
message: cleanText(((
|
|
2874
|
+
message: cleanText(((_d = diagnosisGate.accepted_hypothesis) === null || _d === void 0 ? void 0 : _d.statement) || ((_e = diagnosisGate.acceptedHypothesis) === null || _e === void 0 ? void 0 : _e.statement) || diagnosisGate.summary || 'Support diagnosis gate recorded.', 1800),
|
|
2724
2875
|
metadata: {
|
|
2725
2876
|
status: diagnosisGate.status,
|
|
2726
2877
|
issueClass: diagnosisIssueClass,
|
|
@@ -2757,59 +2908,59 @@ function buildSupportAIRunFromEvidence(input) {
|
|
|
2757
2908
|
managerNoBlindLoopPolicy: managerNoBlindLoopMetadata(noBlindLoopGate),
|
|
2758
2909
|
diagnosisBeforeRepair: diagnosisBeforeRepairGate ? {
|
|
2759
2910
|
status: diagnosisBeforeRepairGate.status,
|
|
2760
|
-
diagnosisValid: ((
|
|
2761
|
-
diagnosisStatus: cleanText((
|
|
2762
|
-
activityCount: Number(((
|
|
2763
|
-
changedFiles: cleanStringList((
|
|
2764
|
-
allowedDispatchAction: cleanText((
|
|
2765
|
-
productRepairAllowed: ((
|
|
2766
|
-
blockers: cleanStringList((
|
|
2911
|
+
diagnosisValid: ((_f = diagnosisBeforeRepairGate.metadata) === null || _f === void 0 ? void 0 : _f.diagnosisValid) === true,
|
|
2912
|
+
diagnosisStatus: cleanText((_g = diagnosisBeforeRepairGate.metadata) === null || _g === void 0 ? void 0 : _g.diagnosisStatus, 120),
|
|
2913
|
+
activityCount: Number(((_h = diagnosisBeforeRepairGate.metadata) === null || _h === void 0 ? void 0 : _h.activityCount) || 0),
|
|
2914
|
+
changedFiles: cleanStringList((_j = diagnosisBeforeRepairGate.metadata) === null || _j === void 0 ? void 0 : _j.changedFiles, 40, 500),
|
|
2915
|
+
allowedDispatchAction: cleanText((_k = diagnosisBeforeRepairGate.metadata) === null || _k === void 0 ? void 0 : _k.allowedDispatchAction, 160),
|
|
2916
|
+
productRepairAllowed: ((_l = diagnosisBeforeRepairGate.metadata) === null || _l === void 0 ? void 0 : _l.productRepairAllowed) === true,
|
|
2917
|
+
blockers: cleanStringList((_m = diagnosisBeforeRepairGate.metadata) === null || _m === void 0 ? void 0 : _m.blockers, 20, 500)
|
|
2767
2918
|
} : undefined,
|
|
2768
2919
|
rootCauseEntryContract: Object.keys(rootCauseEntryContract).length ? {
|
|
2769
2920
|
contractId: cleanText(rootCauseEntryContract.contract_id || rootCauseEntryContract.contractId, 160),
|
|
2770
2921
|
version: cleanText(rootCauseEntryContract.version, 120),
|
|
2771
2922
|
status: cleanText(rootCauseEntryContract.status, 120),
|
|
2772
2923
|
issueClassProbeCount: asArray(rootCauseEntryContract.issue_class_probes || rootCauseEntryContract.issueClassProbes).length,
|
|
2773
|
-
ownerFileMax: Number(((
|
|
2774
|
-
requiresBusinessAssertion: ((
|
|
2775
|
-
|| ((
|
|
2924
|
+
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,
|
|
2925
|
+
requiresBusinessAssertion: ((_q = rootCauseEntryContract.business_proof_policy) === null || _q === void 0 ? void 0 : _q.requires_aiqa_business_assertion) === true
|
|
2926
|
+
|| ((_r = rootCauseEntryContract.businessProofPolicy) === null || _r === void 0 ? void 0 : _r.requiresAiqaBusinessAssertion) === true
|
|
2776
2927
|
} : undefined,
|
|
2777
2928
|
diagnosis: Object.keys(diagnosisGate).length ? {
|
|
2778
2929
|
status: cleanText(diagnosisGate.status, 80),
|
|
2779
2930
|
issueClass: diagnosisIssueClass,
|
|
2780
2931
|
ownerFiles: diagnosisOwnerFiles,
|
|
2781
|
-
acceptedHypothesis: cleanText(((
|
|
2932
|
+
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),
|
|
2782
2933
|
proofPlan: diagnosisGate.proof_plan || diagnosisGate.proofPlan
|
|
2783
2934
|
} : undefined,
|
|
2784
2935
|
diagnosisEvidencePack: diagnosisEvidencePackGate ? {
|
|
2785
|
-
status: cleanText((
|
|
2936
|
+
status: cleanText((_u = diagnosisEvidencePackGate.metadata) === null || _u === void 0 ? void 0 : _u.status, 120),
|
|
2786
2937
|
gateStatus: diagnosisEvidencePackGate.status,
|
|
2787
|
-
packId: cleanText((
|
|
2788
|
-
readOnly: ((
|
|
2789
|
-
sourceEditsAllowed: ((
|
|
2790
|
-
requiredOutputKey: cleanText((
|
|
2791
|
-
diagnosisValid: ((
|
|
2792
|
-
issueClassHint: cleanText((
|
|
2793
|
-
ownerFileHints: cleanStringList((
|
|
2794
|
-
similarHintCount: Number(((
|
|
2795
|
-
similarHintsAdvisoryOnly: ((
|
|
2796
|
-
issueClassProbeCount: Number(((
|
|
2797
|
-
validationBlockers: cleanStringList((
|
|
2938
|
+
packId: cleanText((_v = diagnosisEvidencePackGate.metadata) === null || _v === void 0 ? void 0 : _v.packId, 180),
|
|
2939
|
+
readOnly: ((_w = diagnosisEvidencePackGate.metadata) === null || _w === void 0 ? void 0 : _w.readOnly) !== false,
|
|
2940
|
+
sourceEditsAllowed: ((_x = diagnosisEvidencePackGate.metadata) === null || _x === void 0 ? void 0 : _x.sourceEditsAllowed) === true,
|
|
2941
|
+
requiredOutputKey: cleanText((_y = diagnosisEvidencePackGate.metadata) === null || _y === void 0 ? void 0 : _y.requiredOutputKey, 120),
|
|
2942
|
+
diagnosisValid: ((_z = diagnosisEvidencePackGate.metadata) === null || _z === void 0 ? void 0 : _z.diagnosisValid) === true,
|
|
2943
|
+
issueClassHint: cleanText((_0 = diagnosisEvidencePackGate.metadata) === null || _0 === void 0 ? void 0 : _0.issueClassHint, 120),
|
|
2944
|
+
ownerFileHints: cleanStringList((_1 = diagnosisEvidencePackGate.metadata) === null || _1 === void 0 ? void 0 : _1.ownerFileHints, 20, 500),
|
|
2945
|
+
similarHintCount: Number(((_2 = diagnosisEvidencePackGate.metadata) === null || _2 === void 0 ? void 0 : _2.similarHintCount) || 0),
|
|
2946
|
+
similarHintsAdvisoryOnly: ((_3 = diagnosisEvidencePackGate.metadata) === null || _3 === void 0 ? void 0 : _3.similarHintsAdvisoryOnly) === true,
|
|
2947
|
+
issueClassProbeCount: Number(((_4 = diagnosisEvidencePackGate.metadata) === null || _4 === void 0 ? void 0 : _4.issueClassProbeCount) || 0),
|
|
2948
|
+
validationBlockers: cleanStringList((_5 = diagnosisEvidencePackGate.metadata) === null || _5 === void 0 ? void 0 : _5.validationBlockers, 20, 500)
|
|
2798
2949
|
} : undefined,
|
|
2799
2950
|
issueClassProbePlan: issueClassProbePlanGate ? {
|
|
2800
|
-
status: cleanText((
|
|
2951
|
+
status: cleanText((_6 = issueClassProbePlanGate.metadata) === null || _6 === void 0 ? void 0 : _6.status, 120),
|
|
2801
2952
|
gateStatus: issueClassProbePlanGate.status,
|
|
2802
|
-
planId: cleanText((
|
|
2803
|
-
issueClass: cleanText((
|
|
2804
|
-
diagnosisValid: ((
|
|
2805
|
-
issueClassProbePlanReady: ((
|
|
2806
|
-
activeRoute: cleanText((
|
|
2807
|
-
action: cleanText((
|
|
2808
|
-
expectedBusinessProof: cleanText((
|
|
2809
|
-
acceptanceGate: cleanText((
|
|
2810
|
-
requiredArtifacts: cleanStringList((
|
|
2811
|
-
falsePassBlockers: cleanStringList((
|
|
2812
|
-
blockers: cleanStringList((
|
|
2953
|
+
planId: cleanText((_7 = issueClassProbePlanGate.metadata) === null || _7 === void 0 ? void 0 : _7.planId, 180),
|
|
2954
|
+
issueClass: cleanText((_8 = issueClassProbePlanGate.metadata) === null || _8 === void 0 ? void 0 : _8.issueClass, 120),
|
|
2955
|
+
diagnosisValid: ((_9 = issueClassProbePlanGate.metadata) === null || _9 === void 0 ? void 0 : _9.diagnosisValid) === true,
|
|
2956
|
+
issueClassProbePlanReady: ((_10 = issueClassProbePlanGate.metadata) === null || _10 === void 0 ? void 0 : _10.issueClassProbePlanReady) === true,
|
|
2957
|
+
activeRoute: cleanText((_11 = issueClassProbePlanGate.metadata) === null || _11 === void 0 ? void 0 : _11.activeRoute, 500),
|
|
2958
|
+
action: cleanText((_12 = issueClassProbePlanGate.metadata) === null || _12 === void 0 ? void 0 : _12.action, 1000),
|
|
2959
|
+
expectedBusinessProof: cleanText((_13 = issueClassProbePlanGate.metadata) === null || _13 === void 0 ? void 0 : _13.expectedBusinessProof, 1200),
|
|
2960
|
+
acceptanceGate: cleanText((_14 = issueClassProbePlanGate.metadata) === null || _14 === void 0 ? void 0 : _14.acceptanceGate, 120),
|
|
2961
|
+
requiredArtifacts: cleanStringList((_15 = issueClassProbePlanGate.metadata) === null || _15 === void 0 ? void 0 : _15.requiredArtifacts, 20, 500),
|
|
2962
|
+
falsePassBlockers: cleanStringList((_16 = issueClassProbePlanGate.metadata) === null || _16 === void 0 ? void 0 : _16.falsePassBlockers, 20, 500),
|
|
2963
|
+
blockers: cleanStringList((_17 = issueClassProbePlanGate.metadata) === null || _17 === void 0 ? void 0 : _17.blockers, 20, 500)
|
|
2813
2964
|
} : undefined,
|
|
2814
2965
|
businessProofReadiness: Object.keys(businessProofReadiness).length ? {
|
|
2815
2966
|
ready: businessProofReadiness.ready === true,
|
|
@@ -2819,19 +2970,19 @@ function buildSupportAIRunFromEvidence(input) {
|
|
|
2819
2970
|
} : undefined,
|
|
2820
2971
|
nextActionContract: nextActionContractGate ? {
|
|
2821
2972
|
status: nextActionContractGate.status,
|
|
2822
|
-
action: cleanText((
|
|
2823
|
-
primaryCommand: cleanText((
|
|
2824
|
-
safeToAutoRun: ((
|
|
2825
|
-
canRunWithoutCodexMonitor: ((
|
|
2826
|
-
codexFallbackRequired: ((
|
|
2827
|
-
requiresHumanApproval: ((
|
|
2828
|
-
rootCauseFirstSatisfied: ((
|
|
2829
|
-
hotfixCommitRequired: ((
|
|
2830
|
-
liveHotfixBlockedUntilCommit: ((
|
|
2831
|
-
failureClass: cleanText((
|
|
2832
|
-
evidenceFreshnessStatus: cleanText((
|
|
2833
|
-
sameFailureCount: Number(((
|
|
2834
|
-
blockers: cleanStringList((
|
|
2973
|
+
action: cleanText((_18 = nextActionContractGate.metadata) === null || _18 === void 0 ? void 0 : _18.action, 160),
|
|
2974
|
+
primaryCommand: cleanText((_19 = nextActionContractGate.metadata) === null || _19 === void 0 ? void 0 : _19.primaryCommand, 240),
|
|
2975
|
+
safeToAutoRun: ((_20 = nextActionContractGate.metadata) === null || _20 === void 0 ? void 0 : _20.safeToAutoRun) === true,
|
|
2976
|
+
canRunWithoutCodexMonitor: ((_21 = nextActionContractGate.metadata) === null || _21 === void 0 ? void 0 : _21.canRunWithoutCodexMonitor) === true,
|
|
2977
|
+
codexFallbackRequired: ((_22 = nextActionContractGate.metadata) === null || _22 === void 0 ? void 0 : _22.codexFallbackRequired) === true,
|
|
2978
|
+
requiresHumanApproval: ((_23 = nextActionContractGate.metadata) === null || _23 === void 0 ? void 0 : _23.requiresHumanApproval) === true,
|
|
2979
|
+
rootCauseFirstSatisfied: ((_24 = nextActionContractGate.metadata) === null || _24 === void 0 ? void 0 : _24.rootCauseFirstSatisfied) === true,
|
|
2980
|
+
hotfixCommitRequired: ((_25 = nextActionContractGate.metadata) === null || _25 === void 0 ? void 0 : _25.hotfixCommitRequired) === true,
|
|
2981
|
+
liveHotfixBlockedUntilCommit: ((_26 = nextActionContractGate.metadata) === null || _26 === void 0 ? void 0 : _26.liveHotfixBlockedUntilCommit) === true,
|
|
2982
|
+
failureClass: cleanText((_27 = nextActionContractGate.metadata) === null || _27 === void 0 ? void 0 : _27.failureClass, 120),
|
|
2983
|
+
evidenceFreshnessStatus: cleanText((_28 = nextActionContractGate.metadata) === null || _28 === void 0 ? void 0 : _28.evidenceFreshnessStatus, 120),
|
|
2984
|
+
sameFailureCount: Number(((_29 = nextActionContractGate.metadata) === null || _29 === void 0 ? void 0 : _29.sameFailureCount) || 0),
|
|
2985
|
+
blockers: cleanStringList((_30 = nextActionContractGate.metadata) === null || _30 === void 0 ? void 0 : _30.blockers, 20, 500)
|
|
2835
2986
|
} : undefined,
|
|
2836
2987
|
customerReplyPolicy: Object.keys(customerReplyPolicy).length ? {
|
|
2837
2988
|
action: cleanText(customerReplyPolicy.action, 120),
|
|
@@ -2839,12 +2990,12 @@ function buildSupportAIRunFromEvidence(input) {
|
|
|
2839
2990
|
canDraftCustomerReply: customerReplyPolicy.canDraftCustomerReply === true || customerReplyPolicy.can_draft_customer_reply === true,
|
|
2840
2991
|
canSendCustomerReply: customerReplyPolicy.canSendCustomerReply === true || customerReplyPolicy.can_send_customer_reply === true,
|
|
2841
2992
|
reason: cleanText(customerReplyPolicy.reason, 1000),
|
|
2842
|
-
reviewType: cleanText(((
|
|
2843
|
-
|| ((
|
|
2844
|
-
|| ((
|
|
2845
|
-
primaryAction: cleanText(((
|
|
2846
|
-
|| ((
|
|
2847
|
-
|| ((
|
|
2993
|
+
reviewType: cleanText(((_31 = customerReplyPolicy.humanReviewPacket) === null || _31 === void 0 ? void 0 : _31.reviewType)
|
|
2994
|
+
|| ((_32 = customerReplyPolicy.human_review_packet) === null || _32 === void 0 ? void 0 : _32.review_type)
|
|
2995
|
+
|| ((_33 = customerReplyPolicy.human_review_packet) === null || _33 === void 0 ? void 0 : _33.reviewType), 160),
|
|
2996
|
+
primaryAction: cleanText(((_34 = customerReplyPolicy.humanReviewPacket) === null || _34 === void 0 ? void 0 : _34.primaryAction)
|
|
2997
|
+
|| ((_35 = customerReplyPolicy.human_review_packet) === null || _35 === void 0 ? void 0 : _35.primary_action)
|
|
2998
|
+
|| ((_36 = customerReplyPolicy.human_review_packet) === null || _36 === void 0 ? void 0 : _36.primaryAction), 160)
|
|
2848
2999
|
} : undefined
|
|
2849
3000
|
}
|
|
2850
3001
|
});
|