@resolveio/server-lib 22.3.213 → 22.3.215

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@resolveio/server-lib",
3
- "version": "22.3.213",
3
+ "version": "22.3.215",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "package": "./build_package.sh",
@@ -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.rejection_reason || source.rejectionReason || 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,9 +149,16 @@ function cleanListEntryText(value, max) {
149
149
  'artifactPath',
150
150
  'artifact_path',
151
151
  'summary',
152
+ 'detail',
152
153
  'message',
153
154
  'description',
155
+ 'rationale',
156
+ 'proof_required',
157
+ 'proofRequired',
158
+ 'rejection_reason',
159
+ 'rejectionReason',
154
160
  'reason',
161
+ 'fact',
155
162
  'value',
156
163
  'label',
157
164
  'id'
@@ -924,6 +931,13 @@ function normalizeIssueClass(value) {
924
931
  upload: 'upload_import',
925
932
  import: 'upload_import',
926
933
  upload_import: 'upload_import',
934
+ behavior: 'missing_wrong_data',
935
+ workflow_behavior: 'missing_wrong_data',
936
+ general: 'missing_wrong_data',
937
+ general_inquiry: 'missing_wrong_data',
938
+ customer_inquiry: 'missing_wrong_data',
939
+ data_mismatch: 'missing_wrong_data',
940
+ warehouse_mismatch: 'missing_wrong_data',
927
941
  route_auth: 'route_auth_hydration',
928
942
  auth_hydration: 'route_auth_hydration',
929
943
  route_auth_hydration: 'route_auth_hydration',
@@ -951,12 +965,19 @@ function normalizeReproductionStatus(value) {
951
965
  function inferSupportDiagnosisEvidenceTypeFromText(value, artifactPath) {
952
966
  if (artifactPath === void 0) { artifactPath = ''; }
953
967
  var text = cleanText([value, artifactPath].filter(Boolean).join(' '), 2000).toLowerCase();
954
- if (/\b(ticket|customer|client|reporter|reported|support request|manual-ticket|email\.metadata)\b/i.test(text)) {
955
- return 'ticket';
968
+ var pathText = cleanText(artifactPath, 500).toLowerCase();
969
+ if (/\b(screenshot|screen shot)\b/i.test(text) || /\.(?:png|jpe?g|webp|gif)$/i.test(pathText)) {
970
+ return 'browser';
971
+ }
972
+ if (/\b(angular|server|client|src|methods|publications|routing|permission|component|template)\b/i.test(pathText)) {
973
+ return 'code';
956
974
  }
957
- if (/\b(browser|dom|click|route|page|screenshot|screen shot|playwright|puppeteer)\b/i.test(text)) {
975
+ if (/\b(browser|dom|click|route|page|playwright|puppeteer)\b/i.test(text)) {
958
976
  return 'browser';
959
977
  }
978
+ if (/\b(ticket|customer|client|reporter|reported|support request|manual-ticket|email\.metadata)\b/i.test(text)) {
979
+ return 'ticket';
980
+ }
960
981
  if (/\b(mongo|database|collection|document|query|findone|aggregate)\b/i.test(text)) {
961
982
  return 'mongo';
962
983
  }
@@ -1030,30 +1051,45 @@ function normalizeSupportDiagnosisEvidence(values, ownerFiles) {
1030
1051
  .map(function (entry) {
1031
1052
  var type = cleanText(entry.type, 80).toLowerCase();
1032
1053
  var artifactPath = cleanText(entry.artifactPath || entry.artifact_path || entry.path || entry.file, 500);
1054
+ var summary = cleanText(entry.summary || entry.detail || entry.message || entry.evidence || entry.reason || entry.rejection_reason || entry.rejectionReason || entry.fact || entry.description || entry.proof_required || entry.proofRequired, 1200)
1055
+ || (artifactPath ? "Evidence from ".concat(artifactPath) : '');
1056
+ var evidenceText = [summary, artifactPath].filter(Boolean).join(' ');
1033
1057
  var inferredType = (function () {
1034
- if (allowed.has(type)) {
1058
+ var inferredFromText = inferSupportDiagnosisEvidenceTypeFromText(summary, artifactPath);
1059
+ if (allowed.has(type) && type !== 'other') {
1060
+ if (type === 'ticket' && inferredFromText === 'browser') {
1061
+ return 'browser';
1062
+ }
1035
1063
  return type;
1036
1064
  }
1037
- if (/\b(ticket|manual-ticket|support-context|email\.metadata)\b/i.test(artifactPath)) {
1065
+ if (/\b(screenshot|screen shot)\b/i.test(evidenceText)
1066
+ || /\.(?:png|jpe?g|webp|gif)$/i.test(artifactPath)) {
1067
+ return 'browser';
1068
+ }
1069
+ if (/\b(angular|server|client|src|methods|publications|routing|permission|component|template)\b/i.test(artifactPath)) {
1070
+ return 'code';
1071
+ }
1072
+ if (/\b(playwright|puppeteer|browser|dom|click|route|page)\b/i.test(evidenceText)) {
1073
+ return 'browser';
1074
+ }
1075
+ if (/\b(ticket|manual-ticket|support request|customer|reporter|email\.metadata)\b/i.test(evidenceText)) {
1038
1076
  return 'ticket';
1039
1077
  }
1040
- if (/\b(commit|git)\b/i.test(artifactPath)) {
1078
+ if (/\b(commit|git)\b/i.test(evidenceText)) {
1041
1079
  return 'commit';
1042
1080
  }
1043
- if (/\b(mongo|query|database|collection)\b/i.test(artifactPath)) {
1081
+ if (/\b(mongo|query|database|collection)\b/i.test(evidenceText)) {
1044
1082
  return 'mongo';
1045
1083
  }
1046
- if (/\b(log|trace)\b/i.test(artifactPath)) {
1084
+ if (/\b(log|trace|console|network)\b/i.test(evidenceText)) {
1047
1085
  return 'log';
1048
1086
  }
1049
- if (/\b(angular|server|client|src|methods|publications|routing|permission|component)\b/i.test(artifactPath)) {
1087
+ if (/\b(angular|server|client|src|methods|publications|routing|permission|component|template)\b/i.test(evidenceText)) {
1050
1088
  return 'code';
1051
1089
  }
1052
- return 'other';
1090
+ return inferredFromText;
1053
1091
  })();
1054
1092
  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
1093
  var ownerFiles = cleanList(entry.ownerFiles || entry.owner_files || entry.files, 12, 500)
1058
1094
  .map(normalizeOwnerFilePath)
1059
1095
  .filter(Boolean);
@@ -1713,9 +1749,16 @@ function supportDiagnosisNarrativeText(value, max) {
1713
1749
  if (!Object.keys(source).length) {
1714
1750
  return '';
1715
1751
  }
1752
+ var hypothesis = cleanText(source.hypothesis, Math.floor(max / 2));
1753
+ var whyRejected = cleanText(source.why_rejected || source.whyRejected || source.reason_rejected || source.reasonRejected || source.rejection_reason || source.rejectionReason || source.reason, Math.floor(max / 2));
1754
+ if (hypothesis && whyRejected) {
1755
+ return "".concat(hypothesis, " rejected because ").concat(whyRejected).slice(0, max);
1756
+ }
1716
1757
  var direct = pickText(source, [
1717
1758
  'summary',
1759
+ 'detail',
1718
1760
  'description',
1761
+ 'rationale',
1719
1762
  'statement',
1720
1763
  'issue_case',
1721
1764
  'issueCase',
@@ -1728,19 +1771,22 @@ function supportDiagnosisNarrativeText(value, max) {
1728
1771
  'route',
1729
1772
  'path_chain',
1730
1773
  'pathChain',
1774
+ 'reported_path',
1775
+ 'reportedPath',
1776
+ 'verified_path',
1777
+ 'verifiedPath',
1731
1778
  'assessment',
1732
1779
  'path',
1780
+ 'proof_required',
1781
+ 'proofRequired',
1782
+ 'rejection_reason',
1783
+ 'rejectionReason',
1733
1784
  'reason',
1734
1785
  'fact'
1735
1786
  ], max);
1736
1787
  if (direct) {
1737
1788
  return direct;
1738
1789
  }
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
1790
  var routeModulePermission = cleanText(source.route_module_permission_gate || source.routeModulePermissionGate, Math.floor(max / 2));
1745
1791
  var templateGate = cleanText(source.template_conditional_rendering_gate || source.templateConditionalRenderingGate, Math.floor(max / 2));
1746
1792
  var backingGate = cleanText(source.backing_role_group_config_publications_gate || source.backingRoleGroupConfigPublicationsGate, Math.floor(max / 2));
@@ -1826,6 +1872,7 @@ function normalizeOwnerFilePath(value) {
1826
1872
  .replace(/\\/g, '/')
1827
1873
  .replace(/^\.\/+/, '')
1828
1874
  .replace(/^\/+/, '')
1875
+ .replace(/:\d+(?:-\d+)?$/g, '')
1829
1876
  .replace(/\s+$/g, '');
1830
1877
  try {
1831
1878
  for (var _b = __values([
@@ -2225,6 +2272,7 @@ function evaluateResolveIOSupportDiagnosisEvidenceQuality(value) {
2225
2272
  };
2226
2273
  }
2227
2274
  function normalizeResolveIOSupportDiagnosisGate(value, now) {
2275
+ var _a, _b, _c;
2228
2276
  var rootSource = cleanObject(value);
2229
2277
  var source = cleanObject(rootSource.support_diagnosis_gate
2230
2278
  || rootSource.supportDiagnosisGate
@@ -2306,27 +2354,54 @@ function normalizeResolveIOSupportDiagnosisGate(value, now) {
2306
2354
  ownerFiles: [ownerFile]
2307
2355
  }); })), false) : [];
2308
2356
  var diagnosisEvidence = explicitEvidence.length ? explicitEvidence : derivedFeatureRequestEvidence;
2357
+ var ticketEvidenceText = ((_a = diagnosisEvidence.find(function (entry) { return entry.type === 'ticket'; })) === null || _a === void 0 ? void 0 : _a.summary) || '';
2358
+ var browserEvidenceText = ((_b = diagnosisEvidence.find(function (entry) { return entry.type === 'browser'; })) === null || _b === void 0 ? void 0 : _b.summary) || '';
2359
+ var rootCauseEvidenceText = ((_c = diagnosisEvidence.find(function (entry) { return SUPPORT_ROOT_CAUSE_EVIDENCE_TYPES.has(entry.type); })) === null || _c === void 0 ? void 0 : _c.summary) || '';
2360
+ var explicitCustomerComplaint = pickText(issueCaseSource, ['customer_complaint', 'customerComplaint', 'complaint', 'request', 'summary'], 1200);
2361
+ var customerIssueCaseText = (function () {
2362
+ if (explicitCustomerComplaint) {
2363
+ return explicitCustomerComplaint;
2364
+ }
2365
+ var evidenceCustomerText = cleanText([ticketEvidenceText, browserEvidenceText]
2366
+ .filter(Boolean)
2367
+ .join(' '), 1200);
2368
+ if (evidenceCustomerText) {
2369
+ return evidenceCustomerText;
2370
+ }
2371
+ var issueText = cleanText(issueCaseText, 1200);
2372
+ if (issueText && !supportDiagnosisTextLooksGeneric(issueText, 18)
2373
+ && !/\b(general inquiry|existing behavior|not a confirmed runtime failure)\b/i.test(issueText)) {
2374
+ return issueText;
2375
+ }
2376
+ return '';
2377
+ })();
2378
+ var issueCasePrimaryText = customerIssueCaseText || cleanText([
2379
+ rootCauseEvidenceText,
2380
+ failingPathText,
2381
+ hypothesisText
2382
+ ].filter(Boolean).join(' '), 1200);
2309
2383
  var routeModule = pickText(issueCaseSource, ['route_module', 'routeModule', 'route', 'module', 'screen'], 500)
2310
2384
  || pickText(source, ['route_module', 'routeModule', 'module', 'screen'], 500)
2311
- || pickText(failingPathSource, ['route', 'module', 'path', 'description'], 500)
2385
+ || pickText(failingPathSource, ['route', 'module', 'path', 'description', 'reported_path', 'reportedPath', 'verified_path', 'verifiedPath'], 500)
2386
+ || failingPathText
2312
2387
  || (featureRequestClassified ? 'net-new support feature workflow' : '');
2313
2388
  var expectedResult = pickText(issueCaseSource, ['expected_result', 'expectedResult', 'expected'], 1000)
2314
2389
  || pickText(source, ['expected_result', 'expectedResult', 'expected', 'primary_goal', 'primaryGoal', 'requested_behavior', 'requestedBehavior'], 1000)
2315
- || (!featureRequestClassified && issueCaseText ? "Expected customer-facing business result from ticket: ".concat(issueCaseText) : '')
2316
- || (featureRequestClassified && issueCaseText ? "Implement the requested workflow: ".concat(issueCaseText) : '');
2390
+ || (!featureRequestClassified && issueCasePrimaryText ? "Expected customer-facing business result from ticket evidence: ".concat(issueCasePrimaryText) : '')
2391
+ || (featureRequestClassified && issueCasePrimaryText ? "Implement the requested workflow: ".concat(issueCasePrimaryText) : '');
2317
2392
  var observedResult = pickText(issueCaseSource, ['observed_result', 'observedResult', 'observed', 'actual'], 1000)
2318
2393
  || pickText(source, ['observed_result', 'observedResult', 'observed', 'actual', 'current_state', 'currentState'], 1000)
2319
- || (!featureRequestClassified && issueCaseText ? "Observed/reported wrong business result from ticket: ".concat(issueCaseText) : '')
2394
+ || (!featureRequestClassified && (browserEvidenceText || issueCasePrimaryText) ? "Observed/reported wrong business result from ticket or screenshot evidence: ".concat(browserEvidenceText || issueCasePrimaryText) : '')
2320
2395
  || (featureRequestClassified ? "Current repo evidence indicates no implemented route/module for ".concat(routeModule || 'the requested workflow', ".") : '');
2321
2396
  var accountCustomerContext = pickText(issueCaseSource, ['account_customer_context', 'accountCustomerContext', 'account', 'customer', 'user', 'context'], 800)
2322
2397
  || pickText(source, ['account_customer_context', 'accountCustomerContext', 'affected_account_user', 'affectedAccountUser', 'account', 'customer', 'client', 'user', 'context'], 800)
2323
- || (issueCaseText ? 'Customer/account context from support ticket intake and hydrated support attachments.' : '')
2398
+ || (issueCasePrimaryText ? 'Customer/account context from support ticket intake and hydrated support attachments.' : '')
2324
2399
  || (featureRequestClassified ? 'Customer/account context from support ticket intake.' : '');
2325
2400
  var rawReproductionStatus = issueCaseSource.reproduction_status || issueCaseSource.reproductionStatus || source.reproduction_status;
2326
2401
  var hasRuntimeReproductionEvidence = diagnosisEvidence.some(function (entry) { return SUPPORT_REPRODUCTION_EVIDENCE_TYPES.has(entry.type); });
2327
2402
  var gate = {
2328
2403
  issue_case: {
2329
- customer_complaint: pickText(issueCaseSource, ['customer_complaint', 'customerComplaint', 'complaint', 'request', 'summary'], 1200) || issueCaseText,
2404
+ customer_complaint: explicitCustomerComplaint || customerIssueCaseText,
2330
2405
  expected_result: expectedResult,
2331
2406
  observed_result: observedResult,
2332
2407
  route_module: routeModule,
@@ -2342,8 +2417,8 @@ function normalizeResolveIOSupportDiagnosisGate(value, now) {
2342
2417
  || hypothesisText,
2343
2418
  falsifiable_test: pickText(hypothesisSource, ['falsifiable_test', 'falsifiableTest', 'test', 'proof', 'falsifier'], 1000)
2344
2419
  || (failingPathText ? "Verify the accepted hypothesis against the failing path evidence: ".concat(failingPathText) : ''),
2345
- evidence: cleanList(hypothesisSource.evidence || source.hypothesis_evidence || source.hypothesisEvidence, 10, 800).length
2346
- ? cleanList(hypothesisSource.evidence || source.hypothesis_evidence || source.hypothesisEvidence, 10, 800)
2420
+ evidence: cleanList(hypothesisSource.evidence || hypothesisSource.evidence_refs || hypothesisSource.evidenceRefs || source.hypothesis_evidence || source.hypothesisEvidence, 10, 800).length
2421
+ ? cleanList(hypothesisSource.evidence || hypothesisSource.evidence_refs || hypothesisSource.evidenceRefs || source.hypothesis_evidence || source.hypothesisEvidence, 10, 800)
2347
2422
  : diagnosisEvidence.map(function (entry) { return [entry.artifactPath, entry.summary].filter(Boolean).join(': '); }).filter(Boolean).slice(0, 10)
2348
2423
  },
2349
2424
  rejected_alternatives: normalizeSupportDiagnosisRejectedAlternatives(source.rejected_alternatives || source.rejectedAlternatives),
@@ -2352,7 +2427,7 @@ function normalizeResolveIOSupportDiagnosisGate(value, now) {
2352
2427
  backend: pickText(failingPathSource, ['backend', 'backend_path', 'backendPath', 'methodPublicationPath'], 700),
2353
2428
  shared_library: pickText(failingPathSource, ['shared_library', 'sharedLibrary', 'library', 'lib'], 700),
2354
2429
  data_query: pickText(failingPathSource, ['data_query', 'dataQuery', 'query'], 700),
2355
- description: pickText(failingPathSource, ['description', 'path_chain', 'pathChain', 'path', 'assessment', 'summary', 'route'], 1200) || failingPathText
2430
+ description: pickText(failingPathSource, ['description', 'path_chain', 'pathChain', 'reported_path', 'reportedPath', 'verified_path', 'verifiedPath', 'path', 'assessment', 'summary', 'route'], 1200) || failingPathText
2356
2431
  },
2357
2432
  owner_files: ownerFiles,
2358
2433
  proof_plan: {