@resolveio/server-lib 22.3.133 → 22.3.135
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 +1 -1
- package/util/ai-runner-manager-policy.d.ts +37 -0
- package/util/ai-runner-manager-policy.js +149 -13
- package/util/ai-runner-manager-policy.js.map +1 -1
- package/util/aicoder-runner-v6.d.ts +3 -1
- package/util/aicoder-runner-v6.js +26 -111
- package/util/aicoder-runner-v6.js.map +1 -1
- package/util/support-runner-v5.d.ts +4 -1
- package/util/support-runner-v5.js +42 -103
- package/util/support-runner-v5.js.map +1 -1
|
@@ -636,86 +636,45 @@ function decideResolveIOSupportV5RepairGate(input) {
|
|
|
636
636
|
summary: input.blocker
|
|
637
637
|
}
|
|
638
638
|
}); };
|
|
639
|
-
|
|
640
|
-
var
|
|
639
|
+
var recoveryFieldsFor = function (recoveryPlan) {
|
|
640
|
+
var recoveryCheckpoint = recoveryCheckpointFor(recoveryPlan);
|
|
641
641
|
return {
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
642
|
+
recoveryPlan: recoveryPlan,
|
|
643
|
+
recoveryCheckpoint: recoveryCheckpoint,
|
|
644
|
+
recoveryEvidenceProbe: (0, ai_runner_manager_policy_1.buildResolveIOAIManagerRecoveryEvidenceProbe)({
|
|
645
|
+
checkpoint: recoveryCheckpoint,
|
|
646
|
+
current: {
|
|
647
|
+
lane: 'build',
|
|
648
|
+
stepType: activeStepType || 'build_repair',
|
|
649
|
+
failureClass: failureClass || 'unknown',
|
|
650
|
+
blocker: input.blocker || (diagnosisValidation.blockers || []).join(' | '),
|
|
651
|
+
evidenceHash: input.evidenceHash,
|
|
652
|
+
changedFiles: cleanList(input.changedFiles, 40, 500),
|
|
653
|
+
summary: input.blocker
|
|
654
|
+
}
|
|
655
|
+
})
|
|
653
656
|
};
|
|
657
|
+
};
|
|
658
|
+
if (repeatedFailure === null || repeatedFailure === void 0 ? void 0 : repeatedFailure.shouldStop) {
|
|
659
|
+
var recoveryPlan_1 = recoveryPlanFor('park_repeated_failure', repeatedFailure.reason, repeatedFailure.failureClass, true);
|
|
660
|
+
return __assign({ action: 'park_repeated_failure', canEditProductCode: false, blockers: [repeatedFailure.reason], ownerFiles: ownerFiles, issueClass: (_c = diagnosisValidation.normalized) === null || _c === void 0 ? void 0 : _c.issue_class, proofPlan: (_d = diagnosisValidation.normalized) === null || _d === void 0 ? void 0 : _d.proof_plan, outsideOwnerFiles: outsideOwnerFiles, repeatedFailure: repeatedFailure, diagnosisValidation: diagnosisValidation }, recoveryFieldsFor(recoveryPlan_1));
|
|
654
661
|
}
|
|
655
662
|
if (failureClass === 'infra' || failureClass === 'compile') {
|
|
656
663
|
var recoveryPlan_2 = recoveryPlanFor('retry_infra', 'support_v5_infra_or_compile_repair_required', failureClass, false);
|
|
657
|
-
return {
|
|
658
|
-
action: 'infra_repair_only',
|
|
659
|
-
canEditProductCode: false,
|
|
660
|
-
blockers: ['Infra/compile/Puppeteer/startup failures must be repaired in the harness lane before product-code repair.'],
|
|
661
|
-
ownerFiles: ownerFiles,
|
|
662
|
-
issueClass: (_e = diagnosisValidation.normalized) === null || _e === void 0 ? void 0 : _e.issue_class,
|
|
663
|
-
proofPlan: (_f = diagnosisValidation.normalized) === null || _f === void 0 ? void 0 : _f.proof_plan,
|
|
664
|
-
outsideOwnerFiles: outsideOwnerFiles,
|
|
665
|
-
repeatedFailure: repeatedFailure,
|
|
666
|
-
diagnosisValidation: diagnosisValidation,
|
|
667
|
-
recoveryPlan: recoveryPlan_2,
|
|
668
|
-
recoveryCheckpoint: recoveryCheckpointFor(recoveryPlan_2)
|
|
669
|
-
};
|
|
664
|
+
return __assign({ action: 'infra_repair_only', canEditProductCode: false, blockers: ['Infra/compile/Puppeteer/startup failures must be repaired in the harness lane before product-code repair.'], ownerFiles: ownerFiles, issueClass: (_e = diagnosisValidation.normalized) === null || _e === void 0 ? void 0 : _e.issue_class, proofPlan: (_f = diagnosisValidation.normalized) === null || _f === void 0 ? void 0 : _f.proof_plan, outsideOwnerFiles: outsideOwnerFiles, repeatedFailure: repeatedFailure, diagnosisValidation: diagnosisValidation }, recoveryFieldsFor(recoveryPlan_2));
|
|
670
665
|
}
|
|
671
666
|
if (activeStepType === 'diagnosis_gate' || !diagnosisValidation.valid) {
|
|
672
667
|
var recoveryPlan_3 = recoveryPlanFor('continue', 'support_v5_diagnosis_gate_required', 'diagnosis', false);
|
|
673
|
-
return {
|
|
674
|
-
action: 'diagnose_only',
|
|
675
|
-
canEditProductCode: false,
|
|
676
|
-
blockers: diagnosisValidation.blockers.length
|
|
668
|
+
return __assign({ action: 'diagnose_only', canEditProductCode: false, blockers: diagnosisValidation.blockers.length
|
|
677
669
|
? diagnosisValidation.blockers
|
|
678
|
-
: ['SupportDiagnosisGate is required before product-code repair.'],
|
|
679
|
-
ownerFiles: ownerFiles,
|
|
680
|
-
issueClass: (_g = diagnosisValidation.normalized) === null || _g === void 0 ? void 0 : _g.issue_class,
|
|
681
|
-
proofPlan: (_h = diagnosisValidation.normalized) === null || _h === void 0 ? void 0 : _h.proof_plan,
|
|
682
|
-
outsideOwnerFiles: outsideOwnerFiles,
|
|
683
|
-
repeatedFailure: repeatedFailure,
|
|
684
|
-
diagnosisValidation: diagnosisValidation,
|
|
685
|
-
recoveryPlan: recoveryPlan_3,
|
|
686
|
-
recoveryCheckpoint: recoveryCheckpointFor(recoveryPlan_3)
|
|
687
|
-
};
|
|
670
|
+
: ['SupportDiagnosisGate is required before product-code repair.'], ownerFiles: ownerFiles, issueClass: (_g = diagnosisValidation.normalized) === null || _g === void 0 ? void 0 : _g.issue_class, proofPlan: (_h = diagnosisValidation.normalized) === null || _h === void 0 ? void 0 : _h.proof_plan, outsideOwnerFiles: outsideOwnerFiles, repeatedFailure: repeatedFailure, diagnosisValidation: diagnosisValidation }, recoveryFieldsFor(recoveryPlan_3));
|
|
688
671
|
}
|
|
689
672
|
if (outsideOwnerFiles.length) {
|
|
690
673
|
var recoveryPlan_4 = recoveryPlanFor('continue', 'support_v5_out_of_scope_requires_diagnosis_revision', 'owner_scope', false);
|
|
691
|
-
return {
|
|
692
|
-
action: 'reject_out_of_scope',
|
|
693
|
-
canEditProductCode: false,
|
|
694
|
-
blockers: ["Changed files outside diagnosis owner_files; revise diagnosis with new evidence before broadening edits: ".concat(outsideOwnerFiles.join(', '))],
|
|
695
|
-
ownerFiles: ownerFiles,
|
|
696
|
-
issueClass: (_j = diagnosisValidation.normalized) === null || _j === void 0 ? void 0 : _j.issue_class,
|
|
697
|
-
proofPlan: (_k = diagnosisValidation.normalized) === null || _k === void 0 ? void 0 : _k.proof_plan,
|
|
698
|
-
outsideOwnerFiles: outsideOwnerFiles,
|
|
699
|
-
repeatedFailure: repeatedFailure,
|
|
700
|
-
diagnosisValidation: diagnosisValidation,
|
|
701
|
-
recoveryPlan: recoveryPlan_4,
|
|
702
|
-
recoveryCheckpoint: recoveryCheckpointFor(recoveryPlan_4)
|
|
703
|
-
};
|
|
674
|
+
return __assign({ action: 'reject_out_of_scope', canEditProductCode: false, blockers: ["Changed files outside diagnosis owner_files; revise diagnosis with new evidence before broadening edits: ".concat(outsideOwnerFiles.join(', '))], ownerFiles: ownerFiles, issueClass: (_j = diagnosisValidation.normalized) === null || _j === void 0 ? void 0 : _j.issue_class, proofPlan: (_k = diagnosisValidation.normalized) === null || _k === void 0 ? void 0 : _k.proof_plan, outsideOwnerFiles: outsideOwnerFiles, repeatedFailure: repeatedFailure, diagnosisValidation: diagnosisValidation }, recoveryFieldsFor(recoveryPlan_4));
|
|
704
675
|
}
|
|
705
676
|
var recoveryPlan = recoveryPlanFor('continue', 'support_v5_product_repair_allowed_after_diagnosis', failureClass || 'product_code', true);
|
|
706
|
-
return {
|
|
707
|
-
action: 'allow_product_repair',
|
|
708
|
-
canEditProductCode: true,
|
|
709
|
-
blockers: [],
|
|
710
|
-
ownerFiles: ownerFiles,
|
|
711
|
-
issueClass: (_l = diagnosisValidation.normalized) === null || _l === void 0 ? void 0 : _l.issue_class,
|
|
712
|
-
proofPlan: (_m = diagnosisValidation.normalized) === null || _m === void 0 ? void 0 : _m.proof_plan,
|
|
713
|
-
outsideOwnerFiles: outsideOwnerFiles,
|
|
714
|
-
repeatedFailure: repeatedFailure,
|
|
715
|
-
diagnosisValidation: diagnosisValidation,
|
|
716
|
-
recoveryPlan: recoveryPlan,
|
|
717
|
-
recoveryCheckpoint: recoveryCheckpointFor(recoveryPlan)
|
|
718
|
-
};
|
|
677
|
+
return __assign({ action: 'allow_product_repair', canEditProductCode: true, blockers: [], ownerFiles: ownerFiles, issueClass: (_l = diagnosisValidation.normalized) === null || _l === void 0 ? void 0 : _l.issue_class, proofPlan: (_m = diagnosisValidation.normalized) === null || _m === void 0 ? void 0 : _m.proof_plan, outsideOwnerFiles: outsideOwnerFiles, repeatedFailure: repeatedFailure, diagnosisValidation: diagnosisValidation }, recoveryFieldsFor(recoveryPlan));
|
|
719
678
|
}
|
|
720
679
|
function applyResolveIOSupportDiagnosisGateToMicrotasks(bundle, diagnosisGate) {
|
|
721
680
|
var validation = validateResolveIOSupportDiagnosisGate(diagnosisGate);
|
|
@@ -1007,7 +966,8 @@ function initializeResolveIOSupportV5State(input) {
|
|
|
1007
966
|
: [],
|
|
1008
967
|
supportV5FailureFingerprints: Array.isArray(existing.supportV5FailureFingerprints)
|
|
1009
968
|
? existing.supportV5FailureFingerprints.slice(-200)
|
|
1010
|
-
: []
|
|
969
|
+
: [],
|
|
970
|
+
supportV5RecoveryEvidenceProbe: existing.supportV5RecoveryEvidenceProbe
|
|
1011
971
|
};
|
|
1012
972
|
return diagnosisValidation.valid && diagnosisValidation.normalized
|
|
1013
973
|
? applyResolveIOSupportDiagnosisGateToMicrotasks(initialized, diagnosisValidation.normalized)
|
|
@@ -1143,59 +1103,38 @@ function decideResolveIOSupportV5Continuation(bundle) {
|
|
|
1143
1103
|
plan: recoveryPlan,
|
|
1144
1104
|
current: last
|
|
1145
1105
|
}); };
|
|
1106
|
+
var recoveryFieldsFor = function (recoveryPlan) {
|
|
1107
|
+
var recoveryCheckpoint = recoveryCheckpointFor(recoveryPlan);
|
|
1108
|
+
return {
|
|
1109
|
+
recoveryPlan: recoveryPlan,
|
|
1110
|
+
recoveryCheckpoint: recoveryCheckpoint,
|
|
1111
|
+
recoveryEvidenceProbe: (0, ai_runner_manager_policy_1.buildResolveIOAIManagerRecoveryEvidenceProbe)({
|
|
1112
|
+
checkpoint: recoveryCheckpoint,
|
|
1113
|
+
current: last
|
|
1114
|
+
})
|
|
1115
|
+
};
|
|
1116
|
+
};
|
|
1146
1117
|
if (budgetExceeded) {
|
|
1147
1118
|
var recoveryPlan_5 = recoveryPlanFor('manual_handoff', 'support_v5_budget_guard', {
|
|
1148
1119
|
productRepairFailure: false
|
|
1149
1120
|
});
|
|
1150
|
-
return {
|
|
1151
|
-
action: 'park',
|
|
1152
|
-
reason: 'support_v5_budget_guard',
|
|
1153
|
-
nextStep: (last === null || last === void 0 ? void 0 : last.stepType) || 'cleanup',
|
|
1154
|
-
repeatedNoProgressCount: repeatedNoProgressCount,
|
|
1155
|
-
budgetExceeded: budgetExceeded,
|
|
1156
|
-
recoveryPlan: recoveryPlan_5,
|
|
1157
|
-
recoveryCheckpoint: recoveryCheckpointFor(recoveryPlan_5)
|
|
1158
|
-
};
|
|
1121
|
+
return __assign({ action: 'park', reason: 'support_v5_budget_guard', nextStep: (last === null || last === void 0 ? void 0 : last.stepType) || 'cleanup', repeatedNoProgressCount: repeatedNoProgressCount, budgetExceeded: budgetExceeded }, recoveryFieldsFor(recoveryPlan_5));
|
|
1159
1122
|
}
|
|
1160
1123
|
if (repeatedNoProgressCount > budget.maxRepeatedNoProgress) {
|
|
1161
1124
|
var recoveryPlan_6 = recoveryPlanFor('park_repeated_failure', 'support_v5_repeated_no_progress', {
|
|
1162
1125
|
productRepairFailure: true
|
|
1163
1126
|
});
|
|
1164
|
-
return {
|
|
1165
|
-
action: 'park',
|
|
1166
|
-
reason: 'support_v5_repeated_no_progress',
|
|
1167
|
-
nextStep: (last === null || last === void 0 ? void 0 : last.stepType) || 'cleanup',
|
|
1168
|
-
repeatedNoProgressCount: repeatedNoProgressCount,
|
|
1169
|
-
budgetExceeded: budgetExceeded,
|
|
1170
|
-
recoveryPlan: recoveryPlan_6,
|
|
1171
|
-
recoveryCheckpoint: recoveryCheckpointFor(recoveryPlan_6)
|
|
1172
|
-
};
|
|
1127
|
+
return __assign({ action: 'park', reason: 'support_v5_repeated_no_progress', nextStep: (last === null || last === void 0 ? void 0 : last.stepType) || 'cleanup', repeatedNoProgressCount: repeatedNoProgressCount, budgetExceeded: budgetExceeded }, recoveryFieldsFor(recoveryPlan_6));
|
|
1173
1128
|
}
|
|
1174
1129
|
if (repeatedFailure === null || repeatedFailure === void 0 ? void 0 : repeatedFailure.shouldStop) {
|
|
1175
1130
|
var recoveryPlan_7 = recoveryPlanFor(repeatedFailure.reason === 'support_v5_ping_pong_failure_loop' ? 'park_ping_pong' : 'park_repeated_failure', repeatedFailure.reason, {
|
|
1176
1131
|
failureClass: repeatedFailure.failureClass,
|
|
1177
1132
|
productRepairFailure: true
|
|
1178
1133
|
});
|
|
1179
|
-
return {
|
|
1180
|
-
action: 'park',
|
|
1181
|
-
reason: repeatedFailure.reason,
|
|
1182
|
-
nextStep: (last === null || last === void 0 ? void 0 : last.stepType) || 'cleanup',
|
|
1183
|
-
repeatedNoProgressCount: repeatedFailure.repeatedCount,
|
|
1184
|
-
budgetExceeded: budgetExceeded,
|
|
1185
|
-
recoveryPlan: recoveryPlan_7,
|
|
1186
|
-
recoveryCheckpoint: recoveryCheckpointFor(recoveryPlan_7)
|
|
1187
|
-
};
|
|
1134
|
+
return __assign({ action: 'park', reason: repeatedFailure.reason, nextStep: (last === null || last === void 0 ? void 0 : last.stepType) || 'cleanup', repeatedNoProgressCount: repeatedFailure.repeatedCount, budgetExceeded: budgetExceeded }, recoveryFieldsFor(recoveryPlan_7));
|
|
1188
1135
|
}
|
|
1189
1136
|
var recoveryPlan = recoveryPlanFor('continue', 'support_v5_continue');
|
|
1190
|
-
return {
|
|
1191
|
-
action: 'continue',
|
|
1192
|
-
reason: 'support_v5_continue',
|
|
1193
|
-
nextStep: (last === null || last === void 0 ? void 0 : last.stepType) || bundle.supportV5SupervisorState.activeStep,
|
|
1194
|
-
repeatedNoProgressCount: repeatedNoProgressCount,
|
|
1195
|
-
budgetExceeded: false,
|
|
1196
|
-
recoveryPlan: recoveryPlan,
|
|
1197
|
-
recoveryCheckpoint: recoveryCheckpointFor(recoveryPlan)
|
|
1198
|
-
};
|
|
1137
|
+
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));
|
|
1199
1138
|
}
|
|
1200
1139
|
function buildResolveIOSupportV5DiagnoseFirstPrompt(lines) {
|
|
1201
1140
|
var _a, _b;
|