@resolveio/server-lib 22.3.212 → 22.3.213

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.212",
3
+ "version": "22.3.213",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "package": "./build_package.sh",
@@ -948,24 +948,81 @@ function normalizeReproductionStatus(value) {
948
948
  }
949
949
  return 'reproduced';
950
950
  }
951
- function normalizeSupportDiagnosisEvidence(values) {
951
+ function inferSupportDiagnosisEvidenceTypeFromText(value, artifactPath) {
952
+ if (artifactPath === void 0) { artifactPath = ''; }
953
+ 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';
956
+ }
957
+ if (/\b(browser|dom|click|route|page|screenshot|screen shot|playwright|puppeteer)\b/i.test(text)) {
958
+ return 'browser';
959
+ }
960
+ if (/\b(mongo|database|collection|document|query|findone|aggregate)\b/i.test(text)) {
961
+ return 'mongo';
962
+ }
963
+ if (/\b(log|trace|stack|console|network)\b/i.test(text)) {
964
+ return 'log';
965
+ }
966
+ if (/\b(commit|git|branch|pr)\b/i.test(text)) {
967
+ return 'commit';
968
+ }
969
+ if (/\b(qa|test artifact|assertion)\b/i.test(text)) {
970
+ return 'qa';
971
+ }
972
+ if (/\b(component|template|publication|method|model|route|service|resolver|subscription|subscribe|render|renders|stores|persists|returns|finds?|source|repo|repository|angular|server|client|src)\b/i.test(text)) {
973
+ return 'code';
974
+ }
975
+ return 'other';
976
+ }
977
+ function supportLooseOwnerFileMatch(value, ownerFile) {
978
+ var normalizedOwner = normalizeOwnerFilePath(ownerFile);
979
+ var text = cleanText(value, 2000).replace(/[\\/.]+/g, ' ').replace(/[_-]+/g, ' ').toLowerCase();
980
+ var base = normalizedOwner.split('/').pop() || normalizedOwner;
981
+ var stem = base.replace(/\.[a-z0-9]+$/i, '');
982
+ var stemWithoutAngularKind = stem.replace(/\.(component|service|module|directive|pipe|model|resolver|guard|template)$/i, '');
983
+ var looseStem = stem.replace(/[._-]+/g, ' ').toLowerCase();
984
+ var looseStemWithoutKind = stemWithoutAngularKind.replace(/[._-]+/g, ' ').toLowerCase();
985
+ var compactStem = stem.replace(/[^a-z0-9]+/gi, '').toLowerCase();
986
+ var compactStemWithoutKind = stemWithoutAngularKind.replace(/[^a-z0-9]+/gi, '').toLowerCase();
987
+ var compactText = text.replace(/[^a-z0-9]+/g, '');
988
+ return !!normalizedOwner && (supportNormalizedPathMentioned(value, normalizedOwner)
989
+ || (!!looseStem && looseStem.length >= 5 && text.includes(looseStem))
990
+ || (!!looseStemWithoutKind && looseStemWithoutKind.length >= 5 && text.includes(looseStemWithoutKind))
991
+ || (!!compactStem && compactStem.length >= 5 && compactText.includes(compactStem))
992
+ || (!!compactStemWithoutKind && compactStemWithoutKind.length >= 5 && compactText.includes(compactStemWithoutKind)));
993
+ }
994
+ function supportLooseEvidenceOwnerFiles(value, ownerFiles) {
995
+ return ownerFiles
996
+ .map(normalizeOwnerFilePath)
997
+ .filter(Boolean)
998
+ .filter(function (ownerFile) { return supportLooseOwnerFileMatch(value, ownerFile); })
999
+ .slice(0, 8);
1000
+ }
1001
+ function normalizeSupportDiagnosisEvidence(values, ownerFiles) {
1002
+ if (ownerFiles === void 0) { ownerFiles = []; }
952
1003
  var allowed = new Set(['ticket', 'browser', 'mongo', 'log', 'code', 'commit', 'qa', 'other']);
953
1004
  if (!Array.isArray(values)) {
954
1005
  var summary = cleanText(values, 1200);
955
1006
  return summary ? [{
956
- id: "evidence-".concat(hashResolveIOSupportV5Evidence({ type: 'other', summary: summary }).slice(0, 12)),
957
- type: 'other',
958
- summary: summary
1007
+ id: "evidence-".concat(hashResolveIOSupportV5Evidence({ type: inferSupportDiagnosisEvidenceTypeFromText(summary), summary: summary }).slice(0, 12)),
1008
+ type: inferSupportDiagnosisEvidenceTypeFromText(summary),
1009
+ summary: summary,
1010
+ ownerFiles: supportLooseEvidenceOwnerFiles(summary, ownerFiles),
1011
+ artifactPath: supportLooseEvidenceOwnerFiles(summary, ownerFiles)[0]
959
1012
  }] : [];
960
1013
  }
961
1014
  var stringEvidence = values
962
1015
  .filter(function (entry) { return typeof entry === 'string'; })
963
1016
  .map(function (entry) {
964
1017
  var summary = cleanText(entry, 1200);
1018
+ var matchedOwnerFiles = supportLooseEvidenceOwnerFiles(summary, ownerFiles);
1019
+ var type = matchedOwnerFiles.length ? 'code' : inferSupportDiagnosisEvidenceTypeFromText(summary);
965
1020
  return {
966
- id: "evidence-".concat(hashResolveIOSupportV5Evidence({ type: 'other', summary: summary }).slice(0, 12)),
967
- type: 'other',
968
- summary: summary
1021
+ id: "evidence-".concat(hashResolveIOSupportV5Evidence({ type: type, summary: summary, ownerFiles: matchedOwnerFiles }).slice(0, 12)),
1022
+ type: type,
1023
+ summary: summary,
1024
+ artifactPath: type === 'code' ? matchedOwnerFiles[0] : undefined,
1025
+ ownerFiles: matchedOwnerFiles
969
1026
  };
970
1027
  });
971
1028
  var objectEvidence = values
@@ -1668,6 +1725,10 @@ function supportDiagnosisNarrativeText(value, max) {
1668
1725
  'expectedResult',
1669
1726
  'observed_result',
1670
1727
  'observedResult',
1728
+ 'route',
1729
+ 'path_chain',
1730
+ 'pathChain',
1731
+ 'assessment',
1671
1732
  'path',
1672
1733
  'reason',
1673
1734
  'fact'
@@ -2188,18 +2249,31 @@ function normalizeResolveIOSupportDiagnosisGate(value, now) {
2188
2249
  var issueClass = normalizeIssueClass(source.issue_class || source.issueClass);
2189
2250
  var featureRequestClassified = supportDiagnosisLooksLikeClassifiedFeatureRequest(source, issueCaseText, failingPathText, hypothesisText);
2190
2251
  var shouldDeriveLooseProofPlan = Array.isArray(rawProofPlan) || featureRequestClassified;
2252
+ var looseProofSubject = cleanText(issueCaseText || failingPathText || hypothesisText, 1200);
2191
2253
  var proofPlanBefore = pickText(proofPlanSource, ['before', 'before_state', 'beforeState', 'precondition'], 1000);
2192
2254
  var proofPlanBeforeUnavailable = pickText(proofPlanSource, ['before_state_unavailable_reason', 'beforeStateUnavailableReason', 'before_unavailable_reason'], 1000)
2193
2255
  || (featureRequestClassified ? 'Before-state business proof is not available because this is classified as net-new feature scope; current evidence proves the requested route/workflow is not implemented yet.' : '');
2194
- var proofPlanAction = pickText(proofPlanSource, ['action', 'browser_action', 'browserAction', 'steps'], 1000) || proofPlanRows.action;
2195
- var proofPlanAfter = pickText(proofPlanSource, ['after', 'after_state', 'afterState', 'expected_after'], 1000) || proofPlanRows.after;
2196
- var proofPlanBusinessAssertion = pickText(proofPlanSource, ['business_assertion', 'businessAssertion', 'assertion'], 1000) || proofPlanRows.business_assertion;
2197
- var proofPlanDataAssertion = pickText(proofPlanSource, ['data_assertion', 'dataAssertion', 'mongo_delta', 'mongoDelta'], 1000) || proofPlanRows.data_assertion;
2256
+ var derivedLooseBefore = shouldDeriveLooseProofPlan && looseProofSubject
2257
+ ? "Capture the before-state business value from the reported workflow: ".concat(looseProofSubject)
2258
+ : '';
2259
+ var proofPlanBeforeResolved = proofPlanBefore || derivedLooseBefore;
2260
+ var proofPlanAction = pickText(proofPlanSource, ['action', 'browser_action', 'browserAction', 'steps'], 1000)
2261
+ || proofPlanRows.action
2262
+ || (shouldDeriveLooseProofPlan ? 'Execute the issue-specific workflow and inspect the affected data/rendering path.' : '');
2263
+ var proofPlanAfter = pickText(proofPlanSource, ['after', 'after_state', 'afterState', 'expected_after'], 1000)
2264
+ || proofPlanRows.after
2265
+ || (shouldDeriveLooseProofPlan && looseProofSubject ? "The workflow produces the expected customer-facing business value instead of the reported wrong result for: ".concat(looseProofSubject) : '');
2266
+ var proofPlanBusinessAssertion = pickText(proofPlanSource, ['business_assertion', 'businessAssertion', 'assertion'], 1000)
2267
+ || proofPlanRows.business_assertion
2268
+ || (shouldDeriveLooseProofPlan && looseProofSubject ? "The customer-reported condition is resolved with business data proof: ".concat(looseProofSubject) : '');
2269
+ var proofPlanDataAssertion = pickText(proofPlanSource, ['data_assertion', 'dataAssertion', 'mongo_delta', 'mongoDelta'], 1000)
2270
+ || proofPlanRows.data_assertion
2271
+ || (shouldDeriveLooseProofPlan ? 'DOM/data or Mongo proof shows the expected business value and does not show the reported wrong value.' : '');
2198
2272
  var proofPlanArtifactExpectation = pickText(proofPlanSource, ['artifact_expectation', 'artifactExpectation', 'artifact', 'screenshot'], 1000)
2199
2273
  || (shouldDeriveLooseProofPlan && proofPlanBusinessAssertion ? 'browser trace/screenshot plus persisted DOM/data or Mongo delta tied to the business assertion' : '');
2200
2274
  var derivedBusinessProofContract = shouldDeriveLooseProofPlan && proofPlanBusinessAssertion ? {
2201
2275
  issue_class: issueClass || source.issue_class || source.issueClass,
2202
- setup_state: proofPlanBefore || proofPlanBeforeUnavailable,
2276
+ setup_state: proofPlanBeforeResolved || proofPlanBeforeUnavailable,
2203
2277
  action_under_test: proofPlanAction,
2204
2278
  expected_business_state_change: proofPlanAfter || proofPlanBusinessAssertion,
2205
2279
  prohibited_false_pass: 'Route load, screenshot, scorecard, or model claim alone is not acceptance.',
@@ -2216,7 +2290,7 @@ function normalizeResolveIOSupportDiagnosisGate(value, now) {
2216
2290
  .filter(Boolean);
2217
2291
  var productOwnerFiles = rawOwnerFiles.filter(function (ownerFile) { return !ownerFileLooksNonProductEvidence(ownerFile); });
2218
2292
  var ownerFiles = productOwnerFiles.length ? productOwnerFiles : rawOwnerFiles;
2219
- var explicitEvidence = normalizeSupportDiagnosisEvidence(source.evidence);
2293
+ var explicitEvidence = normalizeSupportDiagnosisEvidence(source.evidence, ownerFiles);
2220
2294
  var derivedFeatureRequestEvidence = !explicitEvidence.length && featureRequestClassified ? __spreadArray(__spreadArray([], __read((issueCaseText ? [{
2221
2295
  id: "evidence-".concat(hashResolveIOSupportV5Evidence({ type: 'ticket', summary: issueCaseText }).slice(0, 12)),
2222
2296
  type: 'ticket',
@@ -2238,14 +2312,18 @@ function normalizeResolveIOSupportDiagnosisGate(value, now) {
2238
2312
  || (featureRequestClassified ? 'net-new support feature workflow' : '');
2239
2313
  var expectedResult = pickText(issueCaseSource, ['expected_result', 'expectedResult', 'expected'], 1000)
2240
2314
  || 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) : '')
2241
2316
  || (featureRequestClassified && issueCaseText ? "Implement the requested workflow: ".concat(issueCaseText) : '');
2242
2317
  var observedResult = pickText(issueCaseSource, ['observed_result', 'observedResult', 'observed', 'actual'], 1000)
2243
2318
  || pickText(source, ['observed_result', 'observedResult', 'observed', 'actual', 'current_state', 'currentState'], 1000)
2319
+ || (!featureRequestClassified && issueCaseText ? "Observed/reported wrong business result from ticket: ".concat(issueCaseText) : '')
2244
2320
  || (featureRequestClassified ? "Current repo evidence indicates no implemented route/module for ".concat(routeModule || 'the requested workflow', ".") : '');
2245
2321
  var accountCustomerContext = pickText(issueCaseSource, ['account_customer_context', 'accountCustomerContext', 'account', 'customer', 'user', 'context'], 800)
2246
2322
  || 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.' : '')
2247
2324
  || (featureRequestClassified ? 'Customer/account context from support ticket intake.' : '');
2248
2325
  var rawReproductionStatus = issueCaseSource.reproduction_status || issueCaseSource.reproductionStatus || source.reproduction_status;
2326
+ var hasRuntimeReproductionEvidence = diagnosisEvidence.some(function (entry) { return SUPPORT_REPRODUCTION_EVIDENCE_TYPES.has(entry.type); });
2249
2327
  var gate = {
2250
2328
  issue_case: {
2251
2329
  customer_complaint: pickText(issueCaseSource, ['customer_complaint', 'customerComplaint', 'complaint', 'request', 'summary'], 1200) || issueCaseText,
@@ -2253,7 +2331,9 @@ function normalizeResolveIOSupportDiagnosisGate(value, now) {
2253
2331
  observed_result: observedResult,
2254
2332
  route_module: routeModule,
2255
2333
  account_customer_context: accountCustomerContext,
2256
- reproduction_status: rawReproductionStatus ? normalizeReproductionStatus(rawReproductionStatus) : (featureRequestClassified ? 'classified' : normalizeReproductionStatus(rawReproductionStatus)),
2334
+ reproduction_status: rawReproductionStatus
2335
+ ? normalizeReproductionStatus(rawReproductionStatus)
2336
+ : (featureRequestClassified || !hasRuntimeReproductionEvidence ? 'classified' : 'reproduced'),
2257
2337
  reproduction_blocker: pickText(issueCaseSource, ['reproduction_blocker', 'reproductionBlocker', 'blocked_reason', 'blockedReason'], 1000)
2258
2338
  },
2259
2339
  issue_class: issueClass || 'missing_wrong_data',
@@ -2272,11 +2352,11 @@ function normalizeResolveIOSupportDiagnosisGate(value, now) {
2272
2352
  backend: pickText(failingPathSource, ['backend', 'backend_path', 'backendPath', 'methodPublicationPath'], 700),
2273
2353
  shared_library: pickText(failingPathSource, ['shared_library', 'sharedLibrary', 'library', 'lib'], 700),
2274
2354
  data_query: pickText(failingPathSource, ['data_query', 'dataQuery', 'query'], 700),
2275
- description: pickText(failingPathSource, ['description', 'path', 'summary'], 1200) || failingPathText
2355
+ description: pickText(failingPathSource, ['description', 'path_chain', 'pathChain', 'path', 'assessment', 'summary', 'route'], 1200) || failingPathText
2276
2356
  },
2277
2357
  owner_files: ownerFiles,
2278
2358
  proof_plan: {
2279
- before: proofPlanBefore,
2359
+ before: proofPlanBeforeResolved,
2280
2360
  before_state_unavailable_reason: proofPlanBeforeUnavailable,
2281
2361
  action: proofPlanAction,
2282
2362
  after: proofPlanAfter,