@resolveio/server-lib 22.3.181 → 22.3.183
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
|
@@ -186,6 +186,42 @@ export interface ResolveIOSupportHumanReviewPacket {
|
|
|
186
186
|
costRisk: 'free_or_deterministic' | 'small_model_or_qa' | 'expensive_model' | 'release_or_customer_send';
|
|
187
187
|
createdAt: string;
|
|
188
188
|
}
|
|
189
|
+
export interface ResolveIOSupportHumanDecisionChoice {
|
|
190
|
+
choiceId: string;
|
|
191
|
+
label: string;
|
|
192
|
+
action: string;
|
|
193
|
+
description: string;
|
|
194
|
+
safety: 'low' | 'medium' | 'high';
|
|
195
|
+
requiresConfirmation: boolean;
|
|
196
|
+
nextCommand: string;
|
|
197
|
+
expectedResult: string;
|
|
198
|
+
allowedWithoutCodexMonitor: boolean;
|
|
199
|
+
}
|
|
200
|
+
export interface ResolveIOSupportHumanDecisionRequest {
|
|
201
|
+
requestId: string;
|
|
202
|
+
required: boolean;
|
|
203
|
+
status: 'not_required' | 'waiting_for_operator' | 'auto_dispatch_allowed';
|
|
204
|
+
reason: string;
|
|
205
|
+
question: string;
|
|
206
|
+
preferredChoiceId: string;
|
|
207
|
+
evidence: {
|
|
208
|
+
failureClass: string;
|
|
209
|
+
blocker: string;
|
|
210
|
+
blockerFingerprint: string;
|
|
211
|
+
evidenceHash: string;
|
|
212
|
+
sameFailureCount: number;
|
|
213
|
+
pingPongCount: number;
|
|
214
|
+
evidenceStrength: ResolveIOAIManagerEvidenceStrength;
|
|
215
|
+
requiredResetEvidence: string[];
|
|
216
|
+
recentArtifactPaths: string[];
|
|
217
|
+
changedFiles: string[];
|
|
218
|
+
nextActionContractId: string;
|
|
219
|
+
};
|
|
220
|
+
choices: ResolveIOSupportHumanDecisionChoice[];
|
|
221
|
+
blockedUntil: string[];
|
|
222
|
+
autoDispatchAllowed: boolean;
|
|
223
|
+
createdAt: string;
|
|
224
|
+
}
|
|
189
225
|
export interface ResolveIOSupportCustomerReplyPolicyInput {
|
|
190
226
|
diagnosisGate?: any;
|
|
191
227
|
issueClassProbePlan?: any;
|
|
@@ -198,6 +234,10 @@ export interface ResolveIOSupportCustomerReplyPolicyInput {
|
|
|
198
234
|
previousArtifactFingerprint?: string;
|
|
199
235
|
unresolvedBlockers?: any[];
|
|
200
236
|
releaseStatus?: string;
|
|
237
|
+
releaseEvidence?: any;
|
|
238
|
+
hotfixEvidence?: any;
|
|
239
|
+
releasePolicy?: ResolveIOAIManagerHotfixFirstReleasePolicy;
|
|
240
|
+
releaseGatePassed?: boolean;
|
|
201
241
|
}
|
|
202
242
|
export interface ResolveIOSupportCustomerReplyPolicy {
|
|
203
243
|
action: ResolveIOSupportCustomerReplyAction;
|
|
@@ -721,6 +761,7 @@ export interface ResolveIOSupportV5AutonomousDecision {
|
|
|
721
761
|
continuationProofCheckpoint: ResolveIOSupportContinuationProofCheckpoint;
|
|
722
762
|
nextActionContract: ResolveIOSupportNextActionContract;
|
|
723
763
|
humanReviewPacket: ResolveIOSupportHumanReviewPacket;
|
|
764
|
+
humanDecisionRequest?: ResolveIOSupportHumanDecisionRequest;
|
|
724
765
|
hotfixContinuation?: ResolveIOAIManagerHotfixContinuationDecision;
|
|
725
766
|
recordedAt: string;
|
|
726
767
|
}
|
|
@@ -1001,6 +1001,146 @@ function normalizeSupportConfidenceLevel(value) {
|
|
|
1001
1001
|
function supportReleaseLooksBlocked(value) {
|
|
1002
1002
|
return /\b(fail|failed|error|blocked|missing|empty|stale|denied|timeout)\b/i.test(cleanText(value, 200));
|
|
1003
1003
|
}
|
|
1004
|
+
function supportStatusLooksPassed(value) {
|
|
1005
|
+
return /\b(pass|passed|success|succeeded|complete|completed|ready|not_required|not required)\b/i.test(cleanText(value, 200));
|
|
1006
|
+
}
|
|
1007
|
+
function nestedObject(source) {
|
|
1008
|
+
var e_5, _a;
|
|
1009
|
+
var keys = [];
|
|
1010
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
1011
|
+
keys[_i - 1] = arguments[_i];
|
|
1012
|
+
}
|
|
1013
|
+
try {
|
|
1014
|
+
for (var keys_1 = __values(keys), keys_1_1 = keys_1.next(); !keys_1_1.done; keys_1_1 = keys_1.next()) {
|
|
1015
|
+
var key = keys_1_1.value;
|
|
1016
|
+
var value = cleanObject(source[key]);
|
|
1017
|
+
if (Object.keys(value).length) {
|
|
1018
|
+
return value;
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
1023
|
+
finally {
|
|
1024
|
+
try {
|
|
1025
|
+
if (keys_1_1 && !keys_1_1.done && (_a = keys_1.return)) _a.call(keys_1);
|
|
1026
|
+
}
|
|
1027
|
+
finally { if (e_5) throw e_5.error; }
|
|
1028
|
+
}
|
|
1029
|
+
return {};
|
|
1030
|
+
}
|
|
1031
|
+
function resolveSupportReplyReleaseGate(input) {
|
|
1032
|
+
var e_6, _a;
|
|
1033
|
+
var _b;
|
|
1034
|
+
var releaseEvidence = cleanObject(input.releaseEvidence);
|
|
1035
|
+
var releaseStatus = cleanText(input.releaseStatus
|
|
1036
|
+
|| releaseEvidence.status
|
|
1037
|
+
|| releaseEvidence.releaseStatus
|
|
1038
|
+
|| releaseEvidence.release_status
|
|
1039
|
+
|| nestedObject(releaseEvidence, 'deploy_production', 'production').status
|
|
1040
|
+
|| nestedObject(releaseEvidence, 'deploy_dev', 'dev').status
|
|
1041
|
+
|| nestedObject(releaseEvidence, 'push_master', 'pushMaster').status, 200);
|
|
1042
|
+
var hotfixEvidenceContainer = nestedObject(releaseEvidence, 'hotfix_evidence', 'hotfixEvidence');
|
|
1043
|
+
var currentHotfixEvidence = nestedObject(hotfixEvidenceContainer, 'current');
|
|
1044
|
+
var hotfixEvidence = cleanObject(input.hotfixEvidence
|
|
1045
|
+
|| hotfixEvidenceContainer.normalized
|
|
1046
|
+
|| hotfixEvidenceContainer.evidence
|
|
1047
|
+
|| currentHotfixEvidence.evidence
|
|
1048
|
+
|| currentHotfixEvidence.normalized
|
|
1049
|
+
|| hotfixEvidenceContainer.current_evidence
|
|
1050
|
+
|| hotfixEvidenceContainer.currentEvidence);
|
|
1051
|
+
var hotfixCommitProof = nestedObject(releaseEvidence, 'hotfix_commit_proof', 'hotfixCommitProof');
|
|
1052
|
+
var hotfixDurabilityContract = nestedObject(releaseEvidence, 'hotfix_durability_contract', 'hotfixDurabilityContract');
|
|
1053
|
+
var hotfixCommitGuard = cleanObject(hotfixCommitProof.github_commit_guard
|
|
1054
|
+
|| hotfixCommitProof.githubCommitGuard
|
|
1055
|
+
|| hotfixDurabilityContract.hotfix_commit_guard
|
|
1056
|
+
|| hotfixDurabilityContract.hotfixCommitGuard
|
|
1057
|
+
|| hotfixEvidenceContainer.github_commit_guard
|
|
1058
|
+
|| hotfixEvidenceContainer.githubCommitGuard);
|
|
1059
|
+
var hotfixEvidenceStatus = cleanText(hotfixEvidenceContainer.status || currentHotfixEvidence.status || hotfixEvidence.status, 120);
|
|
1060
|
+
var releaseGateStatus = cleanText(hotfixEvidence.releaseGateStatus
|
|
1061
|
+
|| hotfixEvidence.release_gate_status
|
|
1062
|
+
|| hotfixEvidenceContainer.release_gate_status
|
|
1063
|
+
|| hotfixEvidenceContainer.releaseGateStatus
|
|
1064
|
+
|| releaseEvidence.releaseGateStatus
|
|
1065
|
+
|| releaseEvidence.release_gate_status, 160);
|
|
1066
|
+
var releaseGatePassed = input.releaseGatePassed === true
|
|
1067
|
+
|| supportStatusLooksPassed(releaseGateStatus);
|
|
1068
|
+
var missingCommitProofFields = Array.from(new Set(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(cleanList(hotfixCommitProof.missing_fields || hotfixCommitProof.missingFields, 12, 160)), false), __read(cleanList(hotfixEvidenceContainer.missing_fields || hotfixEvidenceContainer.missingFields, 12, 160)), false), __read(cleanList(hotfixDurabilityContract.missing_commit_proof_fields || hotfixDurabilityContract.missingCommitProofFields, 12, 160)), false), __read(cleanList(hotfixCommitGuard.missing_fields || hotfixCommitGuard.missingFields, 12, 160)), false).filter(Boolean)));
|
|
1069
|
+
var commitProofRequired = hotfixCommitProof.required === true
|
|
1070
|
+
|| hotfixEvidenceContainer.github_commit_required === true
|
|
1071
|
+
|| hotfixEvidenceContainer.githubCommitRequired === true
|
|
1072
|
+
|| hotfixCommitGuard.required === true
|
|
1073
|
+
|| hotfixDurabilityContract.required === true;
|
|
1074
|
+
var commitProofPassed = hotfixCommitProof.passed === true
|
|
1075
|
+
|| hotfixEvidenceContainer.github_commit_proof_passed === true
|
|
1076
|
+
|| hotfixEvidenceContainer.githubCommitProofPassed === true
|
|
1077
|
+
|| hotfixCommitGuard.passed === true;
|
|
1078
|
+
var commitProofBlocked = hotfixCommitProof.blocked === true
|
|
1079
|
+
|| hotfixEvidenceContainer.manager_must_commit_before_hotfix === true
|
|
1080
|
+
|| hotfixEvidenceContainer.managerMustCommitBeforeHotfix === true
|
|
1081
|
+
|| hotfixDurabilityContract.live_hotfix_blocked_until_commit === true
|
|
1082
|
+
|| hotfixDurabilityContract.liveHotfixBlockedUntilCommit === true
|
|
1083
|
+
|| hotfixCommitGuard.manager_must_commit_before_hotfix === true
|
|
1084
|
+
|| hotfixCommitGuard.managerMustCommitBeforeHotfix === true
|
|
1085
|
+
|| (commitProofRequired && !commitProofPassed)
|
|
1086
|
+
|| missingCommitProofFields.length > 0;
|
|
1087
|
+
var statusBlocked = supportReleaseLooksBlocked(releaseStatus)
|
|
1088
|
+
|| supportReleaseLooksBlocked(hotfixEvidenceStatus)
|
|
1089
|
+
|| supportReleaseLooksBlocked(releaseGateStatus);
|
|
1090
|
+
var blockers = [];
|
|
1091
|
+
if (statusBlocked) {
|
|
1092
|
+
blockers.push("release_status=".concat(releaseStatus || hotfixEvidenceStatus || releaseGateStatus || 'blocked'));
|
|
1093
|
+
}
|
|
1094
|
+
if (commitProofBlocked) {
|
|
1095
|
+
blockers.push('hotfix_commit_proof_missing_or_blocked');
|
|
1096
|
+
}
|
|
1097
|
+
try {
|
|
1098
|
+
for (var missingCommitProofFields_1 = __values(missingCommitProofFields), missingCommitProofFields_1_1 = missingCommitProofFields_1.next(); !missingCommitProofFields_1_1.done; missingCommitProofFields_1_1 = missingCommitProofFields_1.next()) {
|
|
1099
|
+
var field = missingCommitProofFields_1_1.value;
|
|
1100
|
+
blockers.push("missing_".concat(field));
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
1104
|
+
finally {
|
|
1105
|
+
try {
|
|
1106
|
+
if (missingCommitProofFields_1_1 && !missingCommitProofFields_1_1.done && (_a = missingCommitProofFields_1.return)) _a.call(missingCommitProofFields_1);
|
|
1107
|
+
}
|
|
1108
|
+
finally { if (e_6) throw e_6.error; }
|
|
1109
|
+
}
|
|
1110
|
+
var shouldEvaluateHotfix = statusBlocked || commitProofRequired || Object.keys(hotfixEvidence).length > 0;
|
|
1111
|
+
var hotfixContinuation = shouldEvaluateHotfix
|
|
1112
|
+
? (0, ai_runner_manager_policy_1.decideResolveIOAIManagerHotfixContinuation)({
|
|
1113
|
+
evidence: hotfixEvidence,
|
|
1114
|
+
policy: input.releasePolicy,
|
|
1115
|
+
releaseGatePassed: releaseGatePassed,
|
|
1116
|
+
failureClass: 'release',
|
|
1117
|
+
blocker: blockers.join('; ') || releaseStatus || hotfixEvidenceStatus || releaseGateStatus,
|
|
1118
|
+
now: undefined
|
|
1119
|
+
})
|
|
1120
|
+
: undefined;
|
|
1121
|
+
if (hotfixContinuation && hotfixContinuation.action !== 'continue_runner' && (statusBlocked || commitProofBlocked || hotfixContinuation.action === 'record_hotfix_evidence' || hotfixContinuation.action === 'rerun_release_gate')) {
|
|
1122
|
+
blockers.push("hotfix_next_action=".concat(hotfixContinuation.action));
|
|
1123
|
+
}
|
|
1124
|
+
var uniqueBlockers = Array.from(new Set(blockers.filter(Boolean)));
|
|
1125
|
+
return {
|
|
1126
|
+
blocked: uniqueBlockers.length > 0,
|
|
1127
|
+
reason: uniqueBlockers.length
|
|
1128
|
+
? 'support_reply_release_or_hotfix_evidence_blocked'
|
|
1129
|
+
: 'support_reply_release_or_hotfix_evidence_clear',
|
|
1130
|
+
status: releaseStatus || hotfixEvidenceStatus || releaseGateStatus || '',
|
|
1131
|
+
blockers: uniqueBlockers,
|
|
1132
|
+
requiredEvidence: [
|
|
1133
|
+
'release status passed or explicitly not required',
|
|
1134
|
+
'hotfix commit proof clear when hotfix evidence is required',
|
|
1135
|
+
'sourceCommitSha, githubCommitUrl, gitCommitStatus=passed, gitPushStatus=passed when backend hotfix was used',
|
|
1136
|
+
'release gate passed when hotfix evidence requires gate rerun'
|
|
1137
|
+
],
|
|
1138
|
+
nextCommands: ((_b = hotfixContinuation === null || hotfixContinuation === void 0 ? void 0 : hotfixContinuation.nextCommands) === null || _b === void 0 ? void 0 : _b.length)
|
|
1139
|
+
? hotfixContinuation.nextCommands
|
|
1140
|
+
: ['record_hotfix_evidence', 'commit_and_push_hotfix_to_github', 'rerun_release_gate_once'],
|
|
1141
|
+
hotfixContinuation: hotfixContinuation
|
|
1142
|
+
};
|
|
1143
|
+
}
|
|
1004
1144
|
function supportBusinessAssertionPassed(value) {
|
|
1005
1145
|
return /^(pass|passed|accepted|business_assertion_passed)$/i.test(cleanText(value, 80));
|
|
1006
1146
|
}
|
|
@@ -1011,7 +1151,7 @@ function supportBusinessAssertionRouteOnly(value) {
|
|
|
1011
1151
|
return /^(route_probe_pass|route_only_pass|route_pass|route_probe|route_loaded)$/i.test(cleanText(value, 80));
|
|
1012
1152
|
}
|
|
1013
1153
|
function normalizeSupportBusinessProofAssertions(input) {
|
|
1014
|
-
var
|
|
1154
|
+
var e_7, _a;
|
|
1015
1155
|
var gate = normalizeResolveIOSupportDiagnosisGate(input.diagnosisGate);
|
|
1016
1156
|
var proofPlan = gate === null || gate === void 0 ? void 0 : gate.proof_plan;
|
|
1017
1157
|
var proofContract = proofPlan === null || proofPlan === void 0 ? void 0 : proofPlan.business_proof_contract;
|
|
@@ -1045,12 +1185,12 @@ function normalizeSupportBusinessProofAssertions(input) {
|
|
|
1045
1185
|
});
|
|
1046
1186
|
}
|
|
1047
1187
|
}
|
|
1048
|
-
catch (
|
|
1188
|
+
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
|
1049
1189
|
finally {
|
|
1050
1190
|
try {
|
|
1051
1191
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1052
1192
|
}
|
|
1053
|
-
finally { if (
|
|
1193
|
+
finally { if (e_7) throw e_7.error; }
|
|
1054
1194
|
}
|
|
1055
1195
|
var status = cleanText(input.businessAssertionStatus || input.outcomeLabel, 80);
|
|
1056
1196
|
if (!assertions.length && (supportBusinessAssertionPassed(status) || supportBusinessAssertionRouteOnly(status) || supportBusinessAssertionFailed(status))) {
|
|
@@ -1089,7 +1229,7 @@ function supportBusinessProofAssertionText(assertion) {
|
|
|
1089
1229
|
].filter(Boolean).join(' '), 4000);
|
|
1090
1230
|
}
|
|
1091
1231
|
function supportBusinessProofAssertionMatchesContract(assertion, gate) {
|
|
1092
|
-
var
|
|
1232
|
+
var e_8, _a;
|
|
1093
1233
|
if (!gate) {
|
|
1094
1234
|
return false;
|
|
1095
1235
|
}
|
|
@@ -1129,12 +1269,12 @@ function supportBusinessProofAssertionMatchesContract(assertion, gate) {
|
|
|
1129
1269
|
}
|
|
1130
1270
|
}
|
|
1131
1271
|
}
|
|
1132
|
-
catch (
|
|
1272
|
+
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
1133
1273
|
finally {
|
|
1134
1274
|
try {
|
|
1135
1275
|
if (proofWords_1_1 && !proofWords_1_1.done && (_a = proofWords_1.return)) _a.call(proofWords_1);
|
|
1136
1276
|
}
|
|
1137
|
-
finally { if (
|
|
1277
|
+
finally { if (e_8) throw e_8.error; }
|
|
1138
1278
|
}
|
|
1139
1279
|
return overlap >= Math.min(5, Math.max(3, Math.ceil(proofWords.size * 0.45)));
|
|
1140
1280
|
}
|
|
@@ -1364,7 +1504,7 @@ function decideResolveIOSupportCustomerReplyPolicy(input) {
|
|
|
1364
1504
|
});
|
|
1365
1505
|
var artifactCount = businessProofReadiness.artifactPaths.length;
|
|
1366
1506
|
var unresolvedBlockers = cleanList(input.unresolvedBlockers, 20, 500);
|
|
1367
|
-
var
|
|
1507
|
+
var releaseGate = resolveSupportReplyReleaseGate(input);
|
|
1368
1508
|
var requiredEvidence = [
|
|
1369
1509
|
'valid SupportDiagnosisGate',
|
|
1370
1510
|
'validated IssueClassProbePlan',
|
|
@@ -1505,7 +1645,8 @@ function decideResolveIOSupportCustomerReplyPolicy(input) {
|
|
|
1505
1645
|
})
|
|
1506
1646
|
};
|
|
1507
1647
|
}
|
|
1508
|
-
if (
|
|
1648
|
+
if (releaseGate.blocked) {
|
|
1649
|
+
var releaseRequiredEvidence = Array.from(new Set(__spreadArray(__spreadArray([], __read(requiredEvidence), false), __read(releaseGate.requiredEvidence), false)));
|
|
1509
1650
|
return {
|
|
1510
1651
|
action: 'hold_internal',
|
|
1511
1652
|
canDraftCustomerReply: false,
|
|
@@ -1513,7 +1654,7 @@ function decideResolveIOSupportCustomerReplyPolicy(input) {
|
|
|
1513
1654
|
confidenceLevel: confidenceLevel,
|
|
1514
1655
|
safety: 'internal_hold',
|
|
1515
1656
|
reason: 'support_reply_blocked_until_release_or_hotfix_gate_finishes',
|
|
1516
|
-
requiredEvidence:
|
|
1657
|
+
requiredEvidence: releaseRequiredEvidence,
|
|
1517
1658
|
humanReviewPacket: buildResolveIOSupportHumanReviewPacket({
|
|
1518
1659
|
reviewType: 'release_hotfix',
|
|
1519
1660
|
title: 'Finish Release Or Hotfix Gate',
|
|
@@ -1521,9 +1662,9 @@ function decideResolveIOSupportCustomerReplyPolicy(input) {
|
|
|
1521
1662
|
primaryAction: 'repair_release_hotfix_first',
|
|
1522
1663
|
safety: 'internal_hold',
|
|
1523
1664
|
reason: 'support_reply_blocked_until_release_or_hotfix_gate_finishes',
|
|
1524
|
-
blockers:
|
|
1525
|
-
requiredEvidence:
|
|
1526
|
-
nextCommands:
|
|
1665
|
+
blockers: releaseGate.blockers,
|
|
1666
|
+
requiredEvidence: releaseRequiredEvidence,
|
|
1667
|
+
nextCommands: releaseGate.nextCommands,
|
|
1527
1668
|
forbiddenActions: ['Do not tell the customer the fix is live before release evidence passes.'],
|
|
1528
1669
|
costRisk: 'release_or_customer_send'
|
|
1529
1670
|
})
|
|
@@ -2424,7 +2565,7 @@ function buildResolveIOSupportV5ScopeDigest(input) {
|
|
|
2424
2565
|
return raw.slice(0, maxChars);
|
|
2425
2566
|
}
|
|
2426
2567
|
function buildResolveIOSupportV5MicrotaskLedger(input) {
|
|
2427
|
-
var
|
|
2568
|
+
var e_9, _a;
|
|
2428
2569
|
var existing = Array.isArray(input.existing) ? input.existing : [];
|
|
2429
2570
|
var completedByObjective = new Map();
|
|
2430
2571
|
try {
|
|
@@ -2435,12 +2576,12 @@ function buildResolveIOSupportV5MicrotaskLedger(input) {
|
|
|
2435
2576
|
}
|
|
2436
2577
|
}
|
|
2437
2578
|
}
|
|
2438
|
-
catch (
|
|
2579
|
+
catch (e_9_1) { e_9 = { error: e_9_1 }; }
|
|
2439
2580
|
finally {
|
|
2440
2581
|
try {
|
|
2441
2582
|
if (existing_1_1 && !existing_1_1.done && (_a = existing_1.return)) _a.call(existing_1);
|
|
2442
2583
|
}
|
|
2443
|
-
finally { if (
|
|
2584
|
+
finally { if (e_9) throw e_9.error; }
|
|
2444
2585
|
}
|
|
2445
2586
|
var now = isoNow(input.now);
|
|
2446
2587
|
var requirements = cleanList(input.requirements, 30, 240);
|
|
@@ -2819,7 +2960,7 @@ function decideResolveIOSupportV5Continuation(bundle) {
|
|
|
2819
2960
|
return __assign({ action: 'continue', reason: 'support_v5_continue', nextStep: (last === null || last === void 0 ? void 0 : last.stepType) || bundle.supportV5SupervisorState.activeStep, repeatedNoProgressCount: repeatedNoProgressCount, budgetExceeded: false }, recoveryFieldsFor(recoveryPlan));
|
|
2820
2961
|
}
|
|
2821
2962
|
function decideResolveIOSupportV5AutonomousNextAction(input) {
|
|
2822
|
-
var _a, _b, _c, _d, _e;
|
|
2963
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2823
2964
|
var bundle = input.bundle;
|
|
2824
2965
|
var activeMicrotask = selectResolveIOSupportV5ActiveMicrotask(bundle.supportV5MicrotaskLedger || [], bundle.supportV5ActiveMicrotaskId);
|
|
2825
2966
|
var diagnosisValidation = validateResolveIOSupportDiagnosisGate(bundle.supportV5DiagnosisGate, {
|
|
@@ -2851,7 +2992,10 @@ function decideResolveIOSupportV5AutonomousNextAction(input) {
|
|
|
2851
2992
|
previousProofFingerprint: input.previousProofFingerprint,
|
|
2852
2993
|
previousArtifactFingerprint: input.previousArtifactFingerprint,
|
|
2853
2994
|
unresolvedBlockers: input.unresolvedBlockers,
|
|
2854
|
-
releaseStatus: input.releaseStatus
|
|
2995
|
+
releaseStatus: input.releaseStatus,
|
|
2996
|
+
hotfixEvidence: input.hotfixEvidence,
|
|
2997
|
+
releasePolicy: input.releasePolicy,
|
|
2998
|
+
releaseGatePassed: input.releaseGatePassed
|
|
2855
2999
|
});
|
|
2856
3000
|
var businessProofReadiness = evaluateResolveIOSupportBusinessProofReadiness({
|
|
2857
3001
|
diagnosisGate: bundle.supportV5DiagnosisGate,
|
|
@@ -3102,6 +3246,128 @@ function decideResolveIOSupportV5AutonomousNextAction(input) {
|
|
|
3102
3246
|
createdAt: createdAt
|
|
3103
3247
|
};
|
|
3104
3248
|
};
|
|
3249
|
+
var buildHumanDecisionRequest = function (action, label, reason, fields, rootCauseReadiness, continuationProofCheckpoint, nextActionContract, requiredEvidence, blockers) {
|
|
3250
|
+
var repeatedEvidenceBlocked = evidenceFreshness.mustCollectNewEvidence === true
|
|
3251
|
+
|| rootCauseReadiness.sameFailureParked === true
|
|
3252
|
+
|| continuationProofCheckpoint.status === 'waiting_for_new_evidence';
|
|
3253
|
+
var manualApprovalRequired = action === 'park_manual'
|
|
3254
|
+
|| action === 'ask_customer_clarification'
|
|
3255
|
+
|| nextActionContract.requiresHumanApproval === true
|
|
3256
|
+
|| fields.canRunAutonomously !== true;
|
|
3257
|
+
if (!repeatedEvidenceBlocked && !manualApprovalRequired) {
|
|
3258
|
+
return undefined;
|
|
3259
|
+
}
|
|
3260
|
+
var createdAt = isoNow(input.now);
|
|
3261
|
+
var autoDispatchAllowed = repeatedEvidenceBlocked
|
|
3262
|
+
&& action === 'collect_new_evidence'
|
|
3263
|
+
&& nextActionContract.safeToAutoRun === true
|
|
3264
|
+
&& nextActionContract.canRunWithoutCodexMonitor === true;
|
|
3265
|
+
var preferredChoiceId = autoDispatchAllowed
|
|
3266
|
+
? 'run_bounded_evidence_probe'
|
|
3267
|
+
: action === 'ask_customer_clarification'
|
|
3268
|
+
? 'review_customer_clarification'
|
|
3269
|
+
: action === 'run_diagnosis_gate' || action === 'revise_diagnosis_scope'
|
|
3270
|
+
? 'revise_diagnosis_gate'
|
|
3271
|
+
: 'keep_parked';
|
|
3272
|
+
var baseRequiredEvidence = Array.from(new Set(__spreadArray(__spreadArray(__spreadArray([], __read(requiredEvidence), false), __read(continuationProofCheckpoint.requiredResetEvidence), false), __read(evidenceFreshness.requiredResetEvidence), false).filter(Boolean))).slice(0, 20);
|
|
3273
|
+
var choices = [];
|
|
3274
|
+
if (repeatedEvidenceBlocked) {
|
|
3275
|
+
choices.push({
|
|
3276
|
+
choiceId: 'run_bounded_evidence_probe',
|
|
3277
|
+
label: 'Run Evidence Probe',
|
|
3278
|
+
action: 'collect_new_evidence',
|
|
3279
|
+
description: 'Collect changed issue-specific evidence only; product-code repair remains blocked until blockerFingerprint, evidenceHash, or business proof changes.',
|
|
3280
|
+
safety: 'low',
|
|
3281
|
+
requiresConfirmation: false,
|
|
3282
|
+
nextCommand: nextActionContract.primaryCommand || 'run_support_v5_recovery_evidence_probe',
|
|
3283
|
+
expectedResult: nextActionExpectedTransition('collect_new_evidence', nextActionContract.primaryCommand || 'run_support_v5_recovery_evidence_probe'),
|
|
3284
|
+
allowedWithoutCodexMonitor: autoDispatchAllowed
|
|
3285
|
+
});
|
|
3286
|
+
}
|
|
3287
|
+
choices.push({
|
|
3288
|
+
choiceId: 'revise_diagnosis_gate',
|
|
3289
|
+
label: 'Revise Diagnosis',
|
|
3290
|
+
action: 'run_diagnosis_gate',
|
|
3291
|
+
description: 'Re-run read-only root-cause diagnosis with the new evidence and update owner files/proof plan before any repair loop.',
|
|
3292
|
+
safety: 'low',
|
|
3293
|
+
requiresConfirmation: repeatedEvidenceBlocked === false,
|
|
3294
|
+
nextCommand: 'revise_support_diagnosis_gate_with_new_evidence',
|
|
3295
|
+
expectedResult: nextActionExpectedTransition('run_diagnosis_gate', 'revise_support_diagnosis_gate_with_new_evidence'),
|
|
3296
|
+
allowedWithoutCodexMonitor: false
|
|
3297
|
+
});
|
|
3298
|
+
if (action === 'ask_customer_clarification') {
|
|
3299
|
+
choices.push({
|
|
3300
|
+
choiceId: 'review_customer_clarification',
|
|
3301
|
+
label: 'Review Clarification',
|
|
3302
|
+
action: 'ask_customer_clarification',
|
|
3303
|
+
description: 'Review the one customer question before any send action; no product-code repair is allowed from guessed context.',
|
|
3304
|
+
safety: 'medium',
|
|
3305
|
+
requiresConfirmation: true,
|
|
3306
|
+
nextCommand: nextActionContract.primaryCommand || 'review_customer_clarification',
|
|
3307
|
+
expectedResult: nextActionExpectedTransition('ask_customer_clarification', nextActionContract.primaryCommand || 'review_customer_clarification'),
|
|
3308
|
+
allowedWithoutCodexMonitor: false
|
|
3309
|
+
});
|
|
3310
|
+
}
|
|
3311
|
+
choices.push({
|
|
3312
|
+
choiceId: 'keep_parked',
|
|
3313
|
+
label: 'Keep Parked',
|
|
3314
|
+
action: 'park_manual',
|
|
3315
|
+
description: 'Do not spend more model, QA, release, or customer-send budget until new evidence, scope, budget, or approval changes.',
|
|
3316
|
+
safety: 'low',
|
|
3317
|
+
requiresConfirmation: false,
|
|
3318
|
+
nextCommand: 'park_support_ticket_until_new_evidence',
|
|
3319
|
+
expectedResult: 'The support runner stays parked and records the blocker as waiting for an operator decision or fresh evidence.',
|
|
3320
|
+
allowedWithoutCodexMonitor: true
|
|
3321
|
+
});
|
|
3322
|
+
var blockedUntil = Array.from(new Set(__spreadArray(__spreadArray([], __read(baseRequiredEvidence), false), [
|
|
3323
|
+
repeatedEvidenceBlocked ? 'blockerFingerprint changes from the starting repeated blocker' : '',
|
|
3324
|
+
repeatedEvidenceBlocked ? 'evidenceHash changes from the starting repeated evidence hash' : '',
|
|
3325
|
+
repeatedEvidenceBlocked ? 'fresh AIQaBusinessAssertion, infra/compile proof, release proof, or artifact path is attached' : '',
|
|
3326
|
+
action === 'park_manual' ? 'operator changes scope, budget, autonomy policy, or approval' : ''
|
|
3327
|
+
], false).filter(Boolean))).slice(0, 16);
|
|
3328
|
+
return {
|
|
3329
|
+
requestId: "support-human-decision-".concat(hashResolveIOSupportV5Evidence({
|
|
3330
|
+
action: action,
|
|
3331
|
+
label: label,
|
|
3332
|
+
reason: reason,
|
|
3333
|
+
preferredChoiceId: preferredChoiceId,
|
|
3334
|
+
failureClass: evidenceFreshness.failureClass,
|
|
3335
|
+
blockerFingerprint: evidenceFreshness.blockerFingerprint,
|
|
3336
|
+
evidenceHash: evidenceFreshness.evidenceHash,
|
|
3337
|
+
createdAt: createdAt.slice(0, 16)
|
|
3338
|
+
}).slice(0, 16)),
|
|
3339
|
+
required: true,
|
|
3340
|
+
status: autoDispatchAllowed ? 'auto_dispatch_allowed' : 'waiting_for_operator',
|
|
3341
|
+
reason: repeatedEvidenceBlocked
|
|
3342
|
+
? "".concat(reason, " Same failure evidence repeated; repair is blocked until new evidence changes the proof state.")
|
|
3343
|
+
: reason,
|
|
3344
|
+
question: repeatedEvidenceBlocked
|
|
3345
|
+
? 'Same blocker/evidence repeated. Run one bounded evidence probe, revise diagnosis with new facts, or keep the ticket parked?'
|
|
3346
|
+
: action === 'ask_customer_clarification'
|
|
3347
|
+
? 'Customer context is missing. Review the clarification question or keep the ticket parked?'
|
|
3348
|
+
: "Human approval is required for ".concat(label, ". What should the runner do next?"),
|
|
3349
|
+
preferredChoiceId: preferredChoiceId,
|
|
3350
|
+
evidence: {
|
|
3351
|
+
failureClass: evidenceFreshness.failureClass,
|
|
3352
|
+
blocker: cleanText(blockers[0] || reason, 1000),
|
|
3353
|
+
blockerFingerprint: evidenceFreshness.blockerFingerprint,
|
|
3354
|
+
evidenceHash: evidenceFreshness.evidenceHash,
|
|
3355
|
+
sameFailureCount: evidenceFreshness.sameFailureCount,
|
|
3356
|
+
pingPongCount: evidenceFreshness.pingPongCount,
|
|
3357
|
+
evidenceStrength: evidenceFreshness.evidenceStrength,
|
|
3358
|
+
requiredResetEvidence: baseRequiredEvidence,
|
|
3359
|
+
recentArtifactPaths: evidenceFreshness.artifactPaths.slice(0, 20),
|
|
3360
|
+
changedFiles: evidenceFreshness.changedFiles.slice(0, 20),
|
|
3361
|
+
nextActionContractId: nextActionContract.contractId
|
|
3362
|
+
},
|
|
3363
|
+
choices: choices
|
|
3364
|
+
.filter(function (choice, index, source) { return source.findIndex(function (candidate) { return candidate.choiceId === choice.choiceId; }) === index; })
|
|
3365
|
+
.slice(0, 6),
|
|
3366
|
+
blockedUntil: blockedUntil,
|
|
3367
|
+
autoDispatchAllowed: autoDispatchAllowed,
|
|
3368
|
+
createdAt: createdAt
|
|
3369
|
+
};
|
|
3370
|
+
};
|
|
3105
3371
|
var makeDecision = function (action, label, reason, fields) {
|
|
3106
3372
|
var _a;
|
|
3107
3373
|
var primaryCommand = fields.primaryCommand || action;
|
|
@@ -3147,6 +3413,7 @@ function decideResolveIOSupportV5AutonomousNextAction(input) {
|
|
|
3147
3413
|
: 'free_or_deterministic',
|
|
3148
3414
|
now: input.now
|
|
3149
3415
|
});
|
|
3416
|
+
var humanDecisionRequest = buildHumanDecisionRequest(action, label, reason, fields, rootCauseReadiness, continuationProofCheckpoint, nextActionContract, requiredEvidence, blockers);
|
|
3150
3417
|
return {
|
|
3151
3418
|
action: action,
|
|
3152
3419
|
label: label,
|
|
@@ -3185,6 +3452,7 @@ function decideResolveIOSupportV5AutonomousNextAction(input) {
|
|
|
3185
3452
|
continuationProofCheckpoint: continuationProofCheckpoint,
|
|
3186
3453
|
nextActionContract: nextActionContract,
|
|
3187
3454
|
humanReviewPacket: humanReviewPacket,
|
|
3455
|
+
humanDecisionRequest: humanDecisionRequest,
|
|
3188
3456
|
hotfixContinuation: fields.hotfixContinuation,
|
|
3189
3457
|
recordedAt: isoNow(input.now)
|
|
3190
3458
|
};
|
|
@@ -3376,6 +3644,24 @@ function decideResolveIOSupportV5AutonomousNextAction(input) {
|
|
|
3376
3644
|
hotfixContinuation: hotfixContinuation
|
|
3377
3645
|
});
|
|
3378
3646
|
}
|
|
3647
|
+
if (customerReplyPolicy.action === 'hold_internal' && customerReplyPolicy.reason === 'support_reply_blocked_until_release_or_hotfix_gate_finishes') {
|
|
3648
|
+
return makeDecision('repair_release_hotfix_first', 'Hotfix Release', 'support_v5_reply_blocked_by_hotfix_evidence', {
|
|
3649
|
+
canRunAutonomously: true,
|
|
3650
|
+
canRunModel: false,
|
|
3651
|
+
canEditProductCode: false,
|
|
3652
|
+
canPrepareHotfixPatch: true,
|
|
3653
|
+
canHotfixBackend: false,
|
|
3654
|
+
liveHotfixBlockedUntilCommit: true,
|
|
3655
|
+
lane: 'release',
|
|
3656
|
+
stepType: 'release_gate',
|
|
3657
|
+
primaryCommand: ((_f = customerReplyPolicy.humanReviewPacket) === null || _f === void 0 ? void 0 : _f.primaryAction) || 'repair_release_hotfix_first',
|
|
3658
|
+
nextCommands: ((_g = customerReplyPolicy.humanReviewPacket) === null || _g === void 0 ? void 0 : _g.nextCommands) || ['record_hotfix_evidence', 'commit_and_push_hotfix_to_github', 'rerun_release_gate_once'],
|
|
3659
|
+
requiredEvidence: customerReplyPolicy.requiredEvidence,
|
|
3660
|
+
blockers: ((_h = customerReplyPolicy.humanReviewPacket) === null || _h === void 0 ? void 0 : _h.blockers) || ['Release or hotfix evidence is incomplete.'],
|
|
3661
|
+
forbiddenActions: ['Do not draft a customer resolution until hotfix commit proof and release evidence are complete.'],
|
|
3662
|
+
humanReviewPacket: customerReplyPolicy.humanReviewPacket
|
|
3663
|
+
});
|
|
3664
|
+
}
|
|
3379
3665
|
if ((activeMicrotask === null || activeMicrotask === void 0 ? void 0 : activeMicrotask.lane) === 'qa' || /^(qa_row|qa_retest|business_proof|route_probe|issue_class_probe)$/.test(activeStepType)) {
|
|
3380
3666
|
return makeDecision('run_business_proof_qa', 'Run Business Proof QA', 'support_v5_business_assertion_required', {
|
|
3381
3667
|
canRunAutonomously: true,
|
|
@@ -3694,7 +3980,7 @@ function buildResolveIOSupportV5MicrotaskPrompt(input) {
|
|
|
3694
3980
|
};
|
|
3695
3981
|
}
|
|
3696
3982
|
function summarizeResolveIOSupportV5MicrotaskUsage(bundle) {
|
|
3697
|
-
var
|
|
3983
|
+
var e_10, _a, e_11, _b;
|
|
3698
3984
|
var byMicrotask = new Map();
|
|
3699
3985
|
var bySection = new Map();
|
|
3700
3986
|
var totalPromptTokenEstimate = 0;
|
|
@@ -3709,17 +3995,17 @@ function summarizeResolveIOSupportV5MicrotaskUsage(bundle) {
|
|
|
3709
3995
|
existing.calls += 1;
|
|
3710
3996
|
byMicrotask.set(usage.microtaskId, existing);
|
|
3711
3997
|
try {
|
|
3712
|
-
for (var _e = (
|
|
3998
|
+
for (var _e = (e_11 = void 0, __values(usage.promptSections || [])), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
3713
3999
|
var section = _f.value;
|
|
3714
4000
|
bySection.set(section.name, (bySection.get(section.name) || 0) + section.tokenEstimate);
|
|
3715
4001
|
}
|
|
3716
4002
|
}
|
|
3717
|
-
catch (
|
|
4003
|
+
catch (e_11_1) { e_11 = { error: e_11_1 }; }
|
|
3718
4004
|
finally {
|
|
3719
4005
|
try {
|
|
3720
4006
|
if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
|
|
3721
4007
|
}
|
|
3722
|
-
finally { if (
|
|
4008
|
+
finally { if (e_11) throw e_11.error; }
|
|
3723
4009
|
}
|
|
3724
4010
|
var hardCap = usage.lane === 'qa' ? promptBudget.qaMicrotaskHardCap : promptBudget.buildMicrotaskHardCap;
|
|
3725
4011
|
if ((usage.promptTokenEstimate || 0) > hardCap) {
|
|
@@ -3727,12 +4013,12 @@ function summarizeResolveIOSupportV5MicrotaskUsage(bundle) {
|
|
|
3727
4013
|
}
|
|
3728
4014
|
}
|
|
3729
4015
|
}
|
|
3730
|
-
catch (
|
|
4016
|
+
catch (e_10_1) { e_10 = { error: e_10_1 }; }
|
|
3731
4017
|
finally {
|
|
3732
4018
|
try {
|
|
3733
4019
|
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
3734
4020
|
}
|
|
3735
|
-
finally { if (
|
|
4021
|
+
finally { if (e_10) throw e_10.error; }
|
|
3736
4022
|
}
|
|
3737
4023
|
return {
|
|
3738
4024
|
totalPromptTokenEstimate: totalPromptTokenEstimate,
|