@resolveio/server-lib 22.3.213 → 22.3.214
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/methods/ai-terminal.js +306 -199
- package/methods/ai-terminal.js.map +1 -1
- package/package.json +1 -1
- package/util/support-runner-v5.js +78 -23
- package/util/support-runner-v5.js.map +1 -1
package/package.json
CHANGED
|
@@ -130,7 +130,7 @@ function cleanListEntryText(value, max) {
|
|
|
130
130
|
if (value && typeof value === 'object' && !Array.isArray(value)) {
|
|
131
131
|
var source = value;
|
|
132
132
|
var hypothesis = cleanListEntryText(source.hypothesis, Math.floor(max / 2));
|
|
133
|
-
var whyRejected = cleanListEntryText(source.why_rejected || source.whyRejected || source.reason_rejected || source.reasonRejected, Math.floor(max / 2));
|
|
133
|
+
var whyRejected = cleanListEntryText(source.why_rejected || source.whyRejected || source.reason_rejected || source.reasonRejected || source.reason, Math.floor(max / 2));
|
|
134
134
|
if (hypothesis && whyRejected) {
|
|
135
135
|
return "".concat(hypothesis, " rejected because ").concat(whyRejected).slice(0, max);
|
|
136
136
|
}
|
|
@@ -149,8 +149,11 @@ function cleanListEntryText(value, max) {
|
|
|
149
149
|
'artifactPath',
|
|
150
150
|
'artifact_path',
|
|
151
151
|
'summary',
|
|
152
|
+
'detail',
|
|
152
153
|
'message',
|
|
153
154
|
'description',
|
|
155
|
+
'proof_required',
|
|
156
|
+
'proofRequired',
|
|
154
157
|
'reason',
|
|
155
158
|
'value',
|
|
156
159
|
'label',
|
|
@@ -924,6 +927,13 @@ function normalizeIssueClass(value) {
|
|
|
924
927
|
upload: 'upload_import',
|
|
925
928
|
import: 'upload_import',
|
|
926
929
|
upload_import: 'upload_import',
|
|
930
|
+
behavior: 'missing_wrong_data',
|
|
931
|
+
workflow_behavior: 'missing_wrong_data',
|
|
932
|
+
general: 'missing_wrong_data',
|
|
933
|
+
general_inquiry: 'missing_wrong_data',
|
|
934
|
+
customer_inquiry: 'missing_wrong_data',
|
|
935
|
+
data_mismatch: 'missing_wrong_data',
|
|
936
|
+
warehouse_mismatch: 'missing_wrong_data',
|
|
927
937
|
route_auth: 'route_auth_hydration',
|
|
928
938
|
auth_hydration: 'route_auth_hydration',
|
|
929
939
|
route_auth_hydration: 'route_auth_hydration',
|
|
@@ -951,12 +961,19 @@ function normalizeReproductionStatus(value) {
|
|
|
951
961
|
function inferSupportDiagnosisEvidenceTypeFromText(value, artifactPath) {
|
|
952
962
|
if (artifactPath === void 0) { artifactPath = ''; }
|
|
953
963
|
var text = cleanText([value, artifactPath].filter(Boolean).join(' '), 2000).toLowerCase();
|
|
954
|
-
|
|
955
|
-
|
|
964
|
+
var pathText = cleanText(artifactPath, 500).toLowerCase();
|
|
965
|
+
if (/\b(screenshot|screen shot)\b/i.test(text) || /\.(?:png|jpe?g|webp|gif)$/i.test(pathText)) {
|
|
966
|
+
return 'browser';
|
|
956
967
|
}
|
|
957
|
-
if (/\b(
|
|
968
|
+
if (/\b(angular|server|client|src|methods|publications|routing|permission|component|template)\b/i.test(pathText)) {
|
|
969
|
+
return 'code';
|
|
970
|
+
}
|
|
971
|
+
if (/\b(browser|dom|click|route|page|playwright|puppeteer)\b/i.test(text)) {
|
|
958
972
|
return 'browser';
|
|
959
973
|
}
|
|
974
|
+
if (/\b(ticket|customer|client|reporter|reported|support request|manual-ticket|email\.metadata)\b/i.test(text)) {
|
|
975
|
+
return 'ticket';
|
|
976
|
+
}
|
|
960
977
|
if (/\b(mongo|database|collection|document|query|findone|aggregate)\b/i.test(text)) {
|
|
961
978
|
return 'mongo';
|
|
962
979
|
}
|
|
@@ -1030,30 +1047,45 @@ function normalizeSupportDiagnosisEvidence(values, ownerFiles) {
|
|
|
1030
1047
|
.map(function (entry) {
|
|
1031
1048
|
var type = cleanText(entry.type, 80).toLowerCase();
|
|
1032
1049
|
var artifactPath = cleanText(entry.artifactPath || entry.artifact_path || entry.path || entry.file, 500);
|
|
1050
|
+
var summary = cleanText(entry.summary || entry.detail || entry.message || entry.evidence || entry.reason || entry.fact || entry.description || entry.proof_required || entry.proofRequired, 1200)
|
|
1051
|
+
|| (artifactPath ? "Evidence from ".concat(artifactPath) : '');
|
|
1052
|
+
var evidenceText = [summary, artifactPath].filter(Boolean).join(' ');
|
|
1033
1053
|
var inferredType = (function () {
|
|
1034
|
-
|
|
1054
|
+
var inferredFromText = inferSupportDiagnosisEvidenceTypeFromText(summary, artifactPath);
|
|
1055
|
+
if (allowed.has(type) && type !== 'other') {
|
|
1056
|
+
if (type === 'ticket' && inferredFromText === 'browser') {
|
|
1057
|
+
return 'browser';
|
|
1058
|
+
}
|
|
1035
1059
|
return type;
|
|
1036
1060
|
}
|
|
1037
|
-
if (/\b(
|
|
1061
|
+
if (/\b(screenshot|screen shot)\b/i.test(evidenceText)
|
|
1062
|
+
|| /\.(?:png|jpe?g|webp|gif)$/i.test(artifactPath)) {
|
|
1063
|
+
return 'browser';
|
|
1064
|
+
}
|
|
1065
|
+
if (/\b(angular|server|client|src|methods|publications|routing|permission|component|template)\b/i.test(artifactPath)) {
|
|
1066
|
+
return 'code';
|
|
1067
|
+
}
|
|
1068
|
+
if (/\b(playwright|puppeteer|browser|dom|click|route|page)\b/i.test(evidenceText)) {
|
|
1069
|
+
return 'browser';
|
|
1070
|
+
}
|
|
1071
|
+
if (/\b(ticket|manual-ticket|support request|customer|reporter|email\.metadata)\b/i.test(evidenceText)) {
|
|
1038
1072
|
return 'ticket';
|
|
1039
1073
|
}
|
|
1040
|
-
if (/\b(commit|git)\b/i.test(
|
|
1074
|
+
if (/\b(commit|git)\b/i.test(evidenceText)) {
|
|
1041
1075
|
return 'commit';
|
|
1042
1076
|
}
|
|
1043
|
-
if (/\b(mongo|query|database|collection)\b/i.test(
|
|
1077
|
+
if (/\b(mongo|query|database|collection)\b/i.test(evidenceText)) {
|
|
1044
1078
|
return 'mongo';
|
|
1045
1079
|
}
|
|
1046
|
-
if (/\b(log|trace)\b/i.test(
|
|
1080
|
+
if (/\b(log|trace|console|network)\b/i.test(evidenceText)) {
|
|
1047
1081
|
return 'log';
|
|
1048
1082
|
}
|
|
1049
|
-
if (/\b(angular|server|client|src|methods|publications|routing|permission|component)\b/i.test(
|
|
1083
|
+
if (/\b(angular|server|client|src|methods|publications|routing|permission|component|template)\b/i.test(evidenceText)) {
|
|
1050
1084
|
return 'code';
|
|
1051
1085
|
}
|
|
1052
|
-
return
|
|
1086
|
+
return inferredFromText;
|
|
1053
1087
|
})();
|
|
1054
1088
|
var normalizedType = inferredType;
|
|
1055
|
-
var summary = cleanText(entry.summary || entry.message || entry.evidence || entry.reason || entry.fact || entry.description, 1200)
|
|
1056
|
-
|| (artifactPath ? "Evidence from ".concat(artifactPath) : '');
|
|
1057
1089
|
var ownerFiles = cleanList(entry.ownerFiles || entry.owner_files || entry.files, 12, 500)
|
|
1058
1090
|
.map(normalizeOwnerFilePath)
|
|
1059
1091
|
.filter(Boolean);
|
|
@@ -1713,8 +1745,14 @@ function supportDiagnosisNarrativeText(value, max) {
|
|
|
1713
1745
|
if (!Object.keys(source).length) {
|
|
1714
1746
|
return '';
|
|
1715
1747
|
}
|
|
1748
|
+
var hypothesis = cleanText(source.hypothesis, Math.floor(max / 2));
|
|
1749
|
+
var whyRejected = cleanText(source.why_rejected || source.whyRejected || source.reason_rejected || source.reasonRejected || source.reason, Math.floor(max / 2));
|
|
1750
|
+
if (hypothesis && whyRejected) {
|
|
1751
|
+
return "".concat(hypothesis, " rejected because ").concat(whyRejected).slice(0, max);
|
|
1752
|
+
}
|
|
1716
1753
|
var direct = pickText(source, [
|
|
1717
1754
|
'summary',
|
|
1755
|
+
'detail',
|
|
1718
1756
|
'description',
|
|
1719
1757
|
'statement',
|
|
1720
1758
|
'issue_case',
|
|
@@ -1730,17 +1768,14 @@ function supportDiagnosisNarrativeText(value, max) {
|
|
|
1730
1768
|
'pathChain',
|
|
1731
1769
|
'assessment',
|
|
1732
1770
|
'path',
|
|
1771
|
+
'proof_required',
|
|
1772
|
+
'proofRequired',
|
|
1733
1773
|
'reason',
|
|
1734
1774
|
'fact'
|
|
1735
1775
|
], max);
|
|
1736
1776
|
if (direct) {
|
|
1737
1777
|
return direct;
|
|
1738
1778
|
}
|
|
1739
|
-
var hypothesis = cleanText(source.hypothesis, Math.floor(max / 2));
|
|
1740
|
-
var whyRejected = cleanText(source.why_rejected || source.whyRejected || source.reason_rejected || source.reasonRejected, Math.floor(max / 2));
|
|
1741
|
-
if (hypothesis && whyRejected) {
|
|
1742
|
-
return "".concat(hypothesis, " rejected because ").concat(whyRejected).slice(0, max);
|
|
1743
|
-
}
|
|
1744
1779
|
var routeModulePermission = cleanText(source.route_module_permission_gate || source.routeModulePermissionGate, Math.floor(max / 2));
|
|
1745
1780
|
var templateGate = cleanText(source.template_conditional_rendering_gate || source.templateConditionalRenderingGate, Math.floor(max / 2));
|
|
1746
1781
|
var backingGate = cleanText(source.backing_role_group_config_publications_gate || source.backingRoleGroupConfigPublicationsGate, Math.floor(max / 2));
|
|
@@ -2225,6 +2260,7 @@ function evaluateResolveIOSupportDiagnosisEvidenceQuality(value) {
|
|
|
2225
2260
|
};
|
|
2226
2261
|
}
|
|
2227
2262
|
function normalizeResolveIOSupportDiagnosisGate(value, now) {
|
|
2263
|
+
var _a, _b, _c;
|
|
2228
2264
|
var rootSource = cleanObject(value);
|
|
2229
2265
|
var source = cleanObject(rootSource.support_diagnosis_gate
|
|
2230
2266
|
|| rootSource.supportDiagnosisGate
|
|
@@ -2306,27 +2342,46 @@ function normalizeResolveIOSupportDiagnosisGate(value, now) {
|
|
|
2306
2342
|
ownerFiles: [ownerFile]
|
|
2307
2343
|
}); })), false) : [];
|
|
2308
2344
|
var diagnosisEvidence = explicitEvidence.length ? explicitEvidence : derivedFeatureRequestEvidence;
|
|
2345
|
+
var ticketEvidenceText = ((_a = diagnosisEvidence.find(function (entry) { return entry.type === 'ticket'; })) === null || _a === void 0 ? void 0 : _a.summary) || '';
|
|
2346
|
+
var browserEvidenceText = ((_b = diagnosisEvidence.find(function (entry) { return entry.type === 'browser'; })) === null || _b === void 0 ? void 0 : _b.summary) || '';
|
|
2347
|
+
var rootCauseEvidenceText = ((_c = diagnosisEvidence.find(function (entry) { return SUPPORT_ROOT_CAUSE_EVIDENCE_TYPES.has(entry.type); })) === null || _c === void 0 ? void 0 : _c.summary) || '';
|
|
2348
|
+
var customerIssueCaseText = (function () {
|
|
2349
|
+
var issueText = cleanText(issueCaseText, 1200);
|
|
2350
|
+
if (issueText && !supportDiagnosisTextLooksGeneric(issueText, 18)
|
|
2351
|
+
&& !/\b(general inquiry|existing behavior|not a confirmed runtime failure)\b/i.test(issueText)) {
|
|
2352
|
+
return issueText;
|
|
2353
|
+
}
|
|
2354
|
+
return cleanText([ticketEvidenceText, browserEvidenceText]
|
|
2355
|
+
.filter(Boolean)
|
|
2356
|
+
.join(' '), 1200);
|
|
2357
|
+
})();
|
|
2358
|
+
var issueCasePrimaryText = customerIssueCaseText || cleanText([
|
|
2359
|
+
rootCauseEvidenceText,
|
|
2360
|
+
failingPathText,
|
|
2361
|
+
hypothesisText
|
|
2362
|
+
].filter(Boolean).join(' '), 1200);
|
|
2309
2363
|
var routeModule = pickText(issueCaseSource, ['route_module', 'routeModule', 'route', 'module', 'screen'], 500)
|
|
2310
2364
|
|| pickText(source, ['route_module', 'routeModule', 'module', 'screen'], 500)
|
|
2311
2365
|
|| pickText(failingPathSource, ['route', 'module', 'path', 'description'], 500)
|
|
2366
|
+
|| failingPathText
|
|
2312
2367
|
|| (featureRequestClassified ? 'net-new support feature workflow' : '');
|
|
2313
2368
|
var expectedResult = pickText(issueCaseSource, ['expected_result', 'expectedResult', 'expected'], 1000)
|
|
2314
2369
|
|| pickText(source, ['expected_result', 'expectedResult', 'expected', 'primary_goal', 'primaryGoal', 'requested_behavior', 'requestedBehavior'], 1000)
|
|
2315
|
-
|| (!featureRequestClassified &&
|
|
2316
|
-
|| (featureRequestClassified &&
|
|
2370
|
+
|| (!featureRequestClassified && issueCasePrimaryText ? "Expected customer-facing business result from ticket evidence: ".concat(issueCasePrimaryText) : '')
|
|
2371
|
+
|| (featureRequestClassified && issueCasePrimaryText ? "Implement the requested workflow: ".concat(issueCasePrimaryText) : '');
|
|
2317
2372
|
var observedResult = pickText(issueCaseSource, ['observed_result', 'observedResult', 'observed', 'actual'], 1000)
|
|
2318
2373
|
|| pickText(source, ['observed_result', 'observedResult', 'observed', 'actual', 'current_state', 'currentState'], 1000)
|
|
2319
|
-
|| (!featureRequestClassified &&
|
|
2374
|
+
|| (!featureRequestClassified && (browserEvidenceText || issueCasePrimaryText) ? "Observed/reported wrong business result from ticket or screenshot evidence: ".concat(browserEvidenceText || issueCasePrimaryText) : '')
|
|
2320
2375
|
|| (featureRequestClassified ? "Current repo evidence indicates no implemented route/module for ".concat(routeModule || 'the requested workflow', ".") : '');
|
|
2321
2376
|
var accountCustomerContext = pickText(issueCaseSource, ['account_customer_context', 'accountCustomerContext', 'account', 'customer', 'user', 'context'], 800)
|
|
2322
2377
|
|| pickText(source, ['account_customer_context', 'accountCustomerContext', 'affected_account_user', 'affectedAccountUser', 'account', 'customer', 'client', 'user', 'context'], 800)
|
|
2323
|
-
|| (
|
|
2378
|
+
|| (issueCasePrimaryText ? 'Customer/account context from support ticket intake and hydrated support attachments.' : '')
|
|
2324
2379
|
|| (featureRequestClassified ? 'Customer/account context from support ticket intake.' : '');
|
|
2325
2380
|
var rawReproductionStatus = issueCaseSource.reproduction_status || issueCaseSource.reproductionStatus || source.reproduction_status;
|
|
2326
2381
|
var hasRuntimeReproductionEvidence = diagnosisEvidence.some(function (entry) { return SUPPORT_REPRODUCTION_EVIDENCE_TYPES.has(entry.type); });
|
|
2327
2382
|
var gate = {
|
|
2328
2383
|
issue_case: {
|
|
2329
|
-
customer_complaint: pickText(issueCaseSource, ['customer_complaint', 'customerComplaint', 'complaint', 'request', 'summary'], 1200) ||
|
|
2384
|
+
customer_complaint: pickText(issueCaseSource, ['customer_complaint', 'customerComplaint', 'complaint', 'request', 'summary'], 1200) || customerIssueCaseText,
|
|
2330
2385
|
expected_result: expectedResult,
|
|
2331
2386
|
observed_result: observedResult,
|
|
2332
2387
|
route_module: routeModule,
|